Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

cavewriting::Effect Class Reference

#include <Effect.H>

Inherited by cavewriting::FadeInOutEffect, cavewriting::FaderEffect, cavewriting::LerpEffect, cavewriting::OrbitEffect, cavewriting::PeelEffect, and cavewriting::SurroundEffect.

List of all members.

Public Member Functions

 Effect (Array< Word * > &words, double startTime, double duration=100.0, bool startPaused=true)
 Effect (Word *word, double startTime, double duration=100.0, bool startPaused=true)
virtual ~Effect ()
virtual void animate ()
 Subclasses should implement.
Array< Word * > & getWords ()
void addWord (Word *word)
virtual void start ()
 Starts the effect running.

Static Public Member Functions

static EffectfromXML (xercesc::DOMElement *effectNode, bool startPaused=true)

Protected Attributes

Array< Word * > _words
Word_word
double _startTime
double _duration
bool _paused


Detailed Description

Base class for effects, which modify Words over time. Subclass from this, and write your own animate() method, to write your own effects. See FaderEffect for a simple example. To add a new subclass, you will have to edit Effect::fromXML to new an instance of your subclass when it is read in from XML. The Effect refers to a bunch of words, but doesn't own them. Sections own words.


Constructor & Destructor Documentation

cavewriting::Effect::Effect Array< Word * > &  words,
double  startTime,
double  duration = 100.0,
bool  startPaused = true
 

Constructs an effect on the words passed in. startTime means "time to wait after 'start' is called duration is in seconds startPaused should probably be true most of the time; it means that a Scene construct controls when the

cavewriting::Effect::Effect Word word,
double  startTime,
double  duration = 100.0,
bool  startPaused = true
 

virtual cavewriting::Effect::~Effect  )  [virtual]
 


Member Function Documentation

void cavewriting::Effect::addWord Word word  )  [inline]
 

Add a word to the list of words this effect controls. Most effects work better if they have only one word, but your subclass can choose to deal properly with more than one word.

virtual void cavewriting::Effect::animate  )  [virtual]
 

Subclasses should implement.

Reimplemented in cavewriting::FadeInOutEffect, cavewriting::FaderEffect, cavewriting::LerpEffect, cavewriting::OrbitEffect, cavewriting::PeelEffect, and cavewriting::SurroundEffect.

static Effect* cavewriting::Effect::fromXML xercesc::DOMElement *  effectNode,
bool  startPaused = true
[static]
 

Reads an Effect in from xml. Creates and returns an instance of the appropriate subclass.

Reimplemented in cavewriting::FadeInOutEffect, cavewriting::FaderEffect, cavewriting::LerpEffect, cavewriting::PeelEffect, and cavewriting::SurroundEffect.

Array<Word*>& cavewriting::Effect::getWords  )  [inline]
 

Returns an array of the words which this effect controls. Most effects work better if they have only one word,

virtual void cavewriting::Effect::start  )  [virtual]
 

Starts the effect running.


Member Data Documentation

double cavewriting::Effect::_duration [protected]
 

bool cavewriting::Effect::_paused [protected]
 

double cavewriting::Effect::_startTime [protected]
 

Word* cavewriting::Effect::_word [protected]
 

Array<Word*> cavewriting::Effect::_words [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Apr 17 13:34:28 2005 for cavewriting by  doxygen 1.4.0