Class TLcdLonLatArcBand
- All Implemented Interfaces:
ILcdArcBand
,ILcdBounded
,ILcdShape
,ILcd2DEditableArcBand
,ILcd2DEditableShape
,ILcdCache
,ILcdCloneable
,Serializable
,Cloneable
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:
-
Field Summary
Fields inherited from interface com.luciad.shape.ILcdArcBand
MAX_RADIUS_END_CORNER, MAX_RADIUS_START_CORNER, MIN_RADIUS_END_CORNER, MIN_RADIUS_START_CORNER
-
Constructor Summary
ConstructorDescriptionConstructs a newTLcdXYArcBand
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 newTLcdLonLatArcBand
with the given parameters.TLcdLonLatArcBand
(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdLonLatArcBand
with the given parameters.TLcdLonLatArcBand
(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle, ILcdEllipsoid aEllipsoid) Constructs a newTLcdLonLatArcBand
with the given parameters.TLcdLonLatArcBand
(TLcdLonLatArcBand aLonLatArcBand) Constructs a newTLcdXYArcBand
that is a deep copy of the givenTLcdLonLatArcBand
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the cache.clone()
Creates and returns a copy of this object.boolean
contains2D
(double aLon, double aLat) Checks whether thisILcdShape
contains the given point in the 2D space.boolean
contains2D
(ILcdPoint aLLP) Checks whether thisALcdShape
contains the given point in the 2D cartesian plane.void
corner2DEditablePointSFCT
(int aCorner, ILcd2DEditablePoint a2DEditablePointSFCT) Computes the position of the specified corner of thisILcdArcBand
.boolean
Returns whether the given object has the same class and the same coordinates and parameters.final double
Returns the angle over which the arc extends (in degrees).Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.getCachedObject
(Object aKey) Looks up and returns the cached Object corresponding to the given key.final ILcdPoint
Returns the center point of thisILcdArcBand
.Returns the focus point of thisILcdShape
.final double
Returns the maximum radius of thisILcdArcBand
.final double
Returns the minimum radius of thisILcdArcBand
.final double
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 theALcdShape.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.removeCachedObject
(Object aKey) Looks up and removes the cached Object corresponding to the given key.void
setArcAngle
(double aArcAngle) Sets the angle over which thisILcd2DEditableArcBand
extends (in degrees).void
setEllipsoid
(ILcdEllipsoid aEllipsoid) Sets the ellipsoid of thisTLcdLonLatArcBand
.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 thisILcd2DEditableArcBand
(in degrees).toString()
void
translate2D
(double x, double y) Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space.Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
contains3D, move2D
Methods inherited from class com.luciad.shape.ALcdShape
contains3D, fromDomainObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2D
Methods inherited from interface com.luciad.shape.ILcdShape
contains3D, contains3D
-
Constructor Details
-
TLcdLonLatArcBand
public TLcdLonLatArcBand()Constructs a newTLcdXYArcBand
with all coordinates and angles set to 0, and with a default ellipsoid. -
TLcdLonLatArcBand
Constructs a newTLcdXYArcBand
that is a deep copy of the givenTLcdLonLatArcBand
.- Parameters:
aLonLatArcBand
- theTLcdLonLatArcBand
to copy.
-
TLcdLonLatArcBand
public TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdLonLatArcBand
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 newTLcdLonLatArcBand
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 newTLcdLonLatArcBand
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
- Returns:
- the ellipsoid of this
TLcdLonLatArcBand
.
-
setEllipsoid
Sets the ellipsoid of thisTLcdLonLatArcBand
.- Parameters:
aEllipsoid
- the new ellipsoid.
-
getCenter
Description copied from interface:ILcdArcBand
Returns the center point of thisILcdArcBand
.- Specified by:
getCenter
in interfaceILcdArcBand
- 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 interfaceILcd2DEditableArcBand
- 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 thisILcdArcBand
.- Specified by:
getMinRadius
in interfaceILcdArcBand
- 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 interfaceILcd2DEditableArcBand
- 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 thisILcdArcBand
.- Specified by:
getMaxRadius
in interfaceILcdArcBand
- 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 interfaceILcdArcBand
- 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 thisILcd2DEditableArcBand
(in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.- Specified by:
setStartAngle
in interfaceILcd2DEditableArcBand
- 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 interfaceILcdArcBand
- 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 thisILcd2DEditableArcBand
extends (in degrees). The angle is positive counter-clockwise.- Specified by:
setArcAngle
in interfaceILcd2DEditableArcBand
- Parameters:
aArcAngle
- the new arc angle.
-
corner2DEditablePointSFCT
Description copied from interface:ILcdArcBand
Computes the position of the specified corner of thisILcdArcBand
.- Specified by:
corner2DEditablePointSFCT
in interfaceILcdArcBand
- Parameters:
aCorner
- the corner:ILcdArcBand.MIN_RADIUS_START_CORNER
,ILcdArcBand.MAX_RADIUS_START_CORNER
,ILcdArcBand.MIN_RADIUS_END_CORNER
, orILcdArcBand.MAX_RADIUS_END_CORNER
.a2DEditablePointSFCT
- anILcd2DEditablePoint
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 interfaceILcd2DEditableArcBand
- 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
, orILcdArcBand.MAX_RADIUS_END_CORNER
.aX
- the new x coordinate of the point.aY
- the new y coordinate of the point.
-
getFocusPoint
Description copied from interface:ILcdShape
Returns the focus point of thisILcdShape
.- Specified by:
getFocusPoint
in interfaceILcdShape
- Returns:
- the focus point of this
ILcdShape
.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
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 ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
contains2D
public boolean contains2D(double aLon, double aLat) Description copied from interface:ILcdShape
Checks whether thisILcdShape
contains the given point in the 2D space. Only the first two dimensions of theILcdShape
are considered.- Specified by:
contains2D
in interfaceILcdShape
- Parameters:
aLon
- the x coordinate of the point.aLat
- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains2D
Description copied from class:ALcdShape
Checks whether thisALcdShape
contains the given point in the 2D cartesian plane.- Specified by:
contains2D
in interfaceILcdShape
- Overrides:
contains2D
in classALcdShape
- 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 thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShape
are considered. The third dimension is left unchanged.- Specified by:
translate2D
in interfaceILcd2DEditableShape
- 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 interfaceILcd2DEditableShape
- Overrides:
move2D
in classALcd2DEditableShape
- Parameters:
x
- the x coordinate of the point.y
- the y coordinate of the point.
-
insertIntoCache
Description copied from interface:ILcdCache
Inserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCache
in interfaceILcdCache
- 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
Description copied from interface:ILcdCache
Looks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObject
in interfaceILcdCache
- 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
Description copied from interface:ILcdCache
Looks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObject
in interfaceILcdCache
- 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 interfaceILcdCache
-
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 interfaceILcdCloneable
- Overrides:
clone
in classALcdShape
- See Also:
-
equals
Returns whether the given object has the same class and the same coordinates and parameters. -
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 theALcdShape.equals(Object)
method. Extensions should refine this implementation, based on their properties. -
toString
-