GenericVRPNServer Class Reference

A class providing a very simple generic VRPN server capable of creating Analog and Button controls. More...

Public Member Functions

 ~GenericVRPNServer ()
 Public destructor.
 
void loop ()
 The loop() method has to be called periodically in order for vrpn to work.
 
void addButton (std::string name, int buttonCount)
 
void changeButtonState (std::string name, int index, int state)
 
int getButtonState (std::string name, int index)
 
void addAnalog (std::string name, int channelCount)
 
void changeAnalogState (std::string name,...)
 
double * getAnalogChannels (std::string name)
 
void reportAnalogChanges (std::string name)
 

Static Public Member Functions

static GenericVRPNServergetInstance (int port)
 Public singleton factory.
 

Detailed Description

A class providing a very simple generic VRPN server capable of creating Analog and Button controls.

Member Function Documentation

void addButton ( std::string  name,
int  buttonCount 
)

Creates a new button object within the VRPN server

Parameters
namename of the vrpn peripheral
buttonCountnumber of virtual buttons in the peripeheral
void changeButtonState ( std::string  name,
int  index,
int  state 
)

Change the button state of a button inside a created VRPN peripheral

Parameters
namename of the vrpn peripheral containing the button
indexindex of the button (beginning by 0)
statenew state of the button 0 = off, 1 = on
int getButtonState ( std::string  name,
int  index 
)

Get the state of a button

Parameters
namename of the vrpn peripheral containing the button
indexindex of the button (beginning by 0)
Returns
the state of the button
void addAnalog ( std::string  name,
int  channelCount 
)

Creates a new analog object within the VRPN server

Parameters
namename of the vrpn peripheral
channelCountnumber of channels in the peripeheral
void changeAnalogState ( std::string  name,
  ... 
)

Change the state of channels of an analog VRPN peripheral

Parameters
namename of the vrpn peripheral containing the analog control
ellipsislist of the values (double)
double * getAnalogChannels ( std::string  name)

Gets a pointer to the channel array

Parameters
namename of the vrpn peripheral containing the analog control
Returns
pointer to the array containing the channels
void reportAnalogChanges ( std::string  name)

Marks the selected analog server channels as modified so the values are sent in the next loop

Parameters
namename of the vrpn peripheral containing the analog control