Sleeping Wombat GUI  0.100
swGUI
Public Types | Public Member Functions | Private Attributes | List of all members
AnimEvaluator< KeyType, AddressType > Class Template Reference

Evaluates animation. More...

#include <AnimEvaluator.h>

Public Types

typedef IInterpolator< KeyTypeInterpolator
 

Public Member Functions

 AnimEvaluator ()=default
 Constructor for serialization only. More...
 
 AnimEvaluator (EngineObject *object, const std::string &propertyPath)
 
 ~AnimEvaluator ()=default
 
void Evaluate (EngineObject *object, TimeType time)
 
bool AddKey (TimeType time, const KeyType &value)
 Adds key and sets default interpolator. More...
 
bool AddKey (TimeType time, const KeyType &value, InterpolatorType interpolatorType)
 Adds key and sets given interpolator. More...
 
bool UpdateKey (TimeType time, const KeyType &newValue, UPtr< Interpolator > &&interpolator)
 Udates key given by time. Sets new interpolator. More...
 
bool UpdateKey (TimeType time, const KeyType &newValue)
 Updates key. Leaves interpolator unchanged. More...
 
bool RemoveKey (TimeType time)
 Removes key in given time. More...
 
bool ChangeInterpolator (Size idx, UPtr< Interpolator > &&interpolator)
 Updates interpolator. Key remains unchanged. More...
 
const Key< KeyType > * GetKey (TimeType time)
 Return key in given time. More...
 
virtual KeySet< KeyType > & GetKeySet ()
 Returns KeySet. More...
 

Private Attributes

KeySet< KeyTypem_keySet
 
AddressType m_param
 

Detailed Description

template<typename KeyType, typename AddressType>
class AnimEvaluator< KeyType, AddressType >

Evaluates animation.

Uses m_keySet to interpolate animation value and sets it to m_param.

Template parameter AddressType is class which is used to set parameter value. You can provide your own classes or apply build in objects. This library implements parameters using rttr library.

See also
DirectProperty, PropertyPath, StringPropertyPath.

Member Typedef Documentation

template<typename KeyType, typename AddressType>
typedef IInterpolator< KeyType > AnimEvaluator< KeyType, AddressType >::Interpolator

Constructor & Destructor Documentation

template<typename KeyType, typename AddressType>
AnimEvaluator< KeyType, AddressType >::AnimEvaluator ( )
explicitdefault

Constructor for serialization only.

template<typename KeyType , typename AddressType >
AnimEvaluator< KeyType, AddressType >::AnimEvaluator ( EngineObject object,
const std::string &  propertyPath 
)
inlineexplicit
template<typename KeyType, typename AddressType>
AnimEvaluator< KeyType, AddressType >::~AnimEvaluator ( )
default

Member Function Documentation

template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::AddKey ( TimeType  time,
const KeyType value 
)
inline

Adds key and sets default interpolator.

Returns
False if key already exists.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::AddKey ( TimeType  time,
const KeyType value,
InterpolatorType  interpolatorType 
)
inline

Adds key and sets given interpolator.

Returns
False if key already exists.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::ChangeInterpolator ( Size  idx,
UPtr< Interpolator > &&  interpolator 
)
inline

Updates interpolator. Key remains unchanged.

Returns
False if There's no key in given time.
template<typename KeyType , typename AddressType >
void AnimEvaluator< KeyType, AddressType >::Evaluate ( EngineObject object,
TimeType  time 
)
inline
template<typename KeyType , typename AddressType >
const Key< KeyType > * AnimEvaluator< KeyType, AddressType >::GetKey ( TimeType  time)
inline

Return key in given time.

template<typename KeyType , typename AddressType >
KeySet< KeyType > & AnimEvaluator< KeyType, AddressType >::GetKeySet ( )
inlinevirtual

Returns KeySet.

template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::RemoveKey ( TimeType  time)
inline

Removes key in given time.

Returns
False if There's no key in given time.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::UpdateKey ( TimeType  time,
const KeyType newValue,
UPtr< Interpolator > &&  interpolator 
)
inline

Udates key given by time. Sets new interpolator.

Returns
False if There's no key in given time.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::UpdateKey ( TimeType  time,
const KeyType newValue 
)
inline

Updates key. Leaves interpolator unchanged.

Returns
False if There's no key in given time.

Member Data Documentation

template<typename KeyType, typename AddressType>
KeySet< KeyType > AnimEvaluator< KeyType, AddressType >::m_keySet
private
template<typename KeyType, typename AddressType>
AddressType AnimEvaluator< KeyType, AddressType >::m_param
private

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