public class TLcdGML31AbstractFeature extends TLcdGML31AbstractGML implements ILcdShapeList, ILcdInvalidateable
gml:AbstractFeatureType
.
gml:AbstractFeatureType
is the XML root type for all XML types modeling a real-world
entity, e.g., a city, a building, a road, ... . A GML feature collection is typically mapped on
an ILcdModel
in LuciadLightspeed, and the model's elements will be all elements in the GML
feature collection with a type extending of gml:AbstractFeatureType
.
The contents of a GML feature can be accessed via two interfaces:
ILcdDataObject
interface provides access to all properties of this GML
feature.ILcdShapeList
interface provides access to the geometries contained in
this feature. The list of shapes will be lazily computed in the collectShapes()
method,
the first time it is needed. This method can be overridden in extensions to tweak which
geometries
are made available via the ILcdShapeList
interface of this class.
gml:AbstractFeatureType
,
used
by the GML model decoder, will return instances of this class!
Modifier and Type | Field and Description |
---|---|
static TLcdDataProperty |
BOUNDED_BY_PROPERTY
Data property that maps to the
boundedBy element. |
static TLcdDataProperty |
LOCATION_PROPERTY
Data property that maps to the
location element. |
DESCRIPTION_PROPERTY, ID_PROPERTY, META_DATA_PROPERTY_PROPERTY, NAME_PROPERTY
Constructor and Description |
---|
TLcdGML31AbstractFeature(TLcdDataType aType)
Creates a new, empty
TLcdGML31AbstractFeature . |
Modifier and Type | Method and Description |
---|---|
TLcdGML31AbstractFeature |
clone()
Returns a deep clone of this object.
|
TLcdDataObject |
clone(Map aObjectDictionary)
Returns a deep clone of this object.
|
protected List<ILcdShape> |
collectShapes()
Override this method to collect all shapes that needs to be included in the ILcdShapeList
implementation of this feature.
|
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. |
TLcdGML31BoundingShape |
getBoundedBy()
Returns the value of the property that maps to the
boundedBy element. |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
Object |
getLocation()
Returns the value of the property that maps to the
location element. |
ILcdShape |
getShape(int aIndex)
Returns the
ILcdShape at the given index. |
int |
getShapeCount()
Returns the number of
ILcdShape objects in the list. |
void |
invalidateObject()
Invalidates all cached values of this object.
|
void |
setBoundedBy(TLcdGML31BoundingShape aValue)
Sets the value of the property that maps to the
boundedBy element. |
void |
setLocation(Object aValue)
Sets the value of the property that maps to the
location element. |
void |
shapesChanged()
Notifies this
ILcdShapeList that some (possibly all) of its shapes have changed. |
getDescription, getId, getMetaDataProperty, getName, setDescription, setId
canSetFeature, getFeature, getFeature, getFeatureCount, getFeaturedDescriptor, setFeature, setFeature
getDataType, getValue, getValue, hasValue, hasValue, setValue, setValue, toString
public static final TLcdDataProperty BOUNDED_BY_PROPERTY
boundedBy
element.
The possible values for this property are instances of TLcdGML31BoundingShape
.public static final TLcdDataProperty LOCATION_PROPERTY
location
element.
The possible values for this property are instances of TLcdGML31LocationProperty
.public TLcdGML31AbstractFeature(TLcdDataType aType)
TLcdGML31AbstractFeature
. The specified TLcdDataType
should be a valid type, that is, it should inherit from
gml:AbstractFeatureType
- it may additionally add its own features.
See the package documentation
for more information on how the XML types are mapped on a data object structure.aType
- the TLcdDataType
describing this feature.protected List<ILcdShape> collectShapes()
ILcdDataObject
for all features implementing ILcdShape
.public void shapesChanged()
ILcdShapeList
that some (possibly all) of its shapes have changed.
This method should be called whenever a shape in this GML feature has been changed, or when
a shape is inserted in or removed in one the properties of this GML feature.
This method is the same as invalidateObject()
.public int getShapeCount()
ILcdShapeList
ILcdShape
objects in the list.getShapeCount
in interface ILcdShapeList
ILcdShape
objects in the list.public ILcdShape getShape(int aIndex) throws IndexOutOfBoundsException
ILcdShapeList
ILcdShape
at the given index.getShape
in interface ILcdShapeList
aIndex
- a valid index in the list of ILcdShape
objects.ILcdShape
at the given index.IndexOutOfBoundsException
- when the index is not valid.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 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 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 ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public TLcdGML31AbstractFeature 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
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void invalidateObject()
ILcdInvalidateable
invalidateObject
in interface ILcdInvalidateable
public TLcdGML31BoundingShape getBoundedBy()
boundedBy
element.BOUNDED_BY_PROPERTY
property.public void setBoundedBy(TLcdGML31BoundingShape aValue)
boundedBy
element.aValue
- the value to set for the BOUNDED_BY_PROPERTY
property.public Object getLocation()
location
element.
Deprecated in GML 3.1.0
LOCATION_PROPERTY
property.TLcdGML31LocationProperty
public void setLocation(Object aValue)
location
element.
Deprecated in GML 3.1.0
aValue
- the value to set for the LOCATION_PROPERTY
property.