SoSFEnum(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

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) const
  • virtual void copyFrom (const SoField &field)
  • const SoSFEnum & operator= (const SoSFEnum &field)
  • virtual SbBool isSame (const SoField &field) const
  • int getValue (void) const
  • void setValue (int newvalue)
  • int operator= (int newvalue)
  • int operator== (const SoSFEnum &field) const
  • int operator!= (const SoSFEnum &field) const
  • void setValue (const SbName name)
  • void setEnums (const int num, const int *vals, const SbName *names)
  • int getNumEnums (void) const
  • int 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) const
  • void setDefault (SbBool def)
  • SbBool isDefault (void) const
  • SbBool isOfType (const SoType type) const
  • void enableConnection (SbBool flag)
  • SbBool isConnectionEnabled (void) const
  • SbBool connectFrom (SoEngineOutput *master, SbBool notnotify=0, SbBool append=0)
  • SbBool appendConnection (SoEngineOutput *master, SbBool notnotify=0)
  • void disconnect (SoEngineOutput *engineoutput)
  • SbBool isConnectedFromEngine (void) const
  • SbBool getConnectedEngine (SoEngineOutput *&master) const
  • SbBool connectFrom (SoField *master, SbBool notnotify=0, SbBool append=0)
  • SbBool appendConnection (SoField *master, SbBool notnotify=0)
  • void disconnect (SoField *field)
  • SbBool isConnectedFromField (void) const
  • SbBool getConnectedField (SoField *&master) const
  • int getNumConnections (void) const
  • int getForwardConnections (SoFieldList &slavelist) const
  • int getConnections (SoFieldList &masterlist) const
  • void disconnect (void)
  • SbBool isConnected (void) const
  • void setContainer (SoFieldContainer *cont)
  • SoFieldContainer * getContainer (void) const
  • SbBool set (const char *valuestring)
  • void get (SbString &valuestring)
  • SbBool shouldWrite (void) const
  • virtual void touch (void)
  • virtual void startNotify (void)
  • virtual void notify (SoNotList *nlist)
  • SbBool enableNotify (SbBool on)
  • SbBool isNotifyEnabled (void) const
  • void addAuditor (void *f, SoNotRec::Type type)
  • void removeAuditor (void *f, SoNotRec::Type type)
  • int operator== (const SoField &f) const
  • int operator!= (const SoField &f) const
  • virtual void connectionStatusChanged (int numconnections)
  • SbBool isReadOnly (void) const
  • virtual void fixCopy (SbBool copyconnections)
  • virtual SbBool referencesCopy (void) const
  • void copyConnection (const SoField *fromfield)
  • virtual SbBool read (SoInput *in, const SbName &name)
  • virtual void write (SoOutput *out, const SbName &name) const
  • virtual void countWriteRefs (SoOutput *out) const
  • void setFieldType (int type)
  • int getFieldType (void) const
  • SbBool getDirty (void) const
  • void 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) const
  • virtual SbBool readConnection (SoInput *in)
  • virtual void writeConnection (SoOutput *out) const
  • SbBool isDestructing (void) const

πŸ”’ Protected Attributes πŸ”’

  • int value
  • int numEnums
  • int * enumValues
  • SbName * enumNames
  • SbBool 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