#include <vrpnTracker.h>
Public Member Functions | |
VrpnTracker (const string &tracker_name, vrpn_Connection *connection) | |
~VrpnTracker () | |
const string & | get_tracker_name () const |
Returns the name of the tracker device that was used to create this VrpnTracker. | |
bool | is_empty () const |
Returns true if no VrpnTrackerDevices reference this VrpnTracker, or false otherwise. | |
void | mark (VrpnTrackerDevice *device) |
Adds the indicated VrpnTrackerDevice to the list of devices that are sharing this VrpnTracker. | |
void | unmark (VrpnTrackerDevice *device) |
Removes the indicated VrpnTrackerDevice from the list of devices that are sharing this VrpnTracker. | |
void | poll () |
Polls the connected device. | |
void | output (ostream &out) const |
void | write (ostream &out, int indent_level=0) const |
Private Types | |
typedef pvector< VrpnTrackerDevice * > | Devices |
Static Private Member Functions | |
void | vrpn_position_callback (void *userdata, const vrpn_TRACKERCB info) |
Receives the tracker positional data from the VRPN code and sends it to any interested VrpnTrackerDevices. | |
void | vrpn_velocity_callback (void *userdata, const vrpn_TRACKERVELCB info) |
Receives the tracker velocity data from the VRPN code and sends it to any interested VrpnTrackerDevices. | |
void | vrpn_acceleration_callback (void *userdata, const vrpn_TRACKERACCCB info) |
Receives the tracker acceleration data from the VRPN code and sends it to any interested VrpnTrackerDevices. | |
Private Attributes | |
string | _tracker_name |
vrpn_Tracker_Remote * | _tracker |
Devices | _devices |
A pointer to this object is stored in the VrpnClient class for each differently-named VRPN tracker we connect to.
The VRPN callbacks go here, which in turn get vectored out to any VrpnTrackerDevice objects that register with this. When the last VrpnTrackerDevice object unregisters, the VrpnTracker will be deleted by the VrpnClient.
This class does not need to be exported from the DLL.
Definition at line 62 of file vrpnTracker.h.
|
Definition at line 90 of file vrpnTracker.h. |
|
Definition at line 39 of file vrpnTracker.cxx. |
|
Definition at line 57 of file vrpnTracker.cxx. References _devices. |
|
Returns the name of the tracker device that was used to create this VrpnTracker.
Definition at line 33 of file vrpnTracker.I. References _devices, and INLINE. Referenced by VrpnClient::disconnect_tracker_device(). |
|
Returns true if no VrpnTrackerDevices reference this VrpnTracker, or false otherwise.
Definition at line 48 of file vrpnTracker.I. References _tracker, and INLINE. Referenced by VrpnClient::disconnect_tracker_device(). |
|
Adds the indicated VrpnTrackerDevice to the list of devices that are sharing this VrpnTracker.
Definition at line 72 of file vrpnTracker.cxx. References _devices. Referenced by VrpnClient::do_poll(). |
|
Definition at line 111 of file vrpnTracker.cxx. |
|
Polls the connected device. Normally you should not call this directly; this will be called by the VrpnClient. Definition at line 65 of file vrpnTracker.I. Referenced by VrpnClient::disconnect_device(). |
|
Removes the indicated VrpnTrackerDevice from the list of devices that are sharing this VrpnTracker.
Definition at line 90 of file vrpnTracker.cxx. References _tracker_name. |
|
Receives the tracker acceleration data from the VRPN code and sends it to any interested VrpnTrackerDevices.
Definition at line 212 of file vrpnTracker.cxx. |
|
Receives the tracker positional data from the VRPN code and sends it to any interested VrpnTrackerDevices.
Definition at line 142 of file vrpnTracker.cxx. References ClientTrackerDevice::_data, _devices, VrpnClient::convert_to_secs(), VrpnTrackerDevice::DT_velocity, VrpnTrackerDevice::get_data_type(), VrpnTrackerDevice::get_sensor(), ClientDevice::lock(), TrackerData::set_dt(), TrackerData::set_orient(), TrackerData::set_pos(), TrackerData::set_time(), and ClientDevice::unlock(). |
|
Receives the tracker velocity data from the VRPN code and sends it to any interested VrpnTrackerDevices.
Definition at line 176 of file vrpnTracker.cxx. References ClientTrackerDevice::_data, _devices, VrpnClient::convert_to_secs(), VrpnTrackerDevice::DT_acceleration, VrpnTrackerDevice::get_data_type(), VrpnTrackerDevice::get_sensor(), ClientDevice::lock(), TrackerData::set_dt(), TrackerData::set_orient(), TrackerData::set_pos(), TrackerData::set_time(), and ClientDevice::unlock(). |
|
Definition at line 123 of file vrpnTracker.cxx. Referenced by VrpnClient::write(). |
|
Definition at line 91 of file vrpnTracker.h. Referenced by get_tracker_name(), mark(), vrpn_position_callback(), vrpn_velocity_callback(), and ~VrpnTracker(). |
|
Definition at line 88 of file vrpnTracker.h. Referenced by is_empty(). |
|
Definition at line 87 of file vrpnTracker.h. Referenced by unmark(). |