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
ConstructorsConstructorDescriptionConstructs a newTLcdXYArcBandwith 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 newTLcdLonLatArcBandwith the given parameters.TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdLonLatArcBandwith the given parameters.TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle, ILcdEllipsoid aEllipsoid) Constructs a newTLcdLonLatArcBandwith the given parameters.TLcdLonLatArcBand(TLcdLonLatArcBand aLonLatArcBand) Constructs a newTLcdXYArcBandthat is a deep copy of the givenTLcdLonLatArcBand. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the cache.clone()Creates and returns a copy of this object.booleancontains2D(double aLon, double aLat) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aLLP) Checks whether thisALcdShapecontains the given point in the 2D cartesian plane.voidcorner2DEditablePointSFCT(int aCorner, ILcd2DEditablePoint a2DEditablePointSFCT) Computes the position of the specified corner of thisILcdArcBand.booleanReturns whether the given object has the same class and the same coordinates and parameters.final doubleReturns the angle over which the arc extends (in degrees).Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.getCachedObject(Object aKey) Looks up and returns the cached Object corresponding to the given key.final ILcdPointReturns the center point of thisILcdArcBand.Returns the focus point of thisILcdShape.final doubleReturns the maximum radius of thisILcdArcBand.final doubleReturns the minimum radius of thisILcdArcBand.final doubleReturns the start angle of the arc (in degrees).inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.voidinsertIntoCache(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.voidmove2D(double x, double y) Translates this shape so that its focus point ends up at the specified position.voidmoveCornerPoint2D(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.voidsetArcAngle(double aArcAngle) Sets the angle over which thisILcd2DEditableArcBandextends (in degrees).voidsetEllipsoid(ILcdEllipsoid aEllipsoid) Sets the ellipsoid of thisTLcdLonLatArcBand.voidsetMaxRadius(double aMaxRadius) Sets the radius of the outer arc of the arc band.voidsetMinRadius(double aMinRadius) Sets the radius of the inner arc of the arc band.voidsetStartAngle(double aStartAngle) Sets the start angle of thisILcd2DEditableArcBand(in degrees).toString()voidtranslate2D(double x, double y) Translates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space.Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
contains3D, move2DMethods inherited from class com.luciad.shape.ALcdShape
contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2DMethods inherited from interface com.luciad.shape.ILcdShape
contains3D, contains3D
-
Constructor Details
-
TLcdLonLatArcBand
public TLcdLonLatArcBand()Constructs a newTLcdXYArcBandwith all coordinates and angles set to 0, and with a default ellipsoid. -
TLcdLonLatArcBand
Constructs a newTLcdXYArcBandthat is a deep copy of the givenTLcdLonLatArcBand.- Parameters:
aLonLatArcBand- theTLcdLonLatArcBandto copy.
-
TLcdLonLatArcBand
public TLcdLonLatArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdLonLatArcBandwith 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 newTLcdLonLatArcBandwith 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 newTLcdLonLatArcBandwith 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:ILcdArcBandReturns the center point of thisILcdArcBand.- Specified by:
getCenterin 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:
setMinRadiusin 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:ILcdArcBandReturns the minimum radius of thisILcdArcBand.- Specified by:
getMinRadiusin 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:
setMaxRadiusin 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:ILcdArcBandReturns the maximum radius of thisILcdArcBand.- Specified by:
getMaxRadiusin interfaceILcdArcBand- Returns:
- the maximum radius of this
ILcdArcBand.
-
getStartAngle
public final double getStartAngle()Description copied from interface:ILcdArcBandReturns the start angle of the arc (in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.- Specified by:
getStartAnglein 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:ILcd2DEditableArcBandSets the start angle of thisILcd2DEditableArcBand(in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.- Specified by:
setStartAnglein interfaceILcd2DEditableArcBand- Parameters:
aStartAngle- the new start angle.
-
getArcAngle
public final double getArcAngle()Description copied from interface:ILcdArcBandReturns the angle over which the arc extends (in degrees). The angle is positive counter-clockwise.- Specified by:
getArcAnglein 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:ILcd2DEditableArcBandSets the angle over which thisILcd2DEditableArcBandextends (in degrees). The angle is positive counter-clockwise.- Specified by:
setArcAnglein interfaceILcd2DEditableArcBand- Parameters:
aArcAngle- the new arc angle.
-
corner2DEditablePointSFCT
Description copied from interface:ILcdArcBandComputes the position of the specified corner of thisILcdArcBand.- Specified by:
corner2DEditablePointSFCTin 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- anILcd2DEditablePointinto which the result is written as a side-effect.
-
moveCornerPoint2D
public void moveCornerPoint2D(int aCorner, double aX, double aY) Description copied from interface:ILcd2DEditableArcBandMoves the specified corner point to a new location. The shape of the arc band changes accordingly.- Specified by:
moveCornerPoint2Din 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:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject 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
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
contains2D
public boolean contains2D(double aLon, double aLat) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered.- Specified by:
contains2Din 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:ALcdShapeChecks whether thisALcdShapecontains the given point in the 2D cartesian plane.- Specified by:
contains2Din interfaceILcdShape- Overrides:
contains2Din 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:ILcd2DEditableShapeTranslates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShapeare considered. The third dimension is left unchanged.- Specified by:
translate2Din 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:ALcd2DEditableShapeTranslates this shape so that its focus point ends up at the specified position.- Specified by:
move2Din interfaceILcd2DEditableShape- Overrides:
move2Din classALcd2DEditableShape- Parameters:
x- the x coordinate of the point.y- the y coordinate of the point.
-
insertIntoCache
Description copied from interface:ILcdCacheInserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCachein 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:ILcdCacheLooks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObjectin 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:ILcdCacheLooks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObjectin 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:ILcdCacheClears the cache.- Specified by:
clearCachein 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:
clonein interfaceILcdCloneable- Overrides:
clonein 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:ALcdShapeThe 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
-