![]() |
LuciadCPillar 2024.1.04
|
Manages feature states. More...
#include <luciad/layers/features/FeatureStateManager.h>
Classes | |
class | Change |
This class is used to build feature state changes. More... | |
Public Member Functions | |
virtual | ~FeatureStateManager ()=default |
virtual void | addObserver (std::shared_ptr< IFeatureStateObserver > observer, bool seedObserver=false)=0 |
Adds an observer that allows to inspect feature state changes. More... | |
virtual void | applyStateChange (const Change &featureStateChange)=0 |
Applies the given state change. More... | |
virtual void | clearEnabledStates (const LayerFeatureId &layerFeatureId)=0 |
Clears (i.e. More... | |
virtual std::vector< FeatureId > | getFeaturesWithStateEnabled (LayerId layerId, const FeatureState &featureState) const =0 |
Returns the collection of feature IDs of the given layer for which the given feature state is enabled. More... | |
virtual bool | isStateEnabled (LayerFeatureId layerFeatureId, const FeatureState &featureState) const =0 |
Checks if the given feature state is enabled for the given feature identifier. More... | |
virtual void | removeObserver (const std::shared_ptr< IFeatureStateObserver > &observer)=0 |
Removes the given observer. More... | |
Manages feature states.
In essence, it keeps a mapping of enabled/disabled states for each feature for specific FeatureState instances. This class can for example manage which features are selected.
|
virtualdefault |
|
pure virtual |
Adds an observer that allows to inspect feature state changes.
Note: this method should only be called on the UI thread
observer | an observer |
seedObserver | whether to inform the observer about the features for which a FeatureState is currently enabled |
InvalidArgumentException | if the observer is already added. |
NullArgumentException | if observer is nullptr . |
|
pure virtual |
Applies the given state change.
After this call, the FeatureStateManager::isStateEnabled method will reflect the given changes, and the registered observers will have been notified of the concrete changes for each feature.
Note: this method should only be called on the UI thread
featureStateChange | a feature state change |
|
pure virtual |
Clears (i.e.
sets to false) all enabled stated for the given feature.
Note: this method should only be called on the UI thread
layerFeatureId | the feature for which to clear all enabled states. |
|
pure virtual |
Returns the collection of feature IDs of the given layer for which the given feature state is enabled.
Note: this method should only be called on the UI thread
layerId | a layer |
featureState | a feature state |
|
pure virtual |
Checks if the given feature state is enabled for the given feature identifier.
Note: this method can be called on any thread.
layerFeatureId | a feature identifier |
featureState | a feature state |
|
pure virtual |
Removes the given observer.
Note: this method should only be called on the UI thread
observer | an observer |
InvalidArgumentException | if the observer was not added. |
NullArgumentException | if observer is nullptr . |