public class TLcdLonLatArcBand extends ALcd2DEditableShape implements ILcd2DEditableArcBand, ILcdCache
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.
MAX_RADIUS_END_CORNER, MAX_RADIUS_START_CORNER, MIN_RADIUS_END_CORNER, MIN_RADIUS_START_CORNER
Constructor and Description |
---|
TLcdLonLatArcBand()
Constructs a new
TLcdXYArcBand with all coordinates and angles set to 0,
and with a default ellipsoid. |
TLcdLonLatArcBand(double aCenterLon,
double aCenterLat,
double aMinRadius,
double aMaxRadius,
double aStartAngle,
double aArcAngle,
ILcdEllipsoid aEllipsoid)
Constructs a new
TLcdLonLatArcBand with the given parameters. |
TLcdLonLatArcBand(ILcdPoint aCenter,
double aMinRadius,
double aMaxRadius,
double aStartAngle,
double aArcAngle)
Constructs a new
TLcdLonLatArcBand with the given parameters. |
TLcdLonLatArcBand(ILcdPoint aCenter,
double aMinRadius,
double aMaxRadius,
double aStartAngle,
double aArcAngle,
ILcdEllipsoid aEllipsoid)
Constructs a new
TLcdLonLatArcBand with the given parameters. |
TLcdLonLatArcBand(TLcdLonLatArcBand aLonLatArcBand)
Constructs a new
TLcdXYArcBand that is a deep copy of the given TLcdLonLatArcBand . |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
contains2D(double aLon,
double aLat)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aLLP)
Checks whether this
ALcdShape contains the given point in the
2D cartesian plane. |
void |
corner2DEditablePointSFCT(int aCorner,
ILcd2DEditablePoint a2DEditablePointSFCT)
Computes the position of the specified corner of this
ILcdArcBand . |
boolean |
equals(Object aObject)
Returns whether the given object has the same class and the same
coordinates and parameters.
|
double |
getArcAngle()
Returns the angle over which the arc extends (in degrees).
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ILcdPoint |
getCenter()
Returns the center point of this
ILcdArcBand . |
ILcdEllipsoid |
getEllipsoid() |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
double |
getMaxRadius()
Returns the maximum radius of this
ILcdArcBand . |
double |
getMinRadius()
Returns the minimum radius of this
ILcdArcBand . |
double |
getStartAngle()
Returns the start angle of the arc (in degrees).
|
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. |
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
void |
move2D(double x,
double y)
Translates this shape so that its focus point ends up at the specified
position.
|
void |
moveCornerPoint2D(int aCorner,
double aX,
double aY)
Moves the specified corner point to a new location.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
setArcAngle(double aArcAngle)
Sets the angle over which this
ILcd2DEditableArcBand extends (in degrees). |
void |
setEllipsoid(ILcdEllipsoid aEllipsoid)
Sets the ellipsoid of this
TLcdLonLatArcBand . |
void |
setMaxRadius(double aMaxRadius)
Sets the radius of the outer arc of the arc band.
|
void |
setMinRadius(double aMinRadius)
Sets the radius of the inner arc of the arc band.
|
void |
setStartAngle(double aStartAngle)
Sets the start angle of this
ILcd2DEditableArcBand (in degrees). |
String |
toString() |
void |
translate2D(double x,
double y)
Translates this
ILcd2DEditableShape from its current position over the given translation
vector in the 2D space. |
contains3D, move2D
contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
move2D
contains3D, contains3D
public TLcdLonLatArcBand()
TLcdXYArcBand
with all coordinates and angles set to 0,
and with a default ellipsoid.public TLcdLonLatArcBand(TLcdLonLatArcBand aLonLatArcBand)
TLcdXYArcBand
that is a deep copy of the given TLcdLonLatArcBand
.aLonLatArcBand
- the TLcdLonLatArcBand
to copy.public TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle)
TLcdLonLatArcBand
with the given 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.IllegalArgumentException
- if the minimum or maximum radius passed is less than 0.public TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle, ILcdEllipsoid aEllipsoid)
TLcdLonLatArcBand
with the given 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.IllegalArgumentException
- if the minimum or maximum radius passed is less than 0.public TLcdLonLatArcBand(double aCenterLon, double aCenterLat, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle, ILcdEllipsoid aEllipsoid)
TLcdLonLatArcBand
with the given 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.IllegalArgumentException
- if the minimum or maximum radius passed is less than 0.public ILcdEllipsoid getEllipsoid()
TLcdLonLatArcBand
.public void setEllipsoid(ILcdEllipsoid aEllipsoid)
TLcdLonLatArcBand
.aEllipsoid
- the new ellipsoid.public final ILcdPoint getCenter()
ILcdArcBand
ILcdArcBand
.getCenter
in interface ILcdArcBand
ILcdArcBand
.public void setMinRadius(double aMinRadius)
setMinRadius
in interface ILcd2DEditableArcBand
aMinRadius
- the radius of the inner arc of the arc band. This value should not be less than 0.IllegalArgumentException
- if the radius passed is less than 0.public final double getMinRadius()
ILcdArcBand
ILcdArcBand
.getMinRadius
in interface ILcdArcBand
ILcdArcBand
.public void setMaxRadius(double aMaxRadius)
setMaxRadius
in interface ILcd2DEditableArcBand
aMaxRadius
- the radius of the outer arc of the arc band. This value should not be less than 0.IllegalArgumentException
- if the radius passed is less than 0.public final double getMaxRadius()
ILcdArcBand
ILcdArcBand
.getMaxRadius
in interface ILcdArcBand
ILcdArcBand
.public final double getStartAngle()
ILcdArcBand
getStartAngle
in interface ILcdArcBand
public void setStartAngle(double aStartAngle)
ILcd2DEditableArcBand
ILcd2DEditableArcBand
(in degrees).
The angle is measured from 3 o'clock position, positive
counter-clockwise.setStartAngle
in interface ILcd2DEditableArcBand
aStartAngle
- the new start angle.public final double getArcAngle()
ILcdArcBand
getArcAngle
in interface ILcdArcBand
public void setArcAngle(double aArcAngle)
ILcd2DEditableArcBand
ILcd2DEditableArcBand
extends (in degrees).
The angle is positive counter-clockwise.setArcAngle
in interface ILcd2DEditableArcBand
aArcAngle
- the new arc angle.public void corner2DEditablePointSFCT(int aCorner, ILcd2DEditablePoint a2DEditablePointSFCT)
ILcdArcBand
ILcdArcBand
.corner2DEditablePointSFCT
in interface ILcdArcBand
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.public void moveCornerPoint2D(int aCorner, double aX, double aY)
ILcd2DEditableArcBand
moveCornerPoint2D
in interface ILcd2DEditableArcBand
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.public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.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
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public boolean contains2D(double aLon, double aLat)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aLon
- the x coordinate of the point.aLat
- the y coordinate of the point.public boolean contains2D(ILcdPoint aLLP)
ALcdShape
ALcdShape
contains the given point in the
2D cartesian plane.contains2D
in interface ILcdShape
contains2D
in class ALcdShape
aLLP
- the point to test.ILcdShape.contains2D(double, double)
public void translate2D(double x, double y)
ILcd2DEditableShape
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.translate2D
in interface ILcd2DEditableShape
x
- the x coordinate of the translation vector.y
- the y coordinate of the translation vector.public void move2D(double x, double y)
ALcd2DEditableShape
move2D
in interface ILcd2DEditableShape
move2D
in class ALcd2DEditableShape
x
- the x coordinate of the point.y
- the y coordinate of the point.public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
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.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public Object clone()
clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
public boolean equals(Object aObject)
public int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.