SOSWITCH(3iv)

✨ SoSwitch ✨

okay bestie, welcome to the SoSwitch(3IV) page πŸ’… this is the group node that traverse one chosen child β€” that's literally the whole NAME, and yes it's iconic, no cap.


πŸ¦‹ INHERITS FROM

SoBase > SoFieldContainer > SoNode > SoGroup > SoSwitch

so it's giving deep family tree, iykyk β€” all that ancestor energy flows downhill 🌈


🌸 SYNOPSIS

#include <Inventor/nodes/SoSwitch.h>

πŸ’– Fields from class SoSwitch:

SoSFInt32           whichChild

πŸ’– Methods from class SoSwitch:

                    SoSwitch()
                    SoSwitch(int nChildren)
static SoType       getClassTypeId()

πŸ’œ Methods from class SoGroup:

void                addChild(SoNode *child)
void                insertChild(SoNode *child, int newChildIndex)
SoNode *            getChild(int index) const
int                 findChild(const SoNode *child) const
int                 getNumChildren() const
void                removeChild(int index)
void                removeChild(SoNode *child)
void                removeAllChildren()
void                replaceChild(int index, SoNode *newChild)
void                replaceChild(SoNode *oldChild, SoNode *newChild)

πŸ’œ Methods from class SoNode:

void                setOverride(SbBool state)
SbBool              isOverride() const
SoNode *            copy(SbBool copyConnections = FALSE) const
virtual SbBool      affectsState() const
static SoNode *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoNodeList &list)

πŸ’œ Methods from class SoFieldContainer:

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
SbBool              set(const char *fieldDataString)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

πŸ’œ Methods from class SoBase:

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

πŸ‘‘ DESCRIPTION

okay so picture this: this group node usually traverses only one of its children, or literally none of them. it's doing the same kinda thing as a switch statement in C β€” hence the name, the branding, the whole moment. πŸŽ€

you can use it to switch the effects of some properties on and off, or to switch between different properties. main character energy fr fr.

the whichChild field says which child gets traversed β€” the index, bestie β€” and the first child has index 0. periodt.

  • a value of SO_SWITCH_NONE (-1, which is the default) means: do not traverse any children. silence. no thoughts, head empty. πŸ™ˆ
  • a value of SO_SWITCH_INHERIT (-2) lets the index be inherited from a previously-encountered SoSwitch node, or from certain other nodes (like SoArray or SoMultipleCopy) that set the switch value. it's giving borrowed vibes ✨
  • a value of SO_SWITCH_ALL (-3) traverses all children, which makes the switch behave exactly like a regular SoGroup. glow up complete πŸ”₯

πŸŽ€ FIELDS

  • SoSFInt32 whichChild β€” the index of the child to traverse, or one of SO_SWITCH_NONE, SO_SWITCH_INHERIT, or SO_SWITCH_ALL. that's it, that's the field 🫢

🧚 METHODS

  • SoSwitch() β€” creates a switch node with default settings. brand new, fresh out the box ⭐
  • SoSwitch(int nChildren) β€” constructor that takes the approximate number of children. just a lil heads-up for the memory, she's thoughtful like that πŸ’–
  • static SoType getClassTypeId() β€” returns the type identifier for this class. hi, who are you? πŸ’…

🌈 ACTION BEHAVIOR

  • SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoHandleEventAction, SoRayPickAction β€” traverses the chosen child or children. only the selected ones get the spotlight πŸ‘‘
  • SoSearchAction β€” if the action's Searching-All flag is set, it always traverses all children. otherwise, it traverses just the chosen child or children. no flag, no all-access pass 🎟️

πŸ’€ FILE FORMAT/DEFAULTS

Switch {
   whichChild  -1
}

πŸ“ SEE ALSO

SoArray, SoLevelOfDetail, SoMultipleCopy, SoPathSwitch


ngl bestie, that's the whole page β€” every flag, every index, every default, untouched. we don't skip lore in this house πŸ’œ

and for the sign-off: this is the SoSwitch page of the 3IV manual, and the footer is literally SoSwitch(3IV)() β€” with the source/version-and-date slot left totally empty, like a story still waiting to be written. iconic. slay. bye bestie πŸŽ€βœ¨