H3D::Switch Class Reference
[X3D node classes.]

The Switch grouping node traverses zero or one of the nodes specified in the choice field. More...

#include <H3D/Switch.h>

Inheritance diagram for H3D::Switch:

Inheritance graph

List of all members.

Classes

class  SFBound
 SFBound is specialized to update from the SFBound fields routed to it. More...

Public Member Functions

 Switch (Inst< MFChild > _addChildren=0, Inst< MFChild > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFInt32 > _whichChoice=0)
 Constructor.
virtual void render ()
 Only render the child defined by whichChoice,.
virtual void traverseSG (TraverseInfo &ti)
 Only traverse the childe defined by whichChoice.

Public Attributes

auto_ptr< SFInt32whichChoice
 The whichChoice field specifies the index of the child to traverse, with the first child having index 0.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The Switch grouping node traverses zero or one of the nodes specified in the choice field.

The whichChoice field specifies the index of the child to traverse, with the first child having index 0. If whichChoice is less than zero or greater than the number of nodes in the choice field, nothing is chosen.

All nodes under a Switch continue to receive and send events regardless of the value of whichChoice. For example, if an active TimeSensor is contained within an inactive choice of an Switch, the TimeSensor sends events regardless of the Switch's state.

The bboxCenter and bboxSize fields specify a bounding box that encloses the Switch node's children. 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 child with the largest bounding box 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:
Switch.dot

Member Data Documentation

The whichChoice field specifies the index of the child to traverse, with the first child having index 0.

If whichChoice is less than zero or greater than the number of nodes in the choice field, nothing is chosen.

Access type: inputOutput
Default value: -1

Switch_whichChoice.dot

Referenced by render(), Switch(), and traverseSG().


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

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