soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
TValueAnimator< T > Class Template Reference

Template class for creating value animators. More...

#include <SValueAnimator.h>

Inheritance diagram for TValueAnimator< T >:
SValueAnimator TObjRefImpl< SObjectImpl< IValueAnimator > > ITimelineHandler SObjectImpl< IValueAnimator >

Public Member Functions

 TValueAnimator (T from, T to)
 Constructor.
 
getValue () const
 Gets the current animated value.
 
void setRange (T from, T to)
 Sets the range of the animation.
 
void copy (const IValueAnimator *pSrc) OVERRIDE
 Copies the properties of another animation to this animation.
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 Defines the attributes for TValueAnimator.
 
- Public Member Functions inherited from SValueAnimator
 SValueAnimator ()
 Creates a new SValueAnimator object.
 
 ~SValueAnimator ()
 Destructor.
 
void setDuration (long duration) OVERRIDE
 Sets the length of the animation.
 
long getDuration () SCONST OVERRIDE
 Gets the length of the animation.
 
long getTotalDuration () SCONST OVERRIDE
 Gets the total duration of the animation, including any repetitions.
 
void setCurrentPlayTime (long playTime) OVERRIDE
 Sets the position of the animation to the specified point in time.
 
void setCurrentFraction (float fraction) OVERRIDE
 Sets the position of the animation to the specified fraction.
 
long getCurrentPlayTime () OVERRIDE
 Gets the current position of the animation in time.
 
long getStartDelay () SCONST OVERRIDE
 Gets the amount of time, in milliseconds, to delay starting the animation after start() is called.
 
void setStartDelay (long startDelay) OVERRIDE
 Sets the amount of time, in milliseconds, to delay starting the animation after start() is called.
 
void setRepeatCount (int value) OVERRIDE
 Sets how many times the animation should be repeated.
 
int getRepeatCount () SCONST OVERRIDE
 Defines how many times the animation should repeat.
 
void setRepeatMode (RepeatMode value) OVERRIDE
 Defines what this animation should do when it reaches the end.
 
RepeatMode getRepeatMode () SCONST OVERRIDE
 Defines what this animation should do when it reaches the end.
 
void addUpdateListener (IAnimatorUpdateListener *listener) OVERRIDE
 Adds a listener to the set of listeners that are sent update events through the life of an animation.
 
void removeAllUpdateListeners () OVERRIDE
 Removes all listeners from the set listening to frame updates for this animation.
 
void removeUpdateListener (IAnimatorUpdateListener *listener) OVERRIDE
 Removes a listener from the set listening to frame updates for this animation.
 
void setInterpolator (IInterpolator *value) OVERRIDE
 Sets the time interpolator used in calculating the elapsed fraction of this animation.
 
IInterpolator * getInterpolator () SCONST OVERRIDE
 Returns the timing interpolator that this SValueAnimator uses.
 
void addListener (IAnimatorListener *p) OVERRIDE
 Adds an animator listener.
 
void removeListener (IAnimatorListener *p) OVERRIDE
 Removes an animator listener.
 
void start (ITimelineHandlersMgr *pContainer) OVERRIDE
 Starts the animation playing.
 
void end () OVERRIDE
 Ends the animation.
 
BOOL isRunning () SCONST OVERRIDE
 Checks if the animation is running.
 
BOOL isStarted () SCONST OVERRIDE
 Checks if the animation has been started.
 
void reverse () OVERRIDE
 Plays the SValueAnimator in reverse.
 
IValueAnimator * clone () SCONST OVERRIDE
 Creates a clone of the current animation.
 
void copy (const IValueAnimator *pSrc) OVERRIDE
 Copies the properties of another animation to this animation.
 
void commitAnimationFrame (long frameTime) OVERRIDE
 Applies an adjustment to the animation to compensate for jank between when the animation first ran and when the frame was drawn.
 
float getAnimatedFraction () SCONST OVERRIDE
 Returns the current animation fraction.
 
void OnNextFrame () OVERRIDE
 Handles the next frame of the animation.
 
- Public Member Functions inherited from TObjRefImpl< SObjectImpl< IValueAnimator > >
 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 
- Public Member Functions inherited from SObjectImpl< IValueAnimator >
 SObjectImpl ()
 Constructor.
 
BOOL InitFromXml (IXmlNode *pXmlNode) OVERRIDE
 Initializes the object from an XML node.
 
LPCWSTR GetName () SCONST OVERRIDE
 Retrieves the object's name.
 
LPCSTR GetNameA () SCONST OVERRIDE
 Retrieves the object's name in ANSI format.
 
void SetName (LPCWSTR pszName) OVERRIDE
 Sets the object's name.
 
int GetID () SCONST OVERRIDE
 Retrieves the object's ID.
 
void SetID (int nID) OVERRIDE
 Sets the object's ID.
 
HRESULT AfterAttribute (LPCWSTR strAttribName, LPCWSTR strValue, BOOL bLoading, HRESULT hr) OVERRIDE
 Handles attribute processing after setting an attribute.
 
HRESULT SetAttributeA (LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using ANSI strings.
 
HRESULT SetAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using wide strings.
 
virtual HRESULT SetAttribute (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Sets an attribute using wide strings.
 
HRESULT ISetAttribute (const IStringW *strAttr, const IStringW *strValue, BOOL bLoading) OVERRIDE
 Sets an attribute using IStringW objects.
 
LPCWSTR GetObjectClass () SCONST OVERRIDE
 Retrieves the object's class name.
 
int GetObjectType () SCONST OVERRIDE
 Retrieves the object's type.
 
BOOL IsClass (LPCWSTR lpszName) SCONST OVERRIDE
 Checks if the object is of a specific class.
 
BOOL GetAttribute (LPCWSTR strAttr, IStringW *pValue) SCONST OVERRIDE
 Retrieves an attribute value.
 
void OnInitFinished (IXmlNode *xmlNode) OVERRIDE
 Handles initialization completion.
 
void SetAttrHandler (FunAttrHandler attrHandler) OVERRIDE
 Sets the attribute handler.
 
virtual HRESULT DefAttributeProc (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Default attribute processing.
 

Protected Member Functions

void onEvaluateValue (float fraction) OVERRIDE
 Evaluates the animated value based on the given fraction.
 

Protected Attributes

TypeEvaluator< T > mValueEvaluator
 Type evaluator for the animated value.
 
mValue
 Current animated value.
 
- Protected Attributes inherited from SValueAnimator
uint64_t mStartTime
 The first time that the animation's animateFrame() method is called.
 
bool mStartTimeCommitted
 Flag indicating whether the start time has been firmly committed.
 
float mSeekFraction
 Set when setCurrentPlayTime() is called.
 
bool mReversing
 Flag to indicate whether this animator is playing in reverse mode.
 
float mOverallFraction
 Tracks the overall fraction of the animation, ranging from 0 to mRepeatCount + 1.
 
float mCurrentFraction
 Tracks current elapsed/eased fraction, for querying in getAnimatedFraction().
 
uint64_t mLastFrameTime
 Tracks the time (in milliseconds) when the last frame arrived.
 
uint64_t mFirstFrameTime
 Tracks the time (in milliseconds) when the first frame arrived.
 
bool mRunning
 Additional playing state to indicate whether an animator has been start()'d.
 
bool mStarted
 Additional playing state to indicate whether an animator has been start()'d, whether or not there is a nonzero startDelay.
 
bool mStartListenersCalled
 Tracks whether we've notified listeners of the onAnimationStart() event.
 
bool mInitialized
 Flag that denotes whether the animation is set up and ready to go.
 
bool mAnimationEndRequested
 Flag that tracks whether animation has been requested to end.
 
long mDuration
 How long the animation should last in milliseconds.
 
long mStartDelay
 The amount of time in milliseconds to delay starting the animation after start() is called.
 
int mRepeatCount
 The number of times the animation will repeat.
 
float sDurationScale
 Scaling factor for the duration.
 
RepeatMode mRepeatMode
 The type of repetition that will occur when repeatMode is nonzero.
 
SAutoRefPtr< IInterpolator > mInterpolator
 The time interpolator to be used.
 
SArray< IAnimatorUpdateListener * > mUpdateListeners
 The set of listeners to be sent update events through the life of an animation.
 
SArray< IAnimatorListener * > mListeners
 
ITimelineHandlersMgr * mContainer
 The container managing the timeline handlers.
 
- Protected Attributes inherited from TObjRefImpl< SObjectImpl< IValueAnimator > >
LONG m_cRef
 Reference count.
 
- Protected Attributes inherited from SObjectImpl< IValueAnimator >
SStringW m_strName
 
int m_nID
 
FunAttrHandler m_attrHandler
 

Additional Inherited Members

- Static Public Member Functions inherited from SObjectImpl< IValueAnimator >
static int GetClassType ()
 Retrieves the class type.
 
static LPCWSTR GetClassName ()
 Retrieves the class name.
 
static LPCWSTR GetClassAlias ()
 Retrieves the class alias.
 
static void MarkAttributeHandled (SXmlAttr xmlAttr, bool bHandled)
 Marks an attribute as handled.
 
static bool IsAttributeHandled (SXmlAttr xmlAttr)
 Checks if an attribute is handled.
 

Detailed Description

template<class T>
class TValueAnimator< T >

Template class for creating value animators.

Template Parameters
TThe type of the animated value.

Definition at line 510 of file SValueAnimator.h.

Constructor & Destructor Documentation

◆ TValueAnimator()

template<class T>
TValueAnimator< T >::TValueAnimator ( T from,
T to )
inline

Constructor.

Parameters
fromInitial value.
toFinal value.

Definition at line 528 of file SValueAnimator.h.

Member Function Documentation

◆ copy()

template<class T>
void TValueAnimator< T >::copy ( const IValueAnimator * pSrc)
inline

Copies the properties of another animation to this animation.

Parameters
pSrcThe source animation to copy properties from.

Definition at line 556 of file SValueAnimator.h.

◆ getValue()

template<class T>
T TValueAnimator< T >::getValue ( ) const
inline

Gets the current animated value.

Returns
The current animated value.

Definition at line 537 of file SValueAnimator.h.

◆ onEvaluateValue()

template<class T>
void TValueAnimator< T >::onEvaluateValue ( float fraction)
inlineprotected

Evaluates the animated value based on the given fraction.

Parameters
fractionThe elapsed fraction of the animation.

Definition at line 569 of file SValueAnimator.h.

◆ SetAttribute()

template<class T>
virtual HRESULT TValueAnimator< T >::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlinevirtual

Defines the attributes for TValueAnimator.

Reimplemented in SColorAnimator, SFloatAnimator, SIntAnimator, SPointAnimator, SRectAnimator, and SSizeAnimator.

Definition at line 578 of file SValueAnimator.h.

◆ setRange()

template<class T>
void TValueAnimator< T >::setRange ( T from,
T to )
inline

Sets the range of the animation.

Parameters
fromInitial value.
toFinal value.

Definition at line 547 of file SValueAnimator.h.

Member Data Documentation

◆ mValue

template<class T>
T TValueAnimator< T >::mValue
protected

Current animated value.

Definition at line 520 of file SValueAnimator.h.

◆ mValueEvaluator

template<class T>
TypeEvaluator<T> TValueAnimator< T >::mValueEvaluator
protected

Type evaluator for the animated value.

Definition at line 515 of file SValueAnimator.h.


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