A composite implementation of IFeatureHandlesProvider.
More...
#include <luciad/edit/features/CompositeFeatureHandlesProvider.h>
A composite implementation of IFeatureHandlesProvider.
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
◆ CompositeFeatureHandlesProvider()
luciad::CompositeFeatureHandlesProvider::CompositeFeatureHandlesProvider |
( |
| ) |
|
Creates an empty composite instance.
◆ ~CompositeFeatureHandlesProvider()
luciad::CompositeFeatureHandlesProvider::~CompositeFeatureHandlesProvider |
( |
| ) |
|
|
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 CompositeFeatureHandlesProvider::remove.
- Parameters
-
handlesProvider | a new instance to register |
priority | a priority. The default is PriorityDefault. |
- Exceptions
-
◆ canProvide()
bool luciad::CompositeFeatureHandlesProvider::canProvide |
( |
const std::shared_ptr< Observable< Feature > > & |
feature, |
|
|
const std::shared_ptr< FeatureEditContext > & |
context |
|
) |
| const |
|
overridevirtual |
Indicates if this handles provider can create handles for the given Feature.
- Parameters
-
feature | an observable Feature. |
context | the context. Contains additional information about the edited feature. |
- Returns
- if this handles provider can create handles for the given Feature.
Implements luciad::IFeatureHandlesProvider.
◆ createDefault()
Creates a composite instance with a default set of instances that can handle any Feature instance that can be edited through its Geometry, using the configured
geometry provider.
- Returns
- a composite instance with a default set of instances. These instances are registered using CompositeFeatureHandlesProvider::PriorityDefault.
◆ getList()
std::vector< std::shared_ptr< IFeatureHandlesProvider > > luciad::CompositeFeatureHandlesProvider::getList |
( |
| ) |
const |
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 handles for the given feature.
If this provider doesn't support the given feature, it can return nullptr
.
- Parameters
-
feature | the observable feature for which to create handles. |
context | the context. Contains additional information about the edited feature. |
featureEditCallback | a callback that notifies the caller when the Feature has changed. |
- Returns
- handles for the given feature. If this provider doesn't support the given feature, it can return
nullptr
.
Implements luciad::IFeatureHandlesProvider.
◆ remove()
void luciad::CompositeFeatureHandlesProvider::remove |
( |
const std::shared_ptr< IFeatureHandlesProvider > & |
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. |
- Exceptions
-