LuciadCPillar 2023.1.04
luciad::PatchHandlesProvider Class Referencefinal

This handles provider can be used to provider edit handles for a Patch geometry. More...

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

Inheritance diagram for luciad::PatchHandlesProvider:
luciad::IGeometryHandlesProvider

Public Member Functions

 PatchHandlesProvider ()
 Creates a new handles provider that can provide handles a Patch geometry. More...
 
 ~PatchHandlesProvider () override
 
bool canProvide (const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &geometry, const std::shared_ptr< FeatureEditContext > &context) const override
 Indicates if this handles provider can create handles for the given geometry. More...
 
std::shared_ptr< IGeometryHandlesProvidergetGeometryHandlesProvider () const
 
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 override
 Returns the handles for the given feature. More...
 
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 override
 Provides a translate action that can be used by the caller to add translation behavior. More...
 
void setGeometryHandlesProvider (std::shared_ptr< IGeometryHandlesProvider > handlesProvider)
 Sets the IGeometryHandlesProvider that is used to provide handles for the base geometry. More...
 
- Public Member Functions inherited from luciad::IGeometryHandlesProvider
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 handles provider can be used to provider edit handles for a Patch geometry.

It delegates handle creation to a handles provider for the base geometry.

Note: the handle to translate the entire feature is typically created by the IFeatureHandlesProvider. FeatureHandlesProvider does this by default.

Since
2020.1

Constructor & Destructor Documentation

◆ PatchHandlesProvider()

luciad::PatchHandlesProvider::PatchHandlesProvider ( )

Creates a new handles provider that can provide handles a Patch geometry.

◆ ~PatchHandlesProvider()

luciad::PatchHandlesProvider::~PatchHandlesProvider ( )
override

Member Function Documentation

◆ canProvide()

bool luciad::PatchHandlesProvider::canProvide ( const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &  geometry,
const std::shared_ptr< FeatureEditContext > &  context 
) const
overridevirtual

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

Implements luciad::IGeometryHandlesProvider.

◆ getGeometryHandlesProvider()

std::shared_ptr< IGeometryHandlesProvider > luciad::PatchHandlesProvider::getGeometryHandlesProvider ( ) const
Returns
the IGeometryHandlesProvider that is used to provide handles for the base geometry.
See also
PatchHandlesProvider::setGeometryHandlesProvider

◆ provide()

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

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.

Implements luciad::IGeometryHandlesProvider.

◆ provideTranslateAction()

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

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.

Implements luciad::IGeometryHandlesProvider.

◆ setGeometryHandlesProvider()

void luciad::PatchHandlesProvider::setGeometryHandlesProvider ( std::shared_ptr< IGeometryHandlesProvider handlesProvider)

Sets the IGeometryHandlesProvider that is used to provide handles for the base geometry.

If this method is not called, a default implementation is used.

Parameters
handlesProviderthe IGeometryHandlesProvider to use, cannot be nullptr.
Exceptions
NullArgumentExceptionwhen nullptr is passed.