H3D::H3DHapticsDevice Class Reference
[Abstract nodes.]

Base class for all haptic devices. More...

#include <H3DHapticsDevice.h>

Inheritance diagram for H3D::H3DHapticsDevice:

Inheritance graph
List of all members.

Public Member Functions

 H3DHapticsDevice (Inst< SFVec3f > _devicePosition=0, Inst< SFRotation > _deviceOrientation=0, Inst< TrackerPosition > _trackerPosition=0, Inst< TrackerOrientation > _trackerOrientation=0, Inst< PosCalibration > _positionCalibration=0, Inst< OrnCalibration > _orientationCalibration=0, Inst< SFVec3f > _proxyPosition=0, Inst< WeightedProxy > _weightedProxyPosition=0, Inst< SFFloat > _proxyWeighting=0, Inst< SFBool > _main_button=0, Inst< SFVec3f > _force=0, Inst< SFVec3f > _torque=0, Inst< SFInt32 > _inputDOF=0, Inst< SFInt32 > _outputDOF=0, Inst< SFInt32 > _hapticsRate=0, Inst< SFNode > _stylus=0, Inst< SFBool > _initialized=0)
 Constructor.
virtual ~H3DHapticsDevice ()
 Destructor. Stops haptics rendering and remove callback functions.
Vec3f getPreviousProxyPosition ()
 Get the proxy position from the previous loop.
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value.
virtual void initDevice ()
 Does all the initialization needed for the device before starting to use it.
PeriodicThreadBasegetThread ()
 Get the thread that is used to run this haptics device.
virtual void resetDevice ()
 Reset the device.
virtual void disableDevice ()
 Perform cleanup and let go of all device resources that are allocated.
virtual void updateDeviceValues ()
 This function is used to transfer device values, such as position, button status etc from the realtime loop to the fields of H3DHapticsDevice, and possible vice versa.
virtual void preRender ()
 This function is called at the start of each scenegraph loop before any calls to other HapticDevice functions and can be used to perform any necessary operation that are needed for the other calls to function properly.
virtual void postRender ()
 This function is called at the end of each scenegraph loop after all calls to other HapticDevice functions and can be used to perform any necessary operation that are needed.

Public Attributes

auto_ptr< SFVec3fdevicePosition
 The position of the device given in the coordinate system of the device.
auto_ptr< SFRotationdeviceOrientation
 The orientation of the device given in the coordinate system of the device.
auto_ptr< TrackerPositiontrackerPosition
 The position of the device in the world coordinates of the API.
auto_ptr< TrackerOrientationtrackerOrientation
 The orientation of the device in the world coordinates of the API.
auto_ptr< PosCalibrationpositionCalibration
 The calibration matrix between devicePosition and trackerPosition.
auto_ptr< OrnCalibrationorientationCalibration
 The calibration rotation between deviceOrientation and trackerOrientation.
auto_ptr< SFVec3fproxyPosition
 The position of the proxy used in the haptic rendering.
auto_ptr< SFVec3fweightedProxyPosition
 A weighted position between proxyPosition and trackerPosition.
auto_ptr< SFFloatproxyWeighting
 The weighting between proxyPosition and trackerPosition when calculating weightedProxyPosition.
auto_ptr< SFBoolmainButton
 The state of the main button.
auto_ptr< SFVec3fforce
 The approximation of the force that has been rendered during the last scenegraph loop.
auto_ptr< SFVec3ftorque
 The approximation of the torque that has been rendered during the last scenegraph loop.
auto_ptr< SFInt32inputDOF
 The degrees of freedom supported as input.
auto_ptr< SFInt32outputDOF
 The degrees of freedom supported as output, i.e.
auto_ptr< SFInt32hapticsRate
 The update rate of the servoloop of the H3DHapticsDevice.
auto_ptr< SFNodestylus
 The Node used as the visual representation of the stylus.
auto_ptr< SFBoolinitialized
 true if the device is initialized and ready for calls to updateDeviceValues() and renderObjects().

Static Public Attributes

static H3DNodeDatabase database
 Node database entry.

Protected Attributes

Vec3f previuos_proxy_pos
PeriodicThreadBasethread
 The thread that this haptics device loop is run in.

Classes

class  OrnCalibration
 Saves the value of the field in a variable that can be accessed from the realtime loop. More...
class  PosCalibration
 Saves the value of the field in a variable that can be accessed from the realtime loop. More...
class  TrackerOrientation
 The TrackerOrientation field updates itself from the device_orientation and orientation_calibration fields. More...
class  TrackerPosition
 The TrackerPosition field updates itself from the device_position and position_calibration fields. More...
class  WeightedProxy
 The WeightedProxy field updates to be a value between the proxy position and tracker position depending on the value of a weighting factor. More...

Detailed Description

Base class for all haptic devices.

It contains information about the haptics device, e.g. the position and orientation of the device, the forces being rendered and supported degrees of freedom. It also contains functions for rendering HapticObject instances on the device. Subclasses should override renderObjects() to render the objects on the H3DHapticsDevice.

Internal routes:
H3DHapticsDevice.dot


Member Function Documentation

virtual string H3D::H3DHapticsDevice::defaultXMLContainerField  )  [inline, virtual]
 

Returns the default xml containerField attribute value.

For this node it is "appearance".

Reimplemented from H3D::Node.

virtual void H3D::H3DHapticsDevice::disableDevice  )  [inline, virtual]
 

Perform cleanup and let go of all device resources that are allocated.

After a call to this function no haptic rendering can be performed on the device until the initDevice() function has been called again.

Reimplemented in H3D::DHDHapticsDevice, H3D::H3DThreadedHapticsDevice, H3D::HaptikHapticsDevice, and H3D::HLHapticsDevice.


Member Data Documentation

auto_ptr< SFRotation > H3D::H3DHapticsDevice::deviceOrientation
 

The orientation of the device given in the coordinate system of the device.

Only applicable if the device supports orientation as input.

Access type: outputOnly

H3DHapticsDevice_deviceOrientation.dot

auto_ptr< SFVec3f > H3D::H3DHapticsDevice::devicePosition
 

The position of the device given in the coordinate system of the device.

Access type: outputOnly

H3DHapticsDevice_devicePosition.dot

auto_ptr< SFVec3f > H3D::H3DHapticsDevice::force
 

The approximation of the force that has been rendered during the last scenegraph loop.

Access type: outputOnly

H3DHapticsDevice_force.dot

auto_ptr< SFInt32 > H3D::H3DHapticsDevice::hapticsRate
 

The update rate of the servoloop of the H3DHapticsDevice.

Access type: outputOnly

H3DHapticsDevice_hapticsRate.dot

auto_ptr< SFBool > H3D::H3DHapticsDevice::initialized
 

true if the device is initialized and ready for calls to updateDeviceValues() and renderObjects().

If not initDevice() will have to be called in order to initialize it before calling those functions.

Access type: outputOnly
Default value: false

auto_ptr< SFInt32 > H3D::H3DHapticsDevice::inputDOF
 

The degrees of freedom supported as input.

Access type: outputOnly

H3DHapticsDevice_inputDOF.dot

auto_ptr< SFBool > H3D::H3DHapticsDevice::mainButton
 

The state of the main button.

true means that the button is pressed.

Access type: outputOnly

H3DHapticsDevice_mainButton.dot

auto_ptr< OrnCalibration > H3D::H3DHapticsDevice::orientationCalibration
 

The calibration rotation between deviceOrientation and trackerOrientation.

Access type: inputOutput
Default value: Rotation( 1, 0, 0, 0 )

H3DHapticsDevice_orientationCalibration.dot

auto_ptr< SFInt32 > H3D::H3DHapticsDevice::outputDOF
 

The degrees of freedom supported as output, i.e.

forces and torques.

Access type: outputOnly

H3DHapticsDevice_outputDOF.dot

auto_ptr< PosCalibration > H3D::H3DHapticsDevice::positionCalibration
 

The calibration matrix between devicePosition and trackerPosition.

Access type: inputOutput
Default value: Unit matrix

H3DHapticsDevice_positionCalibration.dot

auto_ptr< SFVec3f > H3D::H3DHapticsDevice::proxyPosition
 

The position of the proxy used in the haptic rendering.

Access type: outputOnly

H3DHapticsDevice_proxyPosition.dot

auto_ptr< SFFloat > H3D::H3DHapticsDevice::proxyWeighting
 

The weighting between proxyPosition and trackerPosition when calculating weightedProxyPosition.

The value should be between 0 and 1, with 1 meaning that the weightedProxyPosition is the proxyPosition and 0 that it is the trackerPosition.

Access type: inputOutput
Default value: 0.95

H3DHapticsDevice_proxyWeighting.dot

auto_ptr< SFNode > H3D::H3DHapticsDevice::stylus
 

The Node used as the visual representation of the stylus.

Access type: outputOnly

H3DHapticsDevice_stylus.dot

auto_ptr< SFVec3f > H3D::H3DHapticsDevice::torque
 

The approximation of the torque that has been rendered during the last scenegraph loop.

Access type: outputOnly

H3DHapticsDevice_torque.dot

auto_ptr< TrackerOrientation > H3D::H3DHapticsDevice::trackerOrientation
 

The orientation of the device in the world coordinates of the API.

Access type: outputOnly

H3DHapticsDevice_trackerOrientation.dot

auto_ptr< TrackerPosition > H3D::H3DHapticsDevice::trackerPosition
 

The position of the device in the world coordinates of the API.

Access type: outputOnly

H3DHapticsDevice_trackerPosition.dot

auto_ptr< SFVec3f > H3D::H3DHapticsDevice::weightedProxyPosition
 

A weighted position between proxyPosition and trackerPosition.

The weighting factor is the proxyWeigting field. By default this is the field that is used to display the stylus graphically.

Access type: outputOnly

H3DHapticsDevice_weightedProxyPosition.dot


Generated on Thu Aug 24 12:39:16 2006 for H3D API by  doxygen 1.4.5