#include <ArMode.h>
Inheritance diagram for ArMode:
Each mode is going to need to add its keys to the keyHandler... each mode should only use the keys 1-0, the arrow keys (movement), the space bar (stop), z (zoom in), x (zoom out), and e (exercise)... then when its activate is called by that key handler it needs to first deactivate the ourActiveMode (if its not itself, in which case its done) then add its key handling stuff... activate and deactivate will need to add and remove their user tasks (or call the base class activate/deactivate to do it) as well as the key handling things for their other part of modes. This mode will ALWAYS bind help to /, ?, h, and H when the first instance of an ArMode is made.
Public Member Functions | |
virtual void | activate (void)=0 |
The function called when the mode is activated, subclass must provide. | |
ArMode (ArRobot *robot, const char *name, char key, char key2) | |
Constructor. | |
bool | baseActivate (void) |
bool | baseDeactivate (void) |
virtual void | deactivate (void)=0 |
The function called when the mode is deactivated, subclass must provide. | |
char | getKey (void) |
An internal function to get the first key this is bound to. | |
char | getKey2 (void) |
An internal function to get the second key this is bound to. | |
const char * | getName (void) |
Gets the name of the mode. | |
virtual void | help (void) |
The mode's help print out... subclass must provide if needed. | |
virtual void | userTask (void) |
The ArMode's user task, don't need one, subclass must provide if needed. | |
virtual | ~ArMode () |
Destructor. | |
Static Public Member Functions | |
static void | baseHelp (void) |
This is the base help function, its internal, bound to ? and h and H. | |
Protected Member Functions | |
void | addKeyHandler (int keyToHandle, ArFunctor *functor) |
void | remKeyHandler (ArFunctor *functor) |
Protected Attributes | |
ArFunctorC< ArMode > | myActivateCB |
ArFunctorC< ArMode > | myDeactivateCB |
char | myKey |
char | myKey2 |
std::string | myName |
ArRobot * | myRobot |
ArFunctorC< ArMode > | myUserTaskCB |
Static Protected Attributes | |
static ArMode * | ourActiveMode |
static ArGlobalFunctor * | ourHelpCB |
static std::list< ArMode * > | ourModes |
bool ArMode::baseActivate | ( | void | ) |
The base activation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false
bool ArMode::baseDeactivate | ( | void | ) |
The base deactivation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false
virtual void ArMode::help | ( | void | ) | [inline, virtual] |
The mode's help print out... subclass must provide if needed.
This is called as soon as a mode is activated, and should give directions on to what keys do what and what this mode will do