![]() |
ImFusion SDK 4.3
|
#include <ImFusion/US/MotionTrajectoryModel.h>
This model allows users to define a set of keyframes—each associated with a specific frame index. More...
Inheritance diagram for KeyframeMotionModel:This model allows users to define a set of keyframes—each associated with a specific frame index.
These keyframes are used to interpolate transformation matrices for each integer frame in the range [0, m_size).
m_size are allowed.m_size - 1, all remaining frames will be filled with the matrix of the last keyframe.setParameters(). Therefore, all parameters in the internal vector (m_pars) are exposed, not just those associated with the current focus frame.applyFocus() and defineMotion() assume that the parameter vector contains at least 6 elements. Supplying fewer may result in undefined behavior or runtime errors. Public Member Functions | |
| KeyframeMotionModel (int size) | |
| std::string | name () const override |
| Returns the name of the current motion model. | |
| std::vector< mat4 > | defineMotion () const override |
| Computes a set of m_size matrices describing the intended motion trajectory. | |
| mat4 | fitMatrices (const std::vector< mat4 > &mat) override |
| Not Implemented. | |
| void | setFocus (int f) |
| Sets a new focus and sets all the elements of the current parameters to 0.0. | |
| int | focus () const |
| Gets an index of the current focus. | |
| void | applyFocus () |
| Applies the pose from current parameters to the keyframe at the focus index. | |
| void | configure (const Properties *p) override |
| Loads the current keyframe configuration from properties. | |
| void | configuration (Properties *p) const override |
| Stores the current keyframe configuration into properties. | |
| void | addKeyframe (int frame, const mat4 &matrix) |
| Adds a keyframe at the specified frame index. | |
| void | removeKeyframe (int frame) |
| Removes a keyframe at the specified frame index. | |
| bool | isKeyframe (int frame) const |
| Returns true if a keyframe exists at the given frame. | |
| mat4 | keyframeMatrix (int frame) const |
| Returns the transformation matrix of the specified keyframe. | |
| std::vector< int > | keyframes () const |
| Returns all frame indices that have associated keyframes. | |
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. | |
| virtual int | numberOfParameters () const |
| virtual std::vector< double > | parameters () const |
| virtual void | setParameters (const std::vector< double > &pars) |
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::map< int, mat4 > | m_keyFrames |
| Map of frame indices to transformation matrices. | |
| int | m_focus |
| Index of the currently selected (focused) keyframe. | |
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. | |
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 |
Computes a set of m_size matrices describing the intended motion trajectory.
Implements MotionTrajectoryModel.
|
overridevirtual |
Not Implemented.
Implements MotionTrajectoryModel.
| void applyFocus | ( | ) |
Applies the pose from current parameters to the keyframe at the focus index.
If a keyframe exists at the current focus, its matrix will be updated using the pose represented by the current parameters (assumed to be a 6D vector: translation + Euler angles).
|
overridevirtual |
Loads the current keyframe configuration from properties.
Looks for subproperties named "Keyframe", each of which can contain:
Reimplemented from Configurable.
|
overridevirtual |
Stores the current keyframe configuration into properties.
Writes subproperties named "Keyframe" for each defined keyframe. Each subproperty contains:
Reimplemented from Configurable.