public class TLcdGML31LinearRing extends TLcdGML31AbstractRing implements ILcd3DEditablePolygon, ILcdRing, ILcdCache, ILcdInvalidateable
Model class for the GML Linear Ring Type.
A LinearRing is defined by four or more coordinate tuples, with linear interpolation between them; the first and last coordinates shall be coincident. The number of direct positions in the list shall be at least four.
The coordinates are stored in the POS_GROUP_PROPERTY
.
An important difference between an ILcdPolygon
and a GML3 Linear Ring is that in
in GML3 the first and last point of a ring must be the same. As such, the implementation of
ILcdPolygon
will disregard the last point in the ring's points (typically a
direct position list). Applications that set the ring's POS_GROUP_PROPERTY
should follow
GML conventions and ensure that the first and last point in the pos group is identical.
Modifier and Type | Field and Description |
---|---|
static TLcdDataProperty |
GID_PROPERTY
Property that maps on the
gid attribute. |
static TLcdDataProperty |
POS_GROUP_PROPERTY
Data property that maps to the choice between the
pos and pointProperty and pointRep and posList and coordinates and coord elements. |
SRS_PROPERTY
DESCRIPTION_PROPERTY, ID_PROPERTY, META_DATA_PROPERTY_PROPERTY, NAME_PROPERTY
CLOCKWISE, COUNTERCLOCKWISE, INVALID_ORIENTATION
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 |
---|
TLcdGML31LinearRing()
Constructs a new, uninitialized linear ring.
|
TLcdGML31LinearRing(boolean aUseGeodesicInterpolationForGeodeticReferences)
Constructs a new, uninitialized linear ring with the given geodetic interpolation behavior.
|
TLcdGML31LinearRing(ILcdModelReference aModelReference)
Constructs a new object for the given model reference.
|
TLcdGML31LinearRing(TLcdDataType aType) |
TLcdGML31LinearRing(TLcdDataType aDataType,
ILcdModelReference aModelReference)
Constructs a new object of the given type for the given model reference.
|
TLcdGML31LinearRing(TLcdDataType aDataType,
ILcdModelReference aModelReference,
boolean aUseGeodesicInterpolationForGeodeticReferences)
Constructs a new object for the given model reference and with the given geodetic interpolation behavior.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
TLcdGML31LinearRing |
clone()
Returns a deep clone of this object.
|
TLcdDataObject |
clone(Map aObjectDictionary)
Returns a deep clone of this object.
|
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 . |
String |
getGid()
Gets the value of the
GID_PROPERTY property. |
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.
|
int |
getOrientation()
Returns the orientation of this
ILcdPolygon :
ILcdPolygon.CLOCKWISE or ILcdPolygon.COUNTERCLOCKWISE . |
ILcd3DEditablePoint |
getPoint(int aIndex)
Returns the
ILcdPoint at a given index. |
int |
getPointCount()
Returns the number of
ILcdPoint objects in the list. |
Object |
getPosGroup()
Returns the value of the property that maps to the choice between the
pos and pointProperty and pointRep and posList and coordinates and coord elements. |
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.
|
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 |
invalidateObject()
Invalidates all cached values of this object.
|
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. |
void |
move3D(double aX,
double aY,
double aZ)
Moves this
ILcd3DEditableShape to the given point in the 3D space. |
void |
move3D(ILcdPoint aPoint)
Moves this
ILcd3DEditableShape to the given point in the 3D 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 |
setGid(String aValue)
Sets the value of the
GID_PROPERTY property. |
void |
setPosGroup(Object aValue)
Sets the value of the property that maps to the choice between the
pos and pointProperty and pointRep and posList and coordinates and coord elements. |
void |
setValue(TLcdDataProperty aProperty,
Object aValue)
Sets the value of the given property for this data object.
|
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. |
void |
translate3D(double aDeltaX,
double aDeltaY,
double aDeltaZ)
Translates this
ILcd3DEditableShape from its current position over the given translation
vector in the 3D space. |
void |
translate3DPoint(int aIndex,
double aDeltaX,
double aDeltaY,
double aDeltaZ)
Translates the specified point of this
ILcd3DEditablePointList from its current position
over the given translation vector in the 3D space. |
getSrs, setSrs, toString
getDescription, getId, getMetaDataProperty, getName, setDescription, setId
canSetFeature, getFeature, getFeature, getFeatureCount, getFeaturedDescriptor, setFeature, setFeature
getDataType, getValue, getValue, hasValue, hasValue, setValue
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
append2DPoint
getPointSFCT, getX, getY, getZ
public static final TLcdDataProperty POS_GROUP_PROPERTY
pos
and pointProperty
and pointRep
and posList
and coordinates
and coord
elements.
The possible values for this property are instances of
List<TLcdGML31DirectPosition>
List<TLcdGML31PointProperty>
List<TLcdGML31PointProperty>
TLcdGML31DirectPositionList
TLcdGML31Coordinates
List<TLcdGML31Coord>
public static final TLcdDataProperty GID_PROPERTY
gid
attribute. Acceptable values for this property are instances of java.lang.String
.public TLcdGML31LinearRing(TLcdDataType aType)
public TLcdGML31LinearRing()
position group property
, for example
by calling setPosGroup(new ArrayList());
public TLcdGML31LinearRing(boolean aUseGeodesicInterpolationForGeodeticReferences)
position group property
, for example
by calling setPosGroup(new ArrayList());
aUseGeodesicInterpolationForGeodeticReferences
- whether a geodesic interpolation needs to be used in case of a geodetic referencepublic TLcdGML31LinearRing(ILcdModelReference aModelReference)
TLcdGML31DirectPositionList
initialized with the given model reference.
A geodesic interpolation will be used in case of a geodetic reference.aModelReference
- the model reference for this objectpublic TLcdGML31LinearRing(TLcdDataType aDataType, ILcdModelReference aModelReference)
TLcdGML31DirectPositionList
initialized with the given model reference.
A geodesic interpolation will be used in case of a geodetic reference.aDataType
- the data type for this objectaModelReference
- the model reference for this objectpublic TLcdGML31LinearRing(TLcdDataType aDataType, ILcdModelReference aModelReference, boolean aUseGeodesicInterpolationForGeodeticReferences)
TLcdGML31DirectPositionList
initialized with the given model reference.aDataType
- the data type for this objectaModelReference
- the model reference for this objectaUseGeodesicInterpolationForGeodeticReferences
- whether a geodesic interpolation needs to be used in case of a geodetic referencepublic int getOrientation()
ILcdPolygon
ILcdPolygon
:
ILcdPolygon.CLOCKWISE
or ILcdPolygon.COUNTERCLOCKWISE
.getOrientation
in interface ILcdPolygon
ILcdPolygon
:
ILcdPolygon.CLOCKWISE
or ILcdPolygon.COUNTERCLOCKWISE
.
This method should not return INVALID_ORIENTATION
, which is only to be used for resetting the orientation
so that it can be recalculated.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 translate3DPoint(int aIndex, double aDeltaX, double aDeltaY, double aDeltaZ)
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.aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.aDeltaZ
- the z coordinate of the translation vector.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 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 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 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 removePointAt(int aIndex)
ILcd3DEditablePointList
ILcd3DEditablePointList
.removePointAt
in interface ILcd2DEditablePointList
removePointAt
in interface ILcd3DEditablePointList
aIndex
- a valid index in the list of ILcdPoint
objects.public int getPointCount()
ILcdPointList
ILcdPoint
objects in the list.getPointCount
in interface ILcdPointList
ILcdPoint
objects in the list.public ILcd3DEditablePoint 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 ILcdPoint getStartPoint()
ILcdCurve
This is equivalent to computePointSFCT(0)
.
getStartPoint
in interface ILcdCurve
getStartPoint
in class TLcdGML31AbstractRing
public ILcdPoint getEndPoint()
ILcdCurve
This is equivalent to computePointSFCT(1)
.
getEndPoint
in interface ILcdCurve
getEndPoint
in class TLcdGML31AbstractRing
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
getStartTangent2D
in class TLcdGML31AbstractRing
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
getEndTangent2D
in class TLcdGML31AbstractRing
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
getTangent2D
in class TLcdGML31AbstractRing
aParam
- a value of the closed interval [0,1]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
getLength2D
in class TLcdGML31AbstractRing
aParam1
- a value of the closed interval [0,1]aParam2
- a value of the closed interval [0,1]public void computePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT)
ILcdCurve
ILcdCurve.getStartPoint()
.ILcdCurve.getEndPoint()
.computePointSFCT
in interface ILcdCurve
computePointSFCT
in class TLcdGML31AbstractRing
aParam
- a value of the closed interval [0,1]aPointSFCT
- the point to store the computed curve point inpublic 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
getInterpolation
in class TLcdGML31AbstractRing
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
getLineSegmentIntersectionCount
in class TLcdGML31AbstractRing
aP1
- the first point of the line segmentaP2
- the second point of the line segmentpublic 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 move3D(double aX, double aY, double aZ)
ILcd3DEditableShape
ILcd3DEditableShape
to the given point in the 3D space. The focus point
is used as the handle by which the shape is moved.move3D
in interface ILcd3DEditableShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public void move3D(ILcdPoint aPoint)
ILcd3DEditableShape
ILcd3DEditableShape
to the given point in the 3D space. The focus point
is used as the handle by which the shape is moved.move3D
in interface ILcd3DEditableShape
aPoint
- the ILcdPoint
to move to.ILcd3DEditableShape.move3D(double, double, double)
public void translate3D(double aDeltaX, double aDeltaY, double aDeltaZ)
ILcd3DEditableShape
ILcd3DEditableShape
from its current position over the given translation
vector in the 3D space.translate3D
in interface ILcd3DEditablePointList
translate3D
in interface ILcd3DEditableShape
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.aDeltaZ
- the z 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
contains2D
in class TLcdGML31AbstractRing
aPoint
- the ILcdPoint
to test.ILcdShape.contains2D(double, double)
public boolean contains3D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 3D space.contains3D
in interface ILcdShape
contains3D
in class TLcdGML31AbstractRing
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
contains3D
in class TLcdGML31AbstractRing
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.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
contains2D
in class TLcdGML31AbstractRing
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
getFocusPoint
in class TLcdGML31AbstractRing
ILcdShape
.public TLcdGML31LinearRing clone()
TLcdDataObject
TLcdDataObject.clone(Map)
.clone
in interface ILcdCloneable
clone
in class TLcdDataObject
Object.clone()
public TLcdDataObject clone(Map aObjectDictionary)
TLcdDataObject
ILcdDataObject
, the value is cloned by first creating a new instance via
the value.getDataType().newInstance()
method, and then cloning its properties one by one.ILcdDeepCloneable
or
ILcdCloneable
then this interface is used to clone the value.clone
in interface ILcdDeepCloneable
clone
in class TLcdDataObject
aObjectDictionary
- the Object dictionary that keeps track of the objects for which a clone has already been made,
and their corresponding clone Object.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
getBounds
in class TLcdGML31AbstractRing
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.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 removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void invalidateObject()
ILcdInvalidateable
invalidateObject
in interface ILcdInvalidateable
public void setValue(TLcdDataProperty aProperty, Object aValue)
ILcdDataObject
Sets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.
The given property must be declared in thedata object's type
or in one of its super types. In
other words, getDataType().getProperties().contains( aProperty ) should always be true.
Otherwise, the implementation should throw an IllegalArgumentException
.setValue
in interface ILcdDataObject
setValue
in class TLcdDataObject
aProperty
- the property for which the value is to be setaValue
- the value to setTLcdDataType.getProperty(String)
public Object getPosGroup()
pos
and pointProperty
and pointRep
and posList
and coordinates
and coord
elements.
The possible values for this property are instances of
List<TLcdGML31DirectPosition>
List<TLcdGML31PointProperty>
List<TLcdGML31PointProperty>
TLcdGML31DirectPositionList
TLcdGML31Coordinates
List<TLcdGML31Coord>
POS_GROUP_PROPERTY
property.public void setPosGroup(Object aValue)
pos
and pointProperty
and pointRep
and posList
and coordinates
and coord
elements.
The possible values for this property are instances of
List<TLcdGML31DirectPosition>
List<TLcdGML31PointProperty>
List<TLcdGML31PointProperty>
TLcdGML31DirectPositionList
TLcdGML31Coordinates
List<TLcdGML31Coord>
aValue
- the value to set for the POS_GROUP_PROPERTY
property.public String getGid()
GID_PROPERTY
property.
This attribute is included for backward compatibility with GML 2 and is deprecated with GML 3. This identifer is superceded by "gml:id" inherited from AbstractGMLType. The attribute "gid" should not be used anymore and may be deleted in future versions of GML without further notice.
GID_PROPERTY
property.public void setGid(String aValue)
GID_PROPERTY
property.
This attribute is included for backward compatibility with GML 2 and is deprecated with GML 3. This identifer is superceded by "gml:id" inherited from AbstractGMLType. The attribute "gid" should not be used anymore and may be deleted in future versions of GML without further notice.
aValue
- the value to set for the GID_PROPERTY
property.