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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains2D
(double aX, double aY) Checks whether thisALcdPoint
is equal to the given point in the 2D cartesian plane.boolean
contains2D
(double aX, double aY, double aWidth, double aHeight) Checks whether thisILcdBounds
object contains the given rectangle in the 2D space.boolean
contains2D
(ILcdBounds aBounds) Checks whether thisILcdBounds
object contains the givenILcdBounds
object in the 2D space.boolean
contains3D
(double aX, double aY, double aZ) Checks whether thisALcdPoint
is equal to the given point in the 3D cartesian space.boolean
contains3D
(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Checks whether thisILcdBounds
object contains the given box in the 3D space.boolean
contains3D
(ILcdBounds aBounds) Checks whether thisILcdBounds
object contains the givenILcdBounds
object in the 3D space.boolean
Returns whether the given object has the same class and the same coordinates.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.double
getCosX()
Returns cos(getX()
* DEG2RAD ).double
getCosY()
Returns cos(getY()
* DEG2RAD ).double
getDepth()
Returns the depth of the bounding box.Returns the focus point of thisILcdShape
.double
Returns the height of the bounding box.Returns the location of the bounding box (smallest x and y coordinates).double
getMaxX()
Returns the maximum X value (right boundary) of this bounds.double
getMaxY()
Returns the maximum Y value (upper boundary) of this bounds.double
getMaxZ()
Returns the maximum Z value (top boundary) of this bounds.double
getMinX()
Returns the minimum X value (left boundary) of this bounds.double
getMinY()
Returns the minimum Y value (lower boundary) of this bounds.double
getMinZ()
Returns the minimum Z value (bottom boundary) of this bounds.getPoint
(int aIndex) Returns theILcdPoint
at a given index.int
Returns the number ofILcdPoint
objects in the list.double
getSinX()
Returns sin(getX()
* DEG2RAD ).double
getSinY()
Returns sin(getY()
* DEG2RAD ).double
getTanX()
Returns tan(getX()
* DEG2RAD ).double
getTanY()
Returns tan(getY()
* DEG2RAD ).double
getWidth()
Returns the width of the bounding box.int
hashCode()
The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)
method.boolean
interacts2D
(double aX, double aY, double aWidth, double aHeight) Checks whether thisILcdBounds
object interacts with the given rectangle in the 2D space.boolean
interacts2D
(ILcdBounds aBounds) Checks whether thisILcdBounds
object interacts with the givenILcdBounds
object in the 2D space.boolean
interacts3D
(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Checks whether thisILcdBounds
object interacts with the given box in the 3D space.boolean
interacts3D
(ILcdBounds aBounds) Checks whether thisILcdBounds
object interacts with the givenILcdBounds
object.final boolean
A point's bounds are always valid.Methods inherited from class com.luciad.shape.ALcdShape
clone, contains2D, contains3D, fromDomainObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdBounds
cloneAs2DEditableBounds, cloneAs3DEditableBounds, getCenter
Methods inherited from interface com.luciad.util.ILcdCloneable
clone
Methods inherited from interface com.luciad.shape.ILcdPoint
cloneAs2DEditablePoint, cloneAs3DEditablePoint, getX, getY, getZ
Methods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZ
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D
-
Constructor Details
-
ALcdPoint
public ALcdPoint()
-
-
Method Details
-
getCosX
public double getCosX()Description copied from interface:ILcdPoint
Returns cos(getX()
* DEG2RAD ). -
getSinX
public double getSinX()Description copied from interface:ILcdPoint
Returns sin(getX()
* DEG2RAD ). -
getTanX
public double getTanX()Description copied from interface:ILcdPoint
Returns tan(getX()
* DEG2RAD ). -
getCosY
public double getCosY()Description copied from interface:ILcdPoint
Returns cos(getY()
* DEG2RAD ). -
getSinY
public double getSinY()Description copied from interface:ILcdPoint
Returns sin(getY()
* DEG2RAD ). -
getTanY
public double getTanY()Description copied from interface:ILcdPoint
Returns tan(getY()
* DEG2RAD ). -
getFocusPoint
Description copied from interface:ILcdShape
Returns the focus point of thisILcdShape
.- Specified by:
getFocusPoint
in interfaceILcdShape
- Returns:
- the
ALcdPoint
itself.
-
contains2D
public boolean contains2D(double aX, double aY) Checks whether thisALcdPoint
is equal to the given point in the 2D cartesian plane.- Specified by:
contains2D
in 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 thisALcdPoint
is equal to the given point in the 3D cartesian space.- Specified by:
contains3D
in 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:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object 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
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ALcdPoint
itself, playing the role of its ownILcdBounds
.
-
isDefined
public final boolean isDefined()A point's bounds are always valid.- Specified by:
isDefined
in interfaceILcdBounds
- Returns:
- always
true
-
getLocation
Description copied from interface:ILcdBounds
Returns the location of the bounding box (smallest x and y coordinates).- Specified by:
getLocation
in interfaceILcdBounds
- Returns:
- the
ALcdPoint
itself.
-
getMinX
public double getMinX()Description copied from interface:ILcdBounds
Returns the minimum X value (left boundary) of this bounds. By default, this doesgetLocation.getX()
, but can be overridden for performance.- Specified by:
getMinX
in interfaceILcdBounds
- Returns:
- the minimum X boundary
- See Also:
-
getMinY
public double getMinY()Description copied from interface:ILcdBounds
Returns the minimum Y value (lower boundary) of this bounds. By default, this doesgetLocation.getY()
, but can be overridden for performance.- Specified by:
getMinY
in interfaceILcdBounds
- Returns:
- the minimum Y boundary
- See Also:
-
getMinZ
public double getMinZ()Description copied from interface:ILcdBounds
Returns the minimum Z value (bottom boundary) of this bounds. By default, this doesgetLocation.getZ()
, but can be overridden for performance.- Specified by:
getMinZ
in interfaceILcdBounds
- Returns:
- the minimum Z boundary
- See Also:
-
getMaxX
public double getMaxX()Description copied from interface:ILcdBounds
Returns 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:
getMaxX
in interfaceILcdBounds
- Returns:
- the maximum X boundary
- See Also:
-
getMaxY
public double getMaxY()Description copied from interface:ILcdBounds
Returns 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:
getMaxY
in interfaceILcdBounds
- Returns:
- the maximum Y boundary
- See Also:
-
getMaxZ
public double getMaxZ()Description copied from interface:ILcdBounds
Returns 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:
getMaxZ
in interfaceILcdBounds
- Returns:
- the maximum Z boundary
- See Also:
-
getWidth
public double getWidth()Description copied from interface:ILcdBounds
Returns the width of the bounding box. The width has to be larger than or equal to 0.- Specified by:
getWidth
in interfaceILcdBounds
- Returns:
- 0.0.
-
getHeight
public double getHeight()Description copied from interface:ILcdBounds
Returns the height of the bounding box. The height has to be larger than or equal to 0.- Specified by:
getHeight
in interfaceILcdBounds
- Returns:
- 0.0.
-
getDepth
public double getDepth()Description copied from interface:ILcdBounds
Returns the depth of the bounding box. The depth has to be larger than or equal to 0.- Specified by:
getDepth
in interfaceILcdBounds
- Returns:
- 0.0.
-
interacts2D
Description copied from interface:ILcdBounds
Checks whether thisILcdBounds
object interacts with the givenILcdBounds
object in the 2D space. Only the first two dimensions of theILcdBounds
objects are considered.If either bounds is
undefined
, the result is false.- Specified by:
interacts2D
in interfaceILcdBounds
- Parameters:
aBounds
- theILcdBounds
to 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:ILcdBounds
Checks whether thisILcdBounds
object interacts with the given rectangle in the 2D space. Only the first two dimensions of theILcdBounds
object are considered.If this bounds is
undefined
, the result is false.- Specified by:
interacts2D
in 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:
true
if thisILcdBounds
object touches or overlaps to any extent with the given rectangle,false
otherwise.
-
contains2D
Description copied from interface:ILcdBounds
Checks whether thisILcdBounds
object contains the givenILcdBounds
object in the 2D space. Only the first two dimensions of theILcdBounds
objects are considered.If either bounds is
undefined
, the result is false.- Specified by:
contains2D
in interfaceILcdBounds
- Parameters:
aBounds
- theILcdBounds
to 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:ILcdBounds
Checks whether thisILcdBounds
object contains the given rectangle in the 2D space. Only the first two dimensions of theILcdBounds
object are considered.If this bounds is
undefined
, the result is false.- Specified by:
contains2D
in 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:ILcdBounds
Checks whether thisILcdBounds
object interacts with the givenILcdBounds
object.If either bounds is
undefined
, the result is false.- Specified by:
interacts3D
in interfaceILcdBounds
- Parameters:
aBounds
- theILcdBounds
to 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:ILcdBounds
Checks whether thisILcdBounds
object interacts with the given box in the 3D space.If this bounds is
undefined
, the result is false.- Specified by:
interacts3D
in 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:
true
if thisILcdBounds
object touches or overlaps to any extent with the given box,false
otherwise.
-
contains3D
Description copied from interface:ILcdBounds
Checks whether thisILcdBounds
object contains the givenILcdBounds
object in the 3D space.If either bounds is
undefined
, the result is false.- Specified by:
contains3D
in interfaceILcdBounds
- Parameters:
aBounds
- theILcdBounds
to 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:ILcdBounds
Checks whether thisILcdBounds
object contains the given box in the 3D space.If this bounds is
undefined
, the result is false.- Specified by:
contains3D
in 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:ILcdPointList
Returns the number ofILcdPoint
objects in the list.- Specified by:
getPointCount
in interfaceILcdPointList
- Returns:
- 1.
-
getPoint
Description copied from interface:ILcdPointList
Returns theILcdPoint
at a given index.- Specified by:
getPoint
in interfaceILcdPointList
- Parameters:
aIndex
- a valid index in the list ofILcdPoint
objects.- Returns:
- the
ALcdPoint
itself.
-
equals
Returns whether the given object has the same class and the same coordinates.- Specified by:
equals
in interfaceILcdPoint
- Overrides:
equals
in classALcdShape
- Parameters:
aObject
- theObject
to 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:ALcdShape
The 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.
-