Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

MotionSequenceNode< SIZE > Class Template Reference

#include <MotionSequenceNode.h>

Inheritance diagram for MotionSequenceNode< SIZE >:

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 15 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 18 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 23 of file MotionSequenceNode.h.

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

destructor, check if we need to call our teardown

Definition at line 30 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 35 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 42 of file MotionSequenceNode.h.

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 50 of file MotionSequenceNode.h.

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

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

sets the file to play

Definition at line 71 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 79 of file MotionSequenceNode.h.

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

template<unsigned int SIZE>
virtual void MotionSequenceNode< SIZE >::processEvent ( const EventBase  )  [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 81 of file MotionSequenceNode.h.

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

returns true if currently looping

Definition at line 93 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 96 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 99 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 102 of file MotionSequenceNode.h.

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 106 of file MotionSequenceNode.h.

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


Member Data Documentation

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 120 of file MotionSequenceNode.h.

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

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

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


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

Tekkotsu v4.0
Generated Thu Nov 22 00:58:33 2007 by Doxygen 1.5.4