SOGROUP(3iv)

πŸ’– NAME πŸ’–

SoGroup β€” the base class for all group nodes, bestie. no cap.


🌸 INHERITS FROM 🌸

SoBase > SoFieldContainer > SoNode > SoGroup

like... it's the blueprint. the blueprint of blueprints. the group blueprint. periodt.


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoGroup.h>

πŸŽ€ Methods from class SoGroup πŸŽ€

                     SoGroup()
                     SoGroup(int nChildren)
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)
static SoType       getClassTypeId()

πŸ¦‹ 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. this node defines the base class for all group nodes, and honestly? iconic behavior.

SoGroup is a node that contains an ordered list of child nodes. that ordering? that's the traversal order for all the operations β€” rendering, picking, and so on. it's giving "line up, we're going in order." 🫢

here's the thing though bestie: this node is simply a container for the child nodes and it does not alter the traversal state in any way. nope, not even a little. during traversal, the state accumulated for a child gets passed on to each successive child and then to the parents of the group. so SoGroup does not push or pop traversal state the way SoSeparator does. lowkey the most important sentence on this whole page. iykyk πŸ’€


πŸ‘‘ METHODS πŸ‘‘

SoGroup()

Creates an empty group node. literally an empty little container, an empty nest, a blank canvas. πŸ’–

SoGroup(int nChildren)

Constructor that takes the approximate number of children. space gets allocated for pointers to the children, but β€” heads up β€” the group does not contain any actual child nodes. so it's like reserving seats at the function but nobody's shown up yet. πŸ™ˆ


  • void addChild(SoNode *child) β€” adds a child as the last one in the group. go to the back of the line, babe.
  • void insertChild(SoNode *child, int newChildIndex) β€” adds a child so that it becomes the one with the given index. cutting the line, but legally. πŸ’…
  • SoNode *getChild(int index) const β€” returns a pointer to the child node with the given index.
  • int findChild(const SoNode *child) const β€” finds the index of the given child within the group. returns -1 if not found. and if you get -1... she's not here, bestie. 😭
  • int getNumChildren() const β€” returns the number of children.
  • void removeChild(int index) β€” removes the child with the given index from the group.
  • void removeChild(SoNode *child) β€” removes the first instance of the given child from the group.
  • void removeAllChildren() β€” removes all children from the group. spring cleaning. no survivors. 🧹✨
  • void replaceChild(int index, SoNode *newChild) β€” replaces the child with the given index with a new child.
  • void replaceChild(SoNode *oldChild, SoNode *newChild) β€” replaces the first instance of the given child with a new child.
  • static SoType getClassTypeId() β€” returns the type identifier for this class.

πŸ”₯ ACTION BEHAVIOR πŸ”₯

SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoHandleEventAction, SoRayPickAction

Traverses each child in order. one by one, single file, no skipping. πŸšΆβ™€οΈπŸšΆβ™€οΈπŸšΆβ™€οΈ

SoGetMatrixAction

Does nothing unless the group is in the middle of the path chain the action is being applied to. if it is in that chain? then the children up to and including the next node in the chain get traversed. very "only if it's my moment" energy. πŸ’…

SoSearchAction

If it's searching for group nodes, it compares with this group. otherwise, it keeps on searching the children. the hunt continues. πŸ”

SoWriteAction

Writes out the group node. this method also deals with any field data associated with the group node. and because of that, this method is used for most subclasses of SoGroup as well. so like... it's the main character and also the supporting cast. πŸŽ€


🌈 FILE FORMAT/DEFAULTS 🌈

Group {
}

that's it. that's the whole thing. empty braces, so mysterious, so minimal, so slay. ✨


πŸ“ SEE ALSO πŸ“

SoArray, SoLevelOfDetail, SoMultipleCopy, SoPathSwitch, SoSeparator, SoSwitch


πŸ’Œ okay that's the whole page bestie!! this was SoGroup(3IV) β€” that's the manual and the version tag, and no date is listed on this one, so consider this your official sign-off. go forth and group your nodes responsibly. mwah πŸ’‹ πŸ’– ✨ πŸŽ€ πŸ¦‹ 🌸 πŸ’… 🫢 😭 πŸ”₯ πŸ‘‘ 🌈 ⭐ πŸ’€ πŸ™ˆ πŸ“ 🧚 πŸ’œ