The AnimationHandler is the management class for animations. More...
#include <GUIAnimationHandler.h>
Public Types | |
typedef eC_TListDoubleLinked< CGUIAnimationChain * > | AnimationChainPtrList |
The animation chain pointer list is a double-linked list of animation chain pointers. | |
typedef eC_TListDoubleLinked< CGUIAnimation * > | AnimationPtrList |
The animation pointer list is a double-linked list of animation pointers. | |
enum | DeletionPolicy_t { DP_STOP , DP_REMOVE } |
Static Public Member Functions | |
static void | CreateInstance () |
static void | DeleteInstance () |
Friends | |
class | CGUIAnimation |
class | CGUIAnimationChain |
class | CGUIComponentManager |
class | CGUILoadAnimationsCmd |
The AnimationHandler is the management class for animations.
It takes ownership for all animations and animation chains. When a GUIObject is deleted, the AnimationHandler is informed and deletes all animations that are animating this object.
When an animation or an animation chain is created, they are registered in the animation handler. The AnimationHandler will generate a unique id and sets it in the generated animation or animation chain.
When an animation, an animation chain or an animation observer is deleted, the animation handler is informed. The respective destructor calls NotifyOfDestruction().
The animation handler as owner of animations provides the interface to access an animation or an animation chain based on the unique id which was set when the object was instantiated
Store the unique id when creating the animation.
Later access the animation by the ID to start it.
It is also possible to check if an GUIObject has animations (i.e. if there are animations that are animating the object) by calling ObjHasAnimations() and to get the list of all animations by calling GetAnimations().
void CGUIAnimationHandler::AssignNewId | ( | CGUIAnimation * | pkAnimation | ) |
Generates a new unique animation id and assigns it to the animation.
pkAnimation | animation which id will be changed |
void CGUIAnimationHandler::AssignNewId | ( | CGUIAnimationChain * | pkAnimationChain | ) |
Generates a new unique animation chain id and assigns it to the animation chain.
pkAnimationChain | animation-chain whose id will be changed |
|
static |
Create Instance
void CGUIAnimationHandler::DeInit | ( | ) |
Delete and remove all remaining animations and animation chains.
|
static |
Delete Instance
CGUIAnimation * CGUIAnimationHandler::GetAnimation | ( | eC_UInt | uiID | ) | const |
uiID | The unique ID of the Animation. |
CGUIAnimationChain * CGUIAnimationHandler::GetAnimationChain | ( | eC_UInt | uiID | ) | const |
uiID | The unique ID of the AnimationChain. |
const AnimationChainPtrList * CGUIAnimationHandler::GetAnimationChains | ( | void | ) | const |
Get all existing animation chains.
AnimationPtrList CGUIAnimationHandler::GetAnimations | ( | const CGUIObject * | pkObjToCheck | ) | const |
Get all animations that are mapped to an object.
pkObjToCheck | The GUIObject that is animated. |
AnimationPtrList CGUIAnimationHandler::GetAnimationsOfObject | ( | const CGUIObject * | pkObject | ) |
Returns a list of all animations that are animating an object.
pkObject | The object whose animations shall be returned. |
eC_UInt CGUIAnimationHandler::GetDefaultStepTime | ( | ) | const |
Get the currently set default step-time
DeletionPolicy_t CGUIAnimationHandler::GetDeletionPolicy | ( | ) | const |
Get the currently used policy when objects are deleted
void CGUIAnimationHandler::NotifyOfDestruction | ( | CGUIAnimation * | pkAnimation | ) |
Called by the destructor of CGUIAnimation. The Animation will be removed from the internal list.
pkAnimation | The destroyed animation. |
void CGUIAnimationHandler::NotifyOfDestruction | ( | CGUIAnimationChain * | pkAnimationChain | ) |
Called by the destructor of CGUIAnimationChain. The Animation will be removed from the internal list.
pkAnimationChain | The destroyed animation chain. |
void CGUIAnimationHandler::NotifyOfDestruction | ( | CGUIAnimationObserver * | pkObserver | ) |
Called whenever a AnimationObserver is deleted. Sets the observer pointer for all animations that are using this observer to NULL.
pkObserver | The animation observer which will be deleted. |
void CGUIAnimationHandler::NotifyOfDestruction | ( | CGUIObject * | pkDeletedObject | ) |
Called by the destructor of CGUIObject. Removes all animations of the object.
pkDeletedObject | The object which was deleted. |
eC_Bool CGUIAnimationHandler::ObjHasAnimations | ( | const CGUIObject * | pkObjToCheck | ) | const |
Check if an animation was added that animates an object.
pkObjToCheck | The object to check. |
eC_Bool CGUIAnimationHandler::ReadAnimationsFromFile | ( | const eC_String & | rkPath | ) |
Read all animations and animation chains from file and adds them to the internal animation list.
rkPath | The path to the animation file. |
void CGUIAnimationHandler::ReadFromStream | ( | ) |
Read from streaming-file
eC_Bool CGUIAnimationHandler::RemoveAnimation | ( | const AnimationHandle_t & | eAnimation | ) |
Remove the animation with the specified id
eAnimation | id of the animation |
void CGUIAnimationHandler::SetDefaultSteptime | ( | const eC_UInt & | uiDefaultStepTime | ) |
Set the default step-time to be used when animations are set to 0
uiDefaultStepTime | step-time |
void CGUIAnimationHandler::SetDeletionPolicy | ( | const DeletionPolicy_t & | eDeletionPolicy | ) |
Set the policy to be used when objects are deleted that are used in animations
eDeletionPolicy | policy to use |
void CGUIAnimationHandler::SetID | ( | CGUIAnimation * | pkAnimation, |
const eC_UInt & | uiID | ||
) |
Set ID of Animation to given value. Will not change ID on collisions.
pkAnimation | animation |
uiID | ID |
void CGUIAnimationHandler::SetID | ( | CGUIAnimationChain * | pkAnimationChain, |
const eC_UInt & | uiID | ||
) |
Set ID of AnimationChain to given value. Will not change ID on collisions
pkAnimationChain | animation-chain |
uiID | ID |
void CGUIAnimationHandler::StartAllAnimationChains | ( | ) |
Start all animation-chains
void CGUIAnimationHandler::StartAnimationChain | ( | const eC_UInt & | uiID | ) |
Start animation-chain with id
uiID | id of animation-chain to start |
void CGUIAnimationHandler::StopAllAnimationChains | ( | ) |
Stop all currently running animation-chains
void CGUIAnimationHandler::StopAllAnimations | ( | ) |
Stops all animations that were added to the animation handler.
void CGUIAnimationHandler::StopAllAnimations | ( | CGUIObject * | pkAnimatedObject | ) |
Stops all animations that are animating a specific GUIObject.
pkAnimatedObject | The Object that is animated by the animations that shall be stopped. |
void CGUIAnimationHandler::StopAnimationChain | ( | const eC_UInt & | uiID | ) |
Stop animation-chain with id
uiID | id of animation-chain to stop |
eC_Bool CGUIAnimationHandler::WriteAnimationsToFile | ( | const eC_String & | rkPath | ) |
Write all animations and animation chains to file.
rkPath | The path to the animation file. |
void CGUIAnimationHandler::WriteToStream | ( | ) |
Write to streaming-file
|
friend |
|
friend |
|
friend |
|
friend |