GlsAnimation Library  1.0.7
Provides classes and functions to support animating GL Studio objects programmatically or with script files
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
disti::GlsAnimation Class Referenceabstract

Base class for all animations. More...

#include <gls_animation.h>

Inheritance diagram for disti::GlsAnimation:
disti::GlsAnimationCollection disti::GlsAnimationReversalAdapter disti::GlsAnimationSubsetAdapter disti::GlsKeyframeAnimation

Public Types

typedef stdortr1::shared_ptr< GlsAnimationPtr
 Alias for easier reading.
 
typedef GlsKeyframeCurveBase::Key Key
 Alias for easier reading.
 
typedef GlsKeyframeCurveBase::KeyPair KeyPair
 Alias for easier reading.
 
typedef GlsKeyframeCurveBase::Size Size
 Alias for easier reading.
 

Public Member Functions

virtual ~GlsAnimation ()
 Destructor.
 
virtual bool SetDisplayFrame (DisplayFrame *displayFrame)=0
 
virtual bool IsReadyToAnimate () const =0
 Returns whether the display frame has been set and all the properties have been found.
 
virtual Key GetKey () const =0
 
virtual void SetKey (const Key &key)=0
 
virtual Key GetKeyRange () const =0
 
virtual KeyPair GetMinMaxKeys () const =0
 
virtual void Reset ()=0
 
const std::string & GetName () const
 Returns the given name of this animation sequence.
 
virtual GlsAnimation::Ptr Clone () const =0
 Clones an animation.
 
virtual std::vector< std::string > GetPropertyNames () const =0
 Returns a list of the property name(s) referenced by this animation.
 
virtual void RetargetPropertyNames (const std::vector< std::string > &propertyNames)=0
 
virtual void RetargetPropertyNames (const std::string &findStr, const std::string &replaceStr)=0
 
virtual Size CountPropertyNames () const =0
 Returns number of property names referenced by this animation.
 

Protected Member Functions

 GlsAnimation (const std::string &name)
 Constructor - for base classes only.
 

Protected Attributes

DisplayFrame * _displayFrame
 The display frame used for retargeting.
 

Detailed Description

Base class for all animations.

Member Function Documentation

virtual Key disti::GlsAnimation::GetKey ( ) const
pure virtual

Get the current key value for the animation.

Note
Returns NaN until SetKey() has been called.

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, disti::GlsAnimationCollection, and disti::GlsKeyframeAnimation.

virtual Key disti::GlsAnimation::GetKeyRange ( ) const
pure virtual

Returns the total range of the animation in the units of the key.

Note
If the miniumum and maximum key cannot be determined, this function returns NaN.

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, disti::GlsAnimationCollection, and disti::GlsKeyframeAnimation.

virtual KeyPair disti::GlsAnimation::GetMinMaxKeys ( ) const
pure virtual

Returns the minimum and maximum key values.

Note
If the miniumum and maximum cannot be determined, both are NaN.

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, disti::GlsAnimationCollection, and disti::GlsKeyframeAnimation.

virtual void disti::GlsAnimation::Reset ( )
pure virtual

Resets the key back to the default.

Note
Does not apply a new value to the property.
Postcondition
GetKey() is NaN

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, disti::GlsAnimationCollection, and disti::GlsKeyframeAnimation.

virtual void disti::GlsAnimation::RetargetPropertyNames ( const std::vector< std::string > &  propertyNames)
pure virtual

Sets the property name(s) for the animation.

Parameters
propertyNamesThe new list of property names in the same order as that returned from GetPropertyNames().
Note
If GLS_DEBUG is defined and the object has a display frame set but one or more properties are not found in the display frame, this call emits a warning(s) to the console.

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, disti::GlsAnimationCollection, and disti::GlsKeyframeAnimation.

virtual void disti::GlsAnimation::RetargetPropertyNames ( const std::string &  findStr,
const std::string &  replaceStr 
)
pure virtual

Sets the property name(s) for the animation.

Parameters
findStrThe substring to find.
replaceStrThe string to replace every instance of the found string with.
Note
If GLS_DEBUG is defined and the object has a display frame set but one or more properties are not found in the display frame, this call emits a warning(s) to the console.
This function is for convenience. If finer control is needed, use GetPropertyNames().

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, disti::GlsAnimationCollection, and disti::GlsKeyframeAnimation.

virtual bool disti::GlsAnimation::SetDisplayFrame ( DisplayFrame *  displayFrame)
pure virtual

Sets the display frame, to which the property values will be applied.

Parameters
displayFrameThe display frame object.
Returns
Status value defined by the subclass.
Precondition
displayFrame != NULL
Note
If GLS_DEBUG is defined, this function will print a warning message about properties that are not found in the display frame.

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, disti::GlsAnimationCollection, and disti::GlsKeyframeAnimation.

virtual void disti::GlsAnimation::SetKey ( const Key key)
pure virtual

Set the current key value for the animation, which performs the animation.

Parameters
keyThe key for the keyframe pair (usually time in seconds)
Note
If GLS_DEBUG is defined, this emits a warning(s) if IsReadyToAnimate() == false

Implemented in disti::GlsAnimationSubsetAdapter, disti::GlsAnimationReversalAdapter, and disti::GlsAnimationCollection.


The documentation for this class was generated from the following file: