SOMFINT32(3iv)

πŸ’– NAME πŸ’–

SoMFInt32 β€” the multiple-value field that holds literally any number of int32_t integers 🫢


🌸 INHERITS FROM 🌸

SoField > SoMField > SoMFInt32

Like, it's deep in the family tree bestie, it got the whole lineage πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/fields/SoMFInt32.h>

πŸŽ€ Methods from class SoMFInt32 πŸŽ€

     static SoType       getClassTypeId()
     virtual void        getTypeId() const
     int32_t             operator [](int i) const
     const int32_t *     getValues(int start) const
     int                 find(int32_t targetValue, SbBool addIfNotFound =
                              FALSE)
     void                setValues(int start, int num, const int32_t
                              *newValues)
     void                set1Value(int index, int32_t newValue)
     int32_t             operator =(int32_t newValue)
     void                setValue(int32_t newValue)
     int                 operator ==(const SoMFInt32 &f) const
     int                 operator !=(const SoMFInt32 &f) const
     int32_t *           startEditing()
     void                finishEditing()

πŸ¦‹ 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)

🌈 Methods from class SoField 🌈

     void                setIgnored(SbBool ignore)
     SbBool              isIgnored() const
     SbBool              isDefault() const
     virtual SbBool      isOfType(SoType type) const
     SbBool              set(const char *valueString)
     void                get(SbString &valueString)
     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 πŸ’œ

Okay so. It's a multiple-value field, and it contains any number of int32_t (32-bit) integers. Any number. Zero? Sure. Forty thousand? Also sure. It's giving infinite slay ✨

When an SoMFInt32 gets written to file, it goes out as one or more integer values, and those values can be in decimal, hexadecimal, or octal format β€” pick your fighter. And when there's more than one value? They all get wrapped up in square brackets, separated by commas. Iconic little squad. Like this:

[ 17, -0xE20, -518820 ]

πŸ‘‘ METHODS πŸ‘‘

  • static SoType getClassTypeId()
  • virtual void getTypeId() const

Returns the type for this class, or for a particular object of this class. Type check, but make it official πŸ’…

  • int32_t operator [](int i) const

Returns the i'th value of the field. ⚠️ But heads up bestie: indexing past the end of the field (like, passing in i greater than getNum()) will return garbage. Not an error, not a warning β€” just garbage. Main character risk fr.

  • const int32_t * getValues(int start) const

Returns a pointer into the array of values in the field, starting at index start. These values are read-only β€” look, don't touch. If you actually wanna modify values in place, go see the startEditing() / finishEditing() methods instead 🫢

  • int find(int32_t targetValue, SbBool addIfNotFound = FALSE)

Finds the given value in the array and returns the index of that value in the array. If the value is not found, -1 is returned. And if you set addIfNotFound, then targetValue gets added to the end of the array β€” but (plot twist) -1 is still returned. No cap.

  • void setValues(int start, int num, const int32_t *newValues)

Sets num values starting at index start to the values in newValues. The array will automatically be made larger to accommodate the new values if necessary. It just grows for you. Growth mindset πŸ’–

  • void set1Value(int index, int32_t newValue)

Sets the index'th value in the array to newValue. The array will be automatically expanded if necessary. One value, one slot, zero stress ✨

  • int32_t operator =(int32_t newValue)
  • void setValue(int32_t newValue)

Sets the first value in the array to newValue, and then deletes the second value and every value after it. So like… it clears the whole group chat and leaves one message. Brutal but efficient πŸ’€

  • int operator ==(const SoMFInt32 &f) const
  • int operator !=(const SoMFInt32 &f) const

Returns TRUE if all of the values of this field equal (or do not equal) those of the given field. And here's the catch, so listen: if the fields are different types, FALSE will always be returned. Even if one field is an SoMFFloat with one value of 1.0 and the other is an SoMFInt with a value of 1. Nope. Different type, different vibe, FALSE. Periodt.

  • int32_t * startEditing()
  • void finishEditing()

startEditing() returns a pointer to the internally-maintained array, and that array can be modified. You can change the values in the array β€” but you cannot add or remove values. That's the deal.

🚨 Real talk: it is illegal to call any other editing methods between startEditing() and finishEditing() β€” like set1Value(), setValue(), etc. Do not do it. I'm begging.

Fields, engines, or sensors connected to this field β€” and sensors β€” are not notified that this field has changed until finishEditing() is called. And calling finishEditing() always sets the isDefault() flag to FALSE and informs engines and sensors that the field changed β€” even if none of the values actually were changed. Yes, even then. It's dramatic like that 😭


and that's the whole page, bestie β€” go forth and int32 responsibly 🌈

This was the SoMFInt32(3IV) manual page, brought to you by the version stamped right there in the corner, with no date on the tin so don't @ me. Mwah πŸ’‹ πŸŽ€ πŸ¦‹