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

A VisualAnimationCluster is a collection of animations where the animations run concurrently. More...

#include <VisualAnimationCluster.h>

Inheritance diagram for VizKit::VisualAnimationCluster:
VizKit::VisualAnimationComponent VizKit::VisualObject

List of all members.

Public Member Functions

 VisualAnimationCluster ()
 The constructor.
 ~VisualAnimationCluster ()
 The destructor.
 VisualAnimationCluster (const VisualAnimationCluster &other)
 Copy constructor.
VisualAnimationClusteroperator= (const VisualAnimationCluster &other)
 Assignment operator.
virtual VisualAnimationComponentclone (void) const
 Copies the current VisualAnimationCluster and returns a pointer to a new VisualAnimationCluster.
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 cluster.
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=NULL)
 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 VisualAnimationCluster &other)
 Copy method for assignment operator and copy constructor.

Private Attributes

AnimationVector animationVector
 The vector of animations.
VisualItemIdentifierparentCollectionIdentifier
 The optional identifier of the parent collection of the cluster (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 VisualAnimationCluster is a collection of animations where the animations run concurrently.

Animations are added by calling add().


Member Typedef Documentation

Animations are collected as a vector of pointers to VisualAnimationComponents.

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

The AnimationVectorConstIterator is a const iterator of a AnimationVector.

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

The AnimationVectorIterator is an iterator of a AnimationVector.


Constructor & Destructor Documentation

The constructor.

The destructor.

Copy constructor.

Parameters:
otherReference to another VisualAnimationCluster.

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 VisualAnimationCluster::animate ( void  ) [virtual]

Executes the callback function to animate a property.

Implements VizKit::VisualAnimationComponent.

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

Implements VizKit::VisualAnimationComponent.

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

Copy method for assignment operator and copy constructor.

Parameters:
otherAnother VisualAnimationCluster.

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 VisualAnimationCluster::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 VisualAnimationCluster::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 VisualAnimationCluster::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 VisualAnimationCluster::notifyBeforeDeath ( void  ) [virtual]

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

Implements VizKit::VisualAnimationComponent.

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

Assignment operator.

Parameters:
otherReference to another VisualAnimationCluster.

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 VisualAnimationCluster::setCallbackToNotifyBeforeDeath ( VisualAnimationWillDieCallback  theCallback,
void *  userData = NULL 
) [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 VisualAnimationCluster::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 VisualAnimationCluster::start ( void  ) [virtual]

Starts the Animation collection.

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

Implements VizKit::VisualAnimationComponent.

void VisualAnimationCluster::stop ( void  ) [virtual]

Stops the Animation collection.

Implements VizKit::VisualAnimationComponent.

void VisualAnimationCluster::update ( void  ) [virtual]

Updates the state of the animation cluster.

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.

The asset the animation has been added to.

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

sequence the current cluster 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