SOMFIELD(3iv)

✨ NAME ✨

okay so bestie, this is SoMField(3IV) β€” the manual page for the base class for all multiple-valued fields. πŸ’–

🫢 INHERITS FROM 🫢

SoField > SoMField

πŸ“œ SYNOPSIS πŸ“œ

#include <Inventor/fields/SoField.h>

Methods from class SoMField:

int                 getNum() const
void                setNum(int num)
virtual void        deleteValues(int start, int num = -1)
virtual void        insertSpace(int start, int num)
SbBool              set1(int index, const char *valueString)
void                get1(int index, SbString &valueString)
static SoType       getClassTypeId()

Methods from class SoField:

void                setIgnored(SbBool ignore)
SbBool              isIgnored() const
SbBool              isDefault() const
virtual SoType      getTypeId() const
virtual SbBool      isOfType(SoType type) const
SbBool              set(const char *valueString)
void                get(SbString &valueString)
int                 operator ==(const SoField &f) const
int                 operator !=(const SoField &f) const
void                touch()
SbBool              connectFrom(SoField *fromField)
SbBool              connectFrom(SoEngineOutput *fromEngine)
void                disconnect()
SbBool              isConnected() const
SbBool              isConnectedFromField() const
SbBool              getConnectedField(SoField *&writingField) const
SbBool              isConnectedFromEngine() const
SbBool              getConnectedEngine(SoEngineOutput *&engineOutput)
                         const
void                enableConnection(SbBool flag)
SbBool              isConnectionEnabled() const
int                 getForwardConnections(SoFieldList &list) const
SoFieldContainer *  getContainer() const

πŸ’– DESCRIPTION πŸ’–

so like, every class that inherits from SoMField starts its name with SoMF and is literally a dynamic array of values of some particular type. each one has a setValues() method, and you pass it a pointer to a const array of values of the correct type. those values get copied into the field's array, and if there's not enough room, the field makes extra room. the start and num params tell it which starting array index to copy into and how many values to copy. periodt. πŸ’…

the getValues() method on a multiple-value field hands you back a const pointer to the array of values inside the field. and because that pointer is const, bestie, you can look but you cannot touch β€” no changing values through it. 🚫

also the indexing operator [] is overloaded to return the i'th value in the array. it gives you a const reference, so it's read-only β€” you can get values with it, but setting them? nope, not today. πŸ™ˆ

there are methods for getting how many values are in the field, inserting space for new values in the middle, and deleting values. iconic. ✨

other methods let you set just one value out of several in the field, or set the field to contain one and only one value. main character energy. πŸ‘‘

and two more methods let you make several changes to a multiple-value field without the overhead of copying values in and out. startEditing() returns a non-const pointer to the array of values in the field; you can use that pointer to change any values in the array (but you can't add or remove values, okay?). finishEditing() says editing is done and notifies any sensors or engines connected to the field. slay. πŸ”₯

SoMFields get written to file as a series of values separated by commas, all wrapped in square brackets. if the field has zero values (getNum() returns zero), then only the square brackets [] are written. the last value can optionally be followed by a comma. each field subtype defines how its values are written; for example, a field whose values are integers might look like:

[ 1, 2, 3, 4 ]
   or:
[ 1, 2, 3, 4, ]

πŸ› οΈ METHODS πŸ› οΈ

  • int getNum() const β€” Returns the number of values currently in the field. πŸ’―
  • void setNum(int num) β€” Forces this field to have exactly num values, inserting or deleting values as necessary. no cap.
  • virtual void deleteValues(int start, int num = -1) β€” Deletes num values beginning at index start (index start through start+num-1 will be deleted, and any leftover values will be moved down to fill in the gap created). A num of -1 means delete all values from start to the last value in the field; getNum() will return start as the number of values in the field after this operation (deleteValues(0, -1) empties the field). ⚠️ careful, this one's destructive.
  • virtual void insertSpace(int start, int num) β€” Inserts space for num values at index start. Index start through start+num-1 will be moved up to make room. For example, to make room for 7 new values at the beginning of the field call insertSpace(0, 10). 🌸
  • SbBool set1(int index, const char *valueString) and void get1(int index, SbString &valueString) β€” These are equivalent to the set() and get() methods of SoField, but they operate on only one value. See the SoField methods for details. 🫢
  • static SoType getClassTypeId() β€” Return the type identifier for this field class. ✨

πŸ‘€ SEE ALSO πŸ‘€

SoNode, SoEngine


so yeah, that's the whole page. this manual is signed off by SoMField(3IV)() β€” that's the source/version and date vibe, even if the date is giving blank. stay iconic, bestie. πŸ’…πŸ’–βœ¨