VizKit  3.3.7
Public Member Functions | Private Types | Private Member Functions | Private Attributes
VizKit::VisualAnimationSequence Class Reference

A VisualAnimationSequence is a collection of animations where the animations run sequentially. More...

#include <VisualAnimationSequence.h>

Inheritance diagram for VizKit::VisualAnimationSequence:
VizKit::VisualAnimationComponent VizKit::VisualObject

List of all members.

Public Member Functions

 VisualAnimationSequence ()
 The constructor.
 ~VisualAnimationSequence ()
 The destructor.
 VisualAnimationSequence (const VisualAnimationSequence &other)
 Copy constructor.
VisualAnimationSequenceoperator= (const VisualAnimationSequence &other)
 Assignment operator.
virtual VisualAnimationComponentclone (void) const
 Copies the current VisualAnimationSequence and returns a pointer to a new VisualAnimationSequence.
void add (VisualAnimationComponent &anAnimation)
 Adds an animation to the collection.
virtual void animate (void)
 Executes the callback function to animate a property.
virtual void update (void)
 Updates the state of the animation sequence.
virtual bool isRunning (void) const
 Answers the question whether at least one animation is (still) running.
virtual bool isReadyToDie (void) const
 Answers the question whether the animation ended and is ready to be destroyed.
virtual void start (void)
 Starts the Animation collection.
virtual void stop (void)
 Stops the Animation collection.
virtual AnimatedProperty getAnimatedProperty (void) const
 Returns the animated property of the animation.
virtual void preparePriorToAddingToAsset (VisualAsset &visualAsset)
 Prepares the animation before it is added to an asset.
virtual const VisualAsset *const getEnclosingAsset (void) const
 Returns the asset the animation has been added to.
virtual void setIdentifierOfParentCollection (const VisualItemIdentifier &aCollectionIdentifier)
 Sets the identifier of the parent collection (the collection which the current animation is part of).
virtual void handleOneCollectionItemAnimationDied (void)
 Executes the appropriate action for the case that one animation of the current collection died.
virtual void setCallbackToPerformAnyAdditionalAction (VisualAnimationPerformAnyAdditionalActionCallback theCallback, void *userData=NULL)
 Sets the callback function that is repeatedly called back during animation component's duration time.
virtual void setCallbackToNotifyBeforeDeath (VisualAnimationWillDieCallback theCallback, void *userData)
 Sets the callback function that is called right before the death of the animation component.
virtual void notifyBeforeDeath (void)
 Calls any callback functions right before the death of the animation component.
virtual VisualAnimationComponentgetVisualAnimation (const VisualItemIdentifier &anAnimationIdentifier)
 Returns the VisualAnimation with the specified VisualItemIdentifier.

Private Types

typedef std::vector
< VisualAnimationComponent * > 
AnimationVector
 Animations are collected as a vector of pointers to VisualAnimationComponents.
typedef AnimationVector::iterator AnimationVectorIterator
 The AnimationVectorIterator is an iterator of a AnimationVector.
typedef
AnimationVector::const_iterator 
AnimationVectorConstIterator
 The AnimationVectorConstIterator is a const iterator of a AnimationVector.

Private Member Functions

void copy (const VisualAnimationSequence &other)
 Copy method for assignment operator and copy constructor.

Private Attributes

AnimationVector animationVector
 The vector of animations.
sint32 currAnimationIndex
 Index of the current animation.
VisualItemIdentifierparentCollectionIdentifier
 The optional identifier of the parent collection of the sequence (the cluster resp.
const VisualAssetenclosingAsset
 The asset the animation has been added to.
VisualAnimationPerformAnyAdditionalActionCallback performAnyAdditionalActionCallback
 The optional callback function that is called during the animation.
void * performAnyAdditionalActionCallbackUserData
 The optional user data that is passed to callback function that is called during the animation.
VisualAnimationWillDieCallback willDieCallback
 The optional callback function that is called right before the death of the animation cluster.
void * willDieCallbackUserData
 The optional user data that is passed to callback function that is called right before the death of the animation cluster.

Detailed Description

A VisualAnimationSequence is a collection of animations where the animations run sequentially.

Animations are added by calling add().


Member Typedef Documentation

Animations are collected as a vector of pointers to VisualAnimationComponents.

typedef AnimationVector::const_iterator VizKit::VisualAnimationSequence::AnimationVectorConstIterator [private]

The AnimationVectorConstIterator is a const iterator of a AnimationVector.

typedef AnimationVector::iterator VizKit::VisualAnimationSequence::AnimationVectorIterator [private]

The AnimationVectorIterator is an iterator of a AnimationVector.


Constructor & Destructor Documentation

The constructor.

The destructor.

Copy constructor.

Parameters:
otherReference to another VisualAnimationSequence.

Member Function Documentation

Adds an animation to the collection.

Parameters:
anAnimationReference to an animation (single VisualAnimation or clustered/sequenced composite collection of multiple VisualAnimations).
void VisualAnimationSequence::animate ( void  ) [virtual]

Executes the callback function to animate a property.

Implements VizKit::VisualAnimationComponent.

Copies the current VisualAnimationSequence and returns a pointer to a new VisualAnimationSequence.

Implements VizKit::VisualAnimationComponent.

void VisualAnimationSequence::copy ( const VisualAnimationSequence other) [private]

Copy method for assignment operator and copy constructor.

Parameters:
otherAnother VisualAnimationSequence.

Returns the animated property of the animation.

Returns:
The animated property of the animation.
Remarks:
In case the collection only contains one animation, the animated property of the contained single animation is returned. Otherwise kUndefinedAnimatedProperty is returned.

Implements VizKit::VisualAnimationComponent.

const VisualAsset *const VisualAnimationSequence::getEnclosingAsset ( void  ) const [virtual]

Returns the asset the animation has been added to.

Returns:
The asset the animation has been added to.

Implements VizKit::VisualAnimationComponent.

Returns the VisualAnimation with the specified VisualItemIdentifier.

Parameters:
anAnimationIdentifierThe identifier of the animation.
Returns:
The VisualAnimation with the specified VisualItemIdentifier.
Remarks:
Return value can be NULL if no VisualAnimation with the specified VisualItemIdentifier is found.

Implements VizKit::VisualAnimationComponent.

Executes the appropriate action for the case that one animation of the current collection died.

Remarks:
Only approcpriate for collection (like cluster and sequence). VisualAnimation simply returns after printing an error message.

Implements VizKit::VisualAnimationComponent.

bool VisualAnimationSequence::isReadyToDie ( void  ) const [virtual]

Answers the question whether the animation ended and is ready to be destroyed.

Returns:
True is the animation ended. False otherwise.
Remarks:
The animation is redy to die when the duration is exceeded. VisualAnimationQueue acts on a true return value and deletes the VisualAnimation.

Implements VizKit::VisualAnimationComponent.

bool VisualAnimationSequence::isRunning ( void  ) const [virtual]

Answers the question whether at least one animation is (still) running.

Returns:
True if at least one of the animations is (still) running. False otherwise.

Implements VizKit::VisualAnimationComponent.

void VisualAnimationSequence::notifyBeforeDeath ( void  ) [virtual]

Calls any callback functions right before the death of the animation component.

Implements VizKit::VisualAnimationComponent.

VisualAnimationSequence & VisualAnimationSequence::operator= ( const VisualAnimationSequence other)

Assignment operator.

Parameters:
otherReference to another VisualAnimationSequence.

Prepares the animation before it is added to an asset.

Parameters:
visualAssetThe asset the animation is supposed to be added to..

Implements VizKit::VisualAnimationComponent.

void VisualAnimationSequence::setCallbackToNotifyBeforeDeath ( VisualAnimationWillDieCallback  theCallback,
void *  userData 
) [virtual]

Sets the callback function that is called right before the death of the animation component.

Parameters:
theCallbackPointer to c-style function (static class function).
userDataAdditional data (e.g. pointer to instance variable of initialized class).

Implements VizKit::VisualAnimationComponent.

Sets the callback function that is repeatedly called back during animation component's duration time.

Parameters:
theCallbackPointer to c-style function (static class function).
userDataAdditional data (e.g. pointer to instance variable of initialized class).

Implements VizKit::VisualAnimationComponent.

void VisualAnimationSequence::setIdentifierOfParentCollection ( const VisualItemIdentifier aCollectionIdentifier) [virtual]

Sets the identifier of the parent collection (the collection which the current animation is part of).

Parameters:
aCollectionIdentifierThe identifier of the parent collection.

Implements VizKit::VisualAnimationComponent.

void VisualAnimationSequence::start ( void  ) [virtual]

Starts the Animation collection.

Remarks:
Each contained animation is sent a call to start().

Implements VizKit::VisualAnimationComponent.

void VisualAnimationSequence::stop ( void  ) [virtual]

Stops the Animation collection.

Implements VizKit::VisualAnimationComponent.

void VisualAnimationSequence::update ( void  ) [virtual]

Updates the state of the animation sequence.

Remarks:
Called by VisualAnimationQueue. Updates the current value of the animations. Also tests whether an animation is supposed to be started as the start was delayed.

Implements VizKit::VisualAnimationComponent.


Member Data Documentation

The vector of animations.

Index of the current animation.

The asset the animation has been added to.

The optional identifier of the parent collection of the sequence (the cluster resp.

sequence the current sequence is part of).

The optional callback function that is called during the animation.

The optional user data that is passed to callback function that is called during the animation.

The optional callback function that is called right before the death of the animation cluster.

The optional user data that is passed to callback function that is called right before the death of the animation cluster.


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

Generated on Sun May 3 2015 20:26:31 for VizKit by doxygen 1.8.0