public class TLcdLonLatGeoBuffer extends ALcd2DEditableShape implements ILcd2DEditableGeoBuffer, ILcdCache
TLcdEllipsoidUtil.computeBufferContour2D
can be used.
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.
CAP_BUTT, CAP_ROUND, JOIN_ROUND
Constructor and Description |
---|
TLcdLonLatGeoBuffer()
Creates a new
TLcdLonLatGeoBuffer with width 0
and TLcdEllipsoid.DEFAULT as ellipsoid. |
TLcdLonLatGeoBuffer(ILcdShape aShape,
double aWidth)
Creates a new
TLcdLonLatGeoBuffer with the specified parameters
and TLcdEllipsoid.DEFAULT as ellipsoid. |
TLcdLonLatGeoBuffer(ILcdShape aShape,
double aWidth,
ILcdEllipsoid aEllipsoid)
Creates a new
TLcdLonLatGeoBuffer 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
width.
|
ILcdShape |
getBaseShape()
Returns the base shape of the buffer.
|
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.
|
ILcdEllipsoid |
getEllipsoid()
Returns the ellipsoid on which the buffer is specified.
|
int |
getEndCapStyle()
Returns the end cap style of the buffer.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
int |
getJoinStyle()
Returns the join style for the contour of this buffer, which defines
the representation of the contour at the joins between two line segments
of the base shape.
|
double |
getWidth()
Returns the width of this buffer, expressed in meters and measured
from the line segments of the base shape to the contour.
|
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 |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
void |
invalidateShape()
Indicates that the base shape has been changed,
and that the buffer should be recalculated.
|
void |
move2D(double aX,
double aY)
Translates this shape so that its focus point ends up at the specified
position.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
setBaseShape(ILcdShape aShape)
Sets the base shape of the buffer.
|
void |
setEllipsoid(ILcdEllipsoid aEllipsoid)
Sets the ellipsoid on which the buffer is specified.
|
void |
setEndCapStyle(int aEndCapStyle)
Sets the end cap style of the buffer,
which must be either
ILcdGeoBuffer.CAP_BUTT or
ILcdGeoBuffer.CAP_ROUND . |
void |
setJoinStyle(int aJoinStyle)
Sets the join style of the buffer,
which must be
ILcdGeoBuffer.JOIN_ROUND . |
void |
setWidth(double aWidth)
Sets the width of the buffer, expressed in meters and
measured from the axis to the border.
|
String |
toString() |
void |
translate2D(double aX,
double aY)
Translates this
ILcd2DEditableShape from its current position over the given translation
vector in the 2D space. |
contains3D, move2D
contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
move2D
contains3D, contains3D
public TLcdLonLatGeoBuffer()
TLcdLonLatGeoBuffer
with width 0
and TLcdEllipsoid.DEFAULT
as ellipsoid.public TLcdLonLatGeoBuffer(ILcdShape aShape, double aWidth)
TLcdLonLatGeoBuffer
with the specified parameters
and TLcdEllipsoid.DEFAULT
as ellipsoid.aShape
- the base shape of the buffer, which must be of the type ILcd2DEditableShape
and one of the following:
ILcdPoint
ILcdPolyline
ILcdPolygon
ILcdEditableComplexPolygon
that contains only editable polygons.aWidth
- the width in meters of the corridor, expressed in meters and
measured from the axis to the border.IllegalArgumentException
- if the supplied base shape is not one of the supported shapes, or if the width is negative.public TLcdLonLatGeoBuffer(ILcdShape aShape, double aWidth, ILcdEllipsoid aEllipsoid)
TLcdLonLatGeoBuffer
with the specified parameters.aShape
- the base shape of the buffer, which must be of the type ILcd2DEditableShape
and one of the following:
ILcdPoint
ILcdPolyline
ILcdPolygon
ILcdEditableComplexPolygon
that contains only editable polygons.aWidth
- the width in meters of the corridor, expressed in meters and
measured from the axis to the border.aEllipsoid
- the ellipsoid to be used for the axis.IllegalArgumentException
- if the supplied base shape is not one of the supported shapes, or if the width is negative.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)
ILcd2DEditableShape
ILcd2DEditableShape
from its current position over the given translation
vector in the 2D space. Only the first two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.translate2D
in interface ILcd2DEditableShape
aX
- the x coordinate of the translation vector.aY
- the y coordinate of the translation vector.public final double getWidth()
ILcdGeoBuffer
getWidth
in interface ILcdGeoBuffer
public void setWidth(double aWidth)
ILcd2DEditableGeoBuffer
setWidth
in interface ILcd2DEditableGeoBuffer
aWidth
- the width of the buffer.public ILcdShape getBaseShape()
ILcdGeoBuffer
getBaseShape
in interface ILcdGeoBuffer
public void setBaseShape(ILcdShape aShape)
ILcd2DEditableGeoBuffer
setBaseShape
in interface ILcd2DEditableGeoBuffer
aShape
- the base shape of the buffer.public void invalidateShape()
ILcd2DEditableGeoBuffer
invalidateShape
in interface ILcd2DEditableGeoBuffer
public ILcdEllipsoid getEllipsoid()
public void setEllipsoid(ILcdEllipsoid aEllipsoid)
aEllipsoid
- the ellipsoid on which the buffer is specified.public int getEndCapStyle()
ILcdGeoBuffer.CAP_ROUND
.getEndCapStyle
in interface ILcdGeoBuffer
public void setEndCapStyle(int aEndCapStyle)
ILcd2DEditableGeoBuffer
ILcdGeoBuffer.CAP_BUTT
or
ILcdGeoBuffer.CAP_ROUND
.setEndCapStyle
in interface ILcd2DEditableGeoBuffer
aEndCapStyle
- the end cap style of the buffer.public int getJoinStyle()
ILcdGeoBuffer
ILcdGeoBuffer.JOIN_ROUND
.getJoinStyle
in interface ILcdGeoBuffer
public void setJoinStyle(int aJoinStyle)
ILcd2DEditableGeoBuffer
ILcdGeoBuffer.JOIN_ROUND
.setJoinStyle
in interface ILcd2DEditableGeoBuffer
aJoinStyle
- the join style of the buffer.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()
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.