![]() |
ImFusion SDK 4.3
|
#include <ImFusion/US/MotionTrajectoryModel.h>
Motion model that composes multiple motion models into a single unified model. More...
Inheritance diagram for ComposedMotionModel:Motion model that composes multiple motion models into a single unified model.
This class allows multiple motions to be added and combined into one. Models are added using templated functions that create new motion model instances of the specified type. These sub-models can be configured using overridden motion model functions, which are forwarded to the currently active model.
Public Member Functions | |
| ComposedMotionModel (int size) | |
| std::string | name () const override |
| Returns the name of the current motion model. | |
| std::vector< mat4 > | defineMotion () const override |
| Returns the composed motion from all added models. | |
| void | configure (const Properties *p) override |
| Configures and initializes motion sub-models from the provided properties. | |
| void | configuration (Properties *p) const override |
| Exports the current configuration of all sub-models into the given Properties object. | |
| template<class T> | |
| T * | add () |
| Create a motion model of the specified class and set it as active. | |
| template<class T> | |
| T * | setActive () |
| Sets the first added model of the specified type as active. | |
| const MotionTrajectoryModel * | get () const |
| Returns a const pointer to the active motion model. | |
| MotionTrajectoryModel * | get () |
| Returns a pointer to the active motion model. | |
| template<class T> | |
| T * | get () |
| Returns a pointer to the first added model of the specified type or nullptr if no model is found. | |
Public Member Functions inherited from MotionTrajectoryModel | |
| MotionTrajectoryModel (int size) | |
| void | setRelativeShiftMatrix (const mat4 &relShiftBefore) |
| Sets the relative shift matrix applied before the motion. | |
| void | configure (const Properties *p) override |
| Sets one or multiple properties. | |
| void | configuration (Properties *p) const override |
| Retrieve the properties of this object. | |
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 |
Protected Attributes | |
| std::vector< std::unique_ptr< MotionTrajectoryModel > > | m_models |
| int | m_activeModel |
Protected Attributes inherited from MotionTrajectoryModel | |
| const int | m_size |
| Size of the model, regularly the number of frames. | |
| std::vector< double > | m_pars |
| Full motion parameter vector - not necessarily the exposed ones. | |
| mat4 | m_relShift |
| Generic helper matrix to incorporate optional shifts. Considered by rigidMotion(). | |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
Interface methods forwarded to the currently active model | |
| int | numberOfParameters () const override |
| Returns the number of parameters in the active model. | |
| std::vector< double > | parameters () const override |
| Returns the parameters of the active model. | |
| void | setParameters (const std::vector< double > &pars) override |
| Sets the parameters of the active model. | |
| mat4 | fitMatrices (const std::vector< mat4 > &mat) override |
| Fits input motion data to the active model. | |
Additional Inherited Members | |
Public Types inherited from MotionTrajectoryModel | |
| typedef std::function< MotionTrajectoryModel *(int)> | createModelFunc |
| Function signature for creating a motion model with a given size. | |
Static Public Member Functions inherited from MotionTrajectoryModel | |
| static std::vector< std::pair< std::string, createModelFunc > > & | supportedModels () |
| Returns a list of supported motion models. | |
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 MotionTrajectoryModel | |
| std::vector< mat4 > | rigidMotion (const mat4 &m0, const mat4 &m1, int startFrame=0, int endFrame=-1) const |
| Helper method to interpolate a rigid motion between m0 and m1. | |
|
explicit |
| size | The number of frames in the motion sequence. |
|
inlineoverridevirtual |
Returns the name of the current motion model.
Implements MotionTrajectoryModel.
|
overridevirtual |
Returns the number of parameters in the active model.
Reimplemented from MotionTrajectoryModel.
|
overridevirtual |
Returns the parameters of the active model.
Reimplemented from MotionTrajectoryModel.
|
overridevirtual |
Sets the parameters of the active model.
Reimplemented from MotionTrajectoryModel.
|
overridevirtual |
Fits input motion data to the active model.
Implements MotionTrajectoryModel.
|
overridevirtual |
Returns the composed motion from all added models.
Implements MotionTrajectoryModel.
|
overridevirtual |
Configures and initializes motion sub-models from the provided properties.
This method searches for the sub-properties the given properties object to initialize and configure one or more sub-models. Each sub-property within p is checked against the list of registered model names (as returned by supportedModels()). If a match is found, a corresponding motion model is instantiated, configured using its sub-properties, and added to the composed model.
Additionally, if a property named "activeModel" is present, its value is used to set the index of the active sub-model.
Reimplemented from Configurable.
|
overridevirtual |
Exports the current configuration of all sub-models into the given Properties object.
It also sets the "activeModel" property to reflect the currently active model.
Reimplemented from Configurable.
|
inline |
Create a motion model of the specified class and set it as active.
| T | The type of the motion model to create. |
|
inline |
Sets the first added model of the specified type as active.
| T | The type of the motion model to activate. |
|
inline |
Returns a pointer to the first added model of the specified type or nullptr if no model is found.
| T | The type of motion model to retrieve. |