Interface Switch

All Superinterfaces:
X3DBoundedObject, X3DChildNode, X3DGroupingNode, X3DNode
All Known Implementing Classes:
SwitchObject

public interface Switch
extends X3DGroupingNode
Switch is a Grouping node that only renders one (or zero) child at a time.

X3D node tooltip: [X3DGroupingNode] 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.
  • Hint: GeoViewpoint OrthoViewpoint and Viewpoint share the same binding stack, so no more than one of these nodes can be bound and active at a given time.
  • Warning: do not include GeoViewpoint OrthoViewpoint or Viewpoint as a child of LOD or Switch, instead use ViewpointGroup as parent to constrain location proximity where the viewpoint is available to user.
  • Warning: results are undefined if a bindable node (Background, Fog, NavigationInfo, OrthoViewpoint, TextureBackground, Viewpoint) is a contained descendant node of either LOD or Switch.
  • Hint: contained nodes must have type X3DChildNode, such as Group or Transform or Shape.
  • Warning: Switch is not allowed as parent of Appearance, Material, Color, Coordinate, Normal or Texture nodes.

Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
See Also:
SAI Java Specification: TODO, X3D Abstract Specification: Switch, X3D Tooltips: Switch, X3D Scene Authoring Hints
  • Method Summary

    Modifier and Type Method Description
    void addChildren​(X3DNode[] newValue)
    Add array of children nodes to array of existing nodes (if any).
    float[] getBboxCenter()
    Provide array of 3-tuple float results from initializeOnly SFVec3f field named bboxCenter.
    float[] getBboxSize()
    Provide array of 3-tuple float results within allowed range of [0,infinity), or default value [-1 -1 -1], from initializeOnly SFVec3f field named bboxSize.
    X3DNode[] getChildren()
    Provide array of X3DNode results (using an array consisting of properly typed nodes or ProtoInstanceObjects) from inputOutput MFNode field children.
    X3DMetadataObject getMetadata()
    Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
    boolean getVisible()
    Provide boolean value from inputOutput SFBool field named visible.
    int getWhichChoice()
    Provide int value within allowed range of [-1,infinity) from inputOutput SFInt32 field named whichChoice.
    Switch setBboxCenter​(float[] newValue)
    Accessor method to assign 3-tuple float array to initializeOnly SFVec3f field named bboxCenter.
    Switch setBboxSize​(float[] newValue)
    Accessor method to assign 3-tuple float array to initializeOnly SFVec3f field named bboxSize.
    void setChildren​(X3DNode newValue)
    Set single children node, replacing prior array of existing nodes (if any).
    Switch setChildren​(X3DNode[] newValue)
    Accessor method to assign X3DNode array (using an array consisting of properly typed nodes or ProtoInstanceObjects) to inputOutput MFNode field children.
    Switch setMetadata​(X3DMetadataObject newValue)
    Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
    Switch setVisible​(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named visible.
    Switch setWhichChoice​(int newValue)
    Accessor method to assign int value to inputOutput SFInt32 field named whichChoice.