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

Inheritance diagram for H3D::Switch:

Inheritance graph
List of all members.

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

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.

Classes

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

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

auto_ptr< SFInt32 > H3D::Switch::whichChoice
 

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


Generated on Thu Aug 24 12:40:05 2006 for H3D API by  doxygen 1.4.5