public class TLcdS57Edge extends Object implements ILcd2DEditablePolyline, ILcdCache, ILcdS57DepthAreaEdge, ILcdPointList,ILcdPointList2, ILcdCurve
INTERPOLATION_CIRCLE_BY_3POINTS, INTERPOLATION_CIRCLE_BY_CENTERPOINT, INTERPOLATION_CIRCULARARC_BY_3POINTS, INTERPOLATION_CIRCULARARC_BY_BULGE, INTERPOLATION_CIRCULARARC_BY_CENTERPOINT, INTERPOLATION_ELLIPTICAL, INTERPOLATION_GEODESIC, INTERPOLATION_LINEAR, INTERPOLATION_MIXED, INTERPOLATION_RHUMB
Constructor and Description |
---|
TLcdS57Edge(int aEdgeId)
Constructs an S-57 edge with the given ID.
|
TLcdS57Edge(int aEdgeId,
ILcdPointList aPointList)
Constructs an S-57 edge with the given ID and point list.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
Object |
clone()
Makes
Object.clone() public. |
void |
computePointSFCT(double aParam,
ILcd3DEditablePoint aPointSFCT)
Computes a point of the curve, defined by the given parameter.
|
boolean |
contains2D(double aX,
double aY)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 2D space. |
boolean |
contains3D(double aX,
double aY,
double aZ)
Checks whether this
ILcdShape contains the given point in
the 3D space. |
boolean |
contains3D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 3D space. |
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.
|
ILcdPoint |
getEndPoint()
Retrieves the end point of the curve.
|
double |
getEndTangent2D()
Returns the angle of the curve's tangent at the end point,
in degrees counterclockwise from the direction at 3 o'clock.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
int |
getId()
Returns the ID of this edge, unique among all edges within the model.
|
String |
getInterpolation()
Returns the interpolation method used by this curve.
|
double |
getLength2D(double aParam1,
double aParam2)
Returns the length between two points of the curve,
defined by the given parameters.
|
int |
getLineSegmentIntersectionCount(ILcdPoint aP1,
ILcdPoint aP2)
Returns the number of intersections between this curve and a line segment
defined by the two specified points.
|
float |
getMaximumAdjacentDepth()
Returns the maximum depth (DRVAL1) of the DEPARE/DRGARE object(s) this edge is part of.
|
float |
getMinimumAdjacentDepth()
Returns the minimum depth (DRVAL1) of the DEPARE/DRGARE object(s) this edge is part of.
|
ILcdPoint |
getPoint(int aIndex)
Returns the
ILcdPoint at a given index. |
int |
getPointCount()
Returns the number of
ILcdPoint objects in the list. |
void |
getPointSFCT(int aIndex,
ILcd3DEditablePoint aPointSFCT)
Stores the coordinates of the point at
aIndex in the given point. |
ILcdPoint |
getStartPoint()
Retrieves the start point of the curve.
|
double |
getStartTangent2D()
Returns the angle of the curve's tangent at the start point,
in degrees counterclockwise from the direction at 3 o'clock.
|
double |
getTangent2D(double aParam)
Returns the angle of the curve's tangent in the point defined
by the given parameter, in degrees counterclockwise from the
direction at 3 o'clock.
|
float |
getValueOfDepthContour()
Returns the value of the depth contour (VALDCO), if the edge is shared by a DEPCNT object,
Float.NaN otherwise. |
double |
getX(int aIndex)
Returns the X coordinate of the point at
aIndex . |
double |
getY(int aIndex)
Returns the Y coordinate of the point at
aIndex . |
double |
getZ(int aIndex)
Returns the Z coordinate of the point at
aIndex . |
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.
|
boolean |
isSharedByGroup1LndareOrUnsareObject()
Sets whether this edge is shared by another group 1 object with object class LNDARE or
UNSARE.
|
boolean |
isSharedBySlcons()
Returns whether this edge is shared by an SLCONS object.
|
boolean |
isSharedByUnsafeArea()
Returns true if this edge is shared by another group 1 object with object class LNDARE or
UNSARE but not by a SLCONS object (see the DEPARE02 procedure in the
Presentation Library documentation for more information).
|
void |
move2D(double aX,
double aY)
Moves this
ILcd2DEditableShape to the given point in the 2D space. |
void |
move2D(ILcdPoint aPoint)
Moves this
ILcd2DEditableShape to the given point in the 2D space. |
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 |
setMaximumAdjacentDepth(float aMaximumAdjacentDepth)
Sets the maximum depth (DRVAL1) of the DEPARE/DRGARE object(s) this edge is part of.
|
void |
setMinimumAdjacentDepth(float aMinimumAdjacentDepth)
Sets the minimum depth (DRVAL1) of the DEPARE/DRGARE object(s) this edge is part of.
|
void |
setSharedByGroup1LndareOrUnsareObject(boolean aSharedByGroup1LndareOrUnsareObject)
Sets whether this edge is shared by another group 1 object with object class LNDARE or
UNSARE.
|
void |
setSharedBySlcons(boolean aSharedBySlcons)
Sets whether this edge is shared by an SLCONS object.
|
void |
setValueOfDepthContour(float aValueOfDepthContour)
Sets the value of the depth contour (VALDCO), if the edge is shared by a DEPCNT object,
Float.NaN otherwise. |
String |
toString() |
void |
translate2D(double aDeltaX,
double aDeltaY)
Translates this
ILcd2DEditableShape from its current position over the given translation
vector in the 2D space. |
void |
translate2DPoint(int aIndex,
double aDeltaX,
double aDeltaY)
Translates the specified point of this
ILcd2DEditablePointList from its current position
over the given translation vector in the 2D space. |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
append2DPoint
public TLcdS57Edge(int aEdgeId)
aEdgeId
- an ID for the edge, unique among all edges within the model.public TLcdS57Edge(int aEdgeId, ILcdPointList aPointList)
aEdgeId
- an ID for this edge, unique within the model.aPointList
- a point list defining the coordinates of this edge.
The point list should implement ILcd2DEditablePointList
.IllegalArgumentException
- if aPointList
does not implement ILcd2DEditablePointList
.public int getId()
public void setValueOfDepthContour(float aValueOfDepthContour)
Float.NaN
otherwise.aValueOfDepthContour
- the value of the depth contour, if the edge is shared by a DEPCNT
object,
Float.NaN
otherwise.public void setMinimumAdjacentDepth(float aMinimumAdjacentDepth)
aMinimumAdjacentDepth
- the minimum depth (DRVAL1) of the DEPARE/DRGARE object(s) this
edge is part of.public void setMaximumAdjacentDepth(float aMaximumAdjacentDepth)
aMaximumAdjacentDepth
- the maximum depth (DRVAL1) of the DEPARE/DRGARE object(s) this
edge is part of.public void setSharedBySlcons(boolean aSharedBySlcons)
aSharedBySlcons
- true
if this edge is shared by SLCONS object, false
otherwise.public void setSharedByGroup1LndareOrUnsareObject(boolean aSharedByGroup1LndareOrUnsareObject)
aSharedByGroup1LndareOrUnsareObject
- true
if this edge is shared by another group 1 object with object class LNDARE
or UNSARE, false
otherwise.public boolean isSharedBySlcons()
true
if this edge is shared by SLCONS object, false
otherwise.public boolean isSharedByGroup1LndareOrUnsareObject()
true
if this edge is shared by another group 1 object with object class LNDARE
or UNSARE, false
otherwise.public float getValueOfDepthContour()
ILcdS57DepthAreaEdge
Float.NaN
otherwise.getValueOfDepthContour
in interface ILcdS57DepthAreaEdge
Float.NaN
otherwise.public float getMinimumAdjacentDepth()
ILcdS57DepthAreaEdge
getMinimumAdjacentDepth
in interface ILcdS57DepthAreaEdge
public float getMaximumAdjacentDepth()
ILcdS57DepthAreaEdge
getMaximumAdjacentDepth
in interface ILcdS57DepthAreaEdge
public boolean isSharedByUnsafeArea()
ILcdS57DepthAreaEdge
isSharedByUnsafeArea
in interface ILcdS57DepthAreaEdge
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 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 void computePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT)
ILcdCurve
ILcdCurve.getStartPoint()
.ILcdCurve.getEndPoint()
.computePointSFCT
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]aPointSFCT
- the point to store the computed curve point inpublic ILcdPoint getEndPoint()
ILcdCurve
This is equivalent to computePointSFCT(1)
.
getEndPoint
in interface ILcdCurve
public double getEndTangent2D()
ILcdCurve
The tangent orientation is from the end point, away from the curve before it.
This is the same as getTangent2D(1)
.
getEndTangent2D
in interface ILcdCurve
public String getInterpolation()
ILcdCurve
A set of predefined constants are defined in this interface,
which are used by the default ILcdCurve
implementations
provided by LuciadLightspeed.
Custom implementations can define their own constants, and use them to interpret the interpolation of the curve.
getInterpolation
in interface ILcdCurve
public double getLength2D(double aParam1, double aParam2)
ILcdCurve
aParam1 == aParam2
, the length is 0.aParam1 == 0 and aParam2 == 1
, the length is the whole length of the curve.aParam1 > aParam2
, the length is (aParam1 to 1
) + (0 to aParam2
).getLength2D
in interface ILcdCurve
aParam1
- a value of the closed interval [0,1]aParam2
- a value of the closed interval [0,1]public int getLineSegmentIntersectionCount(ILcdPoint aP1, ILcdPoint aP2)
ILcdCurve
This information can be used to perform containment calculations, if this curve is closed or if this curve is part of a composite closed curve. By determining the number of intersections between this curve and a line segment starting from a given point in a fixed direction, one can determine whether a point is located within the closed curve by using the even-odd rule.
getLineSegmentIntersectionCount
in interface ILcdCurve
aP1
- the first point of the line segmentaP2
- the second point of the line segmentpublic ILcdPoint getStartPoint()
ILcdCurve
This is equivalent to computePointSFCT(0)
.
getStartPoint
in interface ILcdCurve
public double getStartTangent2D()
ILcdCurve
The tangent orientation is from the start point towards the rest of the shape.
This is the same as getTangent2D(0)
.
getStartTangent2D
in interface ILcdCurve
public double getTangent2D(double aParam)
ILcdCurve
The tangent orientation is from the point at parameter aParam
towards the rest of the shape.
ILcdCurve.getStartTangent2D()
.ILcdCurve.getEndTangent2D()
.getTangent2D
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]public void move2D(ILcdPoint aPoint)
ILcd2DEditableShape
ILcd2DEditableShape
to the given point in the 2D space. The focus point
is used as the handle by which the shape is moved. Only the first
two dimensions of the ILcdShape
and the ILcdPoint
are considered.
The third dimension is left unchanged.move2D
in interface ILcd2DEditableShape
aPoint
- the ILcdPoint
to move to.ILcd2DEditableShape.move2D(double, double)
public void move2D(double aX, double aY)
ILcd2DEditableShape
ILcd2DEditableShape
to the given point in the 2D space. The focus point
is used as the handle by which the shape is moved. Only the first
two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.move2D
in interface ILcd2DEditableShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public void translate2D(double aDeltaX, double aDeltaY)
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 ILcd2DEditablePointList
translate2D
in interface ILcd2DEditableShape
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- 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 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 removePointAt(int aIndex)
ILcd2DEditablePointList
ILcd2DEditablePointList
.removePointAt
in interface ILcd2DEditablePointList
aIndex
- a valid index in the list of ILcdPoint
objects.public void translate2DPoint(int aIndex, double aDeltaX, double aDeltaY)
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
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.public boolean contains2D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 2D space.
Only the first two dimensions of the ILcdShape
and the ILcdPoint
are considered.contains2D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains2D(double, double)
public boolean contains2D(double aX, double aY)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public boolean contains3D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 3D space.contains3D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains3D(double, double, double)
public boolean contains3D(double aX, double aY, double aZ)
ILcdShape
ILcdShape
contains the given point in
the 3D space.contains3D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z 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 getPointSFCT(int aIndex, ILcd3DEditablePoint aPointSFCT)
ILcdPointList
aIndex
in the given point.getPointSFCT
in interface ILcdPointList
aIndex
- the index of the point for which to retrieve the coordinates.aPointSFCT
- the side-effect parameter in which to store the coordinates of the requested
point.public double getX(int aIndex)
ILcdPointList
aIndex
.getX
in interface ILcdPointList
aIndex
- the index of the point for which to return the X coordinate.aIndex
.public double getY(int aIndex)
ILcdPointList
aIndex
.getY
in interface ILcdPointList
aIndex
- the index of the point for which to return the Y coordinate.aIndex
.public double getZ(int aIndex)
ILcdPointList
aIndex
.getZ
in interface ILcdPointList
aIndex
- the index of the point for which to return the Z coordinate.aIndex
.public ILcdPoint getPoint(int aIndex) throws IndexOutOfBoundsException
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.IndexOutOfBoundsException
- if the given index is out of bounds.public int getPointCount()
ILcdPointList
ILcdPoint
objects in the list.getPointCount
in interface ILcdPointList
ILcdPoint
objects in the list.public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()