LuciadCPillar 2023.1.04
luciad::IGeometryHandlesProvider Class Referenceabstract

This class can provide edit handles for a given Geometry. More...

#include <luciad/edit/geometries/IGeometryHandlesProvider.h>

Inheritance diagram for luciad::IGeometryHandlesProvider:
luciad::CompositeGeometryHandlesProvider luciad::PatchHandlesProvider luciad::PointHandlesProvider luciad::PolylineHandlesProvider luciad::PolylineRingHandlesProvider

Public Member Functions

virtual ~IGeometryHandlesProvider ()=default
 
virtual bool canProvide (const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &geometry, const std::shared_ptr< FeatureEditContext > &context) const =0
 Indicates if this handles provider can create handles for the given geometry. More...
 
virtual std::shared_ptr< IEditHandlesprovide (std::shared_ptr< Observable< std::shared_ptr< Geometry > > > geometry, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IGeometryEditCallback > geometryEditCallback) const =0
 Returns the handles for the given feature. More...
 
virtual std::shared_ptr< ITranslateEditActionprovideTranslateAction (std::shared_ptr< Observable< std::shared_ptr< Geometry > > > geometry, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IGeometryEditCallback > geometryEditCallback) const =0
 Provides a translate action that can be used by the caller to add translation behavior. More...
 

Detailed Description

This class can provide edit handles for a given Geometry.

The given Geometry is passed to this provider as an Observable. This object allows Editor to communicate geometry changes to the IEditHandles implementations, who can use it to create and update their collection of handles. Editing changes originating from IEditHandles are communicated to the Editor or handles wrappers by calling IGeometryEditCallback. See also the related guide on editing interactions.

This class is typically used in the context of feature editing, when a feature is edited by modifying its geometry.

It has a default implementation that supports many geometries.

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

Since
2020.1

Constructor & Destructor Documentation

◆ ~IGeometryHandlesProvider()

virtual luciad::IGeometryHandlesProvider::~IGeometryHandlesProvider ( )
virtualdefault

Member Function Documentation

◆ canProvide()

virtual bool luciad::IGeometryHandlesProvider::canProvide ( const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &  geometry,
const std::shared_ptr< FeatureEditContext > &  context 
) const
pure virtual

Indicates if this handles provider can create handles for the given geometry.

Parameters
geometryan observable geometry, cannot be nullptr
contextthe context. Contains additional information about the edited feature, cannot be nullptr.
Returns
if this handles provider can provide handles and a translate action for the given Feature

Implemented in luciad::CompositeGeometryHandlesProvider, luciad::PatchHandlesProvider, luciad::PointHandlesProvider, luciad::PolylineHandlesProvider, and luciad::PolylineRingHandlesProvider.

◆ provide()

virtual std::shared_ptr< IEditHandles > luciad::IGeometryHandlesProvider::provide ( std::shared_ptr< Observable< std::shared_ptr< Geometry > > >  geometry,
const std::shared_ptr< FeatureEditContext > &  context,
std::shared_ptr< IGeometryEditCallback geometryEditCallback 
) const
pure virtual

Returns the handles for the given feature.

Note: translation of features is handled by IFeatureHandlesProvider. So geometry handles providers should not provide handles to translate a geometry.

Parameters
geometrythe observable geometry for which to provide handles, cannot be nullptr.
contextthe context. Contains additional information about the edited feature, cannot be nullptr.
geometryEditCallbacka callback that notifies the caller when the Feature has changed, cannot be nullptr.
Returns
handles for the given feature. Never nullptr.

Implemented in luciad::CompositeGeometryHandlesProvider, luciad::PatchHandlesProvider, luciad::PointHandlesProvider, luciad::PolylineHandlesProvider, and luciad::PolylineRingHandlesProvider.

◆ provideTranslateAction()

virtual std::shared_ptr< ITranslateEditAction > luciad::IGeometryHandlesProvider::provideTranslateAction ( std::shared_ptr< Observable< std::shared_ptr< Geometry > > >  geometry,
const std::shared_ptr< FeatureEditContext > &  context,
std::shared_ptr< IGeometryEditCallback geometryEditCallback 
) const
pure virtual

Provides a translate action that can be used by the caller to add translation behavior.

A translation handle is typically added by an IFeatureHandlesProvider, like for example the FeatureHandlesProvider implementation. It calls this method to retrieve a translate action, and uses it to create a TranslateEditHandle.

When ITranslateEditAction::translate is called, the returned implementation must:

Parameters
geometrythe observable geometry for which to provide a translate action, cannot be nullptr
contextthe context, cannot be nullptr
geometryEditCallbacka callback that notifies the caller of this method when a translation has occurred, cannot be nullptr
Returns
a translate action. Never nullptr.

Implemented in luciad::CompositeGeometryHandlesProvider, luciad::PatchHandlesProvider, luciad::PointHandlesProvider, luciad::PolylineHandlesProvider, and luciad::PolylineRingHandlesProvider.