#include <P_Buttons.h>
Inheritance diagram for Buttons:
Public Methods | |
Buttons () | |
virtual | ~Buttons () |
virtual const char * | device_name () const=0 |
virtual Buttons * | clone ()=0 |
int | start (const SensorConfig *) |
virtual void | update ()=0 |
int | state (int num) |
Protected Methods | |
virtual int | do_start (const SensorConfig *) |
Do subclass-specific startup tasks; return success. More... | |
Protected Attributes | |
ResizeArray< int > | used |
the buttons that it uses. More... | |
int | stat [MAX_BUTTONS] |
buttons can be changed by update. More... |
Common notes for VMDTracker, Feedback, and Buttons classes, collectively referred to as devices in what follows.
Constructor: The constructor must not require any input arguments. The reason for this is that an instance of every class is created and held in an associative store so that it can be referenced by its device_name() string. This instantiation is done independently of any device configuration, such as what would be found in the .vmdsensors file. Constructors should thus do nothing but initialize member data to NULL or default values.
device_name(): This pure virtual function supplies a string by which the device can be accessed in an associative store (since classes aren't first-class objects in C++). The name must be unique to that class, among all devices of that type.
clone(): This should do nothing more that return an instance of the class.
do_start(const SensorConfig *): Here's where the action is: This method will be called from the base class start() method after general initialization is done. This method is where the subclass should, e.g., establish a connection to a remote device. If there is no class-specific initialization to do then the subclass need not override this method.
start() should be called only once in a device's life, when it is first added to a Tool.
Definition at line 71 of file P_Buttons.h.
|
Definition at line 80 of file P_Buttons.h. |
|
Definition at line 81 of file P_Buttons.h. |
|
Implemented in MobileButtons. |
|
Implemented in MobileButtons. |
|
Do subclass-specific startup tasks; return success.
Reimplemented in MobileButtons. Definition at line 77 of file P_Buttons.h. Referenced by start. |
|
Definition at line 29 of file P_Buttons.C. References ResizeArray< int >::append, ResizeArray< int >::clear, do_start, SensorConfig::getsensors, MAX_BUTTONS, ResizeArray::num, stat, and used. Referenced by Tool::add_buttons. |
|
Definition at line 89 of file P_Buttons.h. References ResizeArray::num, num, and stat. Referenced by Tool::isgrabbing. |
|
Implemented in MobileButtons. |
|
buttons can be changed by update.
Definition at line 74 of file P_Buttons.h. Referenced by VRPNButtons::do_start, start, state, VRJugglerButtons::update, SpaceballButtons::update, FreeVRButtons::update, CaveButtons::update, and MobileButtons::update. |
|
the buttons that it uses.
Definition at line 73 of file P_Buttons.h. Referenced by start. |