ImFusion SDK 4.3
TransformationStashDataComponent Class Reference

#include <ImFusion/Base/TransformationStashDataComponent.h>

The TransformationStashDataComponent class is a DataComponent that stores transformations. More...

+ Inheritance diagram for TransformationStashDataComponent:

Detailed Description

The TransformationStashDataComponent class is a DataComponent that stores transformations.

An instance always contains a original transformation and optional a arbitrary number of stored transformations. Transformations are stored as a list of matrices to be able to save and restore the matrices of a SharedImageSet. For other Data types the list usually contains only a single element.

Public Member Functions

 TransformationStashDataComponent (const Data *data)
 Creates a new instance with the current matrix of data as the original matrix.
 
 TransformationStashDataComponent (const std::vector< mat4 > &original={mat4::Identity()})
 
bool operator== (const TransformationStashDataComponent &rhs) const
 
std::string id () const override
 Returns a unique string identifier for this type of data component.
 
void setOriginal (const std::vector< mat4 > &matrix)
 Sets the original transformation.
 
const std::vector< mat4 > & original () const
 Returns the original transformation.
 
void append (const mat4 &matrix)
 Equivalent to append({matrix}, "")
 
void append (const mat4 &matrix, const std::string &name)
 Equivalent to append({matrix}, name)
 
void append (const std::vector< mat4 > &transformations)
 Equivalent to append(transformations, name)
 
void append (const std::vector< mat4 > &transformations, const std::string &name)
 Appends a new transformation to the stored matrices.
 
void erase (int index)
 Erases the stored transformation at the given index.
 
void rename (int index, const std::string &name)
 Renames the stored transformation at the given index.
 
int numStored () const
 Returns the number of stored transformations.
 
const std::deque< std::vector< mat4 > > & transformations () const
 Returns all stored transformations.
 
const std::deque< std::string > & names () const
 Returns the names of all stored transformations.
 
void configure (const TransformationStashDataComponent &other)
 Convenient method to copy the configuration of this instance to the given instance.
 
void configure (const Properties *p) override
 Configure this object instance by de-serializing the given Properties.
 
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
 
- Public Member Functions inherited from DataComponent< TransformationStashDataComponent >
std::unique_ptr< DataComponentBaseclone () const override
 Creates a clone of this data component.
 
std::unique_ptr< SubclasscloneDerived () 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
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Public Attributes

Signal signalChanged
 Emitted when a transformation was added, removed or renamed.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Additional Inherited Members

- Protected Member Functions inherited from DataComponentBase
 DataComponentBase (const DataComponentBase &)=default
 
DataComponentBaseoperator= (const DataComponentBase &other)=default
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ id()

std::string id ( ) const
overridevirtual

Returns a unique string identifier for this type of data component.

Note
To avoid conflicts make sure to include potential plugin names into this ID. Due to the modular architecture of the ImFusion library, uniqueness of IDs cannot be checked at compile time. However, DataComponentFactory will check the uniqueness of the ID during registration.

Implements DataComponentBase.

◆ append()

void append ( const std::vector< mat4 > & transformations,
const std::string & name )

Appends a new transformation to the stored matrices.

If name is empty, a default name is generated. In this case, the method ensures that name will be unique. On return, the reference will contain the final name.

◆ erase()

void erase ( int index)

Erases the stored transformation at the given index.

Does nothing if the index is invalid.

◆ rename()

void rename ( int index,
const std::string & name )

Renames the stored transformation at the given index.

Does NOT ensure that the name is unique.

◆ numStored()

int numStored ( ) const

Returns the number of stored transformations.

This does NOT contain the original transformation.

◆ transformations()

const std::deque< std::vector< mat4 > > & transformations ( ) const

Returns all stored transformations.

This does NOT contain the original transformation.

◆ names()

const std::deque< std::string > & names ( ) const

Returns the names of all stored transformations.

This does NOT contain the original transformation.

◆ configure() [1/2]

void configure ( const TransformationStashDataComponent & other)

Convenient method to copy the configuration of this instance to the given instance.

Contrary to the assignment operator, this does not modify the signals.

◆ configure() [2/2]

void configure ( const Properties * p)
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.

See also
configuration() for the inverse functionality

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
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.

See also
configure() for the inverse functionality

Reimplemented from Configurable.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close