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])β setsnumvalues starting at indexstartto the floating point values you hand it. Heads up bestie: there must benum*2values 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 theindex'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 thei'th value of the field. β οΈ real talk: indexing past the end of the field (passing inigreater thangetNum()) 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 indexstart. those values are read-only, bestie β if you want to modify values in place, go look at thestartEditing()/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,-1comes back. and ifaddIfNotFoundis set, thentargetValuegets added to the end of the array β but plot twist,-1is still returned πvoid setValues(int start, int num, const SbVec2f *newValues)β setsnumvalues starting at indexstartto the values innewValues. 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 theindex'th value in the array tonewValue. 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 tonewValue, and then deletes the second and subsequent values. main character value only, everyone else gets cut π€int operator ==(const SoMFVec2f &f) constint operator !=(const SoMFVec2f &f) constβ returnsTRUEif all of the values of this field equal (do not equal) those of the given field. and if the fields are different types,FALSEwill always be returned β even if one field is anSoMFFloatwith one value of1.0and the other is anSoMFIntwith a value of1, 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 betweenstartEditing()andfinishEditing()(likeset1Value(),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 πβ¨
π¦ 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