SOMFFLOAT(3iv)

πŸ’– SoMFFloat(3IV) β€” ok bestie, gather round πŸ’–

SoMFFloat is a multiple-value field that holds any number of floating point values. That's the whole vibe. This is the SoMFFloat(3IV) manual page, and yes, I'm gonna walk you through every single method like we're studying together at 2am. 🫢


✨ NAME ✨

SoMFFloat β€” multiple-value field containing any number of floating point values

No cap, that's it. That's the name. πŸ’…


🧬 INHERITS FROM 🧬

SoField > SoMField > SoMFFloat

She comes from a whole lineage, okay? SoField at the top, then SoMField, then our girl SoMFFloat. Generational talent fr fr. πŸ‘‘


πŸ“œ SYNOPSIS πŸ“œ

Include her like this:

#include <Inventor/fields/SoMFFloat.h>

🌟 Methods from class SoMFFloat 🌟

static SoType       getClassTypeId()
virtual void        getTypeId() const
float               operator [](int i) const
const float *       getValues(int start) const
int                 find(float targetValue, SbBool addIfNotFound = FALSE)
void                setValues(int start, int num, const float *newValues)
void                set1Value(int index, float newValue)
float               operator =(float newValue)
void                setValue(float newValue)
int                 operator ==(const SoMFFloat &f) const
int                 operator !=(const SoMFFloat &f) const
float *             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, <mint>SoMFFloat</mint> is a multiple-value field that contains any number of floating point values. Any number!! She's flexible like that. πŸ’œ

When SoMFFloats get written to a file, they show up as one or more values in standard scientific notation. And when there's more than one value? The whole squad gets wrapped in square brackets and separated by commas. Like this, bestie:

[ 1.0, 2.3, 5, 6.2e4, -100, ]

And yes β€” the last comma is optional. Trailing comma girlies, you're valid. πŸ™ˆ


πŸ’… METHODS πŸ’…

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

Returns the type for this class or a particular object of this class. Type check, but make it iconic. ✨

  • float operator [](int i) const

Returns the i'th value of the field. ⚠️ Heads up though: indexing past the end of the field β€” like passing in an i greater than getNum() β€” will return garbage. Not a cute surprise. Not the good kind of chaos. Garbage. πŸ’€

  • const float *getValues(int start) const

Returns a pointer into the array of values in the field, starting at index start. These values are read-only, okay? If you wanna modify values in place, go look at the startEditing() / finishEditing() methods instead. No touching. 🫢

  • int find(float 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 addIfNotFound is set, then targetValue gets added to the end of the array β€” but plot twist, -1 is still returned. 😭 So don't let the -1 fool you, she did the thing.

  • void setValues(int start, int num, const float *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 necessary. Growth mindset, literally. 🌱

  • void set1Value(int index, float newValue)

Sets the index'th value in the array to newValue. The array will be automatically expanded, if necessary. She just makes room. No drama. πŸ’–

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

Sets the first value in the array to newValue, and deletes the second and subsequent values. It's giving "clean slate, main character energy." Only one survives. πŸ”₯

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

Returns TRUE if all of the values of this field equal (or do not equal) those of the given field. ⚠️ And 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. Like... yes they're both "one" but no, they are not the same. Different type, different story. πŸ™…β™€οΈ

  • float *startEditing()
  • void finishEditing()

startEditing() returns a pointer to the internally-maintained array that can be modified. You may change the values in the array, but you cannot add or remove values. 🚫

It is illegal to call any other editing methods between startEditing() and finishEditing() β€” e.g. set1Value(), setValue(), etc. Do not do it. The rules are the rules. πŸ’€

Fields, engines or sensors connected to this field and sensors are not notified that this field has changed until finishEditing() is called. So it's like... quiet mode. 🀫

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. Even if nothing happened!! She's telling everyone anyway. πŸ“£ Periodt.


πŸŽ€ okay that's the whole page, bye bestie πŸŽ€

This was the SoMFFloat(3IV) page, straight from the SoMFFloat(3IV) manual β€” the source/version line and the date live down at the bottom of the original, right where the footer sits, and this is me blowing you a kiss from that exact spot. πŸ’–βœ¨πŸ¦‹ Go forth and hold those floats. πŸŒΈπŸ’œπŸ«Ά