H3D::HLShape Class Reference

The base class for all haptic shapes that uses HLAPI for haptic rendering. More...

#include <HLShape.h>

Inheritance diagram for H3D::HLShape:

Inheritance graph
List of all members.

Public Member Functions

virtual void hlRender (HLHapticsDevice *hd)=0
 This function performs all the HLAPI calls that are needed to render the surface.
virtual ~HLShape ()
 Destructor.
HLuint getShapeId (HLHapticsDevice *hd)
 Get the HLAPI shape id that is used to render this shape.
virtual bool closeEnoughToBound (const Vec3f &p, const Vec3f &previous_p, const Matrix4f &m, X3DGeometryNode *geom)
 Returns true if the proxy is close enough to the bound of the geometry to be considered for haptics rendering.

Static Public Member Functions

static HLShapegetHLShape (HLuint id)
 Given an shape id return the HLShape with that id.
static void resetShapeIdDB ()
 Reset the shape id database, removing all previous info on how many times a Node has appeared.
static unsigned int getFreeShapeIdIndex (X3DGeometryNode *geom, HLHapticsDevice *hd)
 Given a pointer to a Node return an index indicating how many times this node has been used to generate a HLShape.

Protected Types

typedef std::map< std::pair<
X3DGeometryNode *, HLHapticsDevice * >,
unsigned int > 
ShapeIdMap
typedef std::multimap< HLuint,
HLShape * > 
HLShapeMap

Protected Attributes

std::vector< HLuint > shape_ids
 The shape ids that are used by this HLShape.

Static Protected Attributes

static ShapeIdMap shape_id_db
 We maintain a database of how many times the same Node has been used to create a HLShape.
static HLShapeMap hl_shape_map
 A static map from shape id to HLShape *.

Detailed Description

The base class for all haptic shapes that uses HLAPI for haptic rendering.

It provides a unique HLAPI shape identifier to be used in calls to hlBeginShape.


Member Function Documentation

virtual bool H3D::HLShape::closeEnoughToBound const Vec3f p,
const Vec3f previous_p,
const Matrix4f m,
X3DGeometryNode geom
[virtual]
 

Returns true if the proxy is close enough to the bound of the geometry to be considered for haptics rendering.

By default the values from OpenHapticsOptions nodes are used. p is in global coordinates and m is the transformation matrix from global to local space.

static unsigned int H3D::HLShape::getFreeShapeIdIndex X3DGeometryNode geom,
HLHapticsDevice hd
[inline, static]
 

Given a pointer to a Node return an index indicating how many times this node has been used to generate a HLShape.

Can be given as argument to X3DGeometry::getShapeId() in order to get a unique shape id regardless of how many times the node appears in the scene graph.


Member Data Documentation

ShapeIdMap H3D::HLShape::shape_id_db [static, protected]
 

We maintain a database of how many times the same Node has been used to create a HLShape.

Since Nodes can be shared in several places in the scene graph it can generate several HLShapes. HLAPI requires each of these to have a unique id. Hence we must keep track of how many times a Node that generates a HLShape appears in the scene graph. The map is from pointer to nr of times the pointer has appeared since the last call to resetShapeIdDB().


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