Package com.luciad.shape.shape2D
Class TLcdXYArcBand
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.shape2D.ALcd2DEditableShape
com.luciad.shape.shape2D.TLcdXYArcBand
- All Implemented Interfaces:
ILcdArcBand
,ILcdBounded
,ILcdShape
,ILcd2DEditableArcBand
,ILcd2DEditableShape
,ILcdCache
,ILcdCloneable
,Serializable
,Cloneable
This class provides an implementation of
ILcd2DEditableArcBand
in
the cartesian space.
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.
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.TLcdXYArcBand
(double aCenterX, double aCenterY, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBand
with the given parameters.TLcdXYArcBand
(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBand
with the given parameters.TLcdXYArcBand
(ILcd2DEditableArcBand a2DEditableArcBand) Constructs a newTLcdXYArcBand
that is a deep copy of the givenILcd2DEditableArcBand
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the cache.clone()
Creates and returns a copy of this object.boolean
contains2D
(double aX, double aY) Checks whether thisILcdShape
contains the given point in the 2D space.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.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
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
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 aX, double aY) 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, move2D
Methods inherited from class com.luciad.shape.ALcdShape
contains2D, 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, move2D
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D, contains3D
-
Constructor Details
-
TLcdXYArcBand
public TLcdXYArcBand()Constructs a newTLcdXYArcBand
with all coordinates and angles set to 0. -
TLcdXYArcBand
Constructs a newTLcdXYArcBand
that is a deep copy of the givenILcd2DEditableArcBand
.- Parameters:
a2DEditableArcBand
- theILcd2DEditableArcBand
to copy.
-
TLcdXYArcBand
public TLcdXYArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBand
with the given parameters.- Parameters:
aCenter
- the center point.aMinRadius
- the minimum radius.aMaxRadius
- the maximum radius.aStartAngle
- the start angle.aArcAngle
- the arc angle.- Throws:
IllegalArgumentException
- if the minimum or maximum radius passed is less than 0.
-
TLcdXYArcBand
public TLcdXYArcBand(double aCenterX, double aCenterY, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBand
with the given parameters.- Parameters:
aCenterX
- the longitude of the center point.aCenterY
- the latitude of the center point.aMinRadius
- the minimum radius.aMaxRadius
- the maximum radius.aStartAngle
- the start angle.aArcAngle
- the arc angle.- Throws:
IllegalArgumentException
- if the minimum or maximum radius passed is less than 0.
-
-
Method Details
-
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 aX, double aY) 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:
aX
- the x coordinate of the point.aY
- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
translate2D
public void translate2D(double aX, double aY) 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:
aX
- the x coordinate of the translation vector.aY
- the y coordinate of the translation vector.
-
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 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
-