LuciadCPillar 2023.1.04
|
Default geometry provider that works for Features with a DataType using a GeometryDataAnnotation. More...
#include <luciad/models/features/DefaultFeatureGeometryProvider.h>
Public Member Functions | |
std::optional< Feature > | applyGeometry (Feature originalFeature, std::shared_ptr< Geometry > newGeometry) override |
Updates the original Feature using the modified Geometry, and returns it. More... | |
std::shared_ptr< Geometry > | getGeometry (const Feature &feature) override |
Return the geometry for a Feature (for example a Geometry using which a Geometry can be edited or created). More... | |
Public Member Functions inherited from luciad::IFeatureGeometryProvider | |
virtual | ~IFeatureGeometryProvider ()=default |
virtual std::optional< Feature > | applyGeometry (Feature originalFeature, std::shared_ptr< Geometry > newGeometry)=0 |
Updates the original Feature using the modified Geometry, and returns it. More... | |
virtual std::shared_ptr< Geometry > | getGeometry (const Feature &feature)=0 |
Return the geometry for a Feature (for example a Geometry using which a Geometry can be edited or created). More... | |
Default geometry provider that works for Features with a DataType using a GeometryDataAnnotation.
It is implemented as follows:
This class should not be used when:
Feature::findGeometry
. The geometry isn't an explicit part of the feature, for example, but you can derive it from other properties on the feature.Feature::findGeometry
. It can be useful to display a distinct geometry when a user edits a feature. For example, when users edit the location and orientation of a vessel, you can show an Ellipse, which also has a location and an orientation.Geometry
property, and a property with the length of that geometry. When the Geometry
property changes, the length property needs to change as well. You can do so by providing a custom implementation of IFeatureGeometryProvider::applyGeometry
that changes the geometry, but also changes the length property.In these cases, a custom IFeatureGeometryProvider implementation needs to be used.
|
overridevirtual |
Updates the original Feature using the modified Geometry, and returns it.
This Geometry is not necessarily the same geometry as the one used for painting. See IFeatureGeometryProvider
for an example.
Implements luciad::IFeatureGeometryProvider.
|
overridevirtual |
Return the geometry for a Feature (for example a Geometry using which a Geometry can be edited or created).
This Geometry is not necessarily the same geometry as the one used for painting.
See IFeatureGeometryProvider
for more information.
feature | the Feature to edit |
nullptr
if the Feature can not be edited using a Geometry Implements luciad::IFeatureGeometryProvider.