Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

MotionSequenceNode< SIZE > Class Template Reference

#include <MotionSequenceNode.h>

Inheritance diagram for MotionSequenceNode< SIZE >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<unsigned int SIZE>
class MotionSequenceNode< SIZE >

A StateNode for playing a MotionSequence (and looping it if desired).

Eventually, i'd like to just build the looping functionality into MotionSequence, but in the mean time we have this.

Definition at line 14 of file MotionSequenceNode.h.

Public Member Functions

 MotionSequenceNode ()
 constructor
 MotionSequenceNode (const std::string &nm, const std::string &file, bool loop=false)
 constructor
 ~MotionSequenceNode ()
 destructor, check if we need to call our teardown
virtual void DoStart ()
 Transitions should call this when you are entering the state, so it can enable its transitions.
virtual void DoStop ()
 Transitions should call this when you are leaving the state, so it can disable its transitions.
virtual void teardown ()
 This is called by DoStop() when you should destruct subnodes.
virtual void setFile (const std::string &file)
 sets the file to play
virtual void setLooping (bool loop)
 turns looping on or off
virtual void processEvent (const EventBase &e)
 By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.
virtual bool getLooping ()
 returns true if currently looping
virtual MotionManager::MC_ID getMSid ()
 use this to access the MS that the MotionSequenceNode is using
virtual MMAccessor< MotionSequenceMC<
SIZE > > 
getMSAccessor ()
 use this to access the MS that the MotionSequenceNode is using
virtual bool ownsMSid ()
 returns true if msid was created (and will be destroyed) by this MotionSequenceNode - false if assigned by setMsid()

Protected Member Functions

void updateMS (const std::string &file)
 resets the motion command and starts it playing

Protected Attributes

MotionManager::MC_ID msid
 id of the motion command
bool msidIsMine
 true if this class created the current motion command (and therefore should delete it when done)
bool looping
 true if we should loop
std::string filename
 filename of current motion sequence


Constructor & Destructor Documentation

template<unsigned int SIZE>
MotionSequenceNode< SIZE >::MotionSequenceNode  )  [inline]
 

constructor

Definition at line 17 of file MotionSequenceNode.h.

template<unsigned int SIZE>
MotionSequenceNode< SIZE >::MotionSequenceNode const std::string &  nm,
const std::string &  file,
bool  loop = false
[inline]
 

constructor

Definition at line 22 of file MotionSequenceNode.h.

template<unsigned int SIZE>
MotionSequenceNode< SIZE >::~MotionSequenceNode  )  [inline]
 

destructor, check if we need to call our teardown

Definition at line 29 of file MotionSequenceNode.h.


Member Function Documentation

template<unsigned int SIZE>
virtual void MotionSequenceNode< SIZE >::DoStart  )  [inline, virtual]
 

Transitions should call this when you are entering the state, so it can enable its transitions.

Reimplemented from StateNode.

Definition at line 34 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual void MotionSequenceNode< SIZE >::DoStop  )  [inline, virtual]
 

Transitions should call this when you are leaving the state, so it can disable its transitions.

Reimplemented from StateNode.

Definition at line 41 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual bool MotionSequenceNode< SIZE >::getLooping  )  [inline, virtual]
 

returns true if currently looping

Definition at line 92 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual MMAccessor<MotionSequenceMC<SIZE> > MotionSequenceNode< SIZE >::getMSAccessor  )  [inline, virtual]
 

use this to access the MS that the MotionSequenceNode is using

Definition at line 98 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual MotionManager::MC_ID MotionSequenceNode< SIZE >::getMSid  )  [inline, virtual]
 

use this to access the MS that the MotionSequenceNode is using

Definition at line 95 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual bool MotionSequenceNode< SIZE >::ownsMSid  )  [inline, virtual]
 

returns true if msid was created (and will be destroyed) by this MotionSequenceNode - false if assigned by setMsid()

Definition at line 101 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual void MotionSequenceNode< SIZE >::processEvent const EventBase e  )  [inline, virtual]
 

By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.

Reimplemented from BehaviorBase.

Definition at line 80 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual void MotionSequenceNode< SIZE >::setFile const std::string &  file  )  [inline, virtual]
 

sets the file to play

Definition at line 70 of file MotionSequenceNode.h.

template<unsigned int SIZE>
virtual void MotionSequenceNode< SIZE >::setLooping bool  loop  )  [inline, virtual]
 

turns looping on or off

Definition at line 78 of file MotionSequenceNode.h.

Referenced by MotionSequenceNode< SIZE >::MotionSequenceNode().

template<unsigned int SIZE>
virtual void MotionSequenceNode< SIZE >::teardown  )  [inline, virtual]
 

This is called by DoStop() when you should destruct subnodes.

Default implementation will take care of the subnodes and their transitions, you only need to worry about any *other* memory which may have been allocated. If none, you may not need implement this function at all.

Reimplemented from StateNode.

Definition at line 49 of file MotionSequenceNode.h.

Referenced by MotionSequenceNode< SIZE >::~MotionSequenceNode().

template<unsigned int SIZE>
void MotionSequenceNode< SIZE >::updateMS const std::string &  file  )  [inline, protected]
 

resets the motion command and starts it playing

Definition at line 105 of file MotionSequenceNode.h.

Referenced by MotionSequenceNode< SIZE >::DoStart(), MotionSequenceNode< SIZE >::processEvent(), and MotionSequenceNode< SIZE >::setFile().


Member Data Documentation

template<unsigned int SIZE>
std::string MotionSequenceNode< SIZE >::filename [protected]
 

filename of current motion sequence

Definition at line 121 of file MotionSequenceNode.h.

Referenced by MotionSequenceNode< SIZE >::DoStart(), MotionSequenceNode< SIZE >::processEvent(), MotionSequenceNode< SIZE >::setFile(), and MotionSequenceNode< SIZE >::updateMS().

template<unsigned int SIZE>
bool MotionSequenceNode< SIZE >::looping [protected]
 

true if we should loop

Definition at line 120 of file MotionSequenceNode.h.

Referenced by MotionSequenceNode< SIZE >::getLooping(), MotionSequenceNode< SIZE >::processEvent(), and MotionSequenceNode< SIZE >::setLooping().

template<unsigned int SIZE>
MotionManager::MC_ID MotionSequenceNode< SIZE >::msid [protected]
 

id of the motion command

Definition at line 118 of file MotionSequenceNode.h.

Referenced by MotionSequenceNode< SIZE >::DoStop(), MotionSequenceNode< SIZE >::getMSAccessor(), MotionSequenceNode< SIZE >::getMSid(), MotionSequenceNode< SIZE >::processEvent(), MotionSequenceNode< SIZE >::teardown(), and MotionSequenceNode< SIZE >::updateMS().

template<unsigned int SIZE>
bool MotionSequenceNode< SIZE >::msidIsMine [protected]
 

true if this class created the current motion command (and therefore should delete it when done)

Definition at line 119 of file MotionSequenceNode.h.

Referenced by MotionSequenceNode< SIZE >::ownsMSid(), MotionSequenceNode< SIZE >::teardown(), and MotionSequenceNode< SIZE >::updateMS().


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

Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:05 2005 by Doxygen 1.4.4