H3D::X3DShapeNode Class Reference
[Abstract nodes.]

This is the base node type for all Shape nodes. More...

#include <H3D/X3DShapeNode.h>

Inheritance diagram for H3D::X3DShapeNode:

Inheritance graph

List of all members.

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. More...
class  SFGeometryNode
 SFGeometryNode is dependent on the displayList field of its encapsulated X3DGeometryNode node, i.e. More...

Public Types

enum  GeometryRenderMode {
  TRANSPARENT_ONLY, TRANSPARENT_FRONT, TRANSPARENT_BACK, SOLID,
  ALL
}
typedef DependentSFNode
< X3DAppearanceNode, FieldRef
< H3DDisplayListObject,
H3DDisplayListObject::DisplayList,&H3DDisplayListObject::displayList >
, true > 
SFAppearanceNode
 SFAppearanceNode is dependent on the displayList field of its encapsulated X3DAppearanceNode node, i.e.
typedef TypedSFNode
< X3DGeometryNode
SFHapticGeometry
 SFHapticGeometry contains a X3DGeometryNode.

Public Member Functions

 X3DShapeNode (Inst< SFAppearanceNode > _appearance=0, Inst< SFGeometryNode > _geometry=0, Inst< SFHapticGeometry > _hapticGeometry=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< DisplayList > _displayList=0)
 Constructor.
virtual void initialize ()
 Sets up the bound field using the bboxCenter and bboxSize fields.
virtual void render ()
 Render the shape using OpenGL.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph. Calls traverseSG on appeance and geometry.
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the X3DGeometryNode in the field geometry.
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on the node in the field geometry.
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the geometry in the geometry field.

Public Attributes

auto_ptr< SFAppearanceNodeappearance
 The field containing the X3DAppearance node to be used when rendering the shape.
auto_ptr< SFGeometryNodegeometry
 Contains the X3DGeometryNode to be rendered.
auto_ptr< SFHapticGeometryhapticGeometry
 If specified, contains a X3DGeometryNode to be rendered haptically.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
static bool disable_lighting_if_no_app = true
 Set to true if lighting should be disabled when no Appearance or Material node has been specified as per X3D spec.


Detailed Description

This is the base node type for all Shape nodes.

Internal routes:
X3DShapeNode.dot

Member Typedef Documentation

SFAppearanceNode is dependent on the displayList field of its encapsulated X3DAppearanceNode node, i.e.

an event from that field will trigger an event from the SFAppearanceNode as well.


Member Enumeration Documentation

Enumerator:
TRANSPARENT_ONLY  render only transparent objects
TRANSPARENT_FRONT  render only the front face of transparent objects
TRANSPARENT_BACK  render only the back face of transparent objects
SOLID  render only noon-transparent objects
ALL  render all objects


Member Function Documentation

void X3DShapeNode::closestPoint ( const Vec3f &  p,
NodeIntersectResult &  result 
) [virtual]

Find closest point on the node in the field geometry.

Parameters:
p The point to find the closest point to.
result A struct containing various results of closest points such as which geometries the closest points where detected on.

Reimplemented from H3D::Node.

References geometry.

virtual void H3D::X3DShapeNode::initialize (  )  [inline, virtual]

Sets up the bound field using the bboxCenter and bboxSize fields.

If bboxSize is (-1, -1, -1) the bound will be the bound of the geometry field. Otherwise it will be a BoxBound with center and origin determined by the bboxCenter and bboxOrigin fields.

Reimplemented from H3DUtil::RefCountedClass.

Reimplemented in H3D::ParticleSystem.

References H3D::H3DBoundedObject::bound, H3D::BoxBound::center, H3DUtil::RefCountedClass::initialize(), and H3D::BoxBound::size.

bool X3DShapeNode::lineIntersect ( const Vec3f &  from,
const Vec3f &  to,
LineIntersectResult &  result 
) [virtual]

Detect intersection between a line segment and the X3DGeometryNode in the field geometry.

Parameters:
from The start of the line segment.
to The end of the line segment.
result Contains info about the closest intersection for every object that intersects the line.
Returns:
true if intersected, false otherwise.

Reimplemented from H3D::Node.

References geometry.

bool X3DShapeNode::movingSphereIntersect ( H3DFloat  radius,
const Vec3f &  from,
const Vec3f &  to,
NodeIntersectResult &  result 
) [virtual]

Detect collision between a moving sphere and the geometry in the geometry field.

Parameters:
radius The radius of the sphere
from The start position of the sphere
to The end position of the sphere.
Returns:
true if intersected, false otherwise.
Parameters:
result A struct containing various results of intersections such as which geometries intersected the moving sphere.

Reimplemented from H3D::Node.

References geometry, and H3D::X3DGeometryNode::movingSphereIntersect().


Member Data Documentation

The field containing the X3DAppearance node to be used when rendering the shape.

Access type: inputOutput

X3DShapeNode_appearance.dot

Referenced by render(), H3D::ParticleSystem::render(), traverseSG(), and X3DShapeNode().

Set to true if lighting should be disabled when no Appearance or Material node has been specified as per X3D spec.

Will be set to false in e.g. H3DWindowNode if a default Material node has been specified in a DefaultAppearance option node.

Referenced by H3D::Appearance::postRender(), H3D::Appearance::preRender(), and H3D::H3DWindowNode::render().

If specified, contains a X3DGeometryNode to be rendered haptically.

If NULL the geometry in the geometry field will be used.

Access type: inputOutput

X3DShapeNode_hapticGeometry.dot

Referenced by traverseSG(), and H3D::DeformableShape::traverseSG().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:30 2008 for H3D API by  doxygen 1.5.7