logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoSwitch — group node that traverse one chosen child

Action Behavior

SoGLRenderAction,SoCallbackAction,SoGetBoundingBoxAction,SoGetMatrixAction,SoHandleEventAction,SoRayPickAction
          Traverses the chosen child or children.

     SoSearchAction
          If the action's Searching-All flag is set, always traverses all children.  Otherwise,  traverses  just
          the chosen child or children.

Description

       This group node usually traverses only one or none of its children. It implements an operation similar to
       the  switch  statement in C. One can use this node to switch on and off the effects of some properties or
       to switch between different properties.

       The whichChild field specifies the index of the child to traverse, where the first child has index 0.

       A  value  of  SO_SWITCH_NONE  (-1,  the  default)  means  do  not  traverse  any  children.  A  value  of
       SO_SWITCH_INHERIT  (-2)  allows  the index to be inherited from a previously-encountered SoSwitch node or
       from certain other nodes (such as SoArray or SoMultipleCopy) that  set  the  switch  value.  A  value  of
       SO_SWITCH_ALL (-3) traverses all children, making the switch behave exactly like a regular SoGroup.

Fields

SoSFInt32whichChild
          Index of the child to traverse, or one of SO_SWITCH_NONE, SO_SWITCH_INHERIT, or SO_SWITCH_ALL.

File Format/Defaults

Switch{whichChild-1}

Inherits From

       SoBase > SoFieldContainer > SoNode > SoGroup > SoSwitch

Methods

SoSwitch()
          Creates a switch node with default settings.

                         SoSwitch(intnChildren)
          Constructor that takes approximate number of children.

     staticSoTypegetClassTypeId()
          Returns type identifier for this class.

Name

       SoSwitch — group node that traverse one chosen child

See Also

SoArray,SoLevelOfDetail,SoMultipleCopy,SoPathSwitchSoSwitch(3IV)()

Synopsis

#include<Inventor/nodes/SoSwitch.h>

          Fields from class SoSwitch:

     SoSFInt32whichChild

          Methods from class SoSwitch:

                         SoSwitch()SoSwitch(intnChildren)staticSoTypegetClassTypeId()

          Methods from class SoGroup:

     voidaddChild(SoNode*child)voidinsertChild(SoNode*child,intnewChildIndex)SoNode*getChild(intindex)constintfindChild(constSoNode*child)constintgetNumChildren()constvoidremoveChild(intindex)voidremoveChild(SoNode*child)voidremoveAllChildren()voidreplaceChild(intindex,SoNode*newChild)voidreplaceChild(SoNode*oldChild,SoNode*newChild)

          Methods from class SoNode:

     voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)

          Methods from class SoFieldContainer:

     voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)

          Methods from class SoBase:

     voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const

See Also