SoFieldData(3)
π SoFieldData π
okay bestie, you're reading the Coin manual page for SoFieldData(3) and honestly? it's giving backstage pass to the field system. this thing is a container for a prototype set of fields, and yeah it's lowkey internal, but let's get into it π
β¨ NAME β¨
SoFieldData β the container for a prototype set of fields. that's the whole vibe. it holds the blueprint, not the actual field values, iykyk π
π¦ SYNOPSIS π¦
first thing, you gotta pull in the header:
#include <Inventor/fields/SoFieldData.h>
πΈ Public Member Functions πΈ
here's the full roster, no skips, no cuts, we're listing everyone π
SoFieldData (void)
SoFieldData (const SoFieldData &fd)
SoFieldData (const SoFieldData *fd)
SoFieldData (int numfields)
~SoFieldData ()
void addField (SoFieldContainer *base, const char *name, const SoField *field)
void overlay (SoFieldContainer *to, const SoFieldContainer *from, SbBool copyconnections) const
int getNumFields (void) const
const SbName & getFieldName (int index) const
SoField * getField (const SoFieldContainer *object, int index) const
int getIndex (const SoFieldContainer *fc, const SoField *field) const
void addEnumValue (const char *enumname, const char *valuename, int value)
void getEnumData (const char *enumname, int &num, const int *&values, const SbName *&names)
SbBool read (SoInput *input, SoFieldContainer *object, SbBool erroronunknownfield, SbBool ¬builtin) const
SbBool read (SoInput *input, SoFieldContainer *object, const SbName &fieldname, SbBool &foundname) const
void write (SoOutput *out, const SoFieldContainer *object) const
void copy (const SoFieldData *src)
SbBool isSame (const SoFieldContainer *c1, const SoFieldContainer *c2) const
SbBool readFieldDescriptions (SoInput *input, SoFieldContainer *object, int numdescriptionsexpected, const SbBool readfieldvalues=TRUE) const
void writeFieldDescriptions (SoOutput *out, const SoFieldContainer *object) const
π Detailed Description π
so. SoFieldData is a container for a prototype set of fields. say it with me π«Ά
this class gets instantiated once for each class of objects which use fields, and which need to be able to import and export them. one per class, periodt.
each field of a class is stored with the name it's been given within its "owner" class, plus a pointer offset to the dynamic instance of the field itself. name + offset = how it finds the real thing later β¨
enumeration sets are stored as (name, value) pairs, which is what makes it possible to address, read and save enum type fields by name. cute, right?
ngl bestie, it's unlikely that application programmers should need to use any of the methods of this class directly. this is very much internal plumbing π
See also: SoField, SoFieldContainer β your two new besties π
π Constructor & Destructor Documentation π
SoFieldData::SoFieldData (void )
default constructor. the classic. the blueprint-less blueprint π¦
SoFieldData::SoFieldData (const SoFieldData & fd)
copy constructor. takes a reference, copies the vibe π
SoFieldData::SoFieldData (const SoFieldData * fd)
copy constructor that takes a pointer value as an argument. and here's the iconic part: it handles NULL pointers by behaving like the default constructor. no crash, just chill π
SoFieldData::SoFieldData (int numfields)
constructor that takes an indication on the number of fields which should be stored β so the memory handling stays efficient. it's pre-gaming the memory allocation, we love a planner π
SoFieldData::~SoFieldData ()
destructor. say bye bye, clean up your mess π
π Member Function Documentation π
void SoFieldData::addField (SoFieldContainer * base, const char * name, const SoField * field)
adds a new field to our internal list π
the name gets stored along with a pointer offset between base and field, and that offset will be valid for all instances of the class type of base. so it's a one-time map that works forever, main character energy fr fr.
void SoFieldData::overlay (SoFieldContainer * to, const SoFieldContainer * from, SbBool copyconnections) const
copies fields from container from to container to. and if copyconnections is TRUE, we also copy the connections from has made. bestie is moving in and bringing the whole friend group π₯
okay so if you think the method signature is a bit strange β you're correct. this should really have been astaticmethod (the ownerthisinstance of the method isn't used at all, due to how the internal representation of field template list are stored), but for unknown reasons this is a dynamic method in Open Inventor. so also in Coin, to keep compatibility. we don't make the rules, we just inherit them π
int SoFieldData::getNumFields (void ) const
returns the number of fields contained within this instance. a headcount πΈ
const SbName & SoFieldData::getFieldName (int index) const
returns the name of the field at index. roll call π£
SoField * SoFieldData::getField (const SoFieldContainer * object, int index) const
returns a pointer to the field at index within the object instance. it's giving "here's your field, bestie" π«Ά
int SoFieldData::getIndex (const SoFieldContainer * fc, const SoField * field) const
returns the internal index value of field in fc. and if field is not part of fc? returns -1. rejected, not on the list π
void SoFieldData::addEnumValue (const char * enumname, const char * valuename, int value)
either adds a new enum set (with an initial member), or adds a new value member to an existing enum set. two jobs, one method, versatile icon β¨
void SoFieldData::getEnumData (const char * enumname, int & num, const int *& values, const SbName *& names)
returns the names and values of the enumeration entry with the enumname. the number of (name, value) pairs available in the enumeration is returned in num. data dump, but make it organized π
SbBool SoFieldData::read (SoInput * in, SoFieldContainer * object, SbBool erroronunknownfield, SbBool & notbuiltin) const
reads field data from the in stream for fields belonging to object. returns TRUE if everything went OK, or FALSE if any error conditions occurs. no cap, TRUE means we ate, FALSE means we didn't π
erroronunknownfield decides whether or not FALSE should be returned if a name identifier not recognized as a field name of object is encountered.
β οΈ note thaterroronunknownfieldshould beFALSEifobjectis a container with child objects, otherwise the code will fail upon the first child name specification. so. set it toFALSE. just do it. don't be that person π
if notbuiltin is TRUE on return, object is an unknown node or engine type. unknown nodes are recognized by the fields keyword first in their file format definition, and unknown engines by the inputs keyword. little detective work, we love a mystery π
SbBool SoFieldData::read (SoInput * in, SoFieldContainer * object, const SbName & fieldname, SbBool & foundname) const
finds field fieldname in object, and if it's available, sets foundname to TRUE and tries to read the field specification from in. if foundname is set to TRUE, the return value says whether or not the field specification could be read without any problems. two-step verification, very secure of it π
if fieldname is not part of object, returns FALSE with foundname also set to FALSE. nobody home, both flags down π
void SoFieldData::write (SoOutput * out, const SoFieldContainer * object) const
writes to out the field names and field values for the fields of object. time to put it all out there βοΈ
void SoFieldData::copy (const SoFieldData * src)
copies the contents of src into this instance. and if there was any data set up in this instance before the method was called, the old data is removed first. out with the old, in with the new π§Ήβ¨
β οΈ note that this only copies the field set template specification fromsrc, not actual field contents. for copying field contents, see theSoFieldData::overlay()method. don't get it twisted bestie, these two are not the same π
SbBool SoFieldData::isSame (const SoFieldContainer * c1, const SoFieldContainer * c2) const
compares c1 and c2 to see if they have the same field data set and if the fields of c1 have the same values as the fields of c2. full comparison, no half measures π
field connections are not considered β i.e. we will return TRUE if the values of the fields of c1 are equal to the fields of c2, even if they differ in how they have made connections to other fields. so they can run in totally different circles and still count as same π€
and again: if you think the method signature is a bit strange, you're correct. this should really have been astaticmethod (the ownerthisinstance of the method isn't used at all, due to how the internal representations of field template lists are stored), but for unknown reasons this is a dynamic method in Open Inventor. so also in Coin, to keep compatibility. same story, different function π
SbBool SoFieldData::readFieldDescriptions (SoInput * in, SoFieldContainer * object, int numdescriptionsexpected, const SbBool readfieldvalues = TRUE) const
reads a set of field specifications from in for an unknown node class type, in the form:
"[ FIELDCLASS FIELDNAME, FIELDCLASS FIELDNAME, ... ]"
numdescriptionsexpected is used for binary format import to know how many descriptions should be parsed. binary format said "i need a number" and this is the number π’
if readfieldvalues is TRUE (the default), the field initial value is expected after the field name in the SoInput stream. default behaviour is the default for a reason bestie β¨
void SoFieldData::writeFieldDescriptions (SoOutput * out, const SoFieldContainer * object) const
writes a set of field specifications to out for an unknown node class type, in the form:
"[ FIELDCLASS FIELDNAME, FIELDCLASS FIELDNAME, ... ]"
mirror mirror on the wall, same format for one and all πͺ
π Author π
generated automatically by Doxygen for Coin from the source code. so like, credit where credit's due, a robot wrote my source material and i gave it the glow-up π
and that's the whole page, bestie! π this was Coin's SoFieldData(3) manual page, version 4.0.10, dated Thu Jun 25 2026 00:00:00. slay, you read the whole thing, i'm so proud of you π«Άβ¨π
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms