public class SoVRMLSwitch extends SoVRMLParent
NOTE: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it. See the VRML97 Specification, below.
This section describes the expected behavior of the node in a conforming VRML97 browser application. In some cases, the application is responsible for implementing portions of the expected behavior. Open Inventor viewer classes and IVF classes implement some of the application behaviors.
This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at
The SoVRMLSwitch grouping node traverses zero or one of the nodes specified in the choice field.
See the "Concepts - Grouping and Children Nodes" section which describes "children nodes" for a details on the types of nodes that are legal values for choice.
The whichChoice field specifies the index of the child to traverse, where the first child has index 0. If whichChoice is less than zero or greater than the number of nodes in the choice field then nothing is chosen.
SoSwitch node or from certain other nodes (such as SoArray or SoMultipleCopy) that set the switch value.
SoGroup.
The bboxCenter and bboxSize fields specify a bounding box that encloses the SoVRMLSwitch's children. This is a hint that may be used for optimization purposes. If the specified bounding box is smaller than the actual bounding box of the children at any time, then the results are undefined. A default bboxSize value, (-1 -1 -1), implies that the bounding box is not specified and if needed must be calculated by the browser. See "Concepts -
Bounding Boxes" for a description of the bboxCenter and bboxSize fields.
Note that all nodes under an SoVRMLSwitch continue to receive and send events regardless of the value of whichChoice.
File format/default:
VRMLSwitch {
| choice | [] // VRML97 |
| children | [] // X3D |
| whichChoice | -1 |
| metadata | NULL |
| bboxCenter | 0 0 0 |
| bboxSize | -1 -1 -1 |
Action behavior:
SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoHandleEventAction, SoRayPickAction, SoGetMatrixAction, SoSearchAction, SoWriteAction
Sets: SoSwitchElement
SoMFNode | addChildren // X3D only |
SoMFNode | removeChildren // X3D only |
SoMFNode | set_choice // VRML97 only |
SoMFNode | set_children // X3D only |
SoSFInt32 | set_whichChoice |
SoSFNode | set_metadata |
SoMFNode | choice_changed // VRML97 only |
SoMFNode | children_changed // X3D only |
SoSFInt32 | whichChoice_changed |
SoSFNode | metadata_changed |
Inventor.ConstructorCommand| Modifier and Type | Field and Description |
|---|---|
SoMFNode |
choice
Deprecated.
Nodes to chose from (VRML97 only).
|
SoSFInt32 |
whichChoice
Deprecated.
Specifies the index of the child to traverse.
|
bboxCenter, bboxSize, children, metadataboundingBoxIgnoringVERBOSE_LEVEL, ZeroHandle| Constructor and Description |
|---|
SoVRMLSwitch()
Deprecated.
Constructor.
|
SoVRMLSwitch(int nChoices)
Deprecated.
Constructor that takes approximate number of choices.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChoice(SoNode choice1)
Deprecated.
Adds a choice/child as last one in group.
|
int |
findChoice(SoNode choice1)
Deprecated.
Finds index of given choice/child within group.
|
SoNode |
getChoice(int index)
Deprecated.
Returns the nth choice/child node.
|
int |
getNumChoices()
Deprecated.
Returns number of choices/children.
|
void |
insertChoice(SoNode choice1,
int newLevelIndex)
Deprecated.
Adds a choice/child so that it becomes the one with the given index.
|
void |
removeAllChoices()
Deprecated.
Removes all choices/children from group.
|
void |
removeChoice(int index)
Deprecated.
Removes choice/child with given index from group.
|
void |
removeChoice(SoNode choice1)
Deprecated.
Removes first instance of given choice/child from group.
|
void |
replaceChoice(int index,
SoNode newChoice)
Deprecated.
Replaces choice with given index with new choice/child.
|
void |
replaceChoice(SoNode oldChoice,
SoNode newChoice)
Deprecated.
Replaces first instance of given choice/child with new choice/child.
|
addChild, findChild, getChild, getNumChildren, insertChild, removeAllChildren, removeChild, removeChild, replaceChild, replaceChildaffectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, writecopyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaultsdispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizablegetAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreadspublic final SoMFNode choice
SoVRMLParent).
NOTE: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it.
public final SoSFInt32 whichChoice
public SoVRMLSwitch()
public SoVRMLSwitch(int nChoices)
public void addChoice(SoNode choice1)
public void removeAllChoices()
public void replaceChoice(SoNode oldChoice, SoNode newChoice)
public void removeChoice(int index)
public void replaceChoice(int index,
SoNode newChoice)
public void removeChoice(SoNode choice1)
public SoNode getChoice(int index)
public void insertChoice(SoNode choice1, int newLevelIndex)
public int getNumChoices()
public int findChoice(SoNode choice1)
Generated on July 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com