Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
Dali::Internal::SceneGraph::AnimatorBase Class Referenceabstract

An abstract base class for Animators, which can be added to scene graph animations. More...

#include <scene-graph-animator.h>

Inheritance diagram for Dali::Internal::SceneGraph::AnimatorBase:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::SceneGraph::AnimatorBase:
Collaboration graph
[legend]

Public Types

typedef float(* AlphaFunc )(float progress)
 Definition of an alpha function. More...
 

Public Member Functions

 AnimatorBase ()
 Constructor. More...
 
virtual ~AnimatorBase ()
 Virtual destructor. More...
 
virtual void ConnectToSceneGraph ()=0
 Called when Animator is added to the scene-graph in update-thread. More...
 
void SetDuration (float seconds)
 Set the duration of the animator. More...
 
float GetDuration ()
 Retrieve the duration of the animator. More...
 
void SetInitialDelay (float seconds)
 Set the delay before the animator should take effect. More...
 
float GetInitialDelay ()
 Retrieve the initial delay of the animator. More...
 
void SetAlphaFunction (const AlphaFunction &alphaFunction)
 Set the alpha function for an animator. More...
 
AlphaFunction GetAlphaFunction () const
 Retrieve the alpha function of an animator. More...
 
float ApplyAlphaFunction (float progress) const
 
void SetDisconnectAction (Dali::Animation::EndAction action)
 Whether to bake the animation if attached property owner is disconnected. More...
 
Dali::Animation::EndAction GetDisconnectAction () const
 Retrieve the disconnect action of an animator. More...
 
void SetActive (bool active)
 Whether the animator is active or not. More...
 
bool GetActive () const
 Retrieve whether the animator has been set to active or not. More...
 
bool IsEnabled () const
 
virtual bool Orphan ()=0
 Returns wheter the target object of the animator is still valid or has been destroyed. More...
 
virtual void Update (BufferIndex bufferIndex, float progress, bool bake)=0
 Update the scene object attached to the animator. More...
 

Protected Member Functions

float EvaluateCubicBezier (float p0, float p1, float t) const
 Helper function to evaluate a cubic bezier curve assuming first point is at 0.0 and last point is at 1.0. More...
 

Protected Attributes

float mDurationSeconds
 
float mInitialDelaySeconds
 
AlphaFunction mAlphaFunction
 
Dali::Animation::EndAction mDisconnectAction
 EndAction to apply when target object gets disconnected from the stage. More...
 
bool mActive:1
 Animator is "active" while it's running. More...
 
bool mEnabled:1
 Animator is "enabled" while its target object is valid and on the stage. More...
 
bool mConnectedToSceneGraph:1
 True if ConnectToSceneGraph() has been called in update-thread. More...
 

Detailed Description

An abstract base class for Animators, which can be added to scene graph animations.

Each animator changes a single property of an object in the scene graph.

Definition at line 59 of file scene-graph-animator.h.

Member Typedef Documentation

typedef float(* Dali::Internal::SceneGraph::AnimatorBase::AlphaFunc)(float progress)

Definition of an alpha function.

Definition at line 63 of file scene-graph-animator.h.

Constructor & Destructor Documentation

Dali::Internal::SceneGraph::AnimatorBase::AnimatorBase ( )
inline

Constructor.

Definition at line 68 of file scene-graph-animator.h.

virtual Dali::Internal::SceneGraph::AnimatorBase::~AnimatorBase ( )
inlinevirtual

Virtual destructor.

Definition at line 82 of file scene-graph-animator.h.

Member Function Documentation

float Dali::Internal::SceneGraph::AnimatorBase::ApplyAlphaFunction ( float  progress) const
inline
virtual void Dali::Internal::SceneGraph::AnimatorBase::ConnectToSceneGraph ( )
pure virtual

Called when Animator is added to the scene-graph in update-thread.

Implemented in Dali::Internal::SceneGraph::Animator< PropertyType, PropertyAccessorType >.

Referenced by Dali::Internal::SceneGraph::Animation::AddAnimator().

Here is the caller graph for this function:

float Dali::Internal::SceneGraph::AnimatorBase::EvaluateCubicBezier ( float  p0,
float  p1,
float  t 
) const
inlineprotected

Helper function to evaluate a cubic bezier curve assuming first point is at 0.0 and last point is at 1.0.

Parameters
[in]p0First control point of the bezier curve
[in]p1Second control point of the bezier curve
[in]tA floating point value between 0.0 and 1.0
Returns
Value of the curve at progress t

Definition at line 351 of file scene-graph-animator.h.

Referenced by ApplyAlphaFunction().

Here is the caller graph for this function:

bool Dali::Internal::SceneGraph::AnimatorBase::GetActive ( ) const
inline

Retrieve whether the animator has been set to active or not.

Returns
The active state.

Definition at line 313 of file scene-graph-animator.h.

References mActive.

AlphaFunction Dali::Internal::SceneGraph::AnimatorBase::GetAlphaFunction ( ) const
inline

Retrieve the alpha function of an animator.

Returns
The function.

Definition at line 144 of file scene-graph-animator.h.

References mAlphaFunction.

Dali::Animation::EndAction Dali::Internal::SceneGraph::AnimatorBase::GetDisconnectAction ( ) const
inline

Retrieve the disconnect action of an animator.

Returns
The disconnect action.

Definition at line 293 of file scene-graph-animator.h.

References mDisconnectAction.

float Dali::Internal::SceneGraph::AnimatorBase::GetDuration ( )
inline

Retrieve the duration of the animator.

Returns
The duration in seconds.

Definition at line 107 of file scene-graph-animator.h.

References mDurationSeconds.

Referenced by Dali::Internal::SceneGraph::Animation::UpdateAnimators().

Here is the caller graph for this function:

float Dali::Internal::SceneGraph::AnimatorBase::GetInitialDelay ( )
inline

Retrieve the initial delay of the animator.

Returns
The delay in seconds.

Definition at line 126 of file scene-graph-animator.h.

References mInitialDelaySeconds.

Referenced by Dali::Internal::SceneGraph::Animation::UpdateAnimators().

Here is the caller graph for this function:

bool Dali::Internal::SceneGraph::AnimatorBase::IsEnabled ( ) const
inline

Definition at line 322 of file scene-graph-animator.h.

References mEnabled.

Referenced by Dali::Internal::SceneGraph::Animation::UpdateAnimators().

Here is the caller graph for this function:

virtual bool Dali::Internal::SceneGraph::AnimatorBase::Orphan ( )
pure virtual

Returns wheter the target object of the animator is still valid or has been destroyed.

Returns
True if animator is orphan, false otherwise *
Note
The SceneGraph::Animation will delete any orphan animator in its Update method.

Implemented in Dali::Internal::SceneGraph::Animator< PropertyType, PropertyAccessorType >.

Referenced by Dali::Internal::SceneGraph::Animation::UpdateAnimators().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::AnimatorBase::SetActive ( bool  active)
inline

Whether the animator is active or not.

Parameters
[in]activeThe new active state.
Postcondition
When the animator becomes active, it applies the disconnect-action if the property owner is then disconnected.
Note
When the property owner is disconnected, the active state is set to false.

Definition at line 304 of file scene-graph-animator.h.

References mActive.

Referenced by Dali::Internal::SceneGraph::Animation::UpdateAnimators().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::AnimatorBase::SetAlphaFunction ( const AlphaFunction alphaFunction)
inline

Set the alpha function for an animator.

Parameters
[in]alphaFuncThe alpha function to apply to the animation progress.

Definition at line 135 of file scene-graph-animator.h.

References mAlphaFunction.

void Dali::Internal::SceneGraph::AnimatorBase::SetDisconnectAction ( Dali::Animation::EndAction  action)
inline

Whether to bake the animation if attached property owner is disconnected.

Property is only baked if the animator is active.

Parameters
[in]actionThe disconnect action.

Definition at line 284 of file scene-graph-animator.h.

References mDisconnectAction.

Referenced by Dali::Internal::SceneGraph::Animation::AddAnimator().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::AnimatorBase::SetDuration ( float  seconds)
inline

Set the duration of the animator.

Precondition
durationSeconds must be zero or greater; zero is useful when animating boolean values.
Parameters
[in]secondsDuration in seconds.

Definition at line 96 of file scene-graph-animator.h.

References DALI_ASSERT_DEBUG, and mDurationSeconds.

void Dali::Internal::SceneGraph::AnimatorBase::SetInitialDelay ( float  seconds)
inline

Set the delay before the animator should take effect.

The default is zero i.e. no delay.

Parameters
[in]secondsThe delay in seconds.

Definition at line 117 of file scene-graph-animator.h.

References mInitialDelaySeconds.

virtual void Dali::Internal::SceneGraph::AnimatorBase::Update ( BufferIndex  bufferIndex,
float  progress,
bool  bake 
)
pure virtual

Update the scene object attached to the animator.

Parameters
[in]bufferIndexThe buffer to animate.
[in]progressA value from 0 to 1, where 0 is the start of the animation, and 1 is the end point.
[in]bakeBake.

Implemented in Dali::Internal::SceneGraph::Animator< PropertyType, PropertyAccessorType >.

Referenced by Dali::Internal::SceneGraph::Animation::UpdateAnimators().

Here is the caller graph for this function:

Member Data Documentation

bool Dali::Internal::SceneGraph::AnimatorBase::mActive
protected
AlphaFunction Dali::Internal::SceneGraph::AnimatorBase::mAlphaFunction
protected

Definition at line 360 of file scene-graph-animator.h.

Referenced by ApplyAlphaFunction(), GetAlphaFunction(), and SetAlphaFunction().

bool Dali::Internal::SceneGraph::AnimatorBase::mConnectedToSceneGraph
protected
Dali::Animation::EndAction Dali::Internal::SceneGraph::AnimatorBase::mDisconnectAction
protected

EndAction to apply when target object gets disconnected from the stage.

Definition at line 362 of file scene-graph-animator.h.

Referenced by GetDisconnectAction(), Dali::Internal::SceneGraph::Animator< PropertyType, PropertyAccessorType >::PropertyOwnerDisconnected(), and SetDisconnectAction().

float Dali::Internal::SceneGraph::AnimatorBase::mDurationSeconds
protected

Definition at line 357 of file scene-graph-animator.h.

Referenced by GetDuration(), and SetDuration().

bool Dali::Internal::SceneGraph::AnimatorBase::mEnabled
protected
float Dali::Internal::SceneGraph::AnimatorBase::mInitialDelaySeconds
protected

Definition at line 358 of file scene-graph-animator.h.

Referenced by GetInitialDelay(), and SetInitialDelay().


The documentation for this class was generated from the following file:
Dali Docs Home
Read more about Dali