public class TLcdLonLatHeightBuffer extends ALcd3DEditableShape implements ILcd3DEditablePointList, ILcdCache, Cloneable
width
is from the axis to the edge of the buffer on both sides, so the buffer is 2 * width wide.height
is from the bottom to the top of the buffer, half of the height above the axis, half beneath.All longitude/latitude coordinates are expressed in degrees. Lengths are expressed in meters.
For efficiency reasons the current implementation works
with a spherical approximation where the radius of the sphere
is the major axis of the ellipsoid. If no ellipsoid is specified
at the construction of the TLcdLonLatHeightBuffer
object
the default ellipsoid is used.
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.
For a more flexible 3D buffer, see TLcdLonLatHeightVariableGeoBuffer
.
ILcdVariableGeoBuffer
,
Serialized FormConstructor and Description |
---|
TLcdLonLatHeightBuffer()
Creates a new
TLcdLonLatHeightBuffer , without points, with a default width of 300km and height of 100m |
TLcdLonLatHeightBuffer(ILcd3DEditablePoint[] aAxisPointArray,
double aWidth,
double aHeight)
Creates a new
TLcdLonLatHeightBuffer with the specified parameters. |
TLcdLonLatHeightBuffer(ILcd3DEditablePoint[] aAxisPointArray,
double aWidth,
double aHeight,
ILcdEllipsoid aEllipsoid)
Creates a new
TLcdLonLatHeightBuffer with the specified parameters. |
TLcdLonLatHeightBuffer(ILcd3DEditablePointList aAxisPointList,
double aWidth,
double aHeight)
Creates a new
TLcdLonLatHeightBuffer with the specified parameters. |
TLcdLonLatHeightBuffer(ILcd3DEditablePointList aAxisPointList,
double aWidth,
double aHeight,
ILcdEllipsoid aEllipsoid)
Creates a new
TLcdLonLatHeightBuffer with the specified parameters. |
TLcdLonLatHeightBuffer(TLcdLonLatHeightBuffer aLonLatHeightBuffer)
Copy constructor.
|
TLcdLonLatHeightBuffer(TLcdLonLatHeightPolyline aAxisPolyline,
double aWidth,
double aHeight)
Creates a new
TLcdLonLatHeightBuffer with the specified parameters. |
TLcdLonLatHeightBuffer(TLcdLonLatHeightPolyline aAxisPolyline,
double aWidth,
double aHeight,
ILcdEllipsoid aEllipsoid)
Creates a new
TLcdLonLatHeightBuffer with the specified parameters. |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
contains2D(double x,
double y)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aPoint)
Checks whether this
ALcdShape contains the given point in the
2D cartesian plane. |
boolean |
contains3D(double aX,
double aY,
double aZ)
Provides an approximate default implementation of the 3D containment test
based on the 2D containment test.
|
boolean |
contains3D(ILcdPoint aPoint)
Checks whether this
ALcdShape contains the given point in the
3D space. |
boolean |
equals(Object aObject)
Returns whether the given object has the same class and the same
coordinates and parameters.
|
ILcdPolyline |
getAxisPolyline() |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ILcd3DEditablePointList |
getContour() |
ILcdEllipsoid |
getEllipsoid() |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
double |
getHeight()
Returns the height of the buffer.
|
ILcdPoint |
getPoint(int aIndex)
Returns the
ILcdPoint at a given index. |
int |
getPointCount()
Returns the number of
ILcdPoint objects in the list. |
double |
getWidth()
Returns the distance from the axis to the buffer edge.
|
int |
hashCode()
The hash code of this shape is the hash code of its class, in order to
be consistent with the
ALcdShape.equals(Object) method. |
void |
insert2DPoint(int aIndex,
double aX,
double aY)
Inserts a point at the given index into this
ILcd2DEditablePointList . |
void |
insert3DPoint(int aIndex,
double aX,
double aY,
double aZ)
Inserts a point at the given index into this
ILcd3DEditablePointList . |
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
void |
move2D(double aX,
double aY)
Translates this shape so that its focus point ends up at the specified
position.
|
void |
move2DPoint(int aIndex,
double aX,
double aY)
Moves the specified point of this
ILcd2DEditablePointList to the given point in the 2D space. |
void |
move3DPoint(int aIndex,
double aX,
double aY,
double aZ)
Moves the specified point of this
ILcd3DEditablePointList to the given point in the 3D space. |
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
removePointAt(int aIndex)
Removes the point at the given index from this
ILcd3DEditablePointList . |
void |
setHeight(double aHeight)
Set the height of this buffer.
|
void |
setWidth(double aWidth)
Set the distance is from the axis to the buffer edge.
|
String |
toString() |
void |
translate2D(double aX,
double aY)
Translates all the points of this
ILcd2DEditablePointList from their current positions
over the given translation vector in the 2D space. |
void |
translate2DPoint(int aIndex,
double aX,
double aY)
Translates the specified point of this
ILcd2DEditablePointList from its current position
over the given translation vector in the 2D space. |
void |
translate3D(double aX,
double aY,
double aZ)
Translates all the points of this
ILcd3DEditablePointList from their current positions
over the given translation vector in the 3D space. |
void |
translate3DPoint(int aIndex,
double aX,
double aY,
double aZ)
Translates the specified point of this
ILcd3DEditablePointList from its current position
over the given translation vector in the 3D space. |
move3D, move3D
move2D
fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
append2DPoint
getPointSFCT, getX, getY, getZ
move2D
public TLcdLonLatHeightBuffer(TLcdLonLatHeightPolyline aAxisPolyline, double aWidth, double aHeight, ILcdEllipsoid aEllipsoid)
TLcdLonLatHeightBuffer
with the specified parameters.aAxisPolyline
- the polyline defining the axis of the corridor.aWidth
- the width in meters of the corridor (>= 0), from the axis to the edgeaHeight
- the full height in meters of the corridor (>= 0), around the axisaEllipsoid
- the ellipsoid usedpublic TLcdLonLatHeightBuffer(ILcd3DEditablePoint[] aAxisPointArray, double aWidth, double aHeight, ILcdEllipsoid aEllipsoid)
TLcdLonLatHeightBuffer
with the specified parameters.aAxisPointArray
- the points defining the axis of the corridor.aWidth
- the width in meters of the corridor (>= 0), from the axis to the edgeaHeight
- the full height in meters of the corridor (>= 0), around the axisaEllipsoid
- the ellipsoid usedpublic TLcdLonLatHeightBuffer(ILcd3DEditablePointList aAxisPointList, double aWidth, double aHeight, ILcdEllipsoid aEllipsoid)
TLcdLonLatHeightBuffer
with the specified parameters.aAxisPointList
- the points defining the axis of the corridor.aWidth
- the width in meters of the corridor (>= 0), from the axis to the edgeaHeight
- the full height in meters of the corridor (>= 0), around the axisaEllipsoid
- the ellipsoid usedpublic TLcdLonLatHeightBuffer(TLcdLonLatHeightPolyline aAxisPolyline, double aWidth, double aHeight)
TLcdLonLatHeightBuffer
with the specified parameters.aAxisPolyline
- the polyline defining the axis of the corridor.aWidth
- the width in meters of the corridor (>= 0), from the axis to the edgeaHeight
- the full height in meters of the corridor (>= 0), around the axispublic TLcdLonLatHeightBuffer(ILcd3DEditablePoint[] aAxisPointArray, double aWidth, double aHeight)
TLcdLonLatHeightBuffer
with the specified parameters.aAxisPointArray
- the points defining the axis of the corridor.aWidth
- the width in meters of the corridor (>= 0), from the axis to the edgeaHeight
- the full height in meters of the corridor (>= 0), around the axispublic TLcdLonLatHeightBuffer(ILcd3DEditablePointList aAxisPointList, double aWidth, double aHeight)
TLcdLonLatHeightBuffer
with the specified parameters.aAxisPointList
- the points defining the axis of the corridor.aWidth
- the width in meters of the corridor (>= 0), from the axis to the edgeaHeight
- the full height in meters of the corridor (>= 0), around the axispublic TLcdLonLatHeightBuffer()
TLcdLonLatHeightBuffer
, without points, with a default width of 300km and height of 100mpublic TLcdLonLatHeightBuffer(TLcdLonLatHeightBuffer aLonLatHeightBuffer)
aLonLatHeightBuffer
- The TLcdLonLatHeightBuffer
to copy.public ILcdEllipsoid getEllipsoid()
public double getWidth()
The buffer is 2 * width wide in total.
public void setWidth(double aWidth)
aWidth
- the width in meters of the corridor (>= 0), from the axis to the edgepublic double getHeight()
The height is from bottom to top of the buffer, half of the height beneath and half of the height above the axis.
public void setHeight(double aHeight)
The height is from bottom to top of the buffer, half of the height beneath and half of the height above the axis.
aHeight
- the full height in meters of the corridor (>= 0), around the axispublic int getPointCount()
ILcdPointList
ILcdPoint
objects in the list.getPointCount
in interface ILcdPointList
ILcdPoint
objects in the list.public ILcdPoint getPoint(int aIndex)
ILcdPointList
ILcdPoint
at a given index.getPoint
in interface ILcdPointList
aIndex
- a valid index in the list of ILcdPoint
objects.ILcdPoint
at the given index.public void removePointAt(int aIndex)
ILcd3DEditablePointList
ILcd3DEditablePointList
.removePointAt
in interface ILcd2DEditablePointList
removePointAt
in interface ILcd3DEditablePointList
aIndex
- a valid index in the list of ILcdPoint
objects.public void move2D(double aX, double aY)
ALcd2DEditableShape
move2D
in interface ILcd2DEditableShape
move2D
in class ALcd2DEditableShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public void translate2D(double aX, double aY)
ILcd2DEditablePointList
ILcd2DEditablePointList
from their current positions
over the given translation vector in the 2D space. Only the first two
dimensions of the points are considered. The third dimension is left unchanged.translate2D
in interface ILcd2DEditablePointList
translate2D
in interface ILcd2DEditableShape
aX
- the x coordinate of the translation vector.aY
- the y coordinate of the translation vector.public void translate3D(double aX, double aY, double aZ)
ILcd3DEditablePointList
ILcd3DEditablePointList
from their current positions
over the given translation vector in the 3D space.translate3D
in interface ILcd3DEditablePointList
translate3D
in interface ILcd3DEditableShape
aX
- the x coordinate of the translation vector.aY
- the y coordinate of the translation vector.aZ
- the z coordinate of the translation vector.public void move2DPoint(int aIndex, double aX, double aY)
ILcd2DEditablePointList
ILcd2DEditablePointList
to the given point in the 2D space. Only the first
two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.move2DPoint
in interface ILcd2DEditablePointList
aIndex
- a valid index in the list of points.aX
- the x coordinate of the point.aY
- the y coordinate of the point.public void move3DPoint(int aIndex, double aX, double aY, double aZ)
ILcd3DEditablePointList
ILcd3DEditablePointList
to the given point in the 3D space.move3DPoint
in interface ILcd3DEditablePointList
aIndex
- a valid index in the list of points.aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public void translate2DPoint(int aIndex, double aX, double aY)
ILcd2DEditablePointList
ILcd2DEditablePointList
from its current position
over the given translation vector in the 2D space. Only the first two
dimensions of the points are considered. The third dimension is left unchanged.translate2DPoint
in interface ILcd2DEditablePointList
aX
- the x coordinate of the translation vector.aY
- the y coordinate of the translation vector.public void translate3DPoint(int aIndex, double aX, double aY, double aZ)
ILcd3DEditablePointList
ILcd3DEditablePointList
from its current position
over the given translation vector in the 3D space.translate3DPoint
in interface ILcd3DEditablePointList
aIndex
- a valid new index in the list of points.aX
- the x coordinate of the translation vector.aY
- the y coordinate of the translation vector.aZ
- the z coordinate of the translation vector.public void insert2DPoint(int aIndex, double aX, double aY)
ILcd2DEditablePointList
ILcd2DEditablePointList
.insert2DPoint
in interface ILcd2DEditablePointList
aIndex
- a valid new index in the list of points.aX
- the x coordinate of the new point.aY
- the y coordinate of the new point.public void insert3DPoint(int aIndex, double aX, double aY, double aZ)
ILcd3DEditablePointList
ILcd3DEditablePointList
.insert3DPoint
in interface ILcd3DEditablePointList
aIndex
- a valid new index in the list of points.aX
- the x coordinate of the new point.aY
- the y coordinate of the new point.aZ
- the z coordinate of the new point.public final ILcdPolyline getAxisPolyline()
public boolean contains2D(ILcdPoint aPoint)
ALcdShape
ALcdShape
contains the given point in the
2D cartesian plane.contains2D
in interface ILcdShape
contains2D
in class ALcdShape
aPoint
- the point to test.ILcdShape.contains2D(double, double)
public boolean contains2D(double x, double y)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
x
- the x coordinate of the point.y
- the y coordinate of the point.public boolean contains3D(ILcdPoint aPoint)
ALcdShape
ALcdShape
contains the given point in the
3D space.contains3D
in interface ILcdShape
contains3D
in class ALcdShape
aPoint
- the point to test.ILcdShape.contains3D(double, double, double)
public boolean contains3D(double aX, double aY, double aZ)
ALcd2DEditableShape
contains3D
in interface ILcdShape
contains3D
in class ALcd2DEditableShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.true
if the bounds of this shape contain the point in the 3D space
and the shape itself contains the point in the 2D space, false
otherwise.public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
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
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public ILcd3DEditablePointList getContour()
public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
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.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public Object clone()
The axis polyline is cloned.
The contained ellipsoid is copied without being cloned.
The cache is not copied or cloned at all.
clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
public boolean equals(Object aObject)
public int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.