All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MultiWidgets::AnimationCurve< T > Class Template Reference

This class represents an animation curve that stores key frames. More...

#include <MultiWidgets/AnimationCurve.hpp>

Inheritance diagram for MultiWidgets::AnimationCurve< T >:
MultiWidgets::IAnimationCurve

Public Member Functions

void addKey (float time, const T &value, InterpolationType interpolation=USE_PREV_KEYFRAME_TYPE)
 Add a key frame to the curve. More...
 
template<>
void addKey (float time, const bool &value, InterpolationType interpolation)
 
 AnimationCurve ()
 Construct an empty curve.
 
 AnimationCurve (const AnimationCurve &rhs)
 Construct a copy of a curve. More...
 
IAnimationCurveclone () const
 Return a copy of the curve. More...
 
bool deserialize (const Valuable::ArchiveElement &element)
 
virtual void evaluate (float t, Valuable::Attribute *attribute) const
 Evaluate the curve at given position. More...
 
evaluate (float t) const
 Evaluate the curve at given point. More...
 
template<>
bool evaluate (float t) const
 
const KeyFrame< T > & key (int i) const
 Get a key from the curve. More...
 
int keyCount () const
 Get the number of key frames in the curve. More...
 
virtual float length () const
 Returns the length of the animation in seconds. More...
 
void removeKey (int index)
 Remove a key from the curve. More...
 
void selectInterpolationType (typename Keyframes::iterator k1)
 Sets the interpolation type of the given key frame automatically. More...
 
Valuable::ArchiveElement serialize (Valuable::Archive &archive) const
 
- Public Member Functions inherited from MultiWidgets::IAnimationCurve
 IAnimationCurve ()
 Constructor.
 
virtual ~IAnimationCurve ()
 Destructor.
 

Detailed Description

template<class T>
class MultiWidgets::AnimationCurve< T >

This class represents an animation curve that stores key frames.

Examples:
AnimationExample.cpp.

Constructor & Destructor Documentation

template<class T>
MultiWidgets::AnimationCurve< T >::AnimationCurve ( const AnimationCurve< T > &  rhs)
inline

Construct a copy of a curve.

Parameters
rhscurve to copy

Member Function Documentation

template<class T>
void MultiWidgets::AnimationCurve< T >::addKey ( float  time,
const T &  value,
InterpolationType  interpolation = USE_PREV_KEYFRAME_TYPE 
)
inline

Add a key frame to the curve.

Parameters
timetime-value of the key frame
valuevalue of the the key frame at given point
interpolationinterpolation used between this key frame and the next
template<class T>
IAnimationCurve* MultiWidgets::AnimationCurve< T >::clone ( ) const
inlinevirtual

Return a copy of the curve.

Returns
copy of the curve

Implements MultiWidgets::IAnimationCurve.

template<class T>
virtual void MultiWidgets::AnimationCurve< T >::evaluate ( float  t,
Valuable::Attribute attribute 
) const
inlinevirtual

Evaluate the curve at given position.

Parameters
tevaluation point on the curve
attributeattribute to store the result into

Implements MultiWidgets::IAnimationCurve.

template<class T>
T MultiWidgets::AnimationCurve< T >::evaluate ( float  t) const
inline

Evaluate the curve at given point.

Parameters
tpoint to evaluate the curve at
Returns
curve value at given point
template<class T>
const KeyFrame<T>& MultiWidgets::AnimationCurve< T >::key ( int  i) const
inline

Get a key from the curve.

Parameters
iindex of the key to get
Returns
key with the given index
template<class T>
int MultiWidgets::AnimationCurve< T >::keyCount ( ) const
inline

Get the number of key frames in the curve.

Returns
number of key frames in the curve
template<class T>
virtual float MultiWidgets::AnimationCurve< T >::length ( ) const
inlinevirtual

Returns the length of the animation in seconds.

Returns
Length of the curve

Implements MultiWidgets::IAnimationCurve.

template<class T>
void MultiWidgets::AnimationCurve< T >::removeKey ( int  index)
inline

Remove a key from the curve.

Parameters
indexindex of the key to remove
template<class T>
void MultiWidgets::AnimationCurve< T >::selectInterpolationType ( typename Keyframes::iterator  k1)
inline

Sets the interpolation type of the given key frame automatically.

Parameters
k1Iterator to key-frame-sequence