H3D::TraverseInfo Class Reference

TraverseInfo is a structure that is passed along when traversing the scene graph. More...

#include <TraverseInfo.h>

List of all members.

Public Member Functions

 H3D_VALUE_EXCEPTION (int, InvalidHapticsDeviceIndex)
 Thrown when trying to get hold of a H3DHapticsDevice using an invalid device index.
 TraverseInfo (const vector< H3DHapticsDevice * > &_haptics_devices)
 Constructor.
int getHapticsDeviceIndex (H3DHapticsDevice *hd)
 Returns the index of the given H3DHapticsDevice.
void addHapticShape (int device_index, HapticShape *shape)
 Adds a HapticShape to be rendered by a H3DHapticsDevice.
void addHapticShape (H3DHapticsDevice *hd, HapticShape *shape)
 Adds a HapticShape to be rendered by a H3DHapticsDevice.
void addHapticShapeToAll (HapticShape *shape)
 Adds a HapticShape to be rendered by all H3DHapticsDevices.
const HapticShapeVectorgetHapticShapes (int device_index)
 Get the HapticShapes that has been added for the H3DHapticsDevice with the given device_index.
const HapticShapeVectorgetHapticShapes (H3DHapticsDevice *hd)
 Get the HapticShapes that has been added for the given H3DHapticsDevice.
void addForceEffect (int device_index, HapticForceEffect *effect)
 Adds a HapticForceEffect to be rendered by a H3DHapticsDevice.
void addForceEffect (H3DHapticsDevice *hd, HapticForceEffect *effect)
 Adds a HapticForceEffect to be rendered by a H3DHapticsDevice.
void addForceEffectToAll (HapticForceEffect *effect)
 Adds a HapticForceEffect to be rendered by all H3DHapticsDevices.
const HapticEffectVectorgetForceEffects (int device_index)
 Get the HapticForceEffects that has been added for the H3DHapticsDevice with the given device_index.
const HapticEffectVectorgetForceEffects (H3DHapticsDevice *hd)
 Get the HapticForceEffects that has been added for the given H3DHapticsDevice.
void setCurrentSurface (H3DSurfaceNode *s)
 Sets the surface that is active in the current traversal.
H3DSurfaceNodegetCurrentSurface ()
 Get the surface that is active in the current traversal.
H3DHapticsDevicegetHapticsDevice (int device_index)
const vector< H3DHapticsDevice * > & getHapticsDevices ()
 Get the haptics devices that are available.
void disableHaptics ()
 When called, future calls to addHapticShapes() and addForceEffects() functions will not add any shapes until enableHaptics() is called.
void enableHaptics ()
 When called, the addHapticShapes() and addForceEffects() functions calls will add HapticShapes to render.
bool hapticsEnabled ()
 Check whether haptics is enabled or not.
void pushMatrices (const Matrix4f &forward, const Matrix4f &inverse)
 This function should be called when we move into a nested coordinate space with the transformation matrices between the coordinate spaces.
void popMatrices ()
 This function should be called when we move out from a nested coordinate space.
const Matrix4fgetAccForwardMatrix ()
 Get the accumulated forward transformation matrix, i.e.
const Matrix4fgetAccInverseMatrix ()
 Get the accumulated inverse transformation matrix, i.e.

Protected Attributes

stack< TransformInfo > transform_stack
H3DSurfaceNodecurrent_surface
vector< H3DHapticsDevice * > haptics_devices
vector< HapticShapeVectorhaptic_shapes
vector< HapticEffectVectorhaptic_effects
bool haptics_enabled


Detailed Description

TraverseInfo is a structure that is passed along when traversing the scene graph.

It contains information needed during the traversing, including e.g. transform matrices, available haptics devices etc. Geometry nodes must register the shapes to render haptically by calls to the addHapticShape() function calls.


Constructor & Destructor Documentation

H3D::TraverseInfo::TraverseInfo const vector< H3DHapticsDevice * > &  _haptics_devices  )  [inline]
 

Constructor.

Parameters:
_haptics_devices The HapticDevice instances that are available to render HapticShapes on.


Member Function Documentation

void H3D::TraverseInfo::addForceEffect H3DHapticsDevice hd,
HapticForceEffect effect
[inline]
 

Adds a HapticForceEffect to be rendered by a H3DHapticsDevice.

Shapes will only be added if hapticsEnabled() is true.

Parameters:
hd The H3DHapticsDevice to render the shape on.
effect The HapticForceEffect to render.

void TraverseInfo::addForceEffect int  device_index,
HapticForceEffect effect
 

Adds a HapticForceEffect to be rendered by a H3DHapticsDevice.

Effects will only be added if hapticsEnabled() is true.

Parameters:
device_index The index of the H3DHapticsDevice to render the shape on.
effect The HapticForceEffect to render.

void TraverseInfo::addForceEffectToAll HapticForceEffect effect  ) 
 

Adds a HapticForceEffect to be rendered by all H3DHapticsDevices.

Effects will only be added if hapticsEnabled() is true.

Parameters:
effect The HapticForceEffect to render.

void H3D::TraverseInfo::addHapticShape H3DHapticsDevice hd,
HapticShape shape
[inline]
 

Adds a HapticShape to be rendered by a H3DHapticsDevice.

Shapes will only be added if hapticsEnabled() is true.

Parameters:
hd The H3DHapticsDevice to render the shape on.
shape The HapticShape to render.

void TraverseInfo::addHapticShape int  device_index,
HapticShape shape
 

Adds a HapticShape to be rendered by a H3DHapticsDevice.

Shapes will only be added if hapticsEnabled() is true.

Parameters:
device_index The index of the H3DHapticsDevice to render the shape on.
shape The HapticShape to render.

void TraverseInfo::addHapticShapeToAll HapticShape shape  ) 
 

Adds a HapticShape to be rendered by all H3DHapticsDevices.

Shapes will only be added if hapticsEnabled() is true.

Parameters:
shape The HapticShape to render.

void H3D::TraverseInfo::enableHaptics  )  [inline]
 

When called, the addHapticShapes() and addForceEffects() functions calls will add HapticShapes to render.

Haptics is enabled by default.

const Matrix4f& H3D::TraverseInfo::getAccForwardMatrix  )  [inline]
 

Get the accumulated forward transformation matrix, i.e.

the transformation matrix from the local space at the current traversal position to global space.

const Matrix4f& H3D::TraverseInfo::getAccInverseMatrix  )  [inline]
 

Get the accumulated inverse transformation matrix, i.e.

the transformation matrix from global space to the local space at the current traversal position.

int H3D::TraverseInfo::getHapticsDeviceIndex H3DHapticsDevice hd  )  [inline]
 

Returns the index of the given H3DHapticsDevice.

-1 is returned if the H3DHapticsDevice is not in the vector of haptics devices.

bool H3D::TraverseInfo::hapticsEnabled  )  [inline]
 

Check whether haptics is enabled or not.

If disabled the addHapticsShapes() functions will have no effect. Geometry nodes that add shapes should check that haptics is enabled before doing any calculations deciding what to render. This is because any HapticShape created will not be rendered anyway so no computer resources should be used creating them.

void H3D::TraverseInfo::pushMatrices const Matrix4f forward,
const Matrix4f inverse
[inline]
 

This function should be called when we move into a nested coordinate space with the transformation matrices between the coordinate spaces.

Parameters:
forward Transformation matrix between the space we move into to the previous space.
inverse The inverse of forward.


Generated on Thu Aug 24 12:40:13 2006 for H3D API by  doxygen 1.4.5