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

KeyFrame class represents an animation keyframe. More...

#include <MultiWidgets/KeyFrame.hpp>

Inheritance diagram for MultiWidgets::KeyFrame< T >:
Valuable::Serializable

Public Member Functions

virtual bool deserialize (const Valuable::ArchiveElement &element)
 Deserializes (reads) this object from serializer element. More...
 
 KeyFrame (float time, const T &value, InterpolationType interpolation=CUBIC)
 Constructs a new keyframe. More...
 
 KeyFrame (float time, const T &value, const T &tIn, const T &tOut, InterpolationType interpolation=CUBIC)
 Constructs a new keyframe. More...
 
bool operator< (const KeyFrame< T > &k) const
 Sort keyframes by time.
 
virtual Valuable::ArchiveElement serialize (Valuable::Archive &archive) const
 Serializes (writes) this object to an element. More...
 
- Public Member Functions inherited from Valuable::Serializable
virtual bool deserializeXML (const DOMElement &element)
 Deserializes (reads) this object from an XML element. More...
 
bool isSerializable () const
 
void setSerializable (bool v)
 

Public Attributes

InterpolationType m_interpolation
 Interpolation type used.
 
m_tangentIn
 In-coming tangent.
 
m_tangentOut
 Out-going tangent.
 
float m_time
 Time position of the keyframe.
 
m_value
 Value of the keyframe.
 

Detailed Description

template<class T>
class MultiWidgets::KeyFrame< T >

KeyFrame class represents an animation keyframe.

It stores the value of an animated attribute at the given time. It also defines the in-coming and out-going tangents at that position. The tangents are stored as offsets to the actual keyframe value. The keyframe also defines the interpolation used to compute the values between this keyframe and the next.

Constructor & Destructor Documentation

template<class T >
MultiWidgets::KeyFrame< T >::KeyFrame ( float  time,
const T &  value,
InterpolationType  interpolation = CUBIC 
)
inline

Constructs a new keyframe.

Parameters
timetime of the keyframe
valuevalue of the keyframe
interpolationinterpolation type that specifies how values between keyframes should be interpolated
See Also
MultiWidgets::InterpolationType
template<class T >
MultiWidgets::KeyFrame< T >::KeyFrame ( float  time,
const T &  value,
const T &  tIn,
const T &  tOut,
InterpolationType  interpolation = CUBIC 
)
inline

Constructs a new keyframe.

Parameters
timetime of the keyframe
valuevalue of the keyframe
tInincoming tangent value
tOutoutgoing tangent value
interpolationinterpolation type that specifies how values between keyframes should be interpolated
See Also
MultiWidgets::InterpolationType

Member Function Documentation

template<class T >
virtual bool MultiWidgets::KeyFrame< T >::deserialize ( const Valuable::ArchiveElement element)
inlinevirtual

Deserializes (reads) this object from serializer element.

Parameters
elementSerialized element that holds the data that should be deserialized.
Returns
Returns true if the read process worked correctly, and false otherwise.

Implements Valuable::Serializable.

template<class T >
virtual Valuable::ArchiveElement MultiWidgets::KeyFrame< T >::serialize ( Valuable::Archive archive) const
inlinevirtual

Serializes (writes) this object to an element.

Parameters
archiveThe serializer archive that is used to create the new element and maintains the serialization state and options.
Returns
The new serialized element.

Implements Valuable::Serializable.