Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

VrpnTracker Class Reference

This is the actual interface to a particular VRPN tracker object, and all of its sensors. More...

#include <vrpnTracker.h>

List of all members.

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


Detailed Description

This is the actual interface to a particular VRPN tracker object, and all of its sensors.

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.


Member Typedef Documentation

typedef pvector<VrpnTrackerDevice *> VrpnTracker::Devices [private]
 

Definition at line 90 of file vrpnTracker.h.


Constructor & Destructor Documentation

VrpnTracker::VrpnTracker const string &  tracker_name,
vrpn_Connection *  connection
 

Definition at line 39 of file vrpnTracker.cxx.

VrpnTracker::~VrpnTracker  ) 
 

Definition at line 57 of file vrpnTracker.cxx.

References _devices.


Member Function Documentation

const string & VrpnTracker::get_tracker_name  )  const [inline]
 

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().

bool VrpnTracker::is_empty  )  const [inline]
 

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().

void VrpnTracker::mark VrpnTrackerDevice 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().

void VrpnTracker::output ostream &  out  )  const
 

Definition at line 111 of file vrpnTracker.cxx.

void VrpnTracker::poll  )  [inline]
 

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().

void VrpnTracker::unmark VrpnTrackerDevice 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.

void VrpnTracker::vrpn_acceleration_callback void *  userdata,
const vrpn_TRACKERACCCB  info
[static, private]
 

Receives the tracker acceleration data from the VRPN code and sends it to any interested VrpnTrackerDevices.

Definition at line 212 of file vrpnTracker.cxx.

void VrpnTracker::vrpn_position_callback void *  userdata,
const vrpn_TRACKERCB  info
[static, private]
 

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().

void VrpnTracker::vrpn_velocity_callback void *  userdata,
const vrpn_TRACKERVELCB  info
[static, private]
 

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().

void VrpnTracker::write ostream &  out,
int  indent_level = 0
const
 

Definition at line 123 of file vrpnTracker.cxx.

Referenced by VrpnClient::write().


Member Data Documentation

Devices VrpnTracker::_devices [private]
 

Definition at line 91 of file vrpnTracker.h.

Referenced by get_tracker_name(), mark(), vrpn_position_callback(), vrpn_velocity_callback(), and ~VrpnTracker().

vrpn_Tracker_Remote* VrpnTracker::_tracker [private]
 

Definition at line 88 of file vrpnTracker.h.

Referenced by is_empty().

string VrpnTracker::_tracker_name [private]
 

Definition at line 87 of file vrpnTracker.h.

Referenced by unmark().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:56:14 2003 for Panda by doxygen1.3