InputDevice Class Reference

#include <InputDevice.h>

Inherited by InputDeviceBase, TrackdDevice, and VrpnDevice.

Collaboration diagram for InputDevice:

List of all members.


Public Member Functions

 InputDevice ()
virtual ~InputDevice ()
virtual int getNumberOfButtons ()=0
virtual int getNumberOfAxes ()=0
virtual int getNumberOfSensors ()=0
virtual int getButtonValue (int idx)=0
virtual float getAxisValue (int idx)=0
virtual SensorData getSensorValue (int idx)=0
virtual void update ()=0

Protected Member Functions

void acquireControllerLock ()
void releaseControllerLock ()
void sendButtonChangeNotification (int buttonIndex, int newButtonValue)

Private Member Functions

void initialize (int deviceIndex, Controller *controller, OSG::Lock *inputDataLock)

Private Attributes

Controllercontroller
OSG::Lock * controllerLock
int deviceIndex

Friends

class Controller

Constructor & Destructor Documentation

InputDevice::InputDevice (  ) 

Constructor

InputDevice::~InputDevice (  )  [virtual]

Destructor


Member Function Documentation

void InputDevice::acquireControllerLock (  )  [protected]

Locks the controller. This method has to be called when the data for the buttons/axes/sensors is not updated in the update method. Take care that the lock is already automatically acquired in the update method, so don't try to call it from there or you may get deadlocks!

virtual float InputDevice::getAxisValue ( int  idx  )  [pure virtual]

Returns the value of the axis with the passed index

Implemented in InputDeviceBase, TrackdDevice, and VrpnDevice.

virtual int InputDevice::getButtonValue ( int  idx  )  [pure virtual]

Returns the value of the button with the passed index

Implemented in InputDeviceBase, TrackdDevice, and VrpnDevice.

virtual int InputDevice::getNumberOfAxes (  )  [pure virtual]

Returns the number of axes provided by the input device

Implemented in InputDeviceBase, TrackdDevice, and VrpnDevice.

virtual int InputDevice::getNumberOfButtons (  )  [pure virtual]

Returns the number of buttons provided by the input device

Implemented in InputDeviceBase, TrackdDevice, and VrpnDevice.

virtual int InputDevice::getNumberOfSensors (  )  [pure virtual]

Returns the number of sensors provided by the input device

Implemented in InputDeviceBase, TrackdDevice, and VrpnDevice.

virtual SensorData InputDevice::getSensorValue ( int  idx  )  [pure virtual]

Returns the value of the sensor with the passed index

Implemented in InputDeviceBase, TrackdDevice, and VrpnDevice.

void InputDevice::initialize ( int  deviceIndex,
Controller controller,
OSG::Lock *  inputDataLock 
) [private]

Initializes the InputDevice. This method is called by the controller when the device is added.

void InputDevice::releaseControllerLock (  )  [protected]

Releases the controller lock.

See also:
acquireControllerLock

void InputDevice::sendButtonChangeNotification ( int  buttonIndex,
int  newButtonValue 
) [protected]

Notifies the controller that the state of a button has changed. This method has to be called whenever a value of a button has changed in order to allow the controller to send callbacks to all registered listeners.

virtual void InputDevice::update (  )  [pure virtual]

Updates the data of the buttons/axes/sensors. This method is called once a frame. Take care to also call the sendButtonChangeNotification method if the state of a button has changed in order to get a correct callback behavior!

Implemented in GlutMouseDevice, InputDeviceBase, StrangeDevice, UdpDevice, TrackdDevice, and VrpnDevice.


Friends And Related Function Documentation

friend class Controller [friend]


Member Data Documentation

Reimplemented in TrackdDevice.

OSG::Lock* InputDevice::controllerLock [private]

int InputDevice::deviceIndex [private]


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

Generated on Wed Oct 20 16:11:57 2010 for inVRs by doxygen 1.5.8