public class TLcdGML2AbstractFeature extends TLcdFeaturedDataObject 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 |
DESCRIPTION_PROPERTY
Data property that maps to the
description element. |
static TLcdDataProperty |
FID_PROPERTY
Data property that maps to the
fid attribute. |
static TLcdDataProperty |
NAME_PROPERTY
Data property that maps to the
name element. |
Constructor and Description |
---|
TLcdGML2AbstractFeature(TLcdDataType aType)
Creates a new, empty
TLcdGML2AbstractFeature . |
Modifier and Type | Method and Description |
---|---|
TLcdGML2AbstractFeature |
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. |
TLcdGML2BoundingShape |
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. |
String |
getDescription()
Returns the value of the property that maps to the
description element. |
String |
getFid()
Returns the value of the property that maps to the
fid attribute. |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
String |
getName()
Returns the value of the property that maps to the
name 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(TLcdGML2BoundingShape aValue)
Sets the value of the property that maps to the
boundedBy element. |
void |
setDescription(String aValue)
Sets the value of the property that maps to the
description element. |
void |
setFid(String aValue)
Sets the value of the property that maps to the
fid attribute. |
void |
setName(String aValue)
Sets the value of the property that maps to the
name element. |
void |
shapesChanged()
Notifies this
ILcdShapeList that some (possibly all) of its shapes have changed. |
canSetFeature, getFeature, getFeature, getFeatureCount, getFeaturedDescriptor, setFeature, setFeature
getDataType, getValue, getValue, hasValue, hasValue, setValue, setValue, toString
public static final TLcdDataProperty FID_PROPERTY
fid
attribute.
The possible values for this property are instances of String
.public static final TLcdDataProperty DESCRIPTION_PROPERTY
description
element.
The possible values for this property are instances of String
.public static final TLcdDataProperty NAME_PROPERTY
name
element.
The possible values for this property are instances of String
.public static final TLcdDataProperty BOUNDED_BY_PROPERTY
boundedBy
element.
The possible values for this property are instances of TLcdGML2BoundingShape
.public TLcdGML2AbstractFeature(TLcdDataType aType)
TLcdGML2AbstractFeature
. 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 TLcdGML2AbstractFeature 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 String getFid()
fid
attribute.FID_PROPERTY
property.public void setFid(String aValue)
fid
attribute.aValue
- the value to set for the FID_PROPERTY
property.public String getDescription()
description
element.DESCRIPTION_PROPERTY
property.public void setDescription(String aValue)
description
element.aValue
- the value to set for the DESCRIPTION_PROPERTY
property.public String getName()
name
element.NAME_PROPERTY
property.public void setName(String aValue)
name
element.aValue
- the value to set for the NAME_PROPERTY
property.public TLcdGML2BoundingShape getBoundedBy()
boundedBy
element.BOUNDED_BY_PROPERTY
property.public void setBoundedBy(TLcdGML2BoundingShape aValue)
boundedBy
element.aValue
- the value to set for the BOUNDED_BY_PROPERTY
property.