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
ConstructorDescriptionTLcdLonLatHeightVariableGeoBuffer
(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 TypeMethodDescriptionvoid
Clears the cache.clone()
Creates and returns a clone of this buffer.boolean
contains2D
(double aX, double aY) Checks whether this buffer contains the given point in the 2D space.boolean
contains2D
(ILcdPoint aPoint) Checks whether this buffer contains the given point in the 2D space.boolean
contains3D
(double aX, double aY, double aZ) Checks whether this buffer contains the given point in the 3D space.boolean
contains3D
(ILcdPoint aPoint) Checks whether this buffer contains the given point in the 3D space.boolean
Indicates whether some other object is "equal to" this one.Returns the base polyline of the buffer.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 ellipsoid on which this buffer is defined.Returns the focus point of thisILcdShape
.double
getHeightAbove
(int aIndex) Returns the height of this buffer above the base polyline point with the given index, expressed in meters.double
getHeightBelow
(int aIndex) Returns the height of this buffer below the base polyline point with the given index, expressed in meters.double
getWidth
(int aIndex) Returns the width of this buffer at the given point index, expressed in meters.int
hashCode()
Returns a hash code value for the object.void
insertIntoCache
(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.void
setEllipsoid
(ILcdEllipsoid aEllipsoid) Sets the ellipsoid on which this buffer is defined.void
setHeight
(int aIndex, double aHeight) Convenience operation that sets both the buffer height above and below the given point index, expressed in meters.void
setHeightAbove
(int aIndex, double aHeight) Sets the height of this buffer above the base polyline point with the given index, expressed in meters.void
setHeightBelow
(int aIndex, double aHeight) Sets the height of this buffer below the base polyline point with the given index, expressed in meters.void
setWidth
(int aIndex, double aWidth) Sets the width of this buffer at the given point index, expressed in meters.toString()
Returns aString
representation of this object.void
translate2D
(double aDeltaX, double aDeltaY) Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space.void
translate3D
(double aDeltaX, double aDeltaY, double aDeltaZ) Translates thisILcd3DEditableShape
from its current position over the given translation vector in the 3D space.Methods inherited from class com.luciad.shape.shape3D.ALcd3DEditableShape
move3D, move3D
Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
move2D, move2D
Methods inherited from class com.luciad.shape.ALcdShape
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.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:ILcdVariableGeoBuffer
Returns the base polyline of the buffer.- Specified by:
getBaseShape
in interfaceILcd2DEditableVariableGeoBuffer
- Specified by:
getBaseShape
in interfaceILcd3DEditableVariableGeoBuffer
- Specified by:
getBaseShape
in interfaceILcdVariableGeoBuffer
- Returns:
- the base polyline of the buffer.
-
getWidth
Description copied from interface:ILcdVariableGeoBuffer
Returns 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:
getWidth
in 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:ILcd2DEditableVariableGeoBuffer
Sets 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:
setWidth
in 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:ILcdVariableGeoBuffer
Returns 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:
getHeightBelow
in 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:ILcd3DEditableVariableGeoBuffer
Sets 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:
setHeightBelow
in 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:ILcdVariableGeoBuffer
Returns 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:
getHeightAbove
in 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:ILcd3DEditableVariableGeoBuffer
Sets 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:
setHeightAbove
in 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: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:
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:ILcd3DEditableShape
Translates thisILcd3DEditableShape
from its current position over the given translation vector in the 3D space.- Specified by:
translate3D
in 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: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) Checks whether this buffer contains the given point in the 2D space. Only the first two dimensions of the buffer 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.
-
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:
contains2D
in interfaceILcdShape
- Overrides:
contains2D
in 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:
contains3D
in interfaceILcdShape
- Overrides:
contains3D
in 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:
contains3D
in interfaceILcdShape
- Overrides:
contains3D
in 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 aString
representation of this object. -
clone
Creates and returns a clone of this buffer.- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classALcdShape
- See Also:
-
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
-