LuciadCPillar 2023.1.04
luciad::FeatureHandlesProvider Class Referencefinal

Default handles provider for features. More...

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

Inheritance diagram for luciad::FeatureHandlesProvider:
luciad::IFeatureHandlesProvider

Classes

class  IHandleFactory
 Allows you to specify the translate handle that is used by this handles provider. More...
 

Public Member Functions

 FeatureHandlesProvider ()
 Creates a new instance. More...
 
 ~FeatureHandlesProvider () override
 
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::shared_ptr< IGeometryHandlesProvidergetGeometryHandlesProvider () const
 
std::shared_ptr< IHandleFactorygetHandleFactory () const
 
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 setGeometryHandlesProvider (std::shared_ptr< IGeometryHandlesProvider > handlesProvider)
 Sets the IGeometryHandlesProvider that is used. More...
 
void setHandleFactory (std::shared_ptr< IHandleFactory > handleFactory)
 Sets the IHandleFactory that is used by this handles provider to create a new translate handle. 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...
 

Detailed Description

Default handles provider for features.

It can create a handles for features by:

  • creating a handle to translate the entire feature
  • delegating to a geometry handles provider.

The delegate geometry handles are created using an IGeometryHandlesProvider. The geometry is extracted from the feature using the IFeatureGeometryProvider that is provided by the feature layer. This IFeatureGeometryProvider can be configured in the feature layer.

Since
2020.1

Constructor & Destructor Documentation

◆ FeatureHandlesProvider()

luciad::FeatureHandlesProvider::FeatureHandlesProvider ( )

Creates a new instance.

◆ ~FeatureHandlesProvider()

luciad::FeatureHandlesProvider::~FeatureHandlesProvider ( )
override

Member Function Documentation

◆ canProvide()

bool luciad::FeatureHandlesProvider::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.

◆ getGeometryHandlesProvider()

std::shared_ptr< IGeometryHandlesProvider > luciad::FeatureHandlesProvider::getGeometryHandlesProvider ( ) const
Returns
the IGeometryHandlesProvider that is used.
See also
setGeometryHandlesProvider

◆ getHandleFactory()

std::shared_ptr< IHandleFactory > luciad::FeatureHandlesProvider::getHandleFactory ( ) const
Returns
the handle factory used by the handles provider

◆ provide()

std::shared_ptr< IEditHandles > luciad::FeatureHandlesProvider::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.

◆ setGeometryHandlesProvider()

void luciad::FeatureHandlesProvider::setGeometryHandlesProvider ( std::shared_ptr< IGeometryHandlesProvider handlesProvider)

Sets the IGeometryHandlesProvider that is used.

If this method is not called, or if nullptr is passed, a default implementation is used.

Parameters
handlesProviderthe IGeometryHandlesProvider to use. Can be nullptr.

◆ setHandleFactory()

void luciad::FeatureHandlesProvider::setHandleFactory ( std::shared_ptr< IHandleFactory handleFactory)

Sets the IHandleFactory that is used by this handles provider to create a new translate handle.

If this method is not called, a default handle factory is used. You can change the behavior of this default handle factory by:

  • retrieving it
  • wrapping it with your own IHandleFactory implementation, by delegating to the default factory
  • omitting/replacing the handle that is returned
Parameters
handleFactorya handle factory