Class TLcdLonLatHeightVariableGeoBuffer

All Implemented Interfaces:
ILcdBounded, ILcdShape, ILcdVariableGeoBuffer, ILcd2DEditableShape, ILcd2DEditableVariableGeoBuffer, ILcd3DEditableShape, ILcd3DEditableVariableGeoBuffer, ILcdCache, ILcdCloneable, Serializable, Cloneable

public class TLcdLonLatHeightVariableGeoBuffer extends ALcd3DEditableShape implements ILcd3DEditableVariableGeoBuffer, ILcdCache
This class represents a variable buffer around a polyline on an ellipsoid, in the geodetic space.

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.

This buffer implementation has the following limitations:

  • Contours with holes (i.e., caused by axis intersections) cannot be represented, since the contour is modeled as a single polygon (ILcdPolygon).
  • the corners of the contour at the axis points are sharp instead of rounded, which make it less suitable for buffers that have sharp angles between its consecutive axis segments; it has also has as consequence that the distance between the contour and the axis exceeds the given buffer distance in the corners,
  • the calculated contour is only an estimate, because it uses a reduced number of contour points; when the start and end point of a segment are further removed from each other, the connected contour lines no longer lie at the given distance from the axis at each intermediate point.
Since:
2012.1
See Also:
  • Constructor Details

    • TLcdLonLatHeightVariableGeoBuffer

      public TLcdLonLatHeightVariableGeoBuffer(ILcdEllipsoid aEllipsoid)
      Creates a new buffer without axis points.
      Parameters:
      aEllipsoid - the ellipsoid on which this buffer is defined.
    • TLcdLonLatHeightVariableGeoBuffer

      public TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double aWidth, double aHeight, ILcdEllipsoid aEllipsoid)
      Creates a new buffer using the given axis, and with the same given width and height for every point of the axis.

      Note: The axis will be cloned, hence getBaseShape() does not return the same point list.

      Parameters:
      aAxis - the axis.
      aWidth - the (same) width at every point of the axis.
      aHeight - the (same) height at every point of the axis.
      aEllipsoid - the ellipsoid on which this buffer is defined.
    • TLcdLonLatHeightVariableGeoBuffer

      public TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double[] aWidth, double[] aHeight, ILcdEllipsoid aEllipsoid)
      Creates a new buffer using the given axis, and with the given widths and heights for every point of the axis.

      Note: The axis will be cloned, hence getBaseShape() does not return the same point list.

      Parameters:
      aAxis - the axis.
      aWidth - the widths for every point of the axis. This array should have a length of aAxis.getPointCount().
      aHeight - the heights for every point of the axis. This array should have a length of aAxis.getPointCount().
      aEllipsoid - the ellipsoid on which this buffer is defined.
    • TLcdLonLatHeightVariableGeoBuffer

      public TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double[] aWidth, double[] aHeightBelow, double[] aHeightAbove, ILcdEllipsoid aEllipsoid)
      Creates a new buffer using the given axis, and with the given widths and heights (below and above) for every point of the axis.

      Note: The axis will be cloned, hence getBaseShape() does not return the same point list.

      Parameters:
      aAxis - the axis.
      aWidth - the widths for every point of the axis. This array should have a length of aAxis.getPointCount().
      aHeightBelow - the height below for every point of the axis. This array should have a length of aAxis.getPointCount().
      aHeightAbove - the height above for every point of the axis. This array should have a length of aAxis.getPointCount().
      aEllipsoid - the ellipsoid on which this buffer is defined.
    • TLcdLonLatHeightVariableGeoBuffer

      public TLcdLonLatHeightVariableGeoBuffer(TLcdLonLatHeightVariableGeoBuffer aBuffer)
      Creates a new variable geo buffer as a copy of the given buffer.
      Parameters:
      aBuffer - a variable geo buffer.
  • Method Details

    • setEllipsoid

      public void setEllipsoid(ILcdEllipsoid aEllipsoid)
      Sets the ellipsoid on which this buffer is defined.
      Parameters:
      aEllipsoid - the ellipsoid on which this buffer is defined.
    • getEllipsoid

      public ILcdEllipsoid getEllipsoid()
      Returns the ellipsoid on which this buffer is defined.
      Returns:
      the ellipsoid on which this buffer is defined.
    • getBaseShape

      public ILcd3DEditablePointList getBaseShape()
      Description copied from interface: ILcdVariableGeoBuffer
      Returns the base polyline of the buffer.
      Specified by:
      getBaseShape in interface ILcd2DEditableVariableGeoBuffer
      Specified by:
      getBaseShape in interface ILcd3DEditableVariableGeoBuffer
      Specified by:
      getBaseShape in interface ILcdVariableGeoBuffer
      Returns:
      the base polyline of the buffer.
    • getWidth

      public double getWidth(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdVariableGeoBuffer
      Returns the width of this buffer at the given point index, expressed in meters. This width is defined as the distance from the respective point in the base polyline, in a direction perpendicular to the segments of the base polyline containing the respective point. This is also illustrated in the class doc of this interface.
      Specified by:
      getWidth in interface ILcdVariableGeoBuffer
      Parameters:
      aIndex - the base shape point index to return the width for
      Returns:
      a positive integer (>= 0) representing the width of the buffer at the given point
      Throws:
      IndexOutOfBoundsException - if the base polyline does not have a point for the given index
    • setWidth

      public void setWidth(int aIndex, double aWidth) throws IndexOutOfBoundsException
      Description copied from interface: ILcd2DEditableVariableGeoBuffer
      Sets the width of this buffer at the given point index, expressed in meters. This width is defined as the distance from the respective point in the base polyline, in a direction perpendicular to the segments of the base polyline containing the respective point.
      Specified by:
      setWidth in interface ILcd2DEditableVariableGeoBuffer
      Parameters:
      aIndex - the base shape point index to set the width for
      aWidth - a positive integer (width >= 0) representing the width of the buffer at the given point
      Throws:
      IndexOutOfBoundsException - if the base polyline does not have a point for the given index
      See Also:
    • getHeightBelow

      public double getHeightBelow(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdVariableGeoBuffer
      Returns the height of this buffer below the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the lower side of the contour at that point.
      Specified by:
      getHeightBelow in interface ILcdVariableGeoBuffer
      Parameters:
      aIndex - the base shape point index to return the height for
      Returns:
      a positive integer (>= 0) representing the distance between the respective point and the lower side of the contour at that point
      Throws:
      IndexOutOfBoundsException - if the base polyline does not have a point for the given index
    • setHeightBelow

      public void setHeightBelow(int aIndex, double aHeight) throws IndexOutOfBoundsException
      Description copied from interface: ILcd3DEditableVariableGeoBuffer
      Sets the height of this buffer below the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the lower side of the contour at that point.
      Specified by:
      setHeightBelow in interface ILcd3DEditableVariableGeoBuffer
      Parameters:
      aIndex - the base shape point index to set the height for
      aHeight - a positive integer (>= 0) representing the distance between the respective point and the lower side of the contour at that point
      Throws:
      IndexOutOfBoundsException - if the base polyline does not have a point for the given index
    • getHeightAbove

      public double getHeightAbove(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdVariableGeoBuffer
      Returns the height of this buffer above the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the upper side of the contour at that point.
      Specified by:
      getHeightAbove in interface ILcdVariableGeoBuffer
      Parameters:
      aIndex - the base shape point index to return the height for
      Returns:
      a positive integer (>= 0) representing the distance between the respective point and the upper side of the contour at that point
      Throws:
      IndexOutOfBoundsException - if the base polyline does not have a point for the given index
    • setHeightAbove

      public void setHeightAbove(int aIndex, double aHeight) throws IndexOutOfBoundsException
      Description copied from interface: ILcd3DEditableVariableGeoBuffer
      Sets the height of this buffer above the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the upper side of the contour at that point.
      Specified by:
      setHeightAbove in interface ILcd3DEditableVariableGeoBuffer
      Parameters:
      aIndex - the base shape point index to set the height for
      aHeight - a positive integer (>= 0) representing the distance between the respective point and the upper side of the contour at that point
      Throws:
      IndexOutOfBoundsException - if the base polyline does not have a point for the given index
    • setHeight

      public void setHeight(int aIndex, double aHeight) throws IndexOutOfBoundsException
      Convenience operation that sets both the buffer height above and below the given point index, expressed in meters.
      Parameters:
      aIndex - the base shape point index to set the height for
      aHeight - a positive integer (>= 0) representing the height of the buffer above and below the given point
      Throws:
      IndexOutOfBoundsException - if the base polyline does not have a point for the given index
      See Also:
    • translate2D

      public void translate2D(double aDeltaX, double aDeltaY)
      Description copied from interface: ILcd2DEditableShape
      Translates this ILcd2DEditableShape from its current position over the given translation vector in the 2D space. Only the first two dimensions of the ILcdShape are considered. The third dimension is left unchanged.
      Specified by:
      translate2D in interface ILcd2DEditableShape
      Parameters:
      aDeltaX - the x coordinate of the translation vector.
      aDeltaY - the y coordinate of the translation vector.
    • translate3D

      public void translate3D(double aDeltaX, double aDeltaY, double aDeltaZ)
      Description copied from interface: ILcd3DEditableShape
      Translates this ILcd3DEditableShape from its current position over the given translation vector in the 3D space.
      Specified by:
      translate3D in interface ILcd3DEditableShape
      Parameters:
      aDeltaX - the x coordinate of the translation vector.
      aDeltaY - the y coordinate of the translation vector.
      aDeltaZ - the z coordinate of the translation vector.
    • getFocusPoint

      public ILcdPoint getFocusPoint()
      Description copied from interface: ILcdShape
      Returns the focus point of this ILcdShape.
      Specified by:
      getFocusPoint in interface ILcdShape
      Returns:
      the focus point of this ILcdShape.
    • 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 ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    • contains2D

      public boolean contains2D(double aX, double aY)
      Checks whether this buffer contains the given point in the 2D space. Only the first two dimensions of the buffer are considered.
      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.
    • contains2D

      public boolean contains2D(ILcdPoint aPoint)
      Checks whether this buffer contains the given point in the 2D space. Only the first two dimensions of the buffer are considered.
      Specified by:
      contains2D in interface ILcdShape
      Overrides:
      contains2D in class ALcdShape
      Parameters:
      aPoint - the point to test
      Returns:
      the boolean result of the containment test.
      See Also:
    • contains3D

      public boolean contains3D(ILcdPoint aPoint)
      Checks whether this buffer contains the given point in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Overrides:
      contains3D in class ALcdShape
      Parameters:
      aPoint - the point to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • contains3D

      public boolean contains3D(double aX, double aY, double aZ)
      Checks whether this buffer contains the given point in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Overrides:
      contains3D in class ALcd2DEditableShape
      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.
    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class ALcdShape
      Parameters:
      o - the other object
      Returns:
      whether some other object is "equal to" this one.
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class ALcdShape
      Returns:
      a hash code value for the object.
      See Also:
    • toString

      public String toString()
      Returns a String representation of this object.
      Overrides:
      toString in class Object
      Returns:
      a String representation of this object.
    • clone

      public Object clone()
      Creates and returns a clone of this buffer.
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALcdShape
      See Also:
    • insertIntoCache

      public void insertIntoCache(Object aKey, Object aObject)
      Description copied from interface: ILcdCache
      Inserts a cache Object corresponding to the given key Object.
      Specified by:
      insertIntoCache in interface ILcdCache
      Parameters:
      aKey - the key Object that will be used to identify the Object. The key must therefore be a unique identifier, typically the caller itself: insertIntoCache(this, ...).
      aObject - the Object to be cached.
    • getCachedObject

      public Object getCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and returns the cached Object corresponding to the given key.
      Specified by:
      getCachedObject in interface ILcdCache
      Parameters:
      aKey - the key Object that was used for storing the cache Object.
      Returns:
      the cached Object, or null if there is no Object corresponding to the given key.
    • removeCachedObject

      public Object removeCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and removes the cached Object corresponding to the given key.
      Specified by:
      removeCachedObject in interface ILcdCache
      Parameters:
      aKey - the key Object that was used for storing the cache Object.
      Returns:
      the cached Object, or null if there was no Object corresponding to the given key.
    • clearCache

      public void clearCache()
      Description copied from interface: ILcdCache
      Clears the cache.
      Specified by:
      clearCache in interface ILcdCache