A composite implementation of IGeometryHandlesProvider.
More...
#include <luciad/edit/geometries/CompositeGeometryHandlesProvider.h>
|
| CompositeGeometryHandlesProvider () |
| Creates an empty composite instance. More...
|
|
| ~CompositeGeometryHandlesProvider () override |
|
void | add (std::shared_ptr< IGeometryHandlesProvider > handlesProvider, Priority priority=Priority::normal()) |
| Adds the given instance to the list of registered instances with the given priority. More...
|
|
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::vector< std::shared_ptr< IGeometryHandlesProvider > > | getList () const |
| Returns the list containing all registered instances, ordered by priority (highest priority first). More...
|
|
std::shared_ptr< IEditHandles > | provide (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< ITranslateEditAction > | provideTranslateAction (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 | remove (const std::shared_ptr< IGeometryHandlesProvider > &handlesProvider) |
| Removes this given instance from the list of registered instances. 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< IEditHandles > | provide (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< ITranslateEditAction > | provideTranslateAction (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...
|
|
A composite implementation of IGeometryHandlesProvider.
This composite allows you to:
The composite implementation uses its delegate instances in a specific order. The order is based on the priority you assign when you add the delegate instance. If the priorities of two instances are equal, the instance that you added first gets priority.
A default implementation is available, see createDefault
.
- Since
- 2020.1
◆ CompositeGeometryHandlesProvider()
luciad::CompositeGeometryHandlesProvider::CompositeGeometryHandlesProvider |
( |
| ) |
|
Creates an empty composite instance.
◆ ~CompositeGeometryHandlesProvider()
luciad::CompositeGeometryHandlesProvider::~CompositeGeometryHandlesProvider |
( |
| ) |
|
|
override |
◆ add()
Adds the given instance to the list of registered instances with the given priority.
If you want to remove an instance again, use CompositeGeometryHandlesProvider::remove.
- Parameters
-
handlesProvider | a new instance to register, cannot be nullptr |
priority | a priority. The default is PriorityDefault. |
- Exceptions
-
◆ canProvide()
bool luciad::CompositeGeometryHandlesProvider::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
-
geometry | an observable geometry, cannot be nullptr |
context | the 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.
◆ createDefault()
Creates a a composite instance with a default set of instances that can handle the following geometries:
- Returns
- a composite instance with a default set of instances. These instances are registered using CompositeGeometryHandlesProvider::PriorityDefault.
◆ getList()
Returns the list containing all registered instances, ordered by priority (highest priority first).
- Returns
- the list containing all registered instances, ordered by priority (highest priority first).
◆ provide()
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
-
geometry | the observable geometry for which to provide handles, cannot be nullptr . |
context | the context. Contains additional information about the edited feature, cannot be nullptr . |
geometryEditCallback | a 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()
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
-
geometry | the observable geometry for which to provide a translate action, cannot be nullptr |
context | the context, cannot be nullptr |
geometryEditCallback | a 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.
◆ remove()
void luciad::CompositeGeometryHandlesProvider::remove |
( |
const std::shared_ptr< IGeometryHandlesProvider > & |
handlesProvider | ) |
|
Removes this given instance from the list of registered instances.
Nothing will happen if the given instance was never added before.
- Parameters
-
handlesProvider | the instance to remove from this composite, cannot be nullptr . |
- Exceptions
-