SOMFVEC2F(3iv)

✨ NAME ✨

SoMFVec2f β€” bestie it's a multiple-value field that holds literally any number of two-dimensional vectors πŸ’–

(also hi, this is the SoMFVec2f(3IV) page, keeping it cute up top πŸŽ€)


🌸 INHERITS FROM 🌸

SoField > SoMField > SoMFVec2f

so it's giving third-generation field energy, it got the whole family tree πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Inventor/fields/SoMFVec2f.h>

✨ Methods from class SoMFVec2f ✨

void                setValues(int start, int num, const float xy[][2])
void                set1Value(int index, float x, float y)
void                set1Value(int index, const float xy[2])
void                setValue(float x, float y)
void                setValue(const float xy[2])
static SoType       getClassTypeId()
virtual void        getTypeId() const
const SbVec2f &     operator [](int i) const
const SbVec2f *     getValues(int start) const
int                 find(const SbVec2f & targetValue, SbBool addIfNotFound
                         = FALSE)
void                setValues(int start, int num, const SbVec2f
                         *newValues)
void                set1Value(int index, const SbVec2f & newValue)
const SbVec2f &     operator =(const SbVec2f & newValue)
void                setValue(const SbVec2f & newValue)
int                 operator ==(const SoMFVec2f &f) const
int                 operator !=(const SoMFVec2f &f) const
SbVec2f *           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. It contains any number of two-dimensional vectors. That's the whole vibe, no cap. πŸ¦‹

When SoMFVec2fs get written out to a file, they show up as one or more pairs of floating point values, separated by whitespace. And when there's more than one value in there? All of them get wrapped up in square brackets and separated by commas, like this:

[ 0 0, 1.2 3.4, 98.6 -4e1 ]

literally so pretty, look at those numbers just chilling πŸ’…


πŸ”₯ METHODS πŸ”₯

  • void setValues(int start, int num, const float xy[][2]) β€” sets num values starting at index start to the floating point values you hand it. Heads up bestie: there must be num*2 values in the array you pass, or it's not gonna go well πŸ™ˆ
  • void set1Value(int index, float x, float y)
  • void set1Value(int index, const float xy[2]) β€” sets the index'th value to the floating point values you give it. one value, one slot, very demure ✨
  • void setValue(float x, float y)
  • void setValue(const float xy[2]) β€” sets the field to contain the given value and only the given value. if the array had multiple values before? gone. deleted. they simply are not invited to the function anymore πŸ’€
  • static SoType getClassTypeId()
  • virtual void getTypeId() const β€” returns the type for this class, or for one particular object of this class. iykyk πŸŽ€
  • const SbVec2f & operator [](int i) const β€” returns the i'th value of the field. ⚠️ real talk: indexing past the end of the field (passing in i greater than getNum()) will return garbage. not a cute surprise, not a slay, just garbage 😭
  • const SbVec2f * getValues(int start) const β€” returns a pointer into the array of values in the field, starting at index start. those values are read-only, bestie β€” if you want to modify values in place, go look at the startEditing()/finishEditing() methods instead 🫢
  • int find(const SbVec2f & targetValue, SbBool addIfNotFound = FALSE) β€” looks for the given value in the array and returns the index of that value in the array. if it's not found, -1 comes back. and if addIfNotFound is set, then targetValue gets added to the end of the array β€” but plot twist, -1 is still returned πŸ™ˆ
  • void setValues(int start, int num, const SbVec2f *newValues) β€” sets num values starting at index start to the values in newValues. the array will automatically be made larger to accomodate the new values if that's necessary. it just does it for you, no stress πŸ’…
  • void set1Value(int index, const SbVec2f & newValue) β€” sets the index'th value in the array to newValue. the array will be automatically expanded if necessary. growth mindset fr fr 🌱
  • const SbVec2f & operator =(const SbVec2f & newValue)
  • void setValue(const SbVec2f & newValue) β€” sets the first value in the array to newValue, and then deletes the second and subsequent values. main character value only, everyone else gets cut 😀
  • int operator ==(const SoMFVec2f &f) const
  • int operator !=(const SoMFVec2f &f) const β€” returns TRUE if all of the values of this field equal (do not equal) those of the given field. and 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, for example. nope. not the same. don't even try it πŸ’€
  • SbVec2f * startEditing()
  • void finishEditing() β€” startEditing() returns a pointer to the internally-maintained array, which you can modify. you can change the values in the array, but you cannot add or remove values. and it is illegal to call any other editing methods between startEditing() and finishEditing() (like set1Value(), setValue(), etc). do not do it. periodt βœ‹

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. it's telling on itself even when nothing happened, iconic honestly πŸ‘‘


and that's the whole page bestie, you ate it, you understood it, go forth and vector πŸ’œ

🌸 sign-off time: this was the SoMFVec2f(3IV) manual page, straight from the SoMFVec2f(3IV)() source, dated SoMFVec2f(3IV)(). love that for us. mwah πŸŽ€βœ¨