public class TLcdHasGeometryAnnotation extends Object implements ILcdAnnotation
Types with this annotation expose their geometry through their data properties.
The supported geometry property types in LuciadLightspeed areILcdShape
for vector data and ALcdImage
for image data.
ILcdShape
or ALcdImage
To access a domain object's geometry, you can make use of the following convenience functions:
ALcdShape.fromDomainObject
to retrieve an ILcdShape
ALcdImage.fromDomainObject
to retrieve an ALcdImage
ALcdBounds.fromDomainObject
to retrieve the geometry's boundsTo create a has-a-geometry data type, add the annotation right after creating the data model.
The following snippet defines a point-based domain object:
TLcdDataModelBuilder builder = new TLcdDataModelBuilder("http://www.mydomain.com/datamodel/myDataModel");
TLcdDataTypeBuilder hasAShapeType = builder.typeBuilder("HasAShapeType");
hasAShapeType.addProperty("Point", TLcdShapeDataTypes.POINT_TYPE);
// add other properties here
// ...
TLcdDataModel dataModel = builder.createDataModel();
TLcdDataType type = dataModel.getDeclaredType("HasAShapeType");
type.addAnnotation(new TLcdHasGeometryAnnotation(type.getProperty("Point")));
The fundamentals samples show how to define and use has-a-shape domain objects.Constructor and Description |
---|
TLcdHasGeometryAnnotation(TLcdDataProperty aGeometryProperty)
Creates a new has-geometry annotation that indicates that the geometry can be accessed using the
given data property.
|
Modifier and Type | Method and Description |
---|---|
TLcdDataProperty |
getGeometryProperty()
Returns the property using which the geometry can be accessed.
|
public TLcdHasGeometryAnnotation(TLcdDataProperty aGeometryProperty)
aGeometryProperty
- the geometry property if the geometry is encoded in a single property,
or null if the geometry property is not known, or if the geometry is encoded
in several properties.public TLcdDataProperty getGeometryProperty()
null
if the
geometry property is not known, or if the geometry is encoded in several properties.