SOMFPLANE(3iv)

πŸ’– SoMFPlane πŸ’–

okay bestie, gather round, because today we're talking about SoMFPlane β€” it's an inventor man page, section 3IV, and it's literally just a field that holds one or more plane equations. that's it. that's the girl. πŸ›©οΈβœ¨


🌸 INHERITS FROM 🌸

lowkey a whole family tree, and she's at the bottom of it:

SoField > SoMField > SoMFPlane

so like, everything SoField can do? she can do. everything SoMField can do? also her. she's the main character of the inheritance chain fr fr πŸ‘‘


✨ SYNOPSIS ✨

first things first, you gotta pull her in:

#include <Inventor/fields/SoMFPlane.h>

πŸŽ€ Methods from class SoMFPlane

these are her own methods, her signature moves:

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

🌈 Methods from class SoMField

the stuff she inherited from her mom, 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

and the stuff from grandma SoField, the OG:

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 πŸ’…

so, a field containing one or more plane equations. simple. elegant. iconic.

SoMFPlanes get written to file as groups of four floating point values, separated by whitespace. and in each little set of four? the first three are the normal direction of the plane, and the fourth is the distance of the plane from the origin (in the direction of the normal). so it's like normal_x normal_y normal_z distance, got it? 🧚

and when there's more than one value? the whole thing gets wrapped in square brackets and separated by commas. like this bestie:

[ 1 0 0 0, .707 .707 0 100, ]

ate. no crumbs. πŸ“


πŸ”₯ METHODS πŸ”₯

static SoType getClassTypeId()

virtual void getTypeId() const

returns the type for this class, or for a particular object of this class. type-checking queen. πŸ‘‘

SbPlane operator [](int i) const

returns the i'th value of the field. but bestie, listen β€” indexing past the end of the field (passing in i greater than getNum()) will return garbage. garbage!! not a crash, not an error, just vibes that are wrong. so don't. πŸ˜­πŸ’€

const SbPlane * getValues(int start) const

hands you a pointer into the array of values in the field, starting at index start. these values are read-only β€” do not touch, do not edit, they are not yours. if you do wanna modify values in place, go see the startEditing()/finishEditing() methods. that's the way. ✨

int find(SbPlane targetValue, SbBool addIfNotFound = FALSE)

looks for the given value in the array and returns the index of that value. if it's not found, -1 is returned. and if you set addIfNotFound, then targetValue gets added to the end of the array β€” but heads up, -1 is still returned. yes really. she found nothing and then added it anyway. make it make sense. πŸ™ˆ

void setValues(int start, int num, const SbPlane *newValues)

sets num values starting at index start to the values in newValues. and the array will automatically be made larger to accommodate the new values, if necessary. she grows for you. 🌱

void set1Value(int index, SbPlane newValue)

sets the index'th value in the array to newValue. the array will automatically be expanded, if necessary. one value, one slot, no stress. πŸ’–

SbPlane operator =(SbPlane newValue)

void setValue(SbPlane newValue)

sets the first value in the array to newValue, and then deletes the second and subsequent values. bye besties, only one survivor. πŸ’…

int operator ==(const SoMFPlane &f) const

int operator !=(const SoMFPlane &f) const

returns TRUE if all of the values of this field equal (or, for !=, do not equal) those of the given field. and here's the important part β€” 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. not the same. different type, different girl. periodt. 🚫

SbPlane * startEditing()

void finishEditing()

startEditing() returns a pointer to the internally-maintained array, and that one you can actually modify. the values in the array may be changed, but values cannot be added or removed.

⚠️ it is illegal to call any other editing methods between startEditing() and finishEditing() β€” like set1Value(), setValue(), etc. illegal!! do not do crimes in the edit window. 🚨

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, she announces a change that didn't happen. she's dramatic like that. πŸ’…βœ¨


and that's the whole page, bestie!! 🫢

this was SoMFPlane(3IV)() β€” that's the page footer right there, source/version and date and everything, all wrapped up in one little SoMFPlane(3IV)() bow. go forth and make planes. ily. πŸ’œπŸ¦‹πŸŒΈ