public abstract class ALcdPoint extends ALcdShape implements ILcdPoint, ILcdPolypoint, ILcdBounds
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.
Constructor and Description |
---|
ALcdPoint() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains2D(double aX,
double aY)
Checks whether this
ALcdPoint is equal to the given point in
the 2D cartesian plane. |
boolean |
contains2D(double aX,
double aY,
double aWidth,
double aHeight)
Checks whether this
ILcdBounds object contains the given rectangle in
the 2D space. |
boolean |
contains2D(ILcdBounds aBounds)
Checks whether this
ILcdBounds object contains the given ILcdBounds
object in the 2D space. |
boolean |
contains3D(double aX,
double aY,
double aZ)
Checks whether this
ALcdPoint 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 this
ILcdBounds object contains the given box in the 3D
space. |
boolean |
contains3D(ILcdBounds aBounds)
Checks whether this
ILcdBounds object contains the given ILcdBounds
object in the 3D space. |
boolean |
equals(Object aObject)
Returns whether the given object has the same class and the same
coordinates.
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
double |
getCosX()
Returns cos(
getX() * DEG2RAD ). |
double |
getCosY()
Returns cos(
getY() * DEG2RAD ). |
double |
getDepth()
Returns the depth of the bounding box.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
double |
getHeight()
Returns the height of the bounding box.
|
ILcdPoint |
getLocation()
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.
|
ILcdPoint |
getPoint(int aIndex)
Returns the
ILcdPoint at a given index. |
int |
getPointCount()
Returns the number of
ILcdPoint 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 the
ALcdShape.equals(Object) method. |
boolean |
interacts2D(double aX,
double aY,
double aWidth,
double aHeight)
Checks whether this
ILcdBounds object interacts with the given rectangle in
the 2D space. |
boolean |
interacts2D(ILcdBounds aBounds)
Checks whether this
ILcdBounds object interacts with the given ILcdBounds
object in the 2D space. |
boolean |
interacts3D(double aX,
double aY,
double aZ,
double aWidth,
double aHeight,
double aDepth)
Checks whether this
ILcdBounds object interacts with the given box in
the 3D space. |
boolean |
interacts3D(ILcdBounds aBounds)
Checks whether this
ILcdBounds object interacts with the given ILcdBounds
object. |
boolean |
isDefined()
A point's bounds are always valid.
|
clone, contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
cloneAs2DEditablePoint, cloneAs3DEditablePoint, getX, getY, getZ
getPointSFCT, getX, getY, getZ
cloneAs2DEditableBounds, cloneAs3DEditableBounds, getCenter
contains2D, contains3D
clone
public double getCosX()
ILcdPoint
getX()
* DEG2RAD ).public double getSinX()
ILcdPoint
getX()
* DEG2RAD ).public double getTanX()
ILcdPoint
getX()
* DEG2RAD ).public double getCosY()
ILcdPoint
getY()
* DEG2RAD ).public double getSinY()
ILcdPoint
getY()
* DEG2RAD ).public double getTanY()
ILcdPoint
getY()
* DEG2RAD ).public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ALcdPoint
itself.public boolean contains2D(double aX, double aY)
ALcdPoint
is equal to the given point in
the 2D cartesian plane.contains2D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public boolean contains3D(double aX, double aY, double aZ)
ALcdPoint
is equal to the given point in
the 3D cartesian space.contains3D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
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
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ALcdPoint
itself, playing the role of its own
ILcdBounds
.public final boolean isDefined()
isDefined
in interface ILcdBounds
true
public ILcdPoint getLocation()
ILcdBounds
getLocation
in interface ILcdBounds
ALcdPoint
itself.public double getMinX()
ILcdBounds
getLocation.getX()
, but can be overridden for performance.getMinX
in interface ILcdBounds
ILcdBounds.getMaxX()
public double getMinY()
ILcdBounds
getLocation.getY()
, but can be overridden for performance.getMinY
in interface ILcdBounds
ILcdBounds.getMaxY()
public double getMinZ()
ILcdBounds
getLocation.getZ()
, but can be overridden for performance.getMinZ
in interface ILcdBounds
ILcdBounds.getMaxZ()
public double getMaxX()
ILcdBounds
getLocation.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.
For geodetic bounds
, the returned value is not necessarily normalized to [-180, 180].getMaxX
in interface ILcdBounds
ILcdBounds.getMinX()
public double getMaxY()
ILcdBounds
getLocation.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.getMaxY
in interface ILcdBounds
ILcdBounds.getMinY()
public double getMaxZ()
ILcdBounds
getLocation.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.getMaxZ
in interface ILcdBounds
ILcdBounds.getMinZ()
public double getWidth()
ILcdBounds
getWidth
in interface ILcdBounds
public double getHeight()
ILcdBounds
getHeight
in interface ILcdBounds
public double getDepth()
ILcdBounds
getDepth
in interface ILcdBounds
public boolean interacts2D(ILcdBounds aBounds)
ILcdBounds
ILcdBounds
object interacts with the given ILcdBounds
object in the 2D space. Only the first two dimensions of the ILcdBounds
objects
are considered.
If either bounds is undefined
, the result is false.
interacts2D
in interface ILcdBounds
aBounds
- the ILcdBounds
to compare with.ILcdBounds.interacts2D(double, double, double, double)
public boolean interacts2D(double aX, double aY, double aWidth, double aHeight)
ILcdBounds
ILcdBounds
object interacts with the given rectangle in
the 2D space. Only the first two dimensions of the ILcdBounds
object
are considered.
If this bounds is undefined
, the result is false.
interacts2D
in interface ILcdBounds
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.true
if this ILcdBounds
object touches or overlaps to
any extent with the given rectangle, false
otherwise.public boolean contains2D(ILcdBounds aBounds)
ILcdBounds
ILcdBounds
object contains the given ILcdBounds
object in the 2D space. Only the first two dimensions of the ILcdBounds
objects
are considered.
If either bounds is undefined
, the result is false.
contains2D
in interface ILcdBounds
aBounds
- the ILcdBounds
to compare with.ILcdBounds.contains2D(double, double, double, double)
public boolean contains2D(double aX, double aY, double aWidth, double aHeight)
ILcdBounds
ILcdBounds
object contains the given rectangle in
the 2D space. Only the first two dimensions of the ILcdBounds
object
are considered.
If this bounds is undefined
, the result is false.
contains2D
in interface ILcdBounds
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.public boolean interacts3D(ILcdBounds aBounds)
ILcdBounds
ILcdBounds
object interacts with the given ILcdBounds
object.
If either bounds is undefined
, the result is false.
interacts3D
in interface ILcdBounds
aBounds
- the ILcdBounds
to compare with.ILcdBounds.interacts3D(double, double, double, double, double, double)
public boolean interacts3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
ILcdBounds
ILcdBounds
object interacts with the given box in
the 3D space.
If this bounds is undefined
, the result is false.
interacts3D
in interface ILcdBounds
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.true
if this ILcdBounds
object touches or overlaps to
any extent with the given box, false
otherwise.public boolean contains3D(ILcdBounds aBounds)
ILcdBounds
ILcdBounds
object contains the given ILcdBounds
object in the 3D space.
If either bounds is undefined
, the result is false.
contains3D
in interface ILcdBounds
aBounds
- the ILcdBounds
to compare with.ILcdBounds.contains3D(double, double, double, double, double, double)
public boolean contains3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
ILcdBounds
ILcdBounds
object contains the given box in the 3D
space.
If this bounds is undefined
, the result is false.
contains3D
in interface ILcdBounds
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.ILcdBounds.contains2D(double, double, double, double)
public int getPointCount()
ILcdPointList
ILcdPoint
objects in the list.getPointCount
in interface ILcdPointList
public ILcdPoint getPoint(int aIndex)
ILcdPointList
ILcdPoint
at a given index.getPoint
in interface ILcdPointList
aIndex
- a valid index in the list of ILcdPoint
objects.ALcdPoint
itself.public boolean equals(Object aObject)
equals
in interface ILcdPoint
equals
in class ALcdShape
aObject
- the Object
to compare to.public int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.