SOMFBOOL(3iv)

πŸ’– SoMFBool β€” the manual page, bestie edition πŸ’–

okay so welcome to SoMFBool(3IV), the manual page for SoMFBool, and honestly? it's giving "small but mighty" ✨ it's a multiple-value field that holds any number of boolean values. that's the whole vibe. let's get into it 🫢


🌸 NAME 🌸

SoMFBool β€” a multiple-value field containing any number of boolean values πŸŽ€


🧬 INHERITS FROM 🧬

SoField > SoMField > SoMFBool

so yeah, it's down the family tree from SoField and SoMField, iykyk πŸ‘‘


✨ SYNOPSIS ✨

first things first, you gotta pull it in:

#include <Inventor/fields/SoMFBool.h>

πŸ’… Methods from class SoMFBool

static SoType       getClassTypeId()
virtual void        getTypeId() const
SbBool              operator [](int i) const
const SbBool *      getValues(int start) const
int                 find(SbBool targetValue, SbBool addIfNotFound = FALSE)
void                setValues(int start, int num, const SbBool *newValues)
void                set1Value(int index, SbBool newValue)
SbBool              operator =(SbBool newValue)
void                setValue(SbBool newValue)
int                 operator ==(const SoMFBool &f) const
int                 operator !=(const SoMFBool &f) const
SbBool *            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 πŸ“

A multiple-value field that contains any number of boolean values. literally any number. go off πŸ’…

SoMFBools get written to file as one or more boolean values, and those values get written as "0" (which is the stand-in for a false value), "1", "TRUE", or "FALSE". four whole looks, pick your fave πŸ’–

When more than one value is present, all of the values are wrapped up in square brackets and separated by commas, like this:

[ 0, FALSE, 1, TRUE ]

iconic formatting behavior, no cap ✨


πŸ› οΈ METHODS πŸ› οΈ

  • static SoType getClassTypeId()
  • virtual void getTypeId() const β€” Returns the type for this class, or for a particular object of this class. it's giving "who am I, really" πŸͺž
  • SbBool operator [](int i) const β€” Returns the i'th value of the field. okay so heads up bestie: indexing past the end of the field (aka passing in an i greater than getNum()) will return garbage. not a vibe. don't do it πŸ’€
  • const SbBool *getValues(int start) const β€” Returns a pointer into the array of values in the field, starting at index start. These values are read-only, so hands off πŸ™ˆ β€” if you wanna modify values in place, go see the startEditing()/finishEditing() methods instead.
  • int find(SbBool 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. If addIfNotFound is set, then targetValue gets added to the end of the array β€” but -1 is still returned. yes really. that's the deal πŸ“
  • void setValues(int start, int num, const SbBool *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. it grows for you, queen 🌱
  • void set1Value(int index, SbBool newValue) β€” Sets the index'th value in the array to newValue. The array will be automatically expanded, if necessary.
  • SbBool operator =(SbBool newValue)
  • void setValue(SbBool newValue) β€” Sets the first value in the array to newValue, and deletes the second and subsequent values. brutal? yes. efficient? also yes πŸ’…
  • int operator ==(const SoMFBool &f) const
  • int operator !=(const SoMFBool &f) const β€” Returns TRUE if all of the values of this field equal (do not equal) those of the given field. 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. type match matters, bestie, no shortcuts 🧚
  • SbBool *startEditing()
  • void finishEditing() β€” startEditing() returns a pointer to the internally-maintained array that can be modified. 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() (e.g. set1Value(), setValue(), etc).

Fields, engines or sensors connected to this field and sensors are not notified that this field has changed until finishEditing() is called. 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. yeah, it announces the change anyway. main character energy πŸ‘‘

⚠️ fr fr, remember: no other editing methods in between startEditing() and finishEditing(). and indexing past getNum() hands you garbage. these are the rules, bestie.

and that's the whole page πŸŽ€ this was SoMFBool(3IV), and the footer down at the bottom just reads SoMFBool(3IV)() β€” same name, and the version/date slot is sitting there empty, no cap. love that for it πŸ’–βœ¨