Class ALcdPoint

java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdPoint
All Implemented Interfaces:
ILcdBounded, ILcdBounds, ILcdPoint, ILcdPointList, ILcdPolypoint, ILcdShape, ILcdCloneable, Serializable, Cloneable
Direct Known Subclasses:
ALcd2DEditablePoint

public abstract class ALcdPoint extends ALcdShape implements ILcdPoint, ILcdPolypoint, ILcdBounds
This abstract class provides a basis for implementing the 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    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
    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
    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.
    Returns the ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    double
    Returns cos( getX() * DEG2RAD ).
    double
    Returns cos( getY() * DEG2RAD ).
    double
    Returns the depth of the bounding box.
    Returns the focus point of this ILcdShape.
    double
    Returns the height of the bounding box.
    Returns the location of the bounding box (smallest x and y coordinates).
    double
    Returns the maximum X value (right boundary) of this bounds.
    double
    Returns the maximum Y value (upper boundary) of this bounds.
    double
    Returns the maximum Z value (top boundary) of this bounds.
    double
    Returns the minimum X value (left boundary) of this bounds.
    double
    Returns the minimum Y value (lower boundary) of this bounds.
    double
    Returns the minimum Z value (bottom boundary) of this bounds.
    getPoint(int aIndex)
    Returns the ILcdPoint at a given index.
    int
    Returns the number of ILcdPoint objects in the list.
    double
    Returns sin( getX() * DEG2RAD ).
    double
    Returns sin( getY() * DEG2RAD ).
    double
    Returns tan( getX() * DEG2RAD ).
    double
    Returns tan( getY() * DEG2RAD ).
    double
    Returns the width of the bounding box.
    int
    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
    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
    Checks whether this ILcdBounds object interacts with the given ILcdBounds 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 ).
      Specified by:
      getCosX in interface ILcdPoint
      Returns:
      cos( getX() * DEG2RAD ).
    • getSinX

      public double getSinX()
      Description copied from interface: ILcdPoint
      Returns sin( getX() * DEG2RAD ).
      Specified by:
      getSinX in interface ILcdPoint
      Returns:
      sin( getX() * DEG2RAD ).
    • getTanX

      public double getTanX()
      Description copied from interface: ILcdPoint
      Returns tan( getX() * DEG2RAD ).
      Specified by:
      getTanX in interface ILcdPoint
      Returns:
      tan( getX() * DEG2RAD ).
    • getCosY

      public double getCosY()
      Description copied from interface: ILcdPoint
      Returns cos( getY() * DEG2RAD ).
      Specified by:
      getCosY in interface ILcdPoint
      Returns:
      cos( getY() * DEG2RAD ).
    • getSinY

      public double getSinY()
      Description copied from interface: ILcdPoint
      Returns sin( getY() * DEG2RAD ).
      Specified by:
      getSinY in interface ILcdPoint
      Returns:
      sin( getY() * DEG2RAD ).
    • getTanY

      public double getTanY()
      Description copied from interface: ILcdPoint
      Returns tan( getY() * DEG2RAD ).
      Specified by:
      getTanY in interface ILcdPoint
      Returns:
      tan( getY() * DEG2RAD ).
    • getFocusPoint

      public ILcdPoint getFocusPoint()
      Description copied from interface: ILcdShape
      Returns the focus point of this ILcdShape.
      Specified by:
      getFocusPoint in interface ILcdShape
      Returns:
      the ALcdPoint itself.
    • contains2D

      public boolean contains2D(double aX, double aY)
      Checks whether this ALcdPoint is equal to the given point in the 2D cartesian plane.
      Specified by:
      contains2D in interface ILcdShape
      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 this ALcdPoint is equal to the given point in the 3D cartesian space.
      Specified by:
      contains3D in interface ILcdShape
      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

      public ILcdBounds getBounds()
      Description copied from interface: ILcdBounded
      Returns the 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.

      Specified by:
      getBounds in interface ILcdBounded
      Returns:
      the ALcdPoint itself, playing the role of its own ILcdBounds.
    • isDefined

      public final boolean isDefined()
      A point's bounds are always valid.
      Specified by:
      isDefined in interface ILcdBounds
      Returns:
      always true
    • getLocation

      public ILcdPoint getLocation()
      Description copied from interface: ILcdBounds
      Returns the location of the bounding box (smallest x and y coordinates).
      Specified by:
      getLocation in interface ILcdBounds
      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 does getLocation.getX(), but can be overridden for performance.

      Specified by:
      getMinX in interface ILcdBounds
      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 does getLocation.getY(), but can be overridden for performance.

      Specified by:
      getMinY in interface ILcdBounds
      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 does getLocation.getZ(), but can be overridden for performance.

      Specified by:
      getMinZ in interface ILcdBounds
      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 does 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].

      Specified by:
      getMaxX in interface ILcdBounds
      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 does 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.

      Specified by:
      getMaxY in interface ILcdBounds
      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 does 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.

      Specified by:
      getMaxZ in interface ILcdBounds
      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 interface ILcdBounds
      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 interface ILcdBounds
      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 interface ILcdBounds
      Returns:
      0.0.
    • interacts2D

      public boolean interacts2D(ILcdBounds aBounds)
      Description copied from interface: ILcdBounds
      Checks whether this 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.

      Specified by:
      interacts2D in interface ILcdBounds
      Parameters:
      aBounds - the ILcdBounds 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 this 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.

      Specified by:
      interacts2D in interface ILcdBounds
      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 this ILcdBounds object touches or overlaps to any extent with the given rectangle, false otherwise.
    • contains2D

      public boolean contains2D(ILcdBounds aBounds)
      Description copied from interface: ILcdBounds
      Checks whether this 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.

      Specified by:
      contains2D in interface ILcdBounds
      Parameters:
      aBounds - the ILcdBounds 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 this 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.

      Specified by:
      contains2D in interface ILcdBounds
      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

      public boolean interacts3D(ILcdBounds aBounds)
      Description copied from interface: ILcdBounds
      Checks whether this ILcdBounds object interacts with the given ILcdBounds object.

      If either bounds is undefined, the result is false.

      Specified by:
      interacts3D in interface ILcdBounds
      Parameters:
      aBounds - the ILcdBounds 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 this ILcdBounds object interacts with the given box in the 3D space.

      If this bounds is undefined, the result is false.

      Specified by:
      interacts3D in interface ILcdBounds
      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 this ILcdBounds object touches or overlaps to any extent with the given box, false otherwise.
    • contains3D

      public boolean contains3D(ILcdBounds aBounds)
      Description copied from interface: ILcdBounds
      Checks whether this ILcdBounds object contains the given ILcdBounds object in the 3D space.

      If either bounds is undefined, the result is false.

      Specified by:
      contains3D in interface ILcdBounds
      Parameters:
      aBounds - the ILcdBounds 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 this ILcdBounds object contains the given box in the 3D space.

      If this bounds is undefined, the result is false.

      Specified by:
      contains3D in interface ILcdBounds
      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 of ILcdPoint objects in the list.
      Specified by:
      getPointCount in interface ILcdPointList
      Returns:
      1.
    • getPoint

      public ILcdPoint getPoint(int aIndex)
      Description copied from interface: ILcdPointList
      Returns the ILcdPoint at a given index.
      Specified by:
      getPoint in interface ILcdPointList
      Parameters:
      aIndex - a valid index in the list of ILcdPoint objects.
      Returns:
      the ALcdPoint itself.
    • equals

      public boolean equals(Object aObject)
      Returns whether the given object has the same class and the same coordinates.
      Specified by:
      equals in interface ILcdPoint
      Overrides:
      equals in class ALcdShape
      Parameters:
      aObject - the Object 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 the ALcdShape.equals(Object) method. Extensions should refine this implementation, based on their properties.
      Overrides:
      hashCode in class ALcdShape