SOFIELDCONTAINER(3iv)
π SoFieldContainer β the abstract base class for stuff that holds fields π
okay bestie, we're in SoFieldContainer(3IV) territory and it's literally the blueprint era. this is the abstract base class for objects that contain fields. she's not out here doing the work herself, she's the template, the main character archetype that engines and nodes are built from. periodt.
πΈ INHERITS FROM πΈ
SoBase > SoFieldContainer
so she got everything from SoBase and then added her own little field-having situation on top. generational wealth of methods, honestly.
β¨ SYNOPSIS β¨
#include <Inventor/fields/SoFieldContainer.h>
Methods from class SoFieldContainer:
static SoType getClassTypeId()
void setToDefaults()
SbBool hasDefaultValues() const
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
void copyFieldValues(const SoFieldContainer *fc, SbBool
copyConnections = FALSE)
SbBool set(const char *fieldDataString)
void get(SbString &fieldDataString)
virtual int getFields(SoFieldList &resultList) const
virtual SoField * getField(const SbName &fieldName) const
SbBool getFieldName(const SoField *field, SbName &fieldName)
const
SbBool isNotifyEnabled() const
SbBool enableNotify(SbBool flag)
Methods from class SoBase:
void ref()
void unref() const
void unrefNoDelete() const
void touch()
virtual SoType getTypeId() const
SbBool isOfType(SbType type) const
virtual void setName(const SbName &name)
virtual SbName getName() const
π«Ά note thecopyConnections = FALSEdefault incopyFieldValuesβ she defaults to NOT dragging the connections along. keep that in your notes, bestie.
π¦ DESCRIPTION π¦
SoFieldContainer is the abstract base class for engines and nodes. it's giving "I contain multitudes, and also fields." she's got methods for finding out what fields an object has, controlling notification, and for dealing with all of an object's fields at once β like a group chat admin for fields. π
the fields of an engine are its inputs. and here's the tea: even though an engine's output corresponds to a specific type of field, an engine output is not a field. it's giving field-adjacent, not field. iykyk. π
π METHODS π
static SoType getClassTypeId()β returns the type of this class. simple, iconic, no notes. β¨void setToDefaults()β sets all fields in this object back to their default values. factory reset her. πSbBool hasDefaultValues() constβ returnsTRUEif all of the object's fields have their default values. but β and this is the plot twist β it will returnTRUEeven if a field'sisDefault()method returnsFALSE. example: if a field's default value is0.0and yousetValue(0.0)that field, the default flag gets set toFALSE(because comparing the field against its default value every single timesetValueis called would be way too slow, and we're not doing that). however,hasDefaultValues()would still returnTRUEin this case. she's doing her own math. πSbBool fieldsAreEqual(const SoFieldContainer *fc) constβ returnsTRUEif this object's fields are exactly equal to fc's fields. if fc is not exactly the same type as this object,FALSEis returned. no type-match, no equality. it's giving strict. πvoid copyFieldValues(const SoFieldContainer *fc, SbBool copyConnections = FALSE)β copies the contents of fc's fields into this object's fields. fc must be the same type as this object. if copyConnections isTRUE, then if any of fc's fields are connected, this object's fields will also be connected to the same source. matching types only, bestie β she does not do mixed friend groups. π«ΆSbBool set(const char *fieldDataString)β sets one or more fields in this object to the values specified in the given string, which should be a string in the Inventor file format.TRUEis returned if the string was valid Inventor file format. for example, you could set the fields of anSoCubeby doing:
SoCube *cube = ....
cube->set("width 1.0 height 2.0 depth 3.2");
look at that syntax slay. π₯
void get(SbString &fieldDataString)β returns the values of the fields of this object in the Inventor ASCII file format in the given string. fields whoseisDefault()bit is set will not be part of the string. you can use thefield->get()method to get a field's value as a string even if it has its default value. so if you're like "where did that field go", she's just being default-shy. πvirtual int getFields(SoFieldList &resultList) constβ appends pointers to all of this object's fields to resultList, and returns the number of fields appended. the types of the fields can be determined usingfield->isOfType()andfield->getTypeId(), and their names can be determined by passing the field pointers to thegetFieldName()method (see below, bestie, she's right there). πvirtual SoField *getField(const SbName &fieldName) constβ returns a pointer to the field of this object whose name is fieldName. returnsNULLif there is no field with the given name. not found? she saidNULL, respectfully. πSbBool getFieldName(const SoField *field, SbName &fieldName) constβ returns the name of the given field in the fieldName argument. returnsFALSEif field is not a member of this object. if she doesn't claim them, she doesn't name them. π«SbBool isNotifyEnabled() constβ notification is the process of telling interested objects that this object has changed. notification is needed to make engines and sensors function, is used to keepSoPathsup to date when the scene graph's topology changes, and is also used to invalidate rendering or bounding box caches.
notification is normally enabled, but can be disabled on a node by node (or engine by engine) basis. if you are making extensive changes to a large part of the scene graph then disabling notification can increase performance β at the expense of increased responsibility for making sure that any interested engines, sensors or paths are kept up to date. it's giving "you wanted the speed, now you own the consequences." π
for example, if you will be making a lot of changes to a small part of your scene graph and you know that there are no engines or sensors attached to nodes in that part of the scene graph, you might disable notification on the nodes you are changing, modify them, re-enable notification, and then touch() one of the nodes to cause a redraw.
however β and she said this with her whole chest β you should profile your application and make sure that notification is actually taking a significant amount of time before going to the trouble of manually controlling notification. do not optimize vibes you haven't measured. π«Ά
SbBool enableNotify(SbBool flag)β notification at this Field Container is enabled (if flag ==TRUE) or disabled (if flag ==FALSE). the returned boolean value indicates whether notification was enabled immediately prior to applying this method. she tells you what the situation was before she changed it. receipts. π
π SEE ALSO π
SoSField, SoMField, SoNode, SoDB
go read those too, they're all in the same friend group. β¨
and that's the whole page, bestie π this was SoFieldContainer(3IV), same name up top and same name down at the bottom, no date drama, just the title and the manual name doing their little matching thing. you ate this. periodt. π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms