SOMFPATH(3iv)

πŸ’– SoMFPath β€” the manual page, but make it cute πŸ’–

okay bestie, so this is SoMFPath(3IV) β€” yes the manual name is literally that, it's giving very "my full legal name is on the group chat" energy. sit down, grab a strawberry, we're learning about fields. πŸ“


🌈 NAME 🌈

SoMFPath β€” a multiple-value field that holds literally any number of pointers to paths. multiple values. any number. pointers to paths. we contain multitudes, periodt. πŸ’…


🧬 INHERITS FROM 🧬

SoField > SoMField > SoMFPath

it's a whole family tree, iykyk. πŸ‘‘


✨ SYNOPSIS ✨

#include <Inventor/fields/SoMFPath.h>

Methods from class SoMFPath:

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

so this field keeps a whole set of pointers to SoPath instances, and it's lowkey doing the most: it correctly maintains their reference counts the entire time. it's the friend who remembers everyone's birthdays. 🫢

SoMFPaths get written to file as one or more paths (go read the SoPath manual page if you want the whole tea on the file format for a path). and the way that when more than one value is present, all of the values are wrapped in square brackets and separated by commas? iconic. no notes. πŸ’…


πŸ’… METHODS πŸ’…

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

gives you back the type for this class, or for one specific object of this class. it's giving "who am I, really?" 🌸

  • SoPath * operator [](int i) const

hands you the i'th value of the field. ⚠️ but bestie, listen: indexing past the end of the field (like, passing in an i greater than getNum()) will return garbage. not "undefined vibes", actual garbage. stay in your lane, stay in bounds. πŸ’€

  • const SoPath * * getValues(int start) const

returns a pointer into the array of values in the field, starting at index start. these values are read-only β€” if you wanna modify values in place, go look at startEditing()/finishEditing(). they're the ones with the keys. πŸ”‘

  • int find(SoPath * targetValue, SbBool addIfNotFound = FALSE)

hunts down the given value in the array and returns the index where it lives. if it's not there? you get -1. and if addIfNotFound is set, then targetValue gets added to the end of the array β€” but plot twist, -1 is still returned. it was found and you still got -1. that's just the deal. 😭

  • void setValues(int start, int num, const SoPath * *newValues)

sets num values starting at index start to the values in newValues. the array will automatically be made bigger to accommodate the new values if it needs to. it expands. growth mindset fr fr. 🌱

  • void set1Value(int index, SoPath * newValue)

sets the index'th value in the array to newValue. array gets automatically expanded if necessary. same energy. ✨

  • SoPath * operator =(SoPath * newValue)
  • void setValue(SoPath * newValue)

sets the first value in the array to newValue, and then deletes the second and every subsequent value. it's not sharing, it's not compromising β€” it's one value and one value only. main character energy, truly. πŸ‘‘

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

returns TRUE if all of the values of this field equal (or don't equal, for !=) those of the given field. ⚠️ but if the fields are different types, FALSE is always 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. yes, literally that example. they are not the same and the code said so. πŸ’€

  • SoPath * * startEditing()
  • void finishEditing()

startEditing() returns a pointer to the internally-maintained array that you're allowed to modify. you may 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. just don't. πŸ™ˆ

fields, engines or sensors connected to this field, and sensors, do not get notified that this field 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 changed. it said "something happened" and it stands by that. periodt. πŸ’…


and that's the whole page, bestie!! every option, every signature, every -1, every FALSE, all present and accounted for β€” nothing skipped, nothing invented. πŸŽ€

okay so this gorgeous little manual was brought to you by SoMFPath(3IV)() β€” that's the source/version tag, and the date slot is just vibing there, empty, keeping its mystery. πŸ¦‹πŸ’–βœ¨

slay, go edit some fields responsibly πŸ’…πŸŒˆ