Class ALcdPoint
- All Implemented Interfaces:
ILcdBounded,ILcdBounds,ILcdPoint,ILcdPointList,ILcdPolypoint,ILcdShape,ILcdCloneable,Serializable,Cloneable
- Direct Known Subclasses:
ALcd2DEditablePoint
ILcdPoint interface.
In order to avoid having to create a new ILcdBounds object in the method
getBounds(), ALcdPoint also implements ILcdBounds, so that
getBounds() can return the ALcdPoint itself.
For convenience, this class also implements ILcdPointList as a list with the ALcdPoint itself as its only point.
This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains2D(double aX, double aY) Checks whether thisALcdPointis equal to the given point in the 2D cartesian plane.booleancontains2D(double aX, double aY, double aWidth, double aHeight) Checks whether thisILcdBoundsobject contains the given rectangle in the 2D space.booleancontains2D(ILcdBounds aBounds) Checks whether thisILcdBoundsobject contains the givenILcdBoundsobject in the 2D space.booleancontains3D(double aX, double aY, double aZ) Checks whether thisALcdPointis equal to the given point in the 3D cartesian space.booleancontains3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Checks whether thisILcdBoundsobject contains the given box in the 3D space.booleancontains3D(ILcdBounds aBounds) Checks whether thisILcdBoundsobject contains the givenILcdBoundsobject in the 3D space.booleanReturns whether the given object has the same class and the same coordinates.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.doublegetCosX()Returns cos(getX()* DEG2RAD ).doublegetCosY()Returns cos(getY()* DEG2RAD ).doublegetDepth()Returns the depth of the bounding box.Returns the focus point of thisILcdShape.doubleReturns the height of the bounding box.Returns the location of the bounding box (smallest x and y coordinates).doublegetMaxX()Returns the maximum X value (right boundary) of this bounds.doublegetMaxY()Returns the maximum Y value (upper boundary) of this bounds.doublegetMaxZ()Returns the maximum Z value (top boundary) of this bounds.doublegetMinX()Returns the minimum X value (left boundary) of this bounds.doublegetMinY()Returns the minimum Y value (lower boundary) of this bounds.doublegetMinZ()Returns the minimum Z value (bottom boundary) of this bounds.getPoint(int aIndex) Returns theILcdPointat a given index.intReturns the number ofILcdPointobjects in the list.doublegetSinX()Returns sin(getX()* DEG2RAD ).doublegetSinY()Returns sin(getY()* DEG2RAD ).doublegetTanX()Returns tan(getX()* DEG2RAD ).doublegetTanY()Returns tan(getY()* DEG2RAD ).doublegetWidth()Returns the width of the bounding box.inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.booleaninteracts2D(double aX, double aY, double aWidth, double aHeight) Checks whether thisILcdBoundsobject interacts with the given rectangle in the 2D space.booleaninteracts2D(ILcdBounds aBounds) Checks whether thisILcdBoundsobject interacts with the givenILcdBoundsobject in the 2D space.booleaninteracts3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Checks whether thisILcdBoundsobject interacts with the given box in the 3D space.booleaninteracts3D(ILcdBounds aBounds) Checks whether thisILcdBoundsobject interacts with the givenILcdBoundsobject.final booleanA point's bounds are always valid.Methods inherited from class com.luciad.shape.ALcdShape
clone, contains2D, contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.shape.ILcdBounds
cloneAs2DEditableBounds, cloneAs3DEditableBounds, getCenterMethods inherited from interface com.luciad.util.ILcdCloneable
cloneMethods inherited from interface com.luciad.shape.ILcdPoint
cloneAs2DEditablePoint, cloneAs3DEditablePoint, getX, getY, getZMethods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D
-
Constructor Details
-
ALcdPoint
public ALcdPoint()
-
-
Method Details
-
getCosX
public double getCosX()Description copied from interface:ILcdPointReturns cos(getX()* DEG2RAD ). -
getSinX
public double getSinX()Description copied from interface:ILcdPointReturns sin(getX()* DEG2RAD ). -
getTanX
public double getTanX()Description copied from interface:ILcdPointReturns tan(getX()* DEG2RAD ). -
getCosY
public double getCosY()Description copied from interface:ILcdPointReturns cos(getY()* DEG2RAD ). -
getSinY
public double getSinY()Description copied from interface:ILcdPointReturns sin(getY()* DEG2RAD ). -
getTanY
public double getTanY()Description copied from interface:ILcdPointReturns tan(getY()* DEG2RAD ). -
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the
ALcdPointitself.
-
contains2D
public boolean contains2D(double aX, double aY) Checks whether thisALcdPointis equal to the given point in the 2D cartesian plane.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the equality test.
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Checks whether thisALcdPointis equal to the given point in the 3D cartesian space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.- Returns:
- the boolean result of the equality test.
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ALcdPointitself, playing the role of its ownILcdBounds.
-
isDefined
public final boolean isDefined()A point's bounds are always valid.- Specified by:
isDefinedin interfaceILcdBounds- Returns:
- always
true
-
getLocation
Description copied from interface:ILcdBoundsReturns the location of the bounding box (smallest x and y coordinates).- Specified by:
getLocationin interfaceILcdBounds- Returns:
- the
ALcdPointitself.
-
getMinX
public double getMinX()Description copied from interface:ILcdBoundsReturns the minimum X value (left boundary) of this bounds. By default, this doesgetLocation.getX(), but can be overridden for performance.- Specified by:
getMinXin interfaceILcdBounds- Returns:
- the minimum X boundary
- See Also:
-
getMinY
public double getMinY()Description copied from interface:ILcdBoundsReturns the minimum Y value (lower boundary) of this bounds. By default, this doesgetLocation.getY(), but can be overridden for performance.- Specified by:
getMinYin interfaceILcdBounds- Returns:
- the minimum Y boundary
- See Also:
-
getMinZ
public double getMinZ()Description copied from interface:ILcdBoundsReturns the minimum Z value (bottom boundary) of this bounds. By default, this doesgetLocation.getZ(), but can be overridden for performance.- Specified by:
getMinZin interfaceILcdBounds- Returns:
- the minimum Z boundary
- See Also:
-
getMaxX
public double getMaxX()Description copied from interface:ILcdBoundsReturns the maximum X value (right boundary) of this bounds. By default, this doesgetLocation.getX() + getWidth(), but can be overridden for performance. Note that this is a derived property, the bounds are defined by their lower-left corner and width/height. Forgeodetic bounds, the returned value is not necessarily normalized to [-180, 180].- Specified by:
getMaxXin interfaceILcdBounds- Returns:
- the maximum X boundary
- See Also:
-
getMaxY
public double getMaxY()Description copied from interface:ILcdBoundsReturns the maximum Y value (upper boundary) of this bounds. By default, this doesgetLocation.getY() + getHeight(), but can be overridden for performance. Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.- Specified by:
getMaxYin interfaceILcdBounds- Returns:
- the maximum Y boundary
- See Also:
-
getMaxZ
public double getMaxZ()Description copied from interface:ILcdBoundsReturns the maximum Z value (top boundary) of this bounds. By default, this doesgetLocation.getZ() + getDepth(), but can be overridden for performance. Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.- Specified by:
getMaxZin interfaceILcdBounds- Returns:
- the maximum Z boundary
- See Also:
-
getWidth
public double getWidth()Description copied from interface:ILcdBoundsReturns the width of the bounding box. The width has to be larger than or equal to 0.- Specified by:
getWidthin interfaceILcdBounds- Returns:
- 0.0.
-
getHeight
public double getHeight()Description copied from interface:ILcdBoundsReturns the height of the bounding box. The height has to be larger than or equal to 0.- Specified by:
getHeightin interfaceILcdBounds- Returns:
- 0.0.
-
getDepth
public double getDepth()Description copied from interface:ILcdBoundsReturns the depth of the bounding box. The depth has to be larger than or equal to 0.- Specified by:
getDepthin interfaceILcdBounds- Returns:
- 0.0.
-
interacts2D
Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject interacts with the givenILcdBoundsobject in the 2D space. Only the first two dimensions of theILcdBoundsobjects are considered.If either bounds is
undefined, the result is false.- Specified by:
interacts2Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the interaction test.
- See Also:
-
interacts2D
public boolean interacts2D(double aX, double aY, double aWidth, double aHeight) Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject interacts with the given rectangle in the 2D space. Only the first two dimensions of theILcdBoundsobject are considered.If this bounds is
undefined, the result is false.- Specified by:
interacts2Din interfaceILcdBounds- Parameters:
aX- the x coordinate of the rectangle.aY- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.- Returns:
trueif thisILcdBoundsobject touches or overlaps to any extent with the given rectangle,falseotherwise.
-
contains2D
Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject contains the givenILcdBoundsobject in the 2D space. Only the first two dimensions of theILcdBoundsobjects are considered.If either bounds is
undefined, the result is false.- Specified by:
contains2Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double aX, double aY, double aWidth, double aHeight) Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject contains the given rectangle in the 2D space. Only the first two dimensions of theILcdBoundsobject are considered.If this bounds is
undefined, the result is false.- Specified by:
contains2Din interfaceILcdBounds- Parameters:
aX- the x coordinate of the rectangle.aY- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.- Returns:
- the boolean result of the containment test.
-
interacts3D
Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject interacts with the givenILcdBoundsobject.If either bounds is
undefined, the result is false.- Specified by:
interacts3Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the interaction test.
- See Also:
-
interacts3D
public boolean interacts3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject interacts with the given box in the 3D space.If this bounds is
undefined, the result is false.- Specified by:
interacts3Din interfaceILcdBounds- Parameters:
aX- the x coordinate of the box.aY- the y coordinate of the box.aZ- the z coordinate of the box.aWidth- the width of the box.aHeight- the height of the box.aDepth- the depth of the box.- Returns:
trueif thisILcdBoundsobject touches or overlaps to any extent with the given box,falseotherwise.
-
contains3D
Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject contains the givenILcdBoundsobject in the 3D space.If either bounds is
undefined, the result is false.- Specified by:
contains3Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
public boolean contains3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject contains the given box in the 3D space.If this bounds is
undefined, the result is false.- Specified by:
contains3Din interfaceILcdBounds- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.aWidth- the width of the box.aHeight- the height of the box.aDepth- the depth of the box.- Returns:
- the boolean result of the containment test.
- See Also:
-
getPointCount
public int getPointCount()Description copied from interface:ILcdPointListReturns the number ofILcdPointobjects in the list.- Specified by:
getPointCountin interfaceILcdPointList- Returns:
- 1.
-
getPoint
Description copied from interface:ILcdPointListReturns theILcdPointat a given index.- Specified by:
getPointin interfaceILcdPointList- Parameters:
aIndex- a valid index in the list ofILcdPointobjects.- Returns:
- the
ALcdPointitself.
-
equals
Returns whether the given object has the same class and the same coordinates.- Specified by:
equalsin interfaceILcdPoint- Overrides:
equalsin classALcdShape- Parameters:
aObject- theObjectto compare to.- Returns:
- false if aObject is an ILcdPoint object with different 3D coordinates or the object is not an ILcdPoint. If the objects do have the same 3D coordinates, the return value is defined by the specific implementations of ILcdPoint and may still be false.
-
hashCode
public int hashCode()Description copied from class:ALcdShapeThe hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method. Extensions should refine this implementation, based on their properties.
-