AnimaL |
Tutorial |
Documentation |
#include <morphingEngine.h>
Inheritance diagram for animal::MorphingEngine< Morphings, Real >:

These datas are defined with the template type named Morphings.
Morphings::Values correspond to all types of vectors whose entries can be accessed using operator[] and whose size can be computed. These conditions are due to the use of linear.h and container_traits.hpp. If these conditions are not respected, you can define in a new file your own functions, v_eq(Y,X) (Y=X), v_eq_ab(Y, a, X) (Y=aX, a is a real), v_peq_ab(Y, a, X) (Y+=aX, a is a real).
Morphings::Keys correspond to real or to an integer.
Definition at line 28 of file morphingEngine.h.
Public Member Functions | |
| MorphingEngine () | |
| Constructor. | |
| virtual | ~MorphingEngine () |
| Destructor. | |
| void | setCurrentKey (Key k) |
| Set the current key. | |
| void | setVelocity (Real v) |
| Set the velocity. | |
| void | toggleCatmullRomMethod (bool b) |
| Set the _interpolationID to 1, i.e. the Catmull Rom method. | |
| void | toggleLinearMethod (bool b) |
| Set the _interpolationID to 0, i.e. the Linear method. | |
| void | setMorphings (Morphings *k) |
| Set the _morphings. | |
| void | setInitialKey (Key k) |
| Set the _initialKey. | |
| int * | getInterpolationID () |
| Get the _interpolationID. | |
| Real * | getVelocity () |
| Get the velocity. | |
| Morphings * | getMorphings () |
| Get the _morphings. | |
| Key * | getInitialKey () |
| Get the _initialKey. | |
Virtual methods from animal::Engine | |
| virtual void | reset () |
| Initialize the positions. | |
| virtual void | move (double dt) |
| Move the engine. | |
| virtual void | draw () |
| Draw the engine, i.e. the generated trajectory. | |
Protected Types | |
| typedef Morphings::Key | Key |
| Types for the datas. | |
| typedef Morphings::Values | Values |
Protected Member Functions | |
| bool | computeInterpolatedValues (Key key) |
| Compute the interpolated values at the given key. | |
| bool | searchRange (const Key key, Key &key0, Key &key1) |
| Search the range [key0, key1[ of the key. | |
Protected Attributes | |
| Values * | _positions |
| The animated positions. | |
| Morphings * | _morphings |
| Data structure composed of pairs of (key, values) to define all the frames Keys are time or frame numbers) and values can be vectors for the interpolated values (for example a list of 2D points). | |
| int | _interpolationID |
| The interpolation method identificator:. | |
| Key | _currentKey |
| The current frame. | |
| Key | _initialKey |
| The initial frame. | |
| Real | _velocity |
| The velocity. | |
Private Member Functions | |
| void | printMorphings () |
| Print all the key frames. | |
| bool | begin (Key &key) |
| Give the first key of the interpolated path. | |
| bool | searchKeys (const Key key, Key &key0, Key &key1, Key &key2, Key &key3) |
| Search the keys such as key0 < key1 <= key < key2 < key3. | |
| bool | computeLinearInterpolation (const Key key) |
| Compute a linear interpolation of the values. | |
| bool | computeCatmullRomInterpolation (const Key key) |
| Compute a Catmull-Rom interpolation of the values. | |
|
|||||
|
|||||
|
Definition at line 33 of file morphingEngine.h. |
|
|||||||||
|
Constructor.
Definition at line 18 of file morphingEngine.inl. |
|
|||||||||
|
Destructor.
Definition at line 30 of file morphingEngine.inl. |
|
||||||||||
|
Give the first key of the interpolated path.
Definition at line 115 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_interpolationID, animal::MorphingEngine< Morphings, Real >::_morphings, and animal::MorphingEngine< Morphings, Real >::Key. |
|
||||||||||
|
Compute a Catmull-Rom interpolation of the values.
Definition at line 300 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_morphings, animal::MorphingEngine< Morphings, Real >::_positions, animal::MorphingEngine< Morphings, Real >::Key, animal::MorphingEngine< Morphings, Real >::searchKeys(), animal::v_eq(), animal::v_eq_ab(), and animal::v_peq_ab(). Referenced by animal::MorphingEngine< Morphings, Real >::computeInterpolatedValues(). |
|
||||||||||
|
Compute the interpolated values at the given key.
Definition at line 139 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_interpolationID, animal::MorphingEngine< Morphings, Real >::computeCatmullRomInterpolation(), animal::MorphingEngine< Morphings, Real >::computeLinearInterpolation(), and animal::MorphingEngine< Morphings, Real >::Key. Referenced by animal::MorphingEngine< Morphings, Real >::move(), and animal::MorphingEngine< Morphings, Real >::reset(). |
|
||||||||||
|
Compute a linear interpolation of the values.
Definition at line 261 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_morphings, animal::MorphingEngine< Morphings, Real >::_positions, animal::MorphingEngine< Morphings, Real >::Key, animal::MorphingEngine< Morphings, Real >::searchRange(), animal::v_eq(), animal::v_eq_ab(), and animal::v_peq_ab(). Referenced by animal::MorphingEngine< Morphings, Real >::computeInterpolatedValues(). |
|
|||||||||
|
Draw the engine, i.e. the generated trajectory.
Reimplemented from animal::Engine. Reimplemented in X3DTK::X3D::AnimalEngineNode< AMorphingEngine >. Definition at line 53 of file morphingEngine.h. |
|
|||||||||
|
Get the _initialKey.
Definition at line 86 of file morphingEngine.h. |
|
|||||||||
|
Get the _interpolationID.
Definition at line 77 of file morphingEngine.h. Referenced by X3DTK::Qt::createMorphingNodeQWidget(), and X3DTK::Qt::MorphingEngineQt::MorphingEngineQt(). |
|
|||||||||
|
Get the _morphings.
Definition at line 83 of file morphingEngine.h. |
|
|||||||||
|
Get the velocity.
Definition at line 80 of file morphingEngine.h. Referenced by X3DTK::Qt::MorphingEngineQt::MorphingEngineQt(). |
|
||||||||||
|
Move the engine.
Reimplemented from animal::Engine. Definition at line 53 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_currentKey, animal::MorphingEngine< Morphings, Real >::_morphings, animal::MorphingEngine< Morphings, Real >::_positions, animal::MorphingEngine< Morphings, Real >::_velocity, and animal::MorphingEngine< Morphings, Real >::computeInterpolatedValues(). |
|
|||||||||
|
Print all the key frames.
Definition at line 100 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_morphings. |
|
|||||||||
|
Initialize the positions.
Reimplemented from animal::Engine. Reimplemented in X3DTK::X3D::AnimalEngineNode< AMorphingEngine >. Definition at line 42 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_currentKey, animal::MorphingEngine< Morphings, Real >::_initialKey, animal::MorphingEngine< Morphings, Real >::_morphings, animal::MorphingEngine< Morphings, Real >::_positions, and animal::MorphingEngine< Morphings, Real >::computeInterpolatedValues(). |
|
||||||||||||||||||||||||||||
|
Search the keys such as key0 < key1 <= key < key2 < key3.
Definition at line 216 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_morphings, animal::MorphingEngine< Morphings, Real >::Key, and animal::MorphingEngine< Morphings, Real >::searchRange(). Referenced by animal::MorphingEngine< Morphings, Real >::computeCatmullRomInterpolation(). |
|
||||||||||||||||||||
|
Search the range [key0, key1[ of the key.
Definition at line 173 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_morphings, and animal::MorphingEngine< Morphings, Real >::Key. Referenced by animal::MorphingEngine< Morphings, Real >::computeLinearInterpolation(), and animal::MorphingEngine< Morphings, Real >::searchKeys(). |
|
||||||||||
|
Set the current key.
Definition at line 65 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_currentKey, and animal::MorphingEngine< Morphings, Real >::Key. |
|
||||||||||
|
Set the _initialKey.
Definition at line 73 of file morphingEngine.h. |
|
||||||||||
|
Set the _morphings.
Definition at line 70 of file morphingEngine.h. |
|
||||||||||
|
Set the velocity.
Definition at line 62 of file morphingEngine.h. Referenced by X3DTK::Qt::MorphingEngineQt::changeVelocity(). |
|
||||||||||
|
Set the _interpolationID to 1, i.e. the Catmull Rom method.
Definition at line 74 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_interpolationID. Referenced by X3DTK::Qt::MorphingEngineQt::toggleCatmullRomMethod(). |
|
||||||||||
|
Set the _interpolationID to 0, i.e. the Linear method.
Definition at line 85 of file morphingEngine.inl. References animal::MorphingEngine< Morphings, Real >::_interpolationID. Referenced by X3DTK::Qt::MorphingEngineQt::toggleLinearMethod(). |
|
|||||
|
The current frame.
Definition at line 153 of file morphingEngine.h. Referenced by animal::MorphingEngine< Morphings, Real >::move(), animal::MorphingEngine< Morphings, Real >::reset(), and animal::MorphingEngine< Morphings, Real >::setCurrentKey(). |
|
|||||
|
The initial frame.
Definition at line 156 of file morphingEngine.h. Referenced by animal::MorphingEngine< Morphings, Real >::reset(). |
|
|||||
|
The interpolation method identificator:.
Definition at line 150 of file morphingEngine.h. Referenced by animal::MorphingEngine< Morphings, Real >::begin(), animal::MorphingEngine< Morphings, Real >::computeInterpolatedValues(), animal::MorphingEngine< Morphings, Real >::toggleCatmullRomMethod(), and animal::MorphingEngine< Morphings, Real >::toggleLinearMethod(). |
|
|||||
|
Data structure composed of pairs of (key, values) to define all the frames Keys are time or frame numbers) and values can be vectors for the interpolated values (for example a list of 2D points).
Definition at line 143 of file morphingEngine.h. Referenced by animal::MorphingEngine< Morphings, Real >::begin(), animal::MorphingEngine< Morphings, Real >::computeCatmullRomInterpolation(), animal::MorphingEngine< Morphings, Real >::computeLinearInterpolation(), animal::MorphingEngine< Morphings, Real >::move(), animal::MorphingEngine< Morphings, Real >::printMorphings(), animal::MorphingEngine< Morphings, Real >::reset(), animal::MorphingEngine< Morphings, Real >::searchKeys(), and animal::MorphingEngine< Morphings, Real >::searchRange(). |
|
|||||
|
The animated positions.
Definition at line 137 of file morphingEngine.h. Referenced by animal::MorphingEngine< Morphings, Real >::computeCatmullRomInterpolation(), animal::MorphingEngine< Morphings, Real >::computeLinearInterpolation(), animal::MorphingEngine< Morphings, Real >::move(), and animal::MorphingEngine< Morphings, Real >::reset(). |
|
|||||
|
The velocity.
Definition at line 159 of file morphingEngine.h. Referenced by animal::MorphingEngine< Morphings, Real >::move(). |
1.3.6