SoSFEnum(3)
okay bestie, this is the SoSFEnum(3) manual page from the Coin library π section 3, no cap. we're about to get into the SoSFEnum class, and it's giving enum container energy. let's go π«Ά
β¨ NAME β¨
SoSFEnum β the SoSFEnum class is literally a container for an enum value. iconic.
π SYNOPSIS π
#include <Inventor/fields/SoSFEnum.h>
inherits SoSField.
inherited by SoSFBitMask.
π Public Member Functions π
virtual SoType getTypeId (void) constvirtual void copyFrom (const SoField &field)const SoSFEnum & operator= (const SoSFEnum &field)virtual SbBool isSame (const SoField &field) constint getValue (void) constvoid setValue (int newvalue)int operator= (int newvalue)int operator== (const SoSFEnum &field) constint operator!= (const SoSFEnum &field) constvoid setValue (const SbName name)void setEnums (const int num, const int *vals, const SbName *names)int getNumEnums (void) constint getEnum (const int idx, SbName &name) const
πΈ Public Member Functions inherited from SoSField πΈ
virtual ~SoSField ()
πΈ Public Member Functions inherited from SoField πΈ
virtual ~SoField ()void setIgnored (SbBool ignore)SbBool isIgnored (void) constvoid setDefault (SbBool def)SbBool isDefault (void) constSbBool isOfType (const SoType type) constvoid enableConnection (SbBool flag)SbBool isConnectionEnabled (void) constSbBool connectFrom (SoEngineOutput *master, SbBool notnotify=0, SbBool append=0)SbBool appendConnection (SoEngineOutput *master, SbBool notnotify=0)void disconnect (SoEngineOutput *engineoutput)SbBool isConnectedFromEngine (void) constSbBool getConnectedEngine (SoEngineOutput *&master) constSbBool connectFrom (SoField *master, SbBool notnotify=0, SbBool append=0)SbBool appendConnection (SoField *master, SbBool notnotify=0)void disconnect (SoField *field)SbBool isConnectedFromField (void) constSbBool getConnectedField (SoField *&master) constint getNumConnections (void) constint getForwardConnections (SoFieldList &slavelist) constint getConnections (SoFieldList &masterlist) constvoid disconnect (void)SbBool isConnected (void) constvoid setContainer (SoFieldContainer *cont)SoFieldContainer * getContainer (void) constSbBool set (const char *valuestring)void get (SbString &valuestring)SbBool shouldWrite (void) constvirtual void touch (void)virtual void startNotify (void)virtual void notify (SoNotList *nlist)SbBool enableNotify (SbBool on)SbBool isNotifyEnabled (void) constvoid addAuditor (void *f, SoNotRec::Type type)void removeAuditor (void *f, SoNotRec::Type type)int operator== (const SoField &f) constint operator!= (const SoField &f) constvirtual void connectionStatusChanged (int numconnections)SbBool isReadOnly (void) constvirtual void fixCopy (SbBool copyconnections)virtual SbBool referencesCopy (void) constvoid copyConnection (const SoField *fromfield)virtual SbBool read (SoInput *in, const SbName &name)virtual void write (SoOutput *out, const SbName &name) constvirtual void countWriteRefs (SoOutput *out) constvoid setFieldType (int type)int getFieldType (void) constSbBool getDirty (void) constvoid setDirty (SbBool dirty)void evaluate (void) const
β¨ Static Public Member Functions β¨
static void * createInstance (void)static SoType getClassTypeId (void)static void initClass (void)
π Static Public Member Functions inherited from SoSField π
static void initClass (void)static SoType getClassTypeId (void)
π Static Public Member Functions inherited from SoField π
static void initClass (void)static void initClasses (void)static SoType getClassTypeId (void)
π‘οΈ Protected Member Functions π‘οΈ
virtual SbBool findEnumValue (const SbName &name, int &val)virtual SbBool findEnumName (int value, const SbName *&name) const
π‘οΈ Protected Member Functions inherited from SoSField π‘οΈ
SoSField (void)
π‘οΈ Protected Member Functions inherited from SoField π‘οΈ
SoField (void)void valueChanged (SbBool resetdefault=1)virtual void evaluateConnection (void) constvirtual SbBool readConnection (SoInput *in)virtual void writeConnection (SoOutput *out) constSbBool isDestructing (void) const
π Protected Attributes π
int valueint numEnumsint * enumValuesSbName * enumNamesSbBool legalValuesSet
π¦ Additional Inherited Members π¦
π Public Types inherited from SoField π
enum FieldType { NORMAL_FIELD = 0, EVENTIN_FIELD, EVENTOUT_FIELD, EXPOSED_FIELD }
πΈ Detailed Description πΈ
so the SoSFEnum class is literally a container for an enum value. it's giving "I hold one value from a set of named options" energy. this field is used where nodes, engines or other field containers need to store one particular value out of an enumerated set.
a field of this type stores its value to file as the symbolic name, rather than the actual integer value. iconic, no cap.
SoSFEnum instances are initialized on an instance basis, usually in the constructor of the fieldcontainer with the macros SO_NODE_DEFINE_ENUM_VALUE(enumtype, symbolvalue) and SO_NODE_SET_SF_ENUM_TYPE(enumfield, enumtype) for nodes, or for engines; SO_ENGINE_DEFINE_ENUM_VALUE() and SO_ENGINE_SET_SF_ENUM_TYPE().
example initialization from the constructor of the SoCone class:
SO_NODE_DEFINE_ENUM_VALUE(Part, SIDES);
SO_NODE_DEFINE_ENUM_VALUE(Part, BOTTOM);
SO_NODE_DEFINE_ENUM_VALUE(Part, ALL);
SO_NODE_SET_SF_ENUM_TYPE(parts, Part);
see also: SoMFEnum, SoSFBitMask π
π¦ Member Function Documentation π¦
SoType SoSFEnum::getTypeId (void ) const [virtual]
returns the type identification instance which uniquely identifies the Coin field class the object belongs to. it's the main character of type IDs. see also getClassTypeId(), SoType. implements SoField. reimplemented in SoSFBitMask.
void SoSFEnum::copyFrom (const SoField & f) [virtual]
copy value(s) from f into this field. f must be of the same type as this field. implements SoField. reimplemented in SoSFBitMask. lowkey references: enumNames, enumValues, legalValuesSet, and numEnums.
SbBool SoSFEnum::isSame (const SoField & f) const [virtual]
check for equal type and value(s). implements SoField. reimplemented in SoSFBitMask.
void SoSFEnum::setValue (const SbName name)
set the value of this field by specifying an enumeration string value. references findEnumValue(), SbName::getString(), and SoDebugError::post().
void SoSFEnum::setEnums (const int num, const int * vals, const SbName * names)
makes a set of num enumeration names map to integer values, given by vals. references enumNames, enumValues, legalValuesSet, and numEnums.
int SoSFEnum::getNumEnums (void ) const
returns the number of enum names the SoSFEnum object understands. heads up bestie: this API method is not part of the original SGI Inventor 2.1 API, and is an extension specific to Coin. this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. since Coin 2.0.
int SoSFEnum::getEnum (const int idx, SbName & name) const
returns the value of the Nth enum this SoSFEnum object understands, and mutates name to contain the Nth enum's name. heads up bestie: this API method is not part of the original SGI Inventor 2.1 API, and is an extension specific to Coin. this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. since Coin 2.0. references enumNames, enumValues, and SoDebugError::post().
SbBool SoSFEnum::findEnumValue (const SbName & name, int & val) [protected], [virtual]
return in val the enumeration value which matches the given enumeration name. returns TRUE if name is a valid enumeration string, otherwise FALSE. references enumNames, enumValues, and numEnums. referenced by setValue().
SbBool SoSFEnum::findEnumName (int valuearg, const SbName *& name) const [protected], [virtual]
set the enumeration name which matches the given enumeration value. returns TRUE if value is a valid enumeration value, otherwise FALSE. references enumNames, enumValues, and numEnums.
π Member Data Documentation π
int SoSFEnum::numEnums [protected]
number of enumeration mappings. referenced by copyFrom(), findEnumName(), findEnumValue(), and setEnums().
int* SoSFEnum::enumValues [protected]
array of enumeration values. maps 1-to-1 with the enumNames. referenced by copyFrom(), findEnumName(), findEnumValue(), getEnum(), and setEnums().
SbName* SoSFEnum::enumNames [protected]
array of enumeration names. maps 1-to-1 with the enumValues. referenced by copyFrom(), findEnumName(), findEnumValue(), getEnum(), and setEnums().
SbBool SoSFEnum::legalValuesSet [protected]
is TRUE if a set of enum name-to-value mappings has been set. referenced by copyFrom(), and setEnums().
π Author π
generated automatically by Doxygen for Coin from the source code. slay.
okay bestie, that's the whole vibe check. this manual page is from Coin, version 2.5.0, section 3. stay iconic, and may your enums always be symbolic. π β¨π¦
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms