LuciadCPillar 2023.1.04
luciad::FeatureHandlesProvider::IHandleFactory Class Referenceabstract

Allows you to specify the translate handle that is used by this handles provider. More...

#include <luciad/edit/features/FeatureHandlesProvider.h>

Public Member Functions

virtual ~IHandleFactory ()=default
 
virtual std::shared_ptr< IEditHandlecreateTranslateHandle (const std::shared_ptr< Observable< Feature > > &feature, const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &geometry, const std::shared_ptr< ITranslateEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to translate the entire Geometry. More...
 
virtual bool isTranslateHandleValid (const std::shared_ptr< IEditHandle > &translateHandle, const std::shared_ptr< Observable< Feature > > &feature, const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &geometry, const std::shared_ptr< FeatureEditContext > &context)=0
 Returns true if the translate handle is still valid, or false if it should be removed. More...
 

Detailed Description

Allows you to specify the translate handle that is used by this handles provider.

It allows you to:

  • replace the handle with another handle implementation
  • (dynamically) disable or re-enable the translation handles

Note: Other handles are created by the delegate geometry handles provider.

Additional handles can not be added using this factory. The way to do this is to wrap the IEditHandles provided by FeatureHandlesProvider, and to insert additional handles in the IEditHandles::getList method.

Constructor & Destructor Documentation

◆ ~IHandleFactory()

virtual luciad::FeatureHandlesProvider::IHandleFactory::~IHandleFactory ( )
virtualdefault

Member Function Documentation

◆ createTranslateHandle()

virtual std::shared_ptr< IEditHandle > luciad::FeatureHandlesProvider::IHandleFactory::createTranslateHandle ( const std::shared_ptr< Observable< Feature > > &  feature,
const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &  geometry,
const std::shared_ptr< ITranslateEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to translate the entire Geometry.

While the handle is not already present, this method is called whenever the edited geometry changes.

Parameters
featurethe feature that is being edited
geometrythe feature's Geometry that is being edited
editActionthe translate edit action, to be used by the handle. If a constraint was configured on the delegate geometry handles provider, this action applies that constraint when it is executed.
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ isTranslateHandleValid()

virtual bool luciad::FeatureHandlesProvider::IHandleFactory::isTranslateHandleValid ( const std::shared_ptr< IEditHandle > &  translateHandle,
const std::shared_ptr< Observable< Feature > > &  feature,
const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &  geometry,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Returns true if the translate handle is still valid, or false if it should be removed.

This method is called whenever the edited geometry changes and allows the factory to dynamically disable or re-create the edit handles. When this method returns false, the handle is removed and createTranslateHandle is called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also return nullptr in that method.

Parameters
translateHandlethe handle
featurethe feature that is being edited
geometrythe feature's Geometry that is being edited
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.