LuciadCPillar 2023.1.04
luciad::PolylineHandlesProvider::IHandleFactory Class Referenceabstract

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

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

Public Member Functions

virtual ~IHandleFactory ()=default
 
virtual std::shared_ptr< IEditHandlecreateAppendPointHandle (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, const std::shared_ptr< IPointEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to insert a new point at the end of a Polyline. More...
 
virtual std::shared_ptr< IEditHandlecreateElevationPointHandle (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t pointIndex, const std::shared_ptr< IPointEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to change the elevation of the point of a Polyline. More...
 
virtual std::shared_ptr< IEditHandlecreateInsertPointHandle (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t insertIndex, const std::shared_ptr< IPointEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to insert a new point between two existing points of a Polyline. More...
 
virtual std::shared_ptr< IEditHandlecreateMovePointHandle (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t pointIndex, const std::shared_ptr< IPointEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to move a point of the Polyline. More...
 
virtual std::shared_ptr< IEditHandlecreatePrependPointHandle (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, const std::shared_ptr< IPointEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to insert a new point at the start of a Polyline. More...
 
virtual std::shared_ptr< IEditHandlecreateRemovePointHandle (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t pointIndex, const std::shared_ptr< IPointEditAction > &editAction, const std::shared_ptr< FeatureEditContext > &context)=0
 Creates a handle that allows you to remove a point of the Polyline. More...
 
virtual bool isAppendPointHandleValid (const std::shared_ptr< IEditHandle > &appendPointHandle, const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, const std::shared_ptr< FeatureEditContext > &context)=0
 Returns true if the given handle is still valid, or false if it should be removed. More...
 
virtual bool isElevationPointHandleValid (const std::shared_ptr< IEditHandle > &elevationPointHandle, const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t pointIndex, const std::shared_ptr< FeatureEditContext > &context)=0
 Returns true if the given handle is still valid, or false if it should be removed. More...
 
virtual bool isInsertPointHandleValid (const std::shared_ptr< IEditHandle > &insertPointHandle, const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t insertIndex, const std::shared_ptr< FeatureEditContext > &context)=0
 Returns true if the given handle is still valid, or false if it should be removed. More...
 
virtual bool isMovePointHandleValid (const std::shared_ptr< IEditHandle > &movePointHandle, const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t pointIndex, const std::shared_ptr< FeatureEditContext > &context)=0
 Returns true if the given handle is still valid, or false if it should be removed. More...
 
virtual bool isPrependPointHandleValid (const std::shared_ptr< IEditHandle > &prependPointHandle, const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, const std::shared_ptr< FeatureEditContext > &context)=0
 Returns true if the given handle is still valid, or false if it should be removed. More...
 
virtual bool isRemovePointHandleValid (const std::shared_ptr< IEditHandle > &removePointHandle, const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &polyline, size_t pointIndex, 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 used 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 PolylineHandlesProvider, and to insert additional handles in the IEditHandles::getList method.

Constructor & Destructor Documentation

◆ ~IHandleFactory()

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

Member Function Documentation

◆ createAppendPointHandle()

virtual std::shared_ptr< IEditHandle > luciad::PolylineHandlesProvider::IHandleFactory::createAppendPointHandle ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
const std::shared_ptr< IPointEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to insert a new point at the end of a Polyline.

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

Parameters
polylinethe Geometry that is being edited
editActionthe edit action that inserts the point at the end of the polyline. If a constraint was configured on the handles provider, this action applies that constraint when it is executed, providing a PolylineChange parameter with one inserted point index equal to pointCount (of the new polyline).
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ createElevationPointHandle()

virtual std::shared_ptr< IEditHandle > luciad::PolylineHandlesProvider::IHandleFactory::createElevationPointHandle ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  pointIndex,
const std::shared_ptr< IPointEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to change the elevation of the point of a Polyline.

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
polylinethe Geometry that is being edited
pointIndexthe index of the point to move/remove
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 PolylineChange parameter with one moved point index.
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ createInsertPointHandle()

virtual std::shared_ptr< IEditHandle > luciad::PolylineHandlesProvider::IHandleFactory::createInsertPointHandle ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  insertIndex,
const std::shared_ptr< IPointEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to insert a new point between two existing points of a Polyline.

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

Parameters
polylinethe Geometry that is being edited
insertIndexthe index at which to insert a point in the Polyline. After the point is inserted, the new point will have this index. Values lie within [1, pointCount - 1]
editActionthe edit action that inserts the point. If a constraint was configured on the handles provider, this action applies that constraint when it is executed, providing a PolylineChange parameter with one inserted point index.
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ createMovePointHandle()

virtual std::shared_ptr< IEditHandle > luciad::PolylineHandlesProvider::IHandleFactory::createMovePointHandle ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  pointIndex,
const std::shared_ptr< IPointEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to move a point of the Polyline.

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

Parameters
polylinethe Geometry that is being edited
pointIndexthe index of the point to move
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 PolylineChange parameter with one moved point index.
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ createPrependPointHandle()

virtual std::shared_ptr< IEditHandle > luciad::PolylineHandlesProvider::IHandleFactory::createPrependPointHandle ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
const std::shared_ptr< IPointEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to insert a new point at the start of a Polyline.

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

Parameters
polylinethe Geometry that is being edited
editActionthe edit action that inserts the point at the start of the polyline. If a constraint was configured on the handles provider, this action applies that constraint when it is executed, providing a PolylineChange parameter with one inserted point index equal to 0.
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ createRemovePointHandle()

virtual std::shared_ptr< IEditHandle > luciad::PolylineHandlesProvider::IHandleFactory::createRemovePointHandle ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  pointIndex,
const std::shared_ptr< IPointEditAction > &  editAction,
const std::shared_ptr< FeatureEditContext > &  context 
)
pure virtual

Creates a handle that allows you to remove a point of the Polyline.

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

Parameters
polylinethe Geometry that is being edited
pointIndexthe index of the point to remove
editActionthe remove-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 PolylineChange parameter with one removed point index.
contextthe context
Returns
a new handle, or nullptr if no handle should be used

◆ isAppendPointHandleValid()

virtual bool luciad::PolylineHandlesProvider::IHandleFactory::isAppendPointHandleValid ( const std::shared_ptr< IEditHandle > &  appendPointHandle,
const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
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 createAppendPointHandle 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
appendPointHandlethe handle
polylinethe Geometry that is being edited
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.

◆ isElevationPointHandleValid()

virtual bool luciad::PolylineHandlesProvider::IHandleFactory::isElevationPointHandleValid ( const std::shared_ptr< IEditHandle > &  elevationPointHandle,
const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  pointIndex,
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
elevationPointHandlethe handle
polylinethe Geometry that is being edited
pointIndexthe index of the point
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.

◆ isInsertPointHandleValid()

virtual bool luciad::PolylineHandlesProvider::IHandleFactory::isInsertPointHandleValid ( const std::shared_ptr< IEditHandle > &  insertPointHandle,
const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  insertIndex,
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 createInsertPointHandle 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
insertPointHandlethe handle
polylinethe Geometry that is being edited
insertIndexthe insertion index
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.

◆ isMovePointHandleValid()

virtual bool luciad::PolylineHandlesProvider::IHandleFactory::isMovePointHandleValid ( const std::shared_ptr< IEditHandle > &  movePointHandle,
const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  pointIndex,
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 createMovePointHandle 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
movePointHandlethe handle
polylinethe Geometry that is being edited
pointIndexthe index of the point
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.

◆ isPrependPointHandleValid()

virtual bool luciad::PolylineHandlesProvider::IHandleFactory::isPrependPointHandleValid ( const std::shared_ptr< IEditHandle > &  prependPointHandle,
const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
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 createPrependPointHandle 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
prependPointHandlethe handle
polylinethe Geometry that is being edited
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.

◆ isRemovePointHandleValid()

virtual bool luciad::PolylineHandlesProvider::IHandleFactory::isRemovePointHandleValid ( const std::shared_ptr< IEditHandle > &  removePointHandle,
const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  polyline,
size_t  pointIndex,
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 createRemovePointHandle 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
removePointHandlethe handle
polylinethe Geometry that is being edited
pointIndexthe index of the point
contextthe context
Returns
true if the given handle is still valid, or false if it should be removed.