H3D API  2.4.1
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
H3D::X3DGroupingNode Class Reference

This abstract node type indicates that concrete node types derived from it contain children nodes and is the basis for all aggregation. More...

#include <H3D/X3DGroupingNode.h>

Inheritance diagram for H3D::X3DGroupingNode:
Inheritance graph

Classes

class  AddChildren
 AddChildren is a class that adds any node added to it to the children field of its owner (X3DGroupingNode) if the node is not already in the children field. More...
 
class  MFChild
 MFChild sets up a routes from the Nodes that are added and removed from the field to the owner of the field. More...
 
class  RemoveChildren
 RemoveChildren is a class that removes any node added to it from the children field of its owner (X3DGroupingNode). More...
 
class  SFBound
 SFBound is specialized to update from the SFBound fields routed to it. More...
 

Public Member Functions

 X3DGroupingNode (Inst< AddChildren > _addChildren=0, Inst< RemoveChildren > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0)
 Constructor.
 
virtual ~X3DGroupingNode ()
 Destructor.
 
virtual void initialize ()
 Sets up the bound field using the bboxCenter and bboxSize fields. More...
 
virtual void render ()
 Render the children.
 
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph. traverseSG() is called in all children nodes.
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and a Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. 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.
 

Public Attributes

bool use_union_bound
 if true a route will be set up between the bound field of the nodes in children and the bound field of the grouping node. More...
 
H3DUniquePtr< AddChildrenaddChildren
 The addChildren event appends nodes to the children field of a grouping node. More...
 
H3DUniquePtr< RemoveChildrenremoveChildren
 The removeChildren event removes nodes from the children field of the grouping node . More...
 
H3DUniquePtr< MFChildchildren
 The nodes that are grouped together by this node. 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

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Protected Attributes

bool children_multi_pass_transparency
 Will be set in traverseSG to indicate if any of the children enables multi-pass transparency. More...
 
vector< H3DRenderStateObject * > render_states
 A vector of all the H3DRenderStatesObject within this X3DGroupingNode.
 
vector< ClipPlane * > clip_planes
 A vector of only ClipPlane children of this X3DGroupingNode.
 

Additional Inherited Members

- 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.
 
- 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.
 
- 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

This abstract node type indicates that concrete node types derived from it contain children nodes and is the basis for all aggregation.

Internal routes:

Member Function Documentation

◆ closestPoint()

void X3DGroupingNode::closestPoint ( const Vec3f &  p,
NodeIntersectResult result 
)
virtual

Find closest point on Node to p.

Calls closestPoint for all children

Parameters
pThe point to find the closest point to.
resultA struct containing various results of closest points such as which geometries the closest points where detected on.

Reimplemented from H3D::Node.

Reimplemented in H3D::ToggleGroup, H3D::Switch, H3D::MatrixTransform, H3D::LOD, and H3D::Collision.

References children, and H3DUtil::AutoRefVector< class >::size().

Referenced by H3D::Collision::closestPoint(), H3D::Inline::closestPoint(), H3D::MatrixTransform::closestPoint(), and H3D::ToggleGroup::closestPoint().

◆ initialize()

virtual void H3D::X3DGroupingNode::initialize ( )
inlinevirtual

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

If bboxSize is (-1, -1, -1) the bound will be the union of all the bound objects of the Nodes in the children 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::FrameBufferTextureGenerator.

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

Referenced by H3D::FrameBufferTextureGenerator::initialize().

◆ lineIntersect()

bool X3DGroupingNode::lineIntersect ( const Vec3f &  from,
const Vec3f &  to,
LineIntersectResult result 
)
virtual

Detect intersection between a line segment and a Node.

Calls lineIntersect for all children

Parameters
fromThe start of the line segment.
toThe end of the line segment.
resultContains info about the closest intersection for every object that intersects the line.
Returns
true if intersected, false otherwise.

Reimplemented from H3D::Node.

Reimplemented in H3D::ToggleGroup, H3D::Switch, H3D::MatrixTransform, H3D::LOD, and H3D::Collision.

References H3D::H3DBoundedObject::bound, children, clip_planes, H3D::Node::LineIntersectResult::detect_pt_device, H3D::Node::NodeIntersectResult::getCurrentTransform(), H3D::Bound::lineSegmentIntersect(), H3D::Node::LineIntersectResult::popCurrentPtDevice(), H3D::Node::LineIntersectResult::pushCurrentPtDevice(), and H3DUtil::AutoRefVector< class >::size().

Referenced by H3D::Collision::lineIntersect(), H3D::Inline::lineIntersect(), H3D::MatrixTransform::lineIntersect(), and H3D::ToggleGroup::lineIntersect().

◆ movingSphereIntersect()

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

Detect collision between a moving sphere and the Node.

Calls movingSphereIntersect for all children

Parameters
radiusThe radius of the sphere
fromThe start position of the sphere
toThe end position of the sphere.
resultA struct containing various results of intersections such as which geometries intersected the moving sphere.
Returns
true if intersected, false otherwise.

Reimplemented from H3D::Node.

Reimplemented in H3D::ToggleGroup, H3D::Switch, H3D::MatrixTransform, H3D::LOD, and H3D::Collision.

References H3D::H3DBoundedObject::bound, children, H3D::Bound::movingSphereIntersect(), and H3DUtil::AutoRefVector< class >::size().

Referenced by H3D::Collision::movingSphereIntersect(), H3D::Inline::movingSphereIntersect(), H3D::MatrixTransform::movingSphereIntersect(), and H3D::ToggleGroup::movingSphereIntersect().

Member Data Documentation

◆ addChildren

H3DUniquePtr< AddChildren > H3D::X3DGroupingNode::addChildren

The addChildren event appends nodes to the children field of a grouping node.

Any nodes passed to the addChildren field that are already in the children list of the grouping node are ignored.

Access type: inputOnly

◆ children

H3DUniquePtr< MFChild > H3D::X3DGroupingNode::children

◆ children_multi_pass_transparency

bool H3D::X3DGroupingNode::children_multi_pass_transparency
protected

Will be set in traverseSG to indicate if any of the children enables multi-pass transparency.

We use this flag to avoid traversing into children without transparent objects when multi-pass rendered transparent objects are to be rendered.

Referenced by H3D::FrameBufferTextureGenerator::render().

◆ removeChildren

H3DUniquePtr< RemoveChildren > H3D::X3DGroupingNode::removeChildren

The removeChildren event removes nodes from the children field of the grouping node .

Any nodes in the removeChildren event that are not in the children list of the grouping node are ignored.

Access type: inputOnly

◆ use_union_bound

bool H3D::X3DGroupingNode::use_union_bound

if true a route will be set up between the bound field of the nodes in children and the bound field of the grouping node.


Referenced by H3D::FrameBufferTextureGenerator::initialize(), H3D::X3DGroupingNode::MFChild::onAdd(), and H3D::X3DGroupingNode::MFChild::onRemove().


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