H3D::HLHapticsDevice Class Reference
[H3D specific Node classes.]

HLHapticsDevice is a haptics device that uses the HLAPI from SensAble to do the haptic rendering. More...

#include <HLHapticsDevice.h>

Inheritance diagram for H3D::HLHapticsDevice:

Inheritance graph
List of all members.

Public Types

typedef TypedSFNode< DeviceLogSFDeviceLog

Public Member Functions

 H3D_VALUE_EXCEPTION (string, CouldNotInitHapticsDevice)
 HLHapticsDevice (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 > _mainButton=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, Inst< SFString > _deviceName=0, Inst< SFBool > _secondaryButton=0, Inst< SFDeviceLog > _deviceLog=0)
 Construtor.
virtual ~HLHapticsDevice ()
 Destructor.
virtual void preRender ()
 Starts a new haptic frame.
virtual void postRender ()
 Ends the haptic frame.
virtual void initDevice ()
 Does all the initialization needed for the device before starting to use it.
virtual void initHLLayer ()
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 HLHapticsDevice, and possible vice versa.
virtual void renderShapes (const HapticShapeVector &shapes)
 Uses the HLAPI to render the objects.
virtual void renderEffects (const HapticEffectVector &effects)
 Uses HLAPI to render the ForceEffects.
HapticEffectVectorgetCurrentForceEffects ()
 Returns the force effects to render in the realtime loop.
HapticEffectVectorgetLastForceEffects ()
 Returns the force effects that was rendered during last scene graph loop.
HHD getDeviceHandle ()
 Returns the HD device handle for this device.
HHLRC getHapticContext ()
 Returns the haptic context for this device.

Static Public Member Functions

static void HLCALLBACK hlButtonCallback (HLenum event, HLuint object, HLenum thread, HLcache *cache, void *data)

Public Attributes

auto_ptr< SFStringdeviceName
 The name of the device.
auto_ptr< SFBoolsecondaryButton
 The status of the secondary button (if such a button exists).
auto_ptr< SFDeviceLogdeviceLog
 Logging Node that can be used to log device position and orientation information to a binary file.
TimeStamp last_effect_change
 The time for the last call to the changeForceEffects callback function.
TimeStamp last_loop_time
 The time between the previous two calls to changeForceEffects.
AutoRef< DeviceLoglog
 Realtime pointer to deviceLog.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

HHD device_handle
 The device handle used in the HLAPI.
HHLRC haptic_context
 The HLAPI haptic context used by this device.
vector< HDCallbackCode > hd_handles
 Handle for the callback for rendering ForceEffects.

Detailed Description

HLHapticsDevice is a haptics device that uses the HLAPI from SensAble to do the haptic rendering.

Internal routes:
HLHapticsDevice.dot


Member Function Documentation

virtual void H3D::HLHapticsDevice::disableDevice  )  [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 from H3D::H3DHapticsDevice.

HapticEffectVector& H3D::HLHapticsDevice::getCurrentForceEffects  )  [inline]
 

Returns the force effects to render in the realtime loop.

Should not be called from the scenegraph loop.

HHLRC H3D::HLHapticsDevice::getHapticContext  )  [inline]
 

Returns the haptic context for this device.

Before rendering anything on this device this context must have been made active

HapticEffectVector& H3D::HLHapticsDevice::getLastForceEffects  )  [inline]
 

Returns the force effects that was rendered during last scene graph loop.

Should not be called from the scenegraph loop.

virtual void H3D::HLHapticsDevice::renderEffects const HapticEffectVector effects  )  [virtual]
 

Uses HLAPI to render the ForceEffects.

Parameters:
objects The force effects to render.

virtual void H3D::HLHapticsDevice::renderShapes const HapticShapeVector shapes  )  [virtual]
 

Uses the HLAPI to render the objects.

The objects given must be a subclass to HLObject in order to be rendered.


Member Data Documentation

auto_ptr< SFDeviceLog > H3D::HLHapticsDevice::deviceLog
 

Logging Node that can be used to log device position and orientation information to a binary file.

Access type: initializeOnly
Default value: NONE

auto_ptr< SFString > H3D::HLHapticsDevice::deviceName
 

The name of the device.

Access type: initializeOnly
Default value: "Default PHANToM"

HLHapticsDevice_deviceName.dot

auto_ptr< SFBool > H3D::HLHapticsDevice::secondaryButton
 

The status of the secondary button (if such a button exists).

true means that the button is pressed

Access type: outputOnly
Default value: false

HLHapticsDevice_secondaryButton.dot


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