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.
Example
bool selected = changeEvent.getChange(FeatureState::selected(), changedFeature);
std::string selectedMessage = selected ? "Selected" : "Deselected";
std::cout << "Feature " << changedFeature.featureId << " => " << selectedMessage << std::endl;
}
});
featureStateManager->addObserver(selectionObserver);
featureStateManager->applyStateChange(*change);
featureStateManager->removeObserver(selectionObserver);
This class is used by IFeatureStateObserver to pass information about FeatureState changes.
Definition: FeatureStateManager.h:19
std::vector< LayerFeatureId > getChangedFeatures(const FeatureState &featureState) const
Returns the list of features for which the given feature state has been changed.
static const FeatureState & selected()
A feature state representing an object that is selected.
static std::shared_ptr< FeatureStateManager::Change > create()
Returns a new, empty, FeatureStateManager::Change.
static std::shared_ptr< IFeatureStateObserver > create(std::function< void(const FeatureStateEvent &)> function)
Convenience method that can be used to construct a IFeatureStateObserver using a function (lambda).