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 exactlynumvalues, inserting or deleting values as necessary. no cap.virtual void deleteValues(int start, int num = -1)β Deletesnumvalues beginning at indexstart(indexstartthroughstart+num-1will be deleted, and any leftover values will be moved down to fill in the gap created). Anumof-1means delete all values fromstartto the last value in the field;getNum()will returnstartas 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 fornumvalues at indexstart. Indexstartthroughstart+num-1will be moved up to make room. For example, to make room for 7 new values at the beginning of the field callinsertSpace(0, 10). πΈSbBool set1(int index, const char *valueString)andvoid get1(int index, SbString &valueString)β These are equivalent to theset()andget()methods ofSoField, but they operate on only one value. See theSoFieldmethods 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. π
πβ¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms