LuciadCPillar 2023.1.04
luciad::PointHandlesProvider::IHandleFactory Class Referenceabstract

Allows you to specify which handles are created by this handles provider. More...

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

Public Member Functions

virtual ~IHandleFactory ()=default
 
virtual std::shared_ptr< IEditHandlecreateElevationPointHandle (const std::shared_ptr< Observable< std::shared_ptr< Point > > > &point, const std::shared_ptr< IPointEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to move the Point vertically. More...
 
virtual bool isElevationPointHandleValid (const std::shared_ptr< IEditHandle > &elevationHandle, const std::shared_ptr< Observable< std::shared_ptr< Point > > > &point, const std::shared_ptr< FeatureEditContext > &context)=0
 Returns true if the given handle is still valid, or false if it should be removed. More...
 

Detailed Description

Allows you to specify which handles are created by this handles provider.

It allows you to

  • replace handles with other handle implementations
  • (dynamically) disable or re-enable specific handles

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

Constructor & Destructor Documentation

◆ ~IHandleFactory()

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

Member Function Documentation

◆ createElevationPointHandle()

virtual std::shared_ptr< IEditHandle > luciad::PointHandlesProvider::IHandleFactory::createElevationPointHandle ( const std::shared_ptr< Observable< std::shared_ptr< Point > > > &  point,
const std::shared_ptr< IPointEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to move the Point vertically.

This method is only called when a 3D Map is used. While the handle is not already present, this method is called whenever the edited geometry changes.

Parameters
pointthe geometry that is being edited
editActionthe move-point edit action, to be used by the handle. If a constraint was configured on the handles provider, this action applies that constraint when it is executed, providing a PointChange parameter with the translation.
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ isElevationPointHandleValid()

virtual bool luciad::PointHandlesProvider::IHandleFactory::isElevationPointHandleValid ( const std::shared_ptr< IEditHandle > &  elevationHandle,
const std::shared_ptr< Observable< std::shared_ptr< Point > > > &  point,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Returns true if the given 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 specific edit handles. When this method returns false, the handle is removed and createElevationPointHandle 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
elevationHandlethe handle
pointthe Geometry that is being edited
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.