H3D API
2.4.1
|
This is the base node type for all Shape nodes. More...
#include <H3D/X3DShapeNode.h>
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 } |
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< X3DGeometryNode > | SFHapticGeometry |
SFHapticGeometry contains a X3DGeometryNode. | |
![]() | |
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 | |
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... | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (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. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
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 Field * | getField (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... | |
![]() | |
H3DBoundedObject (Inst< SFBound > _bound=0) | |
Constructor. | |
![]() | |
H3DDisplayListObject (Inst< DisplayList > _displayList=0) | |
Constructor. | |
Public Attributes | |
H3DUniquePtr< SFAppearanceNode > | appearance |
The field containing the X3DAppearance node to be used when rendering the shape. More... | |
H3DUniquePtr< SFGeometryNode > | geometry |
Contains the X3DGeometryNode to be rendered. More... | |
H3DUniquePtr< SFHapticGeometry > | hapticGeometry |
If specified, contains a X3DGeometryNode to be rendered haptically. More... | |
H3DUniquePtr< SFShadowObjectNode > | shadowVolume |
If specified, contains a H3DShadowObjectNode to be used for shadows. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
![]() | |
H3DUniquePtr< SFVec3f > | bboxCenter |
Specifies a the center of an axis-aligned bounding box enclosing the node. More... | |
H3DUniquePtr< SFVec3f > | bboxSize |
Specifies a the size of an axis-aligned bounding box enclosing the node. More... | |
![]() | |
H3DUniquePtr< SFBound > | bound |
The field containing the bound object. More... | |
![]() | |
H3DUniquePtr< DisplayList > | displayList |
The DisplayList instance handling the OpenGL caching of this object. | |
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. More... | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
This is the base node type for all Shape nodes.
typedef DependentSFNode< X3DAppearanceNode, FieldRef<H3DDisplayListObject, H3DDisplayListObject::DisplayList, &H3DDisplayListObject::displayList >, true > H3D::X3DShapeNode::SFAppearanceNode |
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.
Tells which type of geometry should be rendered.
|
virtual |
Find closest point on the node in the field geometry.
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 H3D::X3DGeometryNode::closestPoint(), and geometry.
|
inlinevirtual |
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.
|
virtual |
Detect intersection between a line segment and the X3DGeometryNode in the field geometry.
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. |
Reimplemented from H3D::Node.
References geometry, and H3D::X3DGeometryNode::lineIntersect().
|
virtual |
Detect collision between a moving sphere and the geometry in the geometry field.
radius | The radius of the sphere |
from | The start position of the sphere |
to | The end position of the sphere. |
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().
|
virtual |
Traverse the scenegraph. Calls traverseSG on appeance and geometry.
node since a change in the value should break the cache and generate a new display list.
Reimplemented from H3D::Node.
Reimplemented in H3D::ParticleSystem, and H3D::DeformableShape.
References appearance, H3D::TraverseInfo::disableHaptics(), H3D::H3DDisplayListObject::displayList, geometry, H3D::TraverseInfo::getAccForwardMatrix(), H3D::GlobalSettings::getActive(), H3D::TraverseInfo::getHapticsEnabled(), H3D::X3DGeometryNode::getShadowObject(), H3D::TraverseInfo::getUserData(), H3D::TraverseInfo::graphicsEnabled(), hapticGeometry, H3D::X3DAppearanceNode::hasGeometryShadow(), H3D::X3DAppearanceNode::isTransparent(), H3D::MatrixTransform::matrix, H3D::ShadowCaster::object, H3D::GlobalSettings::renderMode, H3D::TraverseInfo::setCurrentSurface(), H3D::TraverseInfo::setHapticsEnabled(), H3D::TraverseInfo::setMultiPassTransparency(), H3D::ShadowTransform::shadowVolume, shadowVolume, H3D::H3DShadowObjectNode::transform, H3D::Node::traverseSG(), H3D::X3DAppearanceNode::traverseSG(), H3D::X3DGeometryNode::traverseSG(), and H3D::X3DAppearanceNode::usingMultiPassTransparency().
Referenced by H3D::DeformableShape::traverseSG(), and H3D::ParticleSystem::traverseSG().
H3DUniquePtr< SFAppearanceNode > H3D::X3DShapeNode::appearance |
The field containing the X3DAppearance node to be used when rendering the shape.
Access type: inputOutput
Referenced by H3D::ParticleSystem::render(), render(), traverseSG(), and X3DShapeNode().
|
static |
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::getAffectedGLAttribs(), H3D::Scene::idle(), H3D::Appearance::preRender(), render(), and H3D::H3DWindowNode::render().
H3DUniquePtr< SFGeometryNode > H3D::X3DShapeNode::geometry |
Contains the X3DGeometryNode to be rendered.
Access type: inputOutput
Referenced by closestPoint(), lineIntersect(), movingSphereIntersect(), H3D::ParticleSystem::render(), render(), H3D::DeformableShape::traverseSG(), traverseSG(), and X3DShapeNode().
H3DUniquePtr< SFHapticGeometry > H3D::X3DShapeNode::hapticGeometry |
If specified, contains a X3DGeometryNode to be rendered haptically.
If NULL the geometry in the geometry field will be used.
Access type: inputOutput
Referenced by H3D::DeformableShape::traverseSG(), and traverseSG().
H3DUniquePtr< SFShadowObjectNode > H3D::X3DShapeNode::shadowVolume |
If specified, contains a H3DShadowObjectNode to be used for shadows.
If NULL the standard shadow volume of the geometry will be used.
Access type: inputOutput
Referenced by traverseSG().