LuciadCPillar 2023.1.04
luciad::IFeatureGeometryProvider Class Referenceabstract

This class can provide the Geometry associated with a Feature, and apply Geometry changes on that Feature. More...

#include <luciad/models/features/IFeatureGeometryProvider.h>

Inheritance diagram for luciad::IFeatureGeometryProvider:
luciad::DefaultFeatureGeometryProvider

Public Member Functions

virtual ~IFeatureGeometryProvider ()=default
 
virtual std::optional< FeatureapplyGeometry (Feature originalFeature, std::shared_ptr< Geometry > newGeometry)=0
 Updates the original Feature using the modified Geometry, and returns it. More...
 
virtual std::shared_ptr< GeometrygetGeometry (const Feature &feature)=0
 Return the geometry for a Feature (for example a Geometry using which a Geometry can be edited or created). More...
 

Detailed Description

This class can provide the Geometry associated with a Feature, and apply Geometry changes on that Feature.

this can for example be used to specify the Geometry that is used to edit or create a Feature.

See the related guide for an overview of the editing API.

See DefaultFeatureGeometryProvider for a default implementation that works for Features that use GeometryDataAnnotation.

The provided geometry is not necessarily the same geometry as the one used for painting. An example would be to modify the location and orientation of a vessel by editing it as an Ellipse, which also has a location and an orientation. This could be implemented by:

Similarly, a vessel feature could be created by creating an Ellipse geometry.

Since
2020.1

Constructor & Destructor Documentation

◆ ~IFeatureGeometryProvider()

virtual luciad::IFeatureGeometryProvider::~IFeatureGeometryProvider ( )
virtualdefault

Member Function Documentation

◆ applyGeometry()

virtual std::optional< Feature > luciad::IFeatureGeometryProvider::applyGeometry ( Feature  originalFeature,
std::shared_ptr< Geometry newGeometry 
)
pure virtual

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.

Parameters
originalFeaturethe original Feature
newGeometrya new Geometry to apply on the Feature
Returns
a new Feature, based on a modified Geometry

Implemented in luciad::DefaultFeatureGeometryProvider.

◆ getGeometry()

virtual std::shared_ptr< Geometry > luciad::IFeatureGeometryProvider::getGeometry ( const Feature feature)
pure virtual

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.

Parameters
featurethe Feature to edit
Returns
the Geometry using which a Feature can be edited, or nullptr if the Feature can not be edited using a Geometry

Implemented in luciad::DefaultFeatureGeometryProvider.