27 VrpnAnalog(
const std::string &analog_name, vrpn_Connection *connection) :
28 _analog_name(analog_name)
30 _analog =
new vrpn_Analog_Remote(_analog_name.c_str(), connection);
32 _analog->register_change_handler((
void*)
this, &vrpn_analog_callback);
49 if (vrpn_cat.is_debug()) {
50 vrpn_cat.debug() << *
this <<
" marking " << *device <<
"\n";
52 _devices.push_back(device);
61 if (vrpn_cat.is_debug()) {
62 vrpn_cat.debug() << *
this <<
" unmarking " << *device <<
"\n";
65 Devices::iterator di =
66 find(_devices.begin(), _devices.end(), device);
68 if (di != _devices.end()) {
86 output(std::ostream &out)
const {
94 write(std::ostream &out,
int indent_level)
const {
97 << _devices.size() <<
" devices)\n";
104 void VRPN_CALLBACK VrpnAnalog::
105 vrpn_analog_callback(
void *userdata,
const vrpn_ANALOGCB info) {
108 Devices::iterator di;
109 for (di = self->_devices.begin(); di !=
self->_devices.end(); ++di) {
111 for (
int i = 0; i < info.num_channel; i++) {
112 device->set_axis_value(i, info.channel[i]);