Switch
Switch is a Grouping node that only renders one (or zero) child at a time. Switch can contain most nodes. (Contained nodes are now called 'children' rather than 'choice', for consistent naming among all GroupingNodeType nodes.) All child choices continue to receive and send events regardless of whichChoice is active. Hint: insert a Shape node before adding geometry or Appearance. Hint: authors can temporarily hide test geometry under an unselected child of a Switch. This is a good alternative to 'commenting out' nodes.
Inheritance
Code
XML encoding
<Switch whichChoice='-1' cycle='TRUE' bboxCenter='0 0 0' bboxSize='-1 -1 -1' render='TRUE' showBBox='FALSE' logFeature='' />
Classic encoding
Switch { whichChoice -1 cycle TRUE bboxCenter 0 0 0 bboxSize -1 -1 -1 render TRUE showBBox FALSE logFeature [""] }
Interface
Filter: X3D only | Avalon only | All
id | Name | DataType | PartType | Default | ValueType | Description |
---|---|---|---|---|---|---|
![]() |
next | XFAny | inputOnly | incr whichChoice field if value is non-negative | ||
![]() |
prev | XFAny | inputOnly | decr whichChoice field if value is non-negative | ||
![]() |
cycle | SFBool | inputOutput | TRUE | incr/decr in a modulo manner or clamp value whichChoice | |
![]() |
render | SFBool | inputOutput | TRUE | Flag to control the visibility of the node or subtree | |
![]() |
showBBox | SFBool | inputOutput | FALSE | Show Bounding Box of Subtree. | |
![]() |
logFeature | MFString | inputOutput | state, child, parent, route, eventIn, eventOut | controls the logging of changes, state: log state changes (e.g. live), child: log child add/remove, parent: log parent add/remove, route: log route add/remove; eventIn: log receiving of events, eventOut: log sending of events: guiView, runtime system should create node-view, guiEdit: runtime system should create node-editeverything: log everything |