public class TLcdLonLatBuffer extends ALcd2DEditableShape implements ILcd2DEditablePointList, ILcdCache
All longitude/latitude coordinates are expressed in degrees. Lengths are expressed in meters.
The buffer's width
is from the axis to the edge of the buffer on both sides, so the buffer is 2 * width wide.
This buffer implementation has the following limitations:
ILcdPolygon
),TLcdLonLatGeoBuffer
and TLcdEllipsoidUtil.computeBufferContour2D
.
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.
ILcdGeoBuffer
,
Serialized FormConstructor and Description |
---|
TLcdLonLatBuffer() |
TLcdLonLatBuffer(ILcd2DEditablePoint[] aAxisPointArray,
double aWidth)
Creates a new
TLcdLonLatBuffer with the specified parameters. |
TLcdLonLatBuffer(ILcd2DEditablePoint[] aAxisPointArray,
double aWidth,
ILcdEllipsoid aEllipsoid)
Creates a new
TLcdLonLatBuffer with the specified parameters. |
TLcdLonLatBuffer(TLcdLonLatPolyline aAxisPolyline,
double aWidth)
Creates a new
TLcdLonLatBuffer with the specified parameters. |
TLcdLonLatBuffer(TLcdLonLatPolyline aAxisPolyline,
double aWidth,
ILcdEllipsoid aEllipsoid)
Creates a new
TLcdLonLatBuffer 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 |
equals(Object aObject)
Returns whether the given object has the same class, coordinates, and
radius.
|
ILcd2DEditablePolyline |
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.
|
ILcd2DEditablePolygon |
getContour() |
ILcdEllipsoid |
getEllipsoid() |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
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 |
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. |
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
ILcd2DEditablePointList . |
void |
setEllipsoid(ILcdEllipsoid aEllipsoid) |
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. |
contains3D, move2D
contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
append2DPoint
getPointSFCT, getX, getY, getZ
contains3D
public TLcdLonLatBuffer(TLcdLonLatPolyline aAxisPolyline, double aWidth, ILcdEllipsoid aEllipsoid)
TLcdLonLatBuffer
with the specified parameters.aAxisPolyline
- the polyline defining the axis of the corridor.aWidth
- the width in meters of the corridor, from the axis to the buffer edgepublic TLcdLonLatBuffer(ILcd2DEditablePoint[] aAxisPointArray, double aWidth, ILcdEllipsoid aEllipsoid)
TLcdLonLatBuffer
with the specified parameters.aAxisPointArray
- the array of points defining the axis of the corridor.aWidth
- the width in meters of the corridor, from the axis to the buffer edgepublic TLcdLonLatBuffer(TLcdLonLatPolyline aAxisPolyline, double aWidth)
TLcdLonLatBuffer
with the specified parameters.aAxisPolyline
- the polyline defining the axis of the corridor.aWidth
- the width in meters of the corridor, from the axis to the buffer edgepublic TLcdLonLatBuffer(ILcd2DEditablePoint[] aAxisPointArray, double aWidth)
TLcdLonLatBuffer
with the specified parameters.aAxisPointArray
- the array of points defining the axis of the corridor.aWidth
- the width in meters of the corridor, from the axis to the buffer edgepublic TLcdLonLatBuffer()
public final 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 axis to the edgepublic ILcdEllipsoid getEllipsoid()
public void setEllipsoid(ILcdEllipsoid aEllipsoid)
public final int getPointCount()
ILcdPointList
ILcdPoint
objects in the list.getPointCount
in interface ILcdPointList
ILcdPoint
objects in the list.public final 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)
ILcd2DEditablePointList
ILcd2DEditablePointList
.removePointAt
in interface ILcd2DEditablePointList
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 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 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 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 ILcd2DEditablePolygon getContour()
public final ILcd2DEditablePolyline 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 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 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 contained ellipsoid and axis polyline are 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.