![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/PointsStorageComponent.h>
Data component for storing and managing point sets. More...
Inheritance diagram for PointsStorageComponent:Data component for storing and managing point sets.
This component allows you to store multiple point sets, each identified by a unique name. Each point set can be of a specific type derived from PointsOnData, and you can retrieve or create point sets with the specified type and name. This component keeps track of the created points sets offering automatic persistence and sharing between algorithms. Example usage:
Public Member Functions | |
| bool | operator== (const PointsStorageComponent &) const |
| template<class T, class DataType, std::enable_if_t< std::is_base_of_v< PointsOnData, T >, bool > = 0, std::enable_if_t< std::is_base_of_v< Data, DataType >, bool > = 0> | |
| std::shared_ptr< T > | getOrCreate (DataType &data, const std::string &name) |
| Get a PointsOnData instance with the specified name and type. | |
| bool | add (const std::string &name, const PointsOnData *pod) |
| Adds a new point set with the specified name. | |
| bool | addConfiguration (const std::string &name, std::unique_ptr< Properties > properties) |
| Adds the configuration of a new point set with the specified name. | |
| std::vector< std::string > | names () const |
| List all point set names stored by the component. | |
| bool | contains (const std::string &name) const |
| Check if a point set with the specified name exists. | |
| std::string | id () const override |
| Returns a unique string identifier for this type of data component. | |
| void | configure (const Properties *) override |
| Configure this object instance by de-serializing the given Properties. | |
| void | configuration (Properties *) const override |
| Serialize the current object configuration into the given Properties object. | |
| Properties * | getConfiguration (const std::string &name) const |
Public Member Functions inherited from DataComponent< PointsStorageComponent > | |
| std::unique_ptr< DataComponentBase > | clone () const override |
| Creates a clone of this data component. | |
| std::unique_ptr< Subclass > | cloneDerived () const |
| bool | assign (const DataComponentBase &other) override |
| Assigns the content of other to this data component. | |
| bool | equals (const DataComponentBase &other) const override |
| Compares this data component to other for equality. | |
Public Member Functions inherited from Configurable | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Public Member Functions inherited from SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
Static Public Member Functions | |
| template<class T, class DataType, std::enable_if_t< std::is_base_of_v< PointsOnData, T >, bool > = 0, std::enable_if_t< std::is_base_of_v< Data, DataType >, bool > = 0> | |
| static std::shared_ptr< T > | getOrCreatePoints (DataType &data, const std::string &name) |
| Get a PointsOnData instance associated to the provided data, with the specified name and type. | |
Additional Inherited Members | |
Public Attributes inherited from Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Protected Member Functions inherited from DataComponentBase | |
| DataComponentBase (const DataComponentBase &)=default | |
| DataComponentBase & | operator= (const DataComponentBase &other)=default |
Protected Member Functions inherited from SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
inlinestatic |
Get a PointsOnData instance associated to the provided data, with the specified name and type.
This is a convenience function that retrieves the PointsStorageComponent from the data and calls getOrCreate() on it.
|
inline |
Get a PointsOnData instance with the specified name and type.
If the instance does not exist yet, it will be created. If it exists and is of the requested type, a shared pointer to it is returned.
| bool add | ( | const std::string & | name, |
| const PointsOnData * | pod ) |
Adds a new point set with the specified name.
| bool addConfiguration | ( | const std::string & | name, |
| std::unique_ptr< Properties > | properties ) |
Adds the configuration of a new point set with the specified name.
If a point set with the same name already exists, it will not be overwritten and this function will fail (return false).
|
inlineoverridevirtual |
Returns a unique string identifier for this type of data component.
Implements DataComponentBase.
|
overridevirtual |
Configure this object instance by de-serializing the given Properties.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from Configurable.
|
overridevirtual |
Serialize the current object configuration into the given Properties object.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from Configurable.