LuciadCPillar 2024.0.04
luciad::CompositeFeatureHandlesProvider Class Referencefinal

A composite implementation of IFeatureHandlesProvider. More...

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

Inheritance diagram for luciad::CompositeFeatureHandlesProvider:
luciad::IFeatureHandlesProvider

Public Member Functions

 CompositeFeatureHandlesProvider ()
 Creates an empty composite instance. More...
 
 ~CompositeFeatureHandlesProvider () override
 
void add (std::shared_ptr< IFeatureHandlesProvider > 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< Feature > > &feature, const std::shared_ptr< FeatureEditContext > &context) const override
 Indicates if this handles provider can create handles for the given Feature. More...
 
std::vector< std::shared_ptr< IFeatureHandlesProvider > > getList () const
 Returns the list containing all registered instances, ordered by priority (highest priority first). More...
 
std::shared_ptr< IEditHandlesprovide (std::shared_ptr< Observable< Feature > > feature, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IFeatureEditCallback > featureEditCallback) const override
 Returns handles for the given feature. More...
 
void remove (const std::shared_ptr< IFeatureHandlesProvider > &handlesProvider)
 Removes this given instance from the list of registered instances. More...
 
- Public Member Functions inherited from luciad::IFeatureHandlesProvider
virtual ~IFeatureHandlesProvider ()=default
 
virtual bool canProvide (const std::shared_ptr< Observable< Feature > > &feature, const std::shared_ptr< FeatureEditContext > &context) const =0
 Indicates if this handles provider can create handles for the given Feature. More...
 
virtual std::shared_ptr< IEditHandlesprovide (std::shared_ptr< Observable< Feature > > feature, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IFeatureEditCallback > featureEditCallback) const =0
 Returns handles for the given feature. More...
 

Static Public Member Functions

static std::shared_ptr< CompositeFeatureHandlesProvidercreateDefault ()
 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. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CompositeFeatureHandlesProvider()

luciad::CompositeFeatureHandlesProvider::CompositeFeatureHandlesProvider ( )

Creates an empty composite instance.

◆ ~CompositeFeatureHandlesProvider()

luciad::CompositeFeatureHandlesProvider::~CompositeFeatureHandlesProvider ( )
override

Member Function Documentation

◆ add()

void luciad::CompositeFeatureHandlesProvider::add ( std::shared_ptr< IFeatureHandlesProvider handlesProvider,
Priority  priority = Priority::normal() 
)

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
handlesProvidera new instance to register
prioritya priority. The default is PriorityDefault.
Exceptions
NullArgumentExceptionwhen nullptr is passed.

◆ 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
featurean observable Feature.
contextthe context. Contains additional information about the edited feature.
Returns
if this handles provider can create handles for the given Feature.

Implements luciad::IFeatureHandlesProvider.

◆ createDefault()

static std::shared_ptr< CompositeFeatureHandlesProvider > luciad::CompositeFeatureHandlesProvider::createDefault ( )
static

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()

std::shared_ptr< IEditHandles > luciad::CompositeFeatureHandlesProvider::provide ( std::shared_ptr< Observable< Feature > >  feature,
const std::shared_ptr< FeatureEditContext > &  context,
std::shared_ptr< IFeatureEditCallback featureEditCallback 
) const
overridevirtual

Returns handles for the given feature.

If this provider doesn't support the given feature, it can return nullptr.

Parameters
featurethe observable feature for which to create handles.
contextthe context. Contains additional information about the edited feature.
featureEditCallbacka 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
handlesProviderthe instance to remove from this composite.
Exceptions
NullArgumentExceptionwhen nullptr is passed.