Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

VMDTracker Class Reference

An object representing a connection to a machine that controls 3d input devices (optionally with buttons, force-feedback, etc). One connection may control one or many devices, so there needs to be a global list of trackers which the Sensors peruse when first being initialized. This class is named VMDTracker to avoid name conflicts with the UNC tracker library. More...

#include <P_Tracker.h>

Inheritance diagram for VMDTracker:

CaveTracker FreeVRTracker MobileTracker PhoneTracker SpaceballTracker VRJugglerTracker VRPNTracker List of all members.

Public Methods

 VMDTracker ()
 Constructor: initialize variables, but do not establish any connection. More...

virtual ~VMDTracker ()
virtual const char * device_name () const=0
 Device name; must be unique to other VMDTracker subclasses. More...

virtual VMDTracker * clone ()=0
virtual int start (const SensorConfig *)
 Establish connection to remote device in the start() method, not in the constructor. More...

virtual void update ()=0
virtual int alive ()=0
const float * position ()
const Matrix4orientation ()
void set_offset (const float o[3])
const float * get_offset () const
void set_scale (float s)
float get_scale () const
void set_right_rot (const Matrix4 *right)
void set_left_rot (const Matrix4 *left)
int dimension () const
 dimension of positions returned by the device; subclasses set the dim variable. More...


Protected Methods

void moveto (float x, float y, float z)
virtual int do_start (const SensorConfig *)
 Do device-specific configuration. Return success. More...


Protected Attributes

int dim
 set by subclass; default is three. More...

float pos [3]
Matrix4orient
Matrix4 rot_orient

Detailed Description

An object representing a connection to a machine that controls 3d input devices (optionally with buttons, force-feedback, etc). One connection may control one or many devices, so there needs to be a global list of trackers which the Sensors peruse when first being initialized. This class is named VMDTracker to avoid name conflicts with the UNC tracker library.

Common notes for VMDTracker, Feedback, and Buttons classes, collectively referred to as devices in what follows.

Constructor: The constructor must not require any input arguments. The reason for this is that an instance of every class is created and held in an associative store so that it can be referenced by its device_name() string. This instantiation is done independently of any device configuration, such as what would be found in the .vmdsensors file. Constructors should thus do nothing but initialize member data to NULL or default values.

device_name(): This pure virtual function supplies a string by which the device can be accessed in an associative store (since classes aren't first-class objects in C++). The name must be unique to that class, among all devices of that type.

clone(): This should do nothing more that return an instance of the class.

do_start(const SensorConfig *): Here's where the action is: This method will be called from the base class start() method after general initialization is done. This method is where the subclass should, e.g., establish a connection to a remote device. If there is no class-specific initialization to do then the subclass need not override this method.

start() should be called only once in a device's life, when it is first added to a Tool.

Definition at line 72 of file P_Tracker.h.


Constructor & Destructor Documentation

VMDTracker::VMDTracker  
 

Constructor: initialize variables, but do not establish any connection.

Definition at line 27 of file P_Tracker.C.

References dim, Matrix4::identity, orient, and pos.

VMDTracker::~VMDTracker   [virtual]
 

Definition at line 34 of file P_Tracker.C.

References orient.


Member Function Documentation

virtual int VMDTracker::alive   [pure virtual]
 

Implemented in MobileTracker.

virtual VMDTracker* VMDTracker::clone   [pure virtual]
 

Implemented in MobileTracker.

virtual const char* VMDTracker::device_name   const [pure virtual]
 

Device name; must be unique to other VMDTracker subclasses.

Implemented in MobileTracker.

int VMDTracker::dimension   const [inline]
 

dimension of positions returned by the device; subclasses set the dim variable.

Definition at line 137 of file P_Tracker.h.

References dim.

Referenced by Tool::dimension.

virtual int VMDTracker::do_start const SensorConfig   [inline, protected, virtual]
 

Do device-specific configuration. Return success.

Reimplemented in MobileTracker.

Definition at line 92 of file P_Tracker.h.

Referenced by start.

const float* VMDTracker::get_offset   const [inline]
 

Definition at line 127 of file P_Tracker.h.

Referenced by Tool::addplaneconstraint, Tool::getoffset, Tool::setconstraint, and Tool::setplaneconstraint.

float VMDTracker::get_scale   const [inline]
 

Definition at line 130 of file P_Tracker.h.

Referenced by Tool::addplaneconstraint, Tool::getscale, Tool::setconstraint, Tool::setforcefield, and Tool::setplaneconstraint.

void VMDTracker::moveto float    x,
float    y,
float    z
[inline, protected]
 

Definition at line 87 of file P_Tracker.h.

References pos, and z.

Referenced by SpaceballTracker::do_start, MobileTracker::do_start, SpaceballTracker::update, VRPNTracker::update, and MobileTracker::update.

const Matrix4& VMDTracker::orientation   [inline]
 

Definition at line 115 of file P_Tracker.h.

References Matrix4::loadmatrix, and Matrix4::multmatrix.

const float* VMDTracker::position   [inline]
 

Definition at line 109 of file P_Tracker.h.

References pos.

void VMDTracker::set_left_rot const Matrix4   left [inline]
 

Definition at line 133 of file P_Tracker.h.

Referenced by start.

void VMDTracker::set_offset const float    o[3] [inline]
 

Definition at line 122 of file P_Tracker.h.

Referenced by Tool::setoffset, and start.

void VMDTracker::set_right_rot const Matrix4   right [inline]
 

Definition at line 132 of file P_Tracker.h.

Referenced by start.

void VMDTracker::set_scale float    s [inline]
 

Definition at line 129 of file P_Tracker.h.

Referenced by Tool::setscale, and start.

int VMDTracker::start const SensorConfig   [virtual]
 

Establish connection to remote device in the start() method, not in the constructor.

Definition at line 38 of file P_Tracker.C.

References do_start, SensorConfig::getleft_rot, SensorConfig::getoffset, SensorConfig::getright_rot, SensorConfig::getscale, set_left_rot, set_offset, set_right_rot, and set_scale.

Referenced by Tool::add_tracker.

virtual void VMDTracker::update   [pure virtual]
 

Implemented in MobileTracker.


Member Data Documentation

int VMDTracker::dim [protected]
 

set by subclass; default is three.

Definition at line 81 of file P_Tracker.h.

Referenced by dimension, and VMDTracker.

Matrix4* VMDTracker::orient [protected]
 

Definition at line 84 of file P_Tracker.h.

Referenced by SpaceballTracker::do_start, MobileTracker::do_start, VRJugglerTracker::update, SpaceballTracker::update, VRPNTracker::update, FreeVRTracker::update, CaveTracker::update, MobileTracker::update, VMDTracker, VRPNTracker::VRPNTracker, and ~VMDTracker.

float VMDTracker::pos[3] [protected]
 

Definition at line 83 of file P_Tracker.h.

Referenced by moveto, position, VRJugglerTracker::update, SpaceballTracker::update, FreeVRTracker::update, CaveTracker::update, MobileTracker::update, VMDTracker, and VRPNTracker::VRPNTracker.

Matrix4 VMDTracker::rot_orient [protected]
 

Definition at line 85 of file P_Tracker.h.


The documentation for this class was generated from the following files:
Generated on Fri Apr 19 02:47:17 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002