H3D::X3DGeometryNode Class Reference
[Abstract nodes.]

This is the base node type for all geometry in X3D. More...

#include <X3DGeometryNode.h>

Inheritance diagram for H3D::X3DGeometryNode:

Inheritance graph
List of all members.

Public Types

typedef TypedMFNode< H3DOptionNodeMFOptionsNode

Public Member Functions

 X3DGeometryNode (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< DisplayList > _displayList=0, Inst< MFBool > _isTouched=0, Inst< MFVec3f > _force=0, Inst< MFVec3f > _contactPoint=0, Inst< MFVec3f > _contactNormal=0)
 Constructor.
virtual void hlRender (HLHapticsDevice *hd, Matrix4f &transform)
 This function will be called when rendering the geometry as a feedback shape or depth buffer shape for OpenHaptics and can be used to have other OpenGL calls for the OpenHaptics rendering than for graphics rendering.
void useBackFaceCulling (bool enabled)
 This function should be used by the render() function to disable or enable back face culling.
bool usingBackFaceCulling ()
 Returns if back face culling is in use or not.
void allowBackFaceCulling (bool allow)
 Control if back face culling is allowed or not.
bool allowingBackFaceCulling ()
 Returns true if back face culling is allowed, false otherwise.
template<class OptionNodeType>
void getOptionNode (OptionNodeType *&option)
 Get the first option node of the type of the pointer given as argument from the renderOptions fieeld The option argument will contain the node afterwards, or NULL if no option of that type exists.
virtual ~X3DGeometryNode ()
 Destructor. Deletes the hl_shape_id.
HLuint getHLShapeId (HLHapticsDevice *hd, unsigned int index)
 Get a shape id to be used for rendering of this geometry with HLAPI for the given haptics device.
HapticShapegetOpenGLHapticShape (H3DSurfaceNode *_surface, const Matrix4f &_transform, HLint _nr_vertices=-1)
 Returns a either a HLFeedbackShape or a HLDepthBufferShape with the X3DGeometryNode.
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value.

Public Attributes

auto_ptr< MFBoolisTouched
 Tells if a HapticsDevice has been in contact with the geometry in the last scenegraph loop.
auto_ptr< MFVec3fforce
 The last force delivered by this geometry to the haptics device.
auto_ptr< MFVec3fcontactPoint
 The last contact points of the HapticDevices on the geometry.
auto_ptr< MFVec3fcontactNormal
 The normal at the last contact points of the HapticDevices on the geometry.
auto_ptr< MFOptionsNodeoptions
 Contains nodes with options for haptics and graphics rendering.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Types

typedef map< HLHapticsDevice *,
vector< HLuint > > 
ShapeIdMap

Static Protected Member Functions

static void HLCALLBACK touchCallback (HLenum event, HLuint object, HLenum thread, HLcache *cache, void *userdata)
 HL event callback function for when the geometry is touched.
static void HLCALLBACK untouchCallback (HLenum event, HLuint object, HLenum thread, HLcache *cache, void *userdata)
 HL event callback function for when the geometry is not touched any longer.
static void HLCALLBACK motionCallback (HLenum event, HLuint object, HLenum thread, HLcache *cache, void *userdata)
 HL event callback function for when the proxy moves while in contact with the geometry.

Protected Attributes

ShapeIdMap hl_shape_ids
 HL identifiers for the geometry.
AutoPtrVector< CallbackData > callback_data
bool use_back_face_culling
bool allow_back_face_culling

Classes

class  BugWorkaroundDisplayList
 This is just a dummy class to get around a bug in Visual C++ 7.1 If the X3DGeometry::DisplayList inherits directly from H3DDisplayListObject::Display list the application will crash if trying to call H3DDisplayListObject::DisplayList::callList By using an intermediate class the bug dissappears. More...
class  DisplayList
 Display list is extended in order to set front sidedness of triangles outside the display list. More...

Detailed Description

This is the base node type for all geometry in X3D.


Member Function Documentation

void H3D::X3DGeometryNode::allowBackFaceCulling bool  allow  )  [inline]
 

Control if back face culling is allowed or not.

Used when rendering HLFeedbackBuffer or HLDepthBuffer shapes in order not to have back face culling on when rendering shapes with OpenHaptics.

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

Returns the default xml containerField attribute value.

For this node it is "geometry".

Reimplemented from H3D::Node.

HLuint X3DGeometryNode::getHLShapeId HLHapticsDevice hd,
unsigned int  index
 

Get a shape id to be used for rendering of this geometry with HLAPI for the given haptics device.

Since the geometry can appear in several places in the scene graph it can contain several shape ids (one for each place). Which one to get is determined by the index argument.

HapticShape * X3DGeometryNode::getOpenGLHapticShape H3DSurfaceNode _surface,
const Matrix4f _transform,
HLint  _nr_vertices = -1
 

Returns a either a HLFeedbackShape or a HLDepthBufferShape with the X3DGeometryNode.

Which type depents on possible OpenHapticsOptions nodes in the options field and the default settings in OpenHapticsSettings bindable node.

virtual void H3D::X3DGeometryNode::hlRender HLHapticsDevice hd,
Matrix4f transform
[inline, virtual]
 

This function will be called when rendering the geometry as a feedback shape or depth buffer shape for OpenHaptics and can be used to have other OpenGL calls for the OpenHaptics rendering than for graphics rendering.

By default it is the same is in the graphics rendering.

void H3D::X3DGeometryNode::useBackFaceCulling bool  enabled  )  [inline]
 

This function should be used by the render() function to disable or enable back face culling.

DO NOT USE glEnable/glDisable to do this, since it will cause problems with OpenHaptics.


Member Data Documentation

auto_ptr< MFVec3f > H3D::X3DGeometryNode::contactNormal
 

The normal at the last contact points of the HapticDevices on the geometry.

The field contains a normal for each of the points in contactPoint. The value will be an empty vector before the first contact.

Access type: outputOnly

auto_ptr< MFVec3f > H3D::X3DGeometryNode::contactPoint
 

The last contact points of the HapticDevices on the geometry.

The field contains a contact point for each HapticsDevice with the index as specified in the DeviceInfo node. The value will be an empty vector before the first contact.

Access type: outputOnly

auto_ptr< MFVec3f > H3D::X3DGeometryNode::force
 

The last force delivered by this geometry to the haptics device.

The field contains a force vector for each HapticsDevice with the index as specified in the DeviceInfo node. The value will be an empty vector before the first contact.

auto_ptr< MFBool > H3D::X3DGeometryNode::isTouched
 

Tells if a HapticsDevice has been in contact with the geometry in the last scenegraph loop.

The field contains a boolean for each HapticsDevice with the index as specified in the DeviceInfo node. You can get the contact point from the contactPoint field. The value will be an empty vector before the first contact.

Access type: outputOnly

auto_ptr< MFOptionsNode > H3D::X3DGeometryNode::options
 

Contains nodes with options for haptics and graphics rendering.

Access type: inputOnly


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