VrpnDevice Class Reference

#include <VrpnDevice.h>

Inherits InputDevice.

Collaboration diagram for VrpnDevice:

List of all members.


Public Member Functions

 VrpnDevice (std::string deviceId, unsigned numSensors, unsigned numButtons, unsigned numAxes)
virtual ~VrpnDevice ()
int getNumberOfButtons ()
int getNumberOfAxes ()
int getNumberOfSensors ()
int getButtonValue (int idx)
float getAxisValue (int idx)
SensorData getSensorValue (int idx)
void update ()
bool isInitialized () const

Static Public Member Functions

static void VRPN_CALLBACK trackerPosQuatCallback (void *userdata, const vrpn_TRACKERCB trackerData)
static void VRPN_CALLBACK buttonCallback (void *userdata, const vrpn_BUTTONCB buttonData)
static void VRPN_CALLBACK analogCallback (void *userdata, const vrpn_ANALOGCB analogData)

Private Member Functions

void initializeDevice (unsigned numSensors, unsigned numButtons, unsigned numAxes)
void updateTracker (const vrpn_TRACKERCB trackerData)
void updateButton (const vrpn_BUTTONCB buttonData)
void updateAnalog (const vrpn_ANALOGCB analogData)

Private Attributes

std::vector< int > buttonValues
std::vector< float > axisValues
std::vector< SensorDatasensorValues
std::set< int > buttonCallbackWarnings
std::set< int > axisCallbackWarnings
std::set< int > sensorCallbackWarnings
bool initialized
 defines if
std::string deviceId
vrpn_Tracker_Remote * tracker
 member for reading the tracker data
vrpn_Button_Remote * button
 member for reading the button data
vrpn_Analog_Remote * analog
 member for reading the axis data

Constructor & Destructor Documentation

VrpnDevice::VrpnDevice ( std::string  deviceId,
unsigned  numSensors,
unsigned  numButtons,
unsigned  numAxes 
)

Constructor

VrpnDevice::~VrpnDevice (  )  [virtual]

Destructor


Member Function Documentation

void VRPN_CALLBACK VrpnDevice::analogCallback ( void *  userdata,
const vrpn_ANALOGCB  analogData 
) [static]

Callback method for the analog input data

void VRPN_CALLBACK VrpnDevice::buttonCallback ( void *  userdata,
const vrpn_BUTTONCB  buttonData 
) [static]

Callback method for the buttons

float VrpnDevice::getAxisValue ( int  idx  )  [virtual]

Returns the value of the axis with the passed index

Implements InputDevice.

int VrpnDevice::getButtonValue ( int  idx  )  [virtual]

Returns the value of the button with the passed index

Implements InputDevice.

int VrpnDevice::getNumberOfAxes (  )  [virtual]

Returns the number of axes provided by the input device

Implements InputDevice.

int VrpnDevice::getNumberOfButtons (  )  [virtual]

Returns the number of buttons provided by the input device

Implements InputDevice.

int VrpnDevice::getNumberOfSensors (  )  [virtual]

Returns the number of sensors provided by the input device

Implements InputDevice.

SensorData VrpnDevice::getSensorValue ( int  idx  )  [virtual]

Returns the value of the sensor with the passed index

Implements InputDevice.

void VrpnDevice::initializeDevice ( unsigned  numSensors,
unsigned  numButtons,
unsigned  numAxes 
) [private]

Initializes the device

bool VrpnDevice::isInitialized (  )  const

Returns if the VrpnDevice was successfully initialized

void VRPN_CALLBACK VrpnDevice::trackerPosQuatCallback ( void *  userdata,
const vrpn_TRACKERCB  trackerData 
) [static]

Callback method for the tracker

void VrpnDevice::update (  )  [virtual]

Updates the values of the VrpnDevice

Implements InputDevice.

void VrpnDevice::updateAnalog ( const vrpn_ANALOGCB  analogData  )  [private]

Update analog data

void VrpnDevice::updateButton ( const vrpn_BUTTONCB  buttonData  )  [private]

Update button data

void VrpnDevice::updateTracker ( const vrpn_TRACKERCB  trackerData  )  [private]

Update tracker data


Member Data Documentation

vrpn_Analog_Remote* VrpnDevice::analog [private]

member for reading the axis data

std::set<int> VrpnDevice::axisCallbackWarnings [private]

std::vector<float> VrpnDevice::axisValues [private]

vrpn_Button_Remote* VrpnDevice::button [private]

member for reading the button data

std::set<int> VrpnDevice::buttonCallbackWarnings [private]

std::vector<int> VrpnDevice::buttonValues [private]

std::string VrpnDevice::deviceId [private]

bool VrpnDevice::initialized [private]

defines if

std::set<int> VrpnDevice::sensorCallbackWarnings [private]

std::vector<SensorData> VrpnDevice::sensorValues [private]

vrpn_Tracker_Remote* VrpnDevice::tracker [private]

member for reading the tracker data


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

Generated on Wed Oct 20 16:12:02 2010 for inVRs by doxygen 1.5.8