Package com.luciad.shape.shape3D
Class TLcdLonLatHeightVariableGeoBuffer
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.shape2D.ALcd2DEditableShape
com.luciad.shape.shape3D.ALcd3DEditableShape
com.luciad.shape.shape3D.TLcdLonLatHeightVariableGeoBuffer
- All Implemented Interfaces:
ILcdBounded,ILcdShape,ILcdVariableGeoBuffer,ILcd2DEditableShape,ILcd2DEditableVariableGeoBuffer,ILcd3DEditableShape,ILcd3DEditableVariableGeoBuffer,ILcdCache,ILcdCloneable,Serializable,Cloneable
public class TLcdLonLatHeightVariableGeoBuffer
extends ALcd3DEditableShape
implements ILcd3DEditableVariableGeoBuffer, ILcdCache
This class represents a variable buffer around a polyline on an ellipsoid, in the geodetic space.
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.
This buffer implementation has the following limitations:
- Contours with holes (i.e., caused by axis intersections) cannot
be represented, since the contour is modeled as a single polygon (
ILcdPolygon). - the corners of the contour at the axis points are sharp instead of rounded, which make it less suitable for buffers that have sharp angles between its consecutive axis segments; it has also has as consequence that the distance between the contour and the axis exceeds the given buffer distance in the corners,
- the calculated contour is only an estimate, because it uses a reduced number of contour points; when the start and end point of a segment are further removed from each other, the connected contour lines no longer lie at the given distance from the axis at each intermediate point.
- Since:
- 2012.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdLonLatHeightVariableGeoBuffer(ILcdEllipsoid aEllipsoid) Creates a new buffer without axis points.TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double[] aWidth, double[] aHeightBelow, double[] aHeightAbove, ILcdEllipsoid aEllipsoid) Creates a new buffer using the given axis, and with the given widths and heights (below and above) for every point of the axis.TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double[] aWidth, double[] aHeight, ILcdEllipsoid aEllipsoid) Creates a new buffer using the given axis, and with the given widths and heights for every point of the axis.TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double aWidth, double aHeight, ILcdEllipsoid aEllipsoid) Creates a new buffer using the given axis, and with the same given width and height for every point of the axis.Creates a new variable geo buffer as a copy of the given buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the cache.clone()Creates and returns a clone of this buffer.booleancontains2D(double aX, double aY) Checks whether this buffer contains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether this buffer contains the given point in the 2D space.booleancontains3D(double aX, double aY, double aZ) Checks whether this buffer contains the given point in the 3D space.booleancontains3D(ILcdPoint aPoint) Checks whether this buffer contains the given point in the 3D space.booleanIndicates whether some other object is "equal to" this one.Returns the base polyline of the buffer.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.getCachedObject(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the ellipsoid on which this buffer is defined.Returns the focus point of thisILcdShape.doublegetHeightAbove(int aIndex) Returns the height of this buffer above the base polyline point with the given index, expressed in meters.doublegetHeightBelow(int aIndex) Returns the height of this buffer below the base polyline point with the given index, expressed in meters.doublegetWidth(int aIndex) Returns the width of this buffer at the given point index, expressed in meters.inthashCode()Returns a hash code value for the object.voidinsertIntoCache(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.removeCachedObject(Object aKey) Looks up and removes the cached Object corresponding to the given key.voidsetEllipsoid(ILcdEllipsoid aEllipsoid) Sets the ellipsoid on which this buffer is defined.voidsetHeight(int aIndex, double aHeight) Convenience operation that sets both the buffer height above and below the given point index, expressed in meters.voidsetHeightAbove(int aIndex, double aHeight) Sets the height of this buffer above the base polyline point with the given index, expressed in meters.voidsetHeightBelow(int aIndex, double aHeight) Sets the height of this buffer below the base polyline point with the given index, expressed in meters.voidsetWidth(int aIndex, double aWidth) Sets the width of this buffer at the given point index, expressed in meters.toString()Returns aStringrepresentation of this object.voidtranslate2D(double aDeltaX, double aDeltaY) Translates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space.voidtranslate3D(double aDeltaX, double aDeltaY, double aDeltaZ) Translates thisILcd3DEditableShapefrom its current position over the given translation vector in the 3D space.Methods inherited from class com.luciad.shape.shape3D.ALcd3DEditableShape
move3D, move3DMethods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
move2D, move2DMethods inherited from class com.luciad.shape.ALcdShape
fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2D, move2DMethods inherited from interface com.luciad.shape.shape3D.ILcd3DEditableShape
move3D, move3D
-
Constructor Details
-
TLcdLonLatHeightVariableGeoBuffer
Creates a new buffer without axis points.- Parameters:
aEllipsoid- the ellipsoid on which this buffer is defined.
-
TLcdLonLatHeightVariableGeoBuffer
public TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double aWidth, double aHeight, ILcdEllipsoid aEllipsoid) Creates a new buffer using the given axis, and with the same given width and height for every point of the axis. Note: The axis will be cloned, hencegetBaseShape()does not return the same point list.- Parameters:
aAxis- the axis.aWidth- the (same) width at every point of the axis.aHeight- the (same) height at every point of the axis.aEllipsoid- the ellipsoid on which this buffer is defined.
-
TLcdLonLatHeightVariableGeoBuffer
public TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double[] aWidth, double[] aHeight, ILcdEllipsoid aEllipsoid) Creates a new buffer using the given axis, and with the given widths and heights for every point of the axis. Note: The axis will be cloned, hencegetBaseShape()does not return the same point list.- Parameters:
aAxis- the axis.aWidth- the widths for every point of the axis. This array should have a length ofaAxis.getPointCount().aHeight- the heights for every point of the axis. This array should have a length ofaAxis.getPointCount().aEllipsoid- the ellipsoid on which this buffer is defined.
-
TLcdLonLatHeightVariableGeoBuffer
public TLcdLonLatHeightVariableGeoBuffer(ILcdPointList aAxis, double[] aWidth, double[] aHeightBelow, double[] aHeightAbove, ILcdEllipsoid aEllipsoid) Creates a new buffer using the given axis, and with the given widths and heights (below and above) for every point of the axis. Note: The axis will be cloned, hencegetBaseShape()does not return the same point list.- Parameters:
aAxis- the axis.aWidth- the widths for every point of the axis. This array should have a length ofaAxis.getPointCount().aHeightBelow- the height below for every point of the axis. This array should have a length ofaAxis.getPointCount().aHeightAbove- the height above for every point of the axis. This array should have a length ofaAxis.getPointCount().aEllipsoid- the ellipsoid on which this buffer is defined.
-
TLcdLonLatHeightVariableGeoBuffer
Creates a new variable geo buffer as a copy of the given buffer.- Parameters:
aBuffer- a variable geo buffer.
-
-
Method Details
-
setEllipsoid
Sets the ellipsoid on which this buffer is defined.- Parameters:
aEllipsoid- the ellipsoid on which this buffer is defined.
-
getEllipsoid
Returns the ellipsoid on which this buffer is defined.- Returns:
- the ellipsoid on which this buffer is defined.
-
getBaseShape
Description copied from interface:ILcdVariableGeoBufferReturns the base polyline of the buffer.- Specified by:
getBaseShapein interfaceILcd2DEditableVariableGeoBuffer- Specified by:
getBaseShapein interfaceILcd3DEditableVariableGeoBuffer- Specified by:
getBaseShapein interfaceILcdVariableGeoBuffer- Returns:
- the base polyline of the buffer.
-
getWidth
Description copied from interface:ILcdVariableGeoBufferReturns the width of this buffer at the given point index, expressed in meters. This width is defined as the distance from the respective point in the base polyline, in a direction perpendicular to the segments of the base polyline containing the respective point. This is also illustrated in the class doc of this interface.- Specified by:
getWidthin interfaceILcdVariableGeoBuffer- Parameters:
aIndex- the base shape point index to return the width for- Returns:
- a positive integer (>= 0) representing the width of the buffer at the given point
- Throws:
IndexOutOfBoundsException- if the base polyline does not have a point for the given index
-
setWidth
Description copied from interface:ILcd2DEditableVariableGeoBufferSets the width of this buffer at the given point index, expressed in meters. This width is defined as the distance from the respective point in the base polyline, in a direction perpendicular to the segments of the base polyline containing the respective point.- Specified by:
setWidthin interfaceILcd2DEditableVariableGeoBuffer- Parameters:
aIndex- the base shape point index to set the width foraWidth- a positive integer (width >= 0) representing the width of the buffer at the given point- Throws:
IndexOutOfBoundsException- if the base polyline does not have a point for the given index- See Also:
-
getHeightBelow
Description copied from interface:ILcdVariableGeoBufferReturns the height of this buffer below the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the lower side of the contour at that point.- Specified by:
getHeightBelowin interfaceILcdVariableGeoBuffer- Parameters:
aIndex- the base shape point index to return the height for- Returns:
- a positive integer (>= 0) representing the distance between the respective point and the lower side of the contour at that point
- Throws:
IndexOutOfBoundsException- if the base polyline does not have a point for the given index
-
setHeightBelow
Description copied from interface:ILcd3DEditableVariableGeoBufferSets the height of this buffer below the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the lower side of the contour at that point.- Specified by:
setHeightBelowin interfaceILcd3DEditableVariableGeoBuffer- Parameters:
aIndex- the base shape point index to set the height foraHeight- a positive integer (>= 0) representing the distance between the respective point and the lower side of the contour at that point- Throws:
IndexOutOfBoundsException- if the base polyline does not have a point for the given index
-
getHeightAbove
Description copied from interface:ILcdVariableGeoBufferReturns the height of this buffer above the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the upper side of the contour at that point.- Specified by:
getHeightAbovein interfaceILcdVariableGeoBuffer- Parameters:
aIndex- the base shape point index to return the height for- Returns:
- a positive integer (>= 0) representing the distance between the respective point and the upper side of the contour at that point
- Throws:
IndexOutOfBoundsException- if the base polyline does not have a point for the given index
-
setHeightAbove
Description copied from interface:ILcd3DEditableVariableGeoBufferSets the height of this buffer above the base polyline point with the given index, expressed in meters. This height is defined as the distance between the respective point and the upper side of the contour at that point.- Specified by:
setHeightAbovein interfaceILcd3DEditableVariableGeoBuffer- Parameters:
aIndex- the base shape point index to set the height foraHeight- a positive integer (>= 0) representing the distance between the respective point and the upper side of the contour at that point- Throws:
IndexOutOfBoundsException- if the base polyline does not have a point for the given index
-
setHeight
Convenience operation that sets both the buffer height above and below the given point index, expressed in meters.- Parameters:
aIndex- the base shape point index to set the height foraHeight- a positive integer (>= 0) representing the height of the buffer above and below the given point- Throws:
IndexOutOfBoundsException- if the base polyline does not have a point for the given index- See Also:
-
translate2D
public void translate2D(double aDeltaX, double aDeltaY) 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:
aDeltaX- the x coordinate of the translation vector.aDeltaY- the y coordinate of the translation vector.
-
translate3D
public void translate3D(double aDeltaX, double aDeltaY, double aDeltaZ) Description copied from interface:ILcd3DEditableShapeTranslates thisILcd3DEditableShapefrom its current position over the given translation vector in the 3D space.- Specified by:
translate3Din interfaceILcd3DEditableShape- Parameters:
aDeltaX- the x coordinate of the translation vector.aDeltaY- the y coordinate of the translation vector.aDeltaZ- the z coordinate of the translation vector.
-
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 aX, double aY) Checks whether this buffer contains the given point in the 2D space. Only the first two dimensions of the buffer are considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains2D
Checks whether this buffer contains the given point in the 2D space. Only the first two dimensions of the buffer are considered.- Specified by:
contains2Din interfaceILcdShape- Overrides:
contains2Din classALcdShape- Parameters:
aPoint- the point to test- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
Checks whether this buffer contains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Overrides:
contains3Din classALcdShape- Parameters:
aPoint- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Checks whether this buffer contains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Overrides:
contains3Din classALcd2DEditableShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.- Returns:
- the boolean result of the containment test.
-
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code value for the object. -
toString
Returns aStringrepresentation of this object. -
clone
Creates and returns a clone of this buffer.- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classALcdShape- See Also:
-
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
-