SOARRAY(3iv)

πŸ’– SoArray β€” the SoArray(3IV) page, bestie edition πŸ’–

okay so you opened the manual for SoArray(3IV) and I'm gonna walk you through it like we're texting at 2am, except every single fact stays exactly where it was. no cap. 🫢


✨ NAME ✨

SoArray β€” a group node that creates a regular IxJxK array of copies of its children πŸ‘‘

like. it's the "make a whole grid of my children" node. iconic behavior honestly.


🌸 INHERITS FROM 🌸

SoBase > SoFieldContainer > SoNode > SoGroup > SoArray

the whole ancestry chain, unbothered, in order πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Inventor/nodes/SoArray.h>
enum Origin {
     SoArray::FIRST      First copy is rendered at the current local
                              origin; all other copies are distributed
                              relative to it
     SoArray::CENTER     Copies are distributed relative to the center of
                              the array
     SoArray::LAST       Last copy is rendered at the current local
                              origin; all other copies are distributed
                              relative to it
}

Fields from class SoArray:

SoSFShort           numElements1
SoSFShort           numElements2
SoSFShort           numElements3
SoSFVec3f           separation1
SoSFVec3f           separation2
SoSFVec3f           separation3
SoSFEnum            origin

Methods from class SoArray:

                    SoArray()
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 traverses its children, in order, several times, creating a regular 3D array of copies of them. the number of copies in each of the three directions is specified by fields (yes, fields for each direction, we love a symmetrical queen), and so are the vectors used to separate the copies in each of the three dimensions. 🌈

for example (and this example is literally in the original, I'm not making it up), an SoArray node can be used to create a 2x3x4 array of copies of its children, where the separation vectors between adjacent copies in the three array dimensions are (1,2,3), (-4,-5,-6), and (7,8,9), respectively. the base point of the array can be set to one of several values, as described in the origin field. ✨

now the traversal order β€” this is the part where you gotta pay attention bestie:

copies are traversed so that the first dimension cycles most quickly, followed by the second, and then the third. πŸŒ€

and this order is important, because SoArray sets the current switch value to N before traversing the children for the Nth time (for use with inherited switch values β€” see SoSwitch). so like, the counting is real and the order is real. periodt. πŸ’…


πŸŽ€ FIELDS πŸŽ€

  • SoSFShort numElements1
  • SoSFShort numElements2
  • SoSFShort numElements3

number of elements in each of the three array dimensions. three fields, three directions, no notes. πŸ‘‘

  • SoSFVec3f separation1
  • SoSFVec3f separation2
  • SoSFVec3f separation3

separation vector in each of the three array dimensions. ✨

  • SoSFEnum origin

defines the base point from which copies are distributed. πŸ“


🧚 METHODS 🧚

  • SoArray()

creates an array node with default settings. fresh out the box, defaults on defaults. 🎁

  • static SoType getClassTypeId()

returns type identifier for this class. it's giving "who am I, what am I" but like, officially. πŸ”


πŸ”₯ ACTION BEHAVIOR πŸ”₯

  • SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction

traverses all children for each array element, saving and restoring state before and after each traversal. clean up after yourself, that's the rule. 🧼

  • SoSearchAction

traverses all children once, setting the inherited switch value to SO_SWITCH_ALL first. one pass, all the switch, that's the vibe. πŸ¦‹


πŸ“ FILE FORMAT/DEFAULTS πŸ“

Array {
     numElements1  1
     numElements2  1
     numElements3  1
     separation1   1 0 0
     separation2   0 1 0
     separation3   0 0 1
     origin        FIRST
}

so yeah, everything defaults to 1 element and the separations default to the unit vectors 1 0 0, 0 1 0, 0 0 1, and origin defaults to FIRST. a whole little unit-cube moment. 🌸


⭐ SEE ALSO ⭐

  • SoMultipleCopy
  • SoSwitch

go read those too, they're part of the same friend group. πŸ’–


and that's the whole page bestie!! this was SoArray(3IV) β€” the manual name is right there in the title and the footer tag, and the footer version/source line reads SoArray(3IV)(). you read the whole thing, you understood the whole thing, slay. πŸ«Άβœ¨πŸ’…πŸ‘‘