LuciadCPillar 2023.1.04
luciad::MilitarySymbolFeatureHandlesProvider Class Referencefinal

Provides editing handles for military symbol features. More...

#include <luciad/symbology/military/MilitarySymbolFeatureHandlesProvider.h>

Inheritance diagram for luciad::MilitarySymbolFeatureHandlesProvider:
luciad::IFeatureHandlesProvider

Public Member Functions

 MilitarySymbolFeatureHandlesProvider ()=default
 Default constructor. More...
 
 ~MilitarySymbolFeatureHandlesProvider () override=default
 
bool canProvide (const std::shared_ptr< Observable< Feature > > &observableFeature, const std::shared_ptr< FeatureEditContext > &context) const override
 Indicates if this handles provider can create handles for the given Feature. More...
 
std::shared_ptr< IEditHandlesprovide (std::shared_ptr< Observable< Feature > > observableFeature, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IFeatureEditCallback > featureEditCallback) const override
 Returns handles for the given feature. 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

Provides editing handles for military symbol features.

Example usage

class MyEditConfiguration : public IFeatureEditConfiguration {
public:
void edit(const Feature& /*feature*/, LayerId /*layerId*/, const std::shared_ptr<Map>& /*map*/, FeatureEditConfigurationBuilder& builder) const override {
auto featureHandlesProvider = std::make_shared<MilitarySymbolFeatureHandlesProvider>();
builder.handlesProvider(std::move(featureHandlesProvider));
builder.submit();
}
};
void enableCustomEditing(const std::shared_ptr<IFeatureModel>& militarySymbologyModel) {
// Create a layer from a military symbols model and make it editable using a custom configuration
auto layer = FeatureLayer::newBuilder() //
.model(militarySymbologyModel)
.editable(true)
.editConfiguration(std::make_shared<MyEditConfiguration>())
.build();
}
This builder can be used to configure editing for a layer.
Definition: FeatureEditConfigurationBuilder.h:17
virtual void submit()=0
Submits the information to this builder, and confirm that the current feature can be edited.
virtual FeatureEditConfigurationBuilder & handlesProvider(std::shared_ptr< IFeatureHandlesProvider > handlesProvider)=0
Configures the handles provider that is used to provide the edit handles for a feature.
A Feature is a (partial) copy of a domain object.
Definition: Feature.h:34
std::shared_ptr< FeatureLayer > build() const
Returns a new layer, based on the properties set on this builder.
Builder & model(std::shared_ptr< IFeatureModel > model)
Sets the feature model of the layer.
Builder & editable(bool editable)
Sets whether the layer should be editable initially.
Builder & editConfiguration(std::shared_ptr< IFeatureEditConfiguration > editConfiguration)
Enables editing capabilities using the given IFeatureEditConfiguration.
static Builder newBuilder()
Returns a new builder for creating a FeatureLayer.
Allows you to configure the editing behavior for a feature layer.
Definition: IFeatureEditConfiguration.h:13
uint64_t LayerId
Definition: Layer.h:11
Since
2020.1
See also
Editor

Constructor & Destructor Documentation

◆ MilitarySymbolFeatureHandlesProvider()

luciad::MilitarySymbolFeatureHandlesProvider::MilitarySymbolFeatureHandlesProvider ( )
default

Default constructor.

◆ ~MilitarySymbolFeatureHandlesProvider()

luciad::MilitarySymbolFeatureHandlesProvider::~MilitarySymbolFeatureHandlesProvider ( )
overridedefault

Member Function Documentation

◆ canProvide()

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

◆ provide()

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