Class TLcdLonLatArcBand

All Implemented Interfaces:
ILcdArcBand, ILcdBounded, ILcdShape, ILcd2DEditableArcBand, ILcd2DEditableShape, ILcdCache, ILcdCloneable, Serializable, Cloneable

public class TLcdLonLatArcBand extends ALcd2DEditableShape implements ILcd2DEditableArcBand, ILcdCache
This class provides an implementation of ILcd2DEditableArcBand in the geodetic space. In addition to the properties defined by ILcd2DEditableArcBand, a TLcdLonLatArcBand has an ellipsoid on which it lives.

It implements ILcdCache, thus providing a cache to store expensive calculations, e.g. for painters, to store model-world transformations. The cache is cleared whenever the shape is modified.

All longitude/latitude coordinates are expressed in degrees. Lengths are expressed in meters.

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 Details

    • TLcdLonLatArcBand

      public TLcdLonLatArcBand()
      Constructs a new TLcdXYArcBand with all coordinates and angles set to 0, and with a default ellipsoid.
    • TLcdLonLatArcBand

      public TLcdLonLatArcBand(TLcdLonLatArcBand aLonLatArcBand)
      Constructs a new TLcdXYArcBand that is a deep copy of the given TLcdLonLatArcBand.
      Parameters:
      aLonLatArcBand - the TLcdLonLatArcBand to copy.
    • TLcdLonLatArcBand

      public TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle)
      Constructs a new TLcdLonLatArcBand with the given parameters.
      Parameters:
      aCenter - the center point.
      aMinRadius - the minimum radius.
      aMaxRadius - the maximum radius.
      aStartAngle - the start angle. The angle is measured from 3 o'clock position, positive counter-clockwise and expressed in degrees.
      aArcAngle - the arc angle. The angle is positive counter-clockwise and expressed in degrees.
      Throws:
      IllegalArgumentException - if the minimum or maximum radius passed is less than 0.
    • TLcdLonLatArcBand

      public TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle, ILcdEllipsoid aEllipsoid)
      Constructs a new TLcdLonLatArcBand with the given parameters.
      Parameters:
      aCenter - the center point.
      aMinRadius - the minimum radius.
      aMaxRadius - the maximum radius.
      aStartAngle - the start angle. The angle is measured from 3 o'clock position, positive counter-clockwise and expressed in degrees.
      aArcAngle - the arc angle. The angle is positive counter-clockwise and expressed in degrees.
      aEllipsoid - the ellipsoid.
      Throws:
      IllegalArgumentException - if the minimum or maximum radius passed is less than 0.
    • TLcdLonLatArcBand

      public TLcdLonLatArcBand(double aCenterLon, double aCenterLat, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle, ILcdEllipsoid aEllipsoid)
      Constructs a new TLcdLonLatArcBand with the given parameters.
      Parameters:
      aCenterLon - the longitude of the center.
      aCenterLat - the latitude of the center.
      aMinRadius - the minimum radius.
      aMaxRadius - the maximum radius.
      aStartAngle - the start angle. The angle is measured from 3 o'clock position, positive counter-clockwise and expressed in degrees.
      aArcAngle - the arc angle. The angle is positive counter-clockwise and expressed in degrees.
      aEllipsoid - the ellipsoid.
      Throws:
      IllegalArgumentException - if the minimum or maximum radius passed is less than 0.
  • Method Details

    • getEllipsoid

      public ILcdEllipsoid getEllipsoid()
      Returns:
      the ellipsoid of this TLcdLonLatArcBand.
    • setEllipsoid

      public void setEllipsoid(ILcdEllipsoid aEllipsoid)
      Sets the ellipsoid of this TLcdLonLatArcBand.
      Parameters:
      aEllipsoid - the new ellipsoid.
    • getCenter

      public final ILcdPoint getCenter()
      Description copied from interface: ILcdArcBand
      Returns the center point of this ILcdArcBand.
      Specified by:
      getCenter in interface ILcdArcBand
      Returns:
      the center point of this ILcdArcBand.
    • setMinRadius

      public void setMinRadius(double aMinRadius)
      Sets the radius of the inner arc of the arc band.
      Specified by:
      setMinRadius in interface ILcd2DEditableArcBand
      Parameters:
      aMinRadius - the radius of the inner arc of the arc band. This value should not be less than 0.
      Throws:
      IllegalArgumentException - if the radius passed is less than 0.
    • getMinRadius

      public final double getMinRadius()
      Description copied from interface: ILcdArcBand
      Returns the minimum radius of this ILcdArcBand.
      Specified by:
      getMinRadius in interface ILcdArcBand
      Returns:
      the minimum radius of this ILcdArcBand.
    • setMaxRadius

      public void setMaxRadius(double aMaxRadius)
      Sets the radius of the outer arc of the arc band.
      Specified by:
      setMaxRadius in interface ILcd2DEditableArcBand
      Parameters:
      aMaxRadius - the radius of the outer arc of the arc band. This value should not be less than 0.
      Throws:
      IllegalArgumentException - if the radius passed is less than 0.
    • getMaxRadius

      public final double getMaxRadius()
      Description copied from interface: ILcdArcBand
      Returns the maximum radius of this ILcdArcBand.
      Specified by:
      getMaxRadius in interface ILcdArcBand
      Returns:
      the maximum radius of this ILcdArcBand.
    • getStartAngle

      public final double getStartAngle()
      Description copied from interface: ILcdArcBand
      Returns the start angle of the arc (in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.
      Specified by:
      getStartAngle in interface ILcdArcBand
      Returns:
      the start angle of the arc (in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.
    • setStartAngle

      public void setStartAngle(double aStartAngle)
      Description copied from interface: ILcd2DEditableArcBand
      Sets the start angle of this ILcd2DEditableArcBand (in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.
      Specified by:
      setStartAngle in interface ILcd2DEditableArcBand
      Parameters:
      aStartAngle - the new start angle.
    • getArcAngle

      public final double getArcAngle()
      Description copied from interface: ILcdArcBand
      Returns the angle over which the arc extends (in degrees). The angle is positive counter-clockwise.
      Specified by:
      getArcAngle in interface ILcdArcBand
      Returns:
      the angle over which the arc extends (in degrees). The angle is positive counter-clockwise.
    • setArcAngle

      public void setArcAngle(double aArcAngle)
      Description copied from interface: ILcd2DEditableArcBand
      Sets the angle over which this ILcd2DEditableArcBand extends (in degrees). The angle is positive counter-clockwise.
      Specified by:
      setArcAngle in interface ILcd2DEditableArcBand
      Parameters:
      aArcAngle - the new arc angle.
    • corner2DEditablePointSFCT

      public void corner2DEditablePointSFCT(int aCorner, ILcd2DEditablePoint a2DEditablePointSFCT)
      Description copied from interface: ILcdArcBand
      Computes the position of the specified corner of this ILcdArcBand.
      Specified by:
      corner2DEditablePointSFCT in interface ILcdArcBand
      Parameters:
      aCorner - the corner: ILcdArcBand.MIN_RADIUS_START_CORNER, ILcdArcBand.MAX_RADIUS_START_CORNER, ILcdArcBand.MIN_RADIUS_END_CORNER, or ILcdArcBand.MAX_RADIUS_END_CORNER.
      a2DEditablePointSFCT - an ILcd2DEditablePoint into which the result is written as a side-effect.
    • moveCornerPoint2D

      public void moveCornerPoint2D(int aCorner, double aX, double aY)
      Description copied from interface: ILcd2DEditableArcBand
      Moves the specified corner point to a new location. The shape of the arc band changes accordingly.
      Specified by:
      moveCornerPoint2D in interface ILcd2DEditableArcBand
      Parameters:
      aCorner - a constant indicating which corner is to be moved: ILcdArcBand.MIN_RADIUS_START_CORNER, ILcdArcBand.MAX_RADIUS_START_CORNER, ILcdArcBand.MIN_RADIUS_END_CORNER, or ILcdArcBand.MAX_RADIUS_END_CORNER.
      aX - the new x coordinate of the point.
      aY - the new y coordinate of the point.
    • 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 aLon, double aLat)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given point in the 2D space. Only the first two dimensions of the ILcdShape are considered.
      Specified by:
      contains2D in interface ILcdShape
      Parameters:
      aLon - the x coordinate of the point.
      aLat - the y coordinate of the point.
      Returns:
      the boolean result of the containment test.
    • contains2D

      public boolean contains2D(ILcdPoint aLLP)
      Description copied from class: ALcdShape
      Checks whether this ALcdShape contains the given point in the 2D cartesian plane.
      Specified by:
      contains2D in interface ILcdShape
      Overrides:
      contains2D in class ALcdShape
      Parameters:
      aLLP - the point to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • translate2D

      public void translate2D(double x, double y)
      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:
      x - the x coordinate of the translation vector.
      y - the y coordinate of the translation vector.
    • move2D

      public void move2D(double x, double y)
      Description copied from class: ALcd2DEditableShape
      Translates this shape so that its focus point ends up at the specified position.
      Specified by:
      move2D in interface ILcd2DEditableShape
      Overrides:
      move2D in class ALcd2DEditableShape
      Parameters:
      x - the x coordinate of the point.
      y - the y coordinate of the point.
    • 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
    • clone

      public Object clone()
      Creates and returns a copy of this object.

      The contained center point is cloned.

      The contained ellipsoid is copied without being cloned.

      The cache is not copied or cloned at all.

      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALcdShape
      See Also:
    • equals

      public boolean equals(Object aObject)
      Returns whether the given object has the same class and the same coordinates and parameters.
      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
    • toString

      public String toString()
      Overrides:
      toString in class Object