H3D API  2.4.1
List of all members
H3D::Shape Class Reference

The Shape node has two fields, appearance and geometry, which are used to create rendered objects in the world. More...

#include <H3D/Shape.h>

Inheritance diagram for H3D::Shape:
Inheritance graph

Additional Inherited Members

- Public Types inherited from H3D::X3DShapeNode
enum  GeometryRenderMode {
  TRANSPARENT_ONLY , TRANSPARENT_FRONT , TRANSPARENT_BACK , SOLID ,
  ALL
}
 Tells which type of geometry should be rendered. More...
 
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. More...
 
typedef TypedSFNode< X3DGeometryNodeSFHapticGeometry
 SFHapticGeometry contains a X3DGeometryNode.
 
- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Public Member Functions inherited from H3D::X3DShapeNode
 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. More...
 
virtual void render ()
 Render the shape using OpenGL.
 
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph. Calls traverseSG on appeance and geometry. More...
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the X3DGeometryNode in the field geometry. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on the node in the field geometry. More...
 
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. More...
 
- Public Member Functions inherited from H3D::X3DChildNode
 X3DChildNode (Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
- Public Member Functions inherited from H3D::H3DBoundedObject
 H3DBoundedObject (Inst< SFBound > _bound=0)
 Constructor.
 
- Public Member Functions inherited from H3D::H3DDisplayListObject
 H3DDisplayListObject (Inst< DisplayList > _displayList=0)
 Constructor.
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 
- Public Attributes inherited from H3D::X3DShapeNode
H3DUniquePtr< SFAppearanceNodeappearance
 The field containing the X3DAppearance node to be used when rendering the shape. More...
 
H3DUniquePtr< SFGeometryNodegeometry
 Contains the X3DGeometryNode to be rendered. More...
 
H3DUniquePtr< SFHapticGeometryhapticGeometry
 If specified, contains a X3DGeometryNode to be rendered haptically. More...
 
H3DUniquePtr< SFShadowObjectNodeshadowVolume
 If specified, contains a H3DShadowObjectNode to be used for shadows. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 
- Public Attributes inherited from H3D::X3DBoundedObject
H3DUniquePtr< SFVec3fbboxCenter
 Specifies a the center of an axis-aligned bounding box enclosing the node. More...
 
H3DUniquePtr< SFVec3fbboxSize
 Specifies a the size of an axis-aligned bounding box enclosing the node. More...
 
- Public Attributes inherited from H3D::H3DBoundedObject
H3DUniquePtr< SFBoundbound
 The field containing the bound object. More...
 
- Public Attributes inherited from H3D::H3DDisplayListObject
H3DUniquePtr< DisplayListdisplayList
 The DisplayList instance handling the OpenGL caching of this object.
 
- Static Public Attributes inherited from H3D::X3DShapeNode
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. More...
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 

Detailed Description

The Shape node has two fields, appearance and geometry, which are used to create rendered objects in the world.

The appearance field contains an Appearance node that specifies the visual attributes (e.g., material and texture) to be applied to the geometry. The geometry field contains an X3DGeometryNode. The specified geometry node is rendered with the specified appearance nodes applied. If the geometry field is NULL, the object is not drawn. The hapticGeometry field also contains a X3DGeometryNode. If specified, this geometry will be used for haptic rendering, enabling separate geometries for graphics and haptics. If hapticsGeometry is NULL, the geometry in the geometry field will be used for haptics as well as graphics.

The bboxCenter and bboxSize fields specify a bounding box that encloses the Shape node's geometry. This is a hint that may be used for optimization purposes. The results are undefined if the specified bounding box is smaller than the actual bounding box of the geometry at any time. A default bboxSize value, (-1, -1, -1), implies that the bounding box is not specified and, if needed, is calculated by the browser.

Internal routes:

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