Body Class Reference

Data structure and method for standard bodies (6DOF, 3DOF) without any specials. More...

#include <bodies.h>

Inheritance diagram for Body:

BodyGlove BodyGlove ButtonDevice ButtonDevice FlyStick2 FlyStick2 FlyStick1 FlyStick1 Measurer Measurer FlyStick1 FlyStick1 Measurer Measurer

List of all members.

Public Types

enum  BodyType {
  NRECG = 0, B3D = 1, B6D = 2, BGL = 3,
  B6DF2 = 4, B6DF = 5, B6DMT = 6, NRECG = 0,
  B3D = 1, B6D = 2, BGL = 3, B6DF2 = 4,
  B6DF = 5, B6DMT = 6
}
 The type of the body identificator. More...
enum  BodyType {
  NRECG = 0, B3D = 1, B6D = 2, BGL = 3,
  B6DF2 = 4, B6DF = 5, B6DMT = 6, NRECG = 0,
  B3D = 1, B6D = 2, BGL = 3, B6DF2 = 4,
  B6DF = 5, B6DMT = 6
}
 The type of the body identificator. More...

Public Member Functions

 Body (int id, float qu, BodyType type, float *shift=NULL, float *rotation=NULL)
 Constructor.
 ~Body ()
 destructor
void Identity ()
 Set matrix to identity.
void SetShift (float *shift)
 Copy shift vector to tMatrix (3 values).
void SetRotation (float *rotation)
 Copy rotation matrix to tMatrix (9 values).
void SetMatrix (MATRIX &matr)
 Sets new values for matrix.
int GetID ()
 Returns Id of the device.
BodyType GetType ()
 Returns type of the device.
vector3 GetShift ()
 Reconstructs a shift vector.
MATRIX GetRotation ()
 Reconstructs a rotation matrix.
MATRIX Matrix ()
 Pointer to transofrmation matrix (inner matrix of current structure - see tMatrix).
float GetQuality ()
 Returns quality indicator.
virtual int Button (int num)
 shows whether the button is switched or not
virtual int ButonsNumber ()
 Number of buttons.
virtual int ControlsNuber ()
 Number of Controls.
virtual float Control (int num)
 Returns analog value of control from range -1.000 to 1.000.
virtual int LeftHand ()
 Indicator, whether the Fingertracking glove is left or right hand.
virtual int FingersNum ()
 Number of tracked fingers.
virtual FingerGetFinger (int num)
 Returns the Finger specification (for Fingertracking device only).
virtual int ButtonsMask32 ()
 returns mask of first 32 buttons
void Scale (float num)
 scale matrix with value;
 Body (int id, float qu, BodyType type, float *shift=NULL, float *rotation=NULL)
 Constructor.
 ~Body ()
 destructor
void Identity ()
 Set matrix to identity.
void SetShift (float *shift)
 Copy shift vector to tMatrix (3 values).
void SetRotation (float *rotation)
 Copy rotation matrix to tMatrix (9 values).
void SetMatrix (MATRIX &matr)
 Sets new values for matrix.
int GetID ()
 Returns Id of the device.
BodyType GetType ()
 Returns type of the device.
vector3 GetShift ()
 Reconstructs a shift vector.
MATRIX GetRotation ()
 Reconstructs a rotation matrix.
MATRIX Matrix ()
 Pointer to transofrmation matrix (inner matrix of current structure - see tMatrix).
float GetQuality ()
 Returns quality indicator.
virtual int Button (int num)
 shows whether the button is switched or not
virtual int ButonsNumber ()
 Number of buttons.
virtual int ControlsNuber ()
 Number of Controls.
virtual float Control (int num)
 Returns analog value of control from range -1.000 to 1.000.
virtual int LeftHand ()
 Indicator, whether the Fingertracking glove is left or right hand.
virtual int FingersNum ()
 Number of tracked fingers.
virtual FingerGetFinger (int num)
 Returns the Finger specification (for Fingertracking device only).
virtual int ButtonsMask32 ()
 returns mask of first 32 buttons
void Scale (float num)
 scale matrix with value;

Protected Attributes

BodyType deviceType
 The type of the Device.
int deviceID
 ID identificator of the device.
float quality
 quality parameter of the device
MATRIX tMatrix
 column ordered transformation matrix


Detailed Description

Data structure and method for standard bodies (6DOF, 3DOF) without any specials.

Definition at line 50 of file bodies.h.


Member Enumeration Documentation

The type of the body identificator.

Enumerator:
NRECG  Not recognized device.
B3D  Standard body - Additional marker with 3 degrees of freedom (3DoF).
B6D  Standard body - Additional marker with 6 degrees of freedom (6DoF).
BGL  Finger tracking data structure.
B6DF2  Flystick 2 data structure.
B6DF  Flystick 1 data structure.
B6DMT  Measurement tools. Nearly the same data structure as Flystick 1.
NRECG  Not recognized device.
B3D  Standard body - Additional marker with 3 degrees of freedom (3DoF).
B6D  Standard body - Additional marker with 6 degrees of freedom (6DoF).
BGL  Finger tracking data structure.
B6DF2  Flystick 2 data structure.
B6DF  Flystick 1 data structure.
B6DMT  Measurement tools. Nearly the same data structure as Flystick 1.

Definition at line 54 of file bodies.h.

00055        {
00056               NRECG = 0,  
00057               B3D   = 1,   
00058               B6D   = 2,   
00059               BGL   = 3,   
00060               B6DF2 = 4, 
00061               B6DF  = 5,  
00062               B6DMT = 6  
00063        };

The type of the body identificator.

Enumerator:
NRECG  Not recognized device.
B3D  Standard body - Additional marker with 3 degrees of freedom (3DoF).
B6D  Standard body - Additional marker with 6 degrees of freedom (6DoF).
BGL  Finger tracking data structure.
B6DF2  Flystick 2 data structure.
B6DF  Flystick 1 data structure.
B6DMT  Measurement tools. Nearly the same data structure as Flystick 1.
NRECG  Not recognized device.
B3D  Standard body - Additional marker with 3 degrees of freedom (3DoF).
B6D  Standard body - Additional marker with 6 degrees of freedom (6DoF).
BGL  Finger tracking data structure.
B6DF2  Flystick 2 data structure.
B6DF  Flystick 1 data structure.
B6DMT  Measurement tools. Nearly the same data structure as Flystick 1.

Definition at line 54 of file bodies.h.

00055        {
00056               NRECG = 0,  
00057               B3D   = 1,   
00058               B6D   = 2,   
00059               BGL   = 3,   
00060               B6DF2 = 4, 
00061               B6DF  = 5,  
00062               B6DMT = 6  
00063        };


Constructor & Destructor Documentation

Body::Body ( int  id,
float  qu,
Body::BodyType  type,
float *  shift = NULL,
float *  rotation = NULL 
)

Constructor.

Creates new representation of data structure and fills tMatrix - transformation matrix with values of shift vectro and rotation matrix

Parameters:
Id identificator - contained in the apcket
Qu quality parameter. Devices with buttons returns 1.0 or -1.0; Without buttons only 1.0 is returned.
Shift pointer to array of 3 values - shift vector
Rotation pointer to array of 9 values - rotation matrix

Definition at line 13 of file bodies.cpp.

00014 {
00015        deviceID = id;
00016        quality = qu;
00017        deviceType = type;
00018        //this->Identity();                // init matrix with identity
00019        this->SetRotation(rotation);// copy rotation matrix to transform matrix
00020        this->SetShift(shift);             // copy shift vector to transform matrix
00021 }

Body::~Body (  ) 

destructor

Definition at line 22 of file bodies.cpp.

00023 {}

Body::Body ( int  id,
float  qu,
BodyType  type,
float *  shift = NULL,
float *  rotation = NULL 
)

Constructor.

Creates new representation of data structure and fills tMatrix - transformation matrix with values of shift vectro and rotation matrix

Parameters:
id identificator - contained in the apcket
qu quality parameter. Devices with buttons returns 1.0 or -1.0; Without buttons only 1.0 is returned.
shift pointer to array of 3 values - shift vector
rotation pointer to array of 9 values - rotation matrix

Body::~Body (  ) 

destructor


Member Function Documentation

void Body::Identity (  ) 

Set matrix to identity.

Definition at line 34 of file bodies.cpp.

00035 {
00036        MATRIX identity;
00037        tMatrix = identity;
00038 }

void Body::SetShift ( float *  shift  ) 

Copy shift vector to tMatrix (3 values).

Definition at line 39 of file bodies.cpp.

00040 {
00041        if (shift != NULL)
00042        {
00043               vector3 vct;
00044               vct.x = shift[0];
00045               vct.y = shift[1];
00046               vct.z = shift[2];
00047               tMatrix.Translate(vct);
00048        }
00049 }

void Body::SetRotation ( float *  rotation  ) 

Copy rotation matrix to tMatrix (9 values).

Definition at line 50 of file bodies.cpp.

00051 {
00052        if (rotation != NULL)
00053        {
00054               tMatrix._m11 = rotation[0]; tMatrix._m12 = rotation[3]; tMatrix._m13 = rotation[6];
00055               tMatrix._m21 = rotation[1]; tMatrix._m22 = rotation[4]; tMatrix._m23 = rotation[7];
00056               tMatrix._m31 = rotation[2]; tMatrix._m32 = rotation[5]; tMatrix._m33 = rotation[8];
00057        }
00058 }

void Body::SetMatrix ( MATRIX matr  ) 

Sets new values for matrix.

Definition at line 30 of file bodies.cpp.

00031 {
00032        tMatrix = matr;
00033 }

int Body::GetID (  ) 

Returns Id of the device.

Definition at line 59 of file bodies.cpp.

00060 {
00061        return deviceID;
00062 }

Body::BodyType Body::GetType (  ) 

Returns type of the device.

Definition at line 63 of file bodies.cpp.

00064 {
00065        return deviceType;
00066 }

vector3 Body::GetShift (  ) 

Reconstructs a shift vector.

Parameters:
vect An array where to reconstruct a shift vector

Definition at line 67 of file bodies.cpp.

00068 {
00069        return tMatrix.ExtractTranslation();
00070 }

MATRIX Body::GetRotation (  ) 

Reconstructs a rotation matrix.

Parameters:
vect An array where to reconstruct a rotation matrix (column ordered)

Definition at line 71 of file bodies.cpp.

00072 {
00073        return tMatrix.ExtractRotation();
00074 }

MATRIX Body::Matrix (  ) 

Pointer to transofrmation matrix (inner matrix of current structure - see tMatrix).

Definition at line 75 of file bodies.cpp.

00076 {
00077        return tMatrix;
00078 }

float Body::GetQuality (  ) 

Returns quality indicator.

In case of standard bodies (6DoF, 3DoF) value 1.000 is always returned
In case of Flystick 1, Flystick 2, Measurement tools or Fingertracking gloves either 1.000 or -1.000 is returned. Value 1.000 means that device is currently visible with the DTrack A.R.T tracking system. Value -1.000 means that device is not visible now (but it may contain some informations about buttons or analog controls)

Definition at line 79 of file bodies.cpp.

00080 {
00081        return quality;
00082 }

int Body::Button ( int  num  )  [virtual]

shows whether the button is switched or not

Returns 1 if button is switched on
Returns 0 if button is switched off
Returns -10 if button is unavailable (num parameter is not in scope of the device buttons)

Parameters:
num Number of buttons

Reimplemented in ButtonDevice, FlyStick2, ButtonDevice, and FlyStick2.

Definition at line 83 of file bodies.cpp.

00084 {
00085        return -10; // standard bodies doesn't have any button
00086 }

int Body::ButonsNumber (  )  [virtual]

Number of buttons.

Reimplemented in ButtonDevice, FlyStick2, ButtonDevice, and FlyStick2.

Definition at line 87 of file bodies.cpp.

00088 {
00089        return 0;     // standard bodies doesn't have any button
00090 }

int Body::ControlsNuber (  )  [virtual]

Number of Controls.

Reimplemented in FlyStick2, and FlyStick2.

Definition at line 91 of file bodies.cpp.

00092 {
00093        return 0; // standard bodies doesn't have any button
00094 }

float Body::Control ( int  num  )  [virtual]

Returns analog value of control from range -1.000 to 1.000.

if -10 is returned, Control is not in scope of the device (or Device is not equiped with controls)

Parameters:
num - specifies the analog control.

Reimplemented in FlyStick2, and FlyStick2.

Definition at line 95 of file bodies.cpp.

00096 {
00097        return -10.0; // stnadard bodies doesn't have any control
00098 }

int Body::LeftHand (  )  [virtual]

Indicator, whether the Fingertracking glove is left or right hand.

Returns 1 if device is left hand glove Returns 0 if device is right hand glove Returns -10 if device is not a fingertacking glove

Reimplemented in BodyGlove, and BodyGlove.

Definition at line 99 of file bodies.cpp.

00100 {
00101        return -10;     // standard bodies doesn't
00102 }

int Body::FingersNum (  )  [virtual]

Number of tracked fingers.

Returns value 0 if device is no Fingertracking glove or no finger is tracked

Reimplemented in BodyGlove, and BodyGlove.

Definition at line 103 of file bodies.cpp.

00104 {
00105        return 0;
00106 }

Finger * Body::GetFinger ( int  num  )  [virtual]

Returns the Finger specification (for Fingertracking device only).

Returns 0 if device is not Fingertracking or thumb num parameter is out of scope

Parameters:
num Specification of finger in sequence starting with thumb

Reimplemented in BodyGlove, and BodyGlove.

Definition at line 107 of file bodies.cpp.

00108 {
00109        return NULL;
00110 }

int Body::ButtonsMask32 (  )  [virtual]

returns mask of first 32 buttons

Reimplemented in ButtonDevice, FlyStick2, ButtonDevice, and FlyStick2.

Definition at line 225 of file bodies.cpp.

00226 {
00227        return 0x00;
00228 }

void Body::Scale ( float  num  ) 

scale matrix with value;

Definition at line 24 of file bodies.cpp.

00025 {
00026        vector3 vct;
00027        vct.x = vct.y =vct.z = num;
00028        tMatrix.Scale(vct);
00029 }

void Body::Identity (  ) 

Set matrix to identity.

void Body::SetShift ( float *  shift  ) 

Copy shift vector to tMatrix (3 values).

void Body::SetRotation ( float *  rotation  ) 

Copy rotation matrix to tMatrix (9 values).

void Body::SetMatrix ( MATRIX matr  ) 

Sets new values for matrix.

int Body::GetID (  ) 

Returns Id of the device.

BodyType Body::GetType (  ) 

Returns type of the device.

vector3 Body::GetShift (  ) 

Reconstructs a shift vector.

Parameters:
vect An array where to reconstruct a shift vector

MATRIX Body::GetRotation (  ) 

Reconstructs a rotation matrix.

Parameters:
vect An array where to reconstruct a rotation matrix (column ordered)

MATRIX Body::Matrix (  ) 

Pointer to transofrmation matrix (inner matrix of current structure - see tMatrix).

float Body::GetQuality (  ) 

Returns quality indicator.

In case of standard bodies (6DoF, 3DoF) value 1.000 is always returned
In case of Flystick 1, Flystick 2, Measurement tools or Fingertracking gloves either 1.000 or -1.000 is returned. Value 1.000 means that device is currently visible with the DTrack A.R.T tracking system. Value -1.000 means that device is not visible now (but it may contain some informations about buttons or analog controls)

virtual int Body::Button ( int  num  )  [virtual]

shows whether the button is switched or not

Returns 1 if button is switched on
Returns 0 if button is switched off
Returns -10 if button is unavailable (num parameter is not in scope of the device buttons)

Parameters:
num Number of buttons

Reimplemented in ButtonDevice, FlyStick2, ButtonDevice, and FlyStick2.

virtual int Body::ButonsNumber (  )  [virtual]

Number of buttons.

Reimplemented in ButtonDevice, FlyStick2, ButtonDevice, and FlyStick2.

virtual int Body::ControlsNuber (  )  [virtual]

Number of Controls.

Reimplemented in FlyStick2, and FlyStick2.

virtual float Body::Control ( int  num  )  [virtual]

Returns analog value of control from range -1.000 to 1.000.

if -10 is returned, Control is not in scope of the device (or Device is not equiped with controls)

Parameters:
num - specifies the analog control.

Reimplemented in FlyStick2, and FlyStick2.

virtual int Body::LeftHand (  )  [virtual]

Indicator, whether the Fingertracking glove is left or right hand.

Returns 1 if device is left hand glove Returns 0 if device is right hand glove Returns -10 if device is not a fingertacking glove

Reimplemented in BodyGlove, and BodyGlove.

virtual int Body::FingersNum (  )  [virtual]

Number of tracked fingers.

Returns value 0 if device is no Fingertracking glove or no finger is tracked

Reimplemented in BodyGlove, and BodyGlove.

virtual Finger* Body::GetFinger ( int  num  )  [virtual]

Returns the Finger specification (for Fingertracking device only).

Returns 0 if device is not Fingertracking or thumb num parameter is out of scope

Parameters:
num Specification of finger in sequence starting with thumb

Reimplemented in BodyGlove, and BodyGlove.

virtual int Body::ButtonsMask32 (  )  [virtual]

returns mask of first 32 buttons

Reimplemented in ButtonDevice, FlyStick2, ButtonDevice, and FlyStick2.

void Body::Scale ( float  num  ) 

scale matrix with value;


Member Data Documentation

The type of the Device.

Definition at line 144 of file bodies.h.

int Body::deviceID [protected]

ID identificator of the device.

Definition at line 146 of file bodies.h.

float Body::quality [protected]

quality parameter of the device

Definition at line 148 of file bodies.h.

MATRIX Body::tMatrix [protected]

column ordered transformation matrix

Definition at line 150 of file bodies.h.


The documentation for this class was generated from the following files:

Generated on Tue Mar 10 14:41:37 2009 for VRUT by  doxygen 1.5.5