SoMFNode(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

🌸 SoMFNode(3) β€” Coin 🌸

okay so bestie, this is the SoMFNode(3) page from Coin, and it's giving "container for nodes" main character energy. Buckle up, it's a two-parter πŸ’–


πŸŽ€ NAME πŸŽ€

SoMFNode β€” the class that is literally a container for nodes. That's the whole job description, and it eats. πŸ’…


✨ SYNOPSIS ✨

First things first, you gotta pull it in:

#include <Inventor/fields/SoMFNode.h>

And it Inherits SoMField β€” that's the family tree, iykyk 🧬


🫢 Public Member Functions 🫢

the actual roster, one by one, no skips:

  • virtual SoType getTypeId (void) const β€” hands you back the type id, virtual edition ✨
  • virtual void copyFrom (const SoField &field) β€” copy everything over from another field
  • const SoMFNode & operator= (const SoMFNode &field) β€” assignment operator, but for a whole other SoMFNode
  • virtual SbBool isSame (const SoField &field) const β€” are you and that field the same? πŸ‘€
  • SoNode * operator[] (const int idx) const β€” index in, node pointer out
  • const SoNode ** getValues (const int start) const β€” grab the values array, starting at start
  • int find (SoNode *value, SbBool addifnotfound=FALSE) β€” go hunt for a node, and addifnotfound defaults to FALSE 🌸
  • void setValues (const int start, const int num, const SoNode **newvals) β€” set num values starting at start, sourced from newvals
  • void set1Value (const int idx, SoNode *value) β€” set exactly one value, at idx
  • void setValue (SoNode *value) β€” set the value, singular
  • SoNode * operator= (SoNode *val) β€” assignment operator, single node pointer style
  • SbBool operator== (const SoMFNode &field) const β€” equality check πŸ’«
  • SbBool operator!= (const SoMFNode &field) const β€” inequality check πŸ’«
  • SoNode ** startEditing (void) β€” kick off editing and get the pointer back
  • void finishEditing (void) β€” okay we're done editing, wrap it up
  • virtual void fixCopy (SbBool copyconnections) β€” fix things up post-copy
  • virtual SbBool referencesCopy (void) const β€” does it reference the copy? answering that
  • void addNode (SoNode *node) β€” add a node, simple as
  • void insertNode (SoNode *node, int idx) β€” insert a node at position idx
  • SoNode * getNode (int idx) const β€” get the node sitting at idx
  • int findNode (const SoNode *node) const β€” find that specific node
  • int getNumNodes (void) const β€” how many nodes are we even working with
  • void removeNode (int index) β€” remove a node by index
  • void removeNode (SoNode *node) β€” remove a node by pointer (yes, same name, overloaded, iconic)
  • void removeAllNodes (void) β€” remove ALL of them, clean slate 🧹
  • void replaceNode (int idx, SoNode *newnode) β€” swap a node out by index
  • void replaceNode (SoNode *oldnode, SoNode *newnode) β€” swap a node out by pointer
  • virtual void deleteValues (int start, int num=-1) β€” delete values, and num defaults to -1
  • virtual void insertSpace (int start, int num) β€” make room for num values at start

πŸ‘‘ Public Member Functions inherited from SoMField πŸ‘‘

your inheritance, bestie, all of it:

virtual ~SoMField ()
int getNum (void) const
void setNum (const int num)
SbBool set1 (const int index, const char *const valuestring)
void get1 (const int index, SbString &valuestring)
virtual void enableDeleteValues (void)
virtual SbBool isDeleteValuesEnabled (void) const

πŸ¦‹ Public Member Functions inherited from SoField πŸ¦‹

okay this part is LONG but we don't skip, we never skip:

virtual ~SoField ()
void setIgnored (SbBool ignore)
SbBool isIgnored (void) const
void setDefault (SbBool defaultVal)
SbBool isDefault (void) const
SbBool isOfType (const SoType type) const
void enableConnection (SbBool flag)
SbBool isConnectionEnabled (void) const
SbBool connectFrom (SoEngineOutput *master, SbBool notnotify=FALSE,
    SbBool append=FALSE)
SbBool appendConnection (SoEngineOutput *master, SbBool notnotify=FALSE)
void disconnect (SoEngineOutput *engineoutput)
SbBool isConnectedFromEngine (void) const
SbBool getConnectedEngine (SoEngineOutput *&master) const
SbBool connectFrom (SoField *master, SbBool notnotify=FALSE, SbBool
    append=FALSE)
SbBool appendConnection (SoField *master, SbBool notnotify=FALSE)
void disconnect (SoField *field)
SbBool isConnectedFromField (void) const
SbBool getConnectedField (SoField *&master) const
int getNumConnections (void) const
int getForwardConnections (SoFieldList &slavelist) const
int getConnections (SoFieldList &masterlist) const
void disconnect (void)
SbBool isConnected (void) const
void setContainer (SoFieldContainer *cont)
SoFieldContainer * getContainer (void) const
SbBool set (const char *valuestring)
void get (SbString &valuestring)
SbBool shouldWrite (void) const
virtual void touch (void)
virtual void startNotify (void)
virtual void notify (SoNotList *nlist)
SbBool enableNotify (SbBool on)
SbBool isNotifyEnabled (void) const
void addAuditor (void *f, SoNotRec::Type type)
void removeAuditor (void *f, SoNotRec::Type type)
int operator== (const SoField &f) const
int operator!= (const SoField &f) const
virtual void connectionStatusChanged (int numconnections)
SbBool isReadOnly (void) const
void copyConnection (const SoField *fromfield)
virtual SbBool read (SoInput *input, const SbName &name)
virtual void write (SoOutput *out, const SbName &name) const
void setFieldType (int type)
int getFieldType (void) const
SbBool getDirty (void) const
void setDirty (SbBool dirty)
void evaluate (void) const

⭐ Static Public Member Functions ⭐

the static girlies (no instance needed, they just exist):

  • static void * createInstance (void) β€” spin up an instance
  • static SoType getClassTypeId (void) β€” the class type id
  • static void initClass (void) β€” initialize the class

🌈 Static Public Member Functions inherited from SoMField 🌈

static SoType getClassTypeId (void)
static void atexit_cleanup (void)
static void initClass (void)

🌈 Static Public Member Functions inherited from SoField 🌈

static void initClass (void)
static void initClasses (void)
static void cleanupClass (void)
static SoType getClassTypeId (void)

πŸ’œ Protected Member Functions πŸ’œ

for the inner circle only πŸ”’

  • virtual void deleteAllValues (void) β€” delete all the values
  • virtual void copyValue (int to, int from) β€” copy a value from from to to
  • virtual int fieldSizeof (void) const β€” the size of the field
  • virtual void * valuesPtr (void) β€” pointer to the values
  • virtual void setValuesPtr (void *ptr) β€” set that values pointer to ptr
  • virtual void allocValues (int num) β€” allocate space for num values

πŸ”’ Protected Member Functions inherited from SoMField πŸ”’

SoMField (void)
virtual void makeRoom (int newnum)
virtual SoNotRec createNotRec (SoBase *container)
void setChangedIndex (const int chgidx)
void setChangedIndices (const int chgidx=-1, const int numchgind=0)

πŸ”’ Protected Member Functions inherited from SoField πŸ”’

SoField (void)
void valueChanged (SbBool resetdefault=TRUE)
virtual void evaluateConnection (void) const
virtual SbBool readConnection (SoInput *in)
virtual void writeConnection (SoOutput *out) const
SbBool isDestructing (void) const

πŸ“ Protected Attributes πŸ“

  • SoNode ** values β€” the values array itself, protected but present

πŸ“ Protected Attributes inherited from SoMField πŸ“

int num
int maxNum
SbBool userDataIsUsed

🧚 Additional Inherited Members 🧚

Public Types inherited from SoField

enum FieldType { NORMAL_FIELD = 0, EVENTIN_FIELD, EVENTOUT_FIELD,
    EXPOSED_FIELD }

πŸ’– Detailed Description πŸ’–

okay so here's the tea: the SoMFNode class is a container for nodes. That's it, that's the vibe. 🫢

This field container stores an array of pointers to nodes. It handles all the necessary functionality for dealing with copy, import and export operations. very "does it all so you don't have to" of it πŸ’…

heads up bestie β€” node pointers stored in field instances of this type may be NULL pointers. so like, don't assume they're all filled in, okay? 😭

🌟 See also 🌟

  • SoNode, SoSFNode

and that's only the first half, so don't go anywhere β€” the rest is still coming πŸ‘€βœ¨

✨ MEMBER FUNCTION DOCUMENTATION ✨

okay bestie, this is the part where we go function by function πŸ’… β€” grab a snack, there's a whole lot of them, but they're all little guys, promise.


  • void * SoMFNode::createInstance(void) [static] β€” okay so this one is internal to the library, and the docs are like, bestie, this is not likely to be of interest to the application programmer πŸ™ˆ. What it actually does: creates a new instance of the class type that corresponds to the SoType object. That's it, that's the whole gig.
  • SoType SoMFNode::getClassTypeId(void) [static] β€” a static method that hands you back the SoType object associated with objects of this class. type-system core, yk? 🫢
  • SoType SoMFNode::getTypeId(void) const [virtual] β€” returns the type identification of an object derived from a class inheriting SoField. this is what makes runtime type checking and "downward" casting happen ✨.

Implements SoField.

  • void SoMFNode::copyFrom(const SoField & f) [virtual] β€” copies value(s) from f into this field. ⚠️ important: f must be of the same type as this field, no mixing, no swapping, no shortcuts.

Implements SoField.

  • SbBool SoMFNode::isSame(const SoField & f) const [virtual] β€” checks for equal type and value(s). both. the whole package πŸ’–.

Implements SoField.

  • virtual void SoMFNode::deleteAllValues(void) [protected], [virtual] β€” yeah, it's a SoMField thing.

Implements SoMField.

  • virtual void SoMFNode::copyValue(int to, int from) [protected], [virtual] β€” also a SoMField thing, copy from one slot to another, internal business πŸ”§.

Implements SoMField.

  • const SoNode ** SoMFNode::getValues(const int start) const [inline] β€” returns a pointer to the values array. raw access, handle with care bestie πŸ’….
  • void SoMFNode::initClass(void) [static] β€” internal method that gets called when the library initializes (from SoDB::init()) so the type system can get set up 🌱.
  • void SoMFNode::fixCopy(SbBool copyconnections) [virtual] β€” so this one gets called internally, right after SoField::copyFrom() during scene graph copies, and it's supposed to do whatever operations are necessary to fix up the field instance after it's gotten a new value.

The default method in the SoField superclass does nothing. literally nothing. a whole vibe of emptiness πŸ’€.

The application programmer should normally not need to consider this method β€” unless you're constructing a complex field type that contains new references to container instances (i.e. nodes or engines). In that case, overriding this method becomes necessary, because you have to update those reference pointers: they could have been duplicated during the copy operation 😭.

Reimplemented from SoField.

  • SbBool SoMFNode::referencesCopy(void) const [virtual] β€” returns TRUE if this field has references to any containers in the scene graph which are also duplicated during the copy operation.
heads up: this method is only valid to call during copy operations. no copy, no call 🚫.

Also go read the note about the relevance of the fixCopy() method for application programmers, because that note applies to this method too 🫢.

Reimplemented from SoField.


πŸ¦‹ The Coin-Extension Squad πŸ¦‹

okay so this whole lil crew is Coin-only β€” these functions are extensions for Coin, and they are not available in the original SGI Open Inventor v2.1 API. every single one of them landed in Coin 2.0. iconic behavior honestly πŸ‘‘

  • void SoMFNode::addNode(SoNode * node) β€” adds a node at the end of the array. πŸ“₯

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • void SoMFNode::insertNode(SoNode * node, int idx) β€” inserts a node at index idx. right there, exactly where you point πŸ’…

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • SoNode * SoMFNode::getNode(int idx) const β€” returns the node at index idx. hand it over 🫴

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • int SoMFNode::findNode(const SoNode * node) const β€” returns the index for the first instance of node in the field, or -1 if it's not found πŸ”.

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • int SoMFNode::getNumNodes(void) const β€” returns the number of nodes in this field. count 'em πŸ”’

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • void SoMFNode::removeNode(int idx) β€” removes the node at index idx. bye bestie πŸ‘‹

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • void SoMFNode::removeNode(SoNode * node) β€” removes the first instance of node in the field. only the first one, don't get greedy πŸ’€

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • void SoMFNode::removeAllNodes(void) β€” removes all nodes from the field. full reset, clean slate, main character energy ✨

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • void SoMFNode::replaceNode(int idx, SoNode * newnode) β€” replaces the node at index idx with newnode. glow-up moment 🌸

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.

  • void SoMFNode::replaceNode(SoNode * oldnode, SoNode * newnode) β€” replaces the first instance of oldnode with newnode. the first one only πŸŽ€

Coin extension, not in the original SGI Open Inventor v2.1 API. Since Coin 2.0.


πŸŽ€ The Array-Shuffling Duo πŸŽ€

  • virtual void SoMFNode::deleteValues(int start, int numarg = -1) [virtual] β€” removes value elements from index start up to and including index start + num - 1. note that elements with indices larger than the last deleted element get moved downwards in the value array, so everything slides into place 🫢.

And if num equals -1? it deletes from index start all the way to the end of the array. yeet 🌈.

Reimplemented from SoMField.

  • virtual void SoMFNode::insertSpace(int start, int numarg) [virtual] β€” inserts num "slots" for new value elements from start. the elements already present from start get moved "upward" in the extended array. making room, respectfully πŸ’œ

Reimplemented from SoMField.


πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for Coin from the source code. no human wrote this, it's a robot's finest work πŸ€–πŸ’…


aaaaand that's the whole page bestie!! this one's from Coin version 4.0.10, stamped Thu Jun 25 2026, and yeah β€” it's SoMFNode(3), you found it, you read it, you ate πŸ“βœ¨ periodt.

πŸ“¦ where this page comes from