Class ALcdBounds

java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdBounds
All Implemented Interfaces:
ILcdBounded, ILcdBounds, ILcdShape, ILcdCloneable, Serializable, Cloneable
Direct Known Subclasses:
ALcd2DEditableBounds

public abstract class ALcdBounds extends ALcdShape implements ILcdBounds
This abstract class provides a basis for implementing the ILcdBounds interface.

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 ALcdBounds object contains the given point in the cartesian plane.
    boolean
    contains2D(double aX, double aY, double aWidth, double aHeight)
    Checks whether this ALcdBounds object contains the given rectangle in the cartesian plane.
    boolean
    Checks whether this ALcdBounds object contains the given ILcdBounds object in the cartesian plane.
    boolean
    contains3D(double aX, double aY, double aZ)
    Checks whether this ALcdBounds object contains 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 ALcdBounds object contains the given box in the 3D cartesian space.
    boolean
    Checks whether this ALcdBounds object contains the given ILcdBounds object in the 3D cartesian space.
    boolean
    equals(Object aObject)
    Returns whether the given object has the same class, and the same coordinates, width, height, and depth.
    static ILcdBounds
    Returns the bounds of the given object.
    Returns the ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    Returns the focus point of this ILcdShape.
    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 ALcdBounds object interacts with the given rectangle in the cartesian plane.
    boolean
    Checks whether this ALcdBounds object interacts with the given ILcdBounds object in the cartesian plane.
    boolean
    interacts3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
    Checks whether this ALcdBounds object interacts with the given box in the 3D cartesian space.
    boolean
    Checks whether this ALcdBounds object interacts with the given ILcdBounds object in the 3D cartesian space.
    static boolean
    Checks whether the bounds of the given object are defined.
    static boolean
    Checks whether the given bounds are defined.

    Methods inherited from class com.luciad.shape.ALcdShape

    clone, contains2D, contains3D

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.luciad.util.ILcdCloneable

    clone

    Methods inherited from interface com.luciad.shape.ILcdShape

    contains2D, contains3D
  • Constructor Details

    • ALcdBounds

      public ALcdBounds()
  • Method Details

    • fromDomainObject

      public static ILcdBounds fromDomainObject(Object aObject)

      Returns the bounds of the given object. The given object is usually a domain object, i.e. an object retrieved from the model. It returns bounds in the following cases:

      • The given Object is an ILcdBounded.
      • The Object is an ILcdDataObject whose type contains a TLcdHasGeometryAnnotation with an ILcdShape or ALcdImage property

      In other cases, this method returns null.

      One should never check if an Object is a bounds using instanceof, but use this method instead and perform a null-check on the result.

      Parameters:
      aObject - an object, usually the domain object in a model.
      Returns:
      the bounds associated with the given object or null.
    • isDefined

      public static boolean isDefined(ILcdBounds aBounds)
      Checks whether the given bounds are defined.

      You can pass null as argument, which will result in false.

      This method is shorthand for:

      
         (aBounds != null && aBounds.isDefined())
       
      Parameters:
      aBounds - The bounds to check, can be null.
      Returns:
      false if the given bounds are null or undefined, true otherwise
    • isDefined

      public static boolean isDefined(ILcdBounded aBounded)
      Checks whether the bounds of the given object are defined.

      You can pass null as argument, which will result in false.

      This method is shorthand for:

      
         ALcdBounds.isDefined(aBounded == null ? null : aBounded.getBounds())
       
      Parameters:
      aBounded - The element whose bounds to check, can be null.
      Returns:
      false if the element is null or its bounds are undefined, true otherwise
    • 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 ALcdBounds object itself.
    • getFocusPoint

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

      public boolean contains2D(double aX, double aY)
      Checks whether this ALcdBounds object contains the given point in the cartesian plane. Only the first two dimensions of the ILcdBounds are considered, that is, the x coordinate and y coordinate of its location, its width, and its height.
      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 containment test.
    • contains3D

      public boolean contains3D(double aX, double aY, double aZ)
      Checks whether this ALcdBounds object contains the given point in the 3D cartesian space. All three spatial dimensions of the ILcdBounds are considered, as a combination of contains2D and a test in the third dimension.
      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 containment test.
      See Also:
    • interacts2D

      public boolean interacts2D(ILcdBounds aBounds)
      Checks whether this ALcdBounds object interacts with the given ILcdBounds object in the cartesian plane.
      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)
      Checks whether this ALcdBounds object interacts with the given rectangle in the cartesian plane. Only the first two dimensions of the ILcdBounds object are considered, that is, the x coordinate and y coordinate of its location, its width, and its height.
      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 ALcdBounds object touches or overlaps to any extent with the given rectangle, false otherwise.
    • contains2D

      public boolean contains2D(ILcdBounds aBounds)
      Checks whether this ALcdBounds object contains the given ILcdBounds object in the cartesian plane.
      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)
      Checks whether this ALcdBounds object contains the given rectangle in the cartesian plane. Only the first two dimensions of the ILcdBounds object are considered, that is, the x coordinate and y coordinate of its location, its width, and its height.
      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)
      Checks whether this ALcdBounds object interacts with the given ILcdBounds object in the 3D cartesian space.
      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)
      Checks whether this ALcdBounds object interacts with the given box in the 3D cartesian space.
      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 ALcdBounds object touches or overlaps to any extent with the given box, false otherwise.
    • contains3D

      public boolean contains3D(ILcdBounds aBounds)
      Checks whether this ALcdBounds object contains the given ILcdBounds object in the 3D cartesian space.
      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)
      Checks whether this ALcdBounds object contains the given box in the 3D cartesian space. All three spatial dimensions of the ILcdBounds are considered, as a combination of contains2D and a test in the third dimension.
      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:
    • equals

      public boolean equals(Object aObject)
      Returns whether the given object has the same class, and the same coordinates, width, height, and depth.
      Overrides:
      equals in class ALcdShape
    • 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