AnimationStrategy Class Reference

#include <AnimationStrategy.h>

Inherited by DestructionStrategy.

Inheritance diagram for AnimationStrategy:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 AnimationStrategy (void)
virtual ~AnimationStrategy (void)
float getAnimationStep ()
void setAnimationStep (float value)
float getAnimationParameter ()
void setAnimationParameter (float value)
float getAnimationDuration ()
void setAnimationDuration (float durationInSecs)

Protected Member Functions

void process ()
void onEvent (LargeDisplayEvent *evt)
virtual void animate ()=0
virtual void onAnimationEnd ()
virtual void onAnimationStart (LargeDisplayEvent *evt)

Protected Attributes

bool animating
float animationStep
float animationParameter
float animationDuration

Detailed Description

This strategy provides a base class for generic animation behaviors for the components in the Large Display Framework. The animation is started when a child of this class receives an event of the "START_ANIMATION" type. The subclass has to provide the implementation of the animate() method, which performs the animation frame update. Optionally, it can also implement the onAnimationStart() and/or onAnimationEnd() methods for having specific actions hapenning in the beginning and/or end of the animation.

Author:
Fabricio Anastacio - fabriciocfa@yahoo.com
Since:
December 7, 2007


Constructor & Destructor Documentation

AnimationStrategy::AnimationStrategy ( void   ) 

Creates an AnimationStrategy instance.

AnimationStrategy::~AnimationStrategy ( void   )  [virtual]

Destroys this strategy.


Member Function Documentation

float AnimationStrategy::getAnimationStep (  )  [inline]

Returns the value of the animation step.

Returns:
the value of the animation step.

void AnimationStrategy::setAnimationStep ( float  value  )  [inline]

Sets the value of the animation step.

Parameters:
value the value of the animation step.

float AnimationStrategy::getAnimationParameter (  )  [inline]

Returns the value of the animation parameter.

Returns:
the value of the animation parameter.

void AnimationStrategy::setAnimationParameter ( float  value  )  [inline]

Sets the value of the animation parameter.

Parameters:
value the value of the animation parameter.

float AnimationStrategy::getAnimationDuration (  )  [inline]

Returns the current value of the duration of the animation in seconds.

Returns:
the current value of the duration of the animation in seconds.

void AnimationStrategy::setAnimationDuration ( float  durationInSecs  )  [inline]

Sets the animation to last the given duration in seconds. In the beginning of the animation, the value of the animation step is set so that, when the animation is fully played, it approximately has the given duration in seconds, based on the application frame rate at the moment the animation is started. If this value is set as less or equal than zero, the animation step is not changed.

Parameters:
durationInSecs the approximate duration of the animation in seconds.

void AnimationStrategy::process (  )  [protected]

Performs a given action before rendering the component.

void AnimationStrategy::onEvent ( LargeDisplayEvent *  evt  )  [protected]

Handles the given event.

Parameters:
evt the event to be handled.

virtual void AnimationStrategy::animate (  )  [protected, pure virtual]

Carries the frame update that provides the animation of the associated component. It is run inside the process() method for every animation frame update.

Implemented in DestructionStrategy.

virtual void AnimationStrategy::onAnimationEnd (  )  [inline, protected, virtual]

Performs a specific action when the animation is over.

Reimplemented in DestructionStrategy.

virtual void AnimationStrategy::onAnimationStart ( LargeDisplayEvent *  evt  )  [inline, protected, virtual]

Performs a specific action when the animation starts.

Parameters:
evt the event that triggered the animation.

Reimplemented in DestructionStrategy.


Member Data Documentation

bool AnimationStrategy::animating [protected]

Flag for starting the animation.

float AnimationStrategy::animationStep [protected]

The increment for the animation parameter.

float AnimationStrategy::animationParameter [protected]

The current animation parameter.

float AnimationStrategy::animationDuration [protected]

The duration of the animation in seconds.


The documentation for this class was generated from the following files:
Generated on Fri Dec 21 17:46:06 2007 for LargeDisplayFrameworkToolkit by  doxygen 1.5.2