.TH "SoSFEnum" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoSFEnum \- The \fBSoSFEnum\fP class is a container for an enum value\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoSField\fP\&. .PP Inherited by \fBSoSFBitMask\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBvirtual\fP \fBSoType\fP \fBgetTypeId\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBcopyFrom\fP (\fBconst\fP \fBSoField\fP &\fBfield\fP)" .br .ti -1c .RI "\fBconst\fP \fBSoSFEnum\fP & \fBoperator=\fP (\fBconst\fP \fBSoSFEnum\fP &\fBfield\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisSame\fP (\fBconst\fP \fBSoField\fP &\fBfield\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetValue\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetValue\fP (int \fBnewvalue\fP)" .br .ti -1c .RI "int \fBoperator=\fP (int \fBnewvalue\fP)" .br .ti -1c .RI "int \fBoperator==\fP (\fBconst\fP \fBSoSFEnum\fP &\fBfield\fP) \fBconst\fP" .br .ti -1c .RI "int \fBoperator!=\fP (\fBconst\fP \fBSoSFEnum\fP &\fBfield\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetValue\fP (\fBconst\fP \fBSbName\fP name)" .br .ti -1c .RI "\fBvoid\fP \fBsetEnums\fP (\fBconst\fP int num, \fBconst\fP int *\fBvals\fP, \fBconst\fP \fBSbName\fP *names)" .br .ti -1c .RI "int \fBgetNumEnums\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetEnum\fP (\fBconst\fP int idx, \fBSbName\fP &name) \fBconst\fP" .br .in -1c Public Member Functions inherited from \fBSoSField\fP .in +1c .ti -1c .RI "\fBvirtual\fP \fB~SoSField\fP ()" .br .in -1c Public Member Functions inherited from \fBSoField\fP .in +1c .ti -1c .RI "\fBvirtual\fP \fB~SoField\fP ()" .br .ti -1c .RI "\fBvoid\fP \fBsetIgnored\fP (SbBool \fBignore\fP)" .br .ti -1c .RI "SbBool \fBisIgnored\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetDefault\fP (SbBool \fBdefaultVal\fP)" .br .ti -1c .RI "SbBool \fBisDefault\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBisOfType\fP (\fBconst\fP \fBSoType\fP type) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBenableConnection\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBisConnectionEnabled\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBconnectFrom\fP (\fBSoEngineOutput\fP *master, SbBool \fBnotnotify\fP=FALSE, SbBool append=FALSE)" .br .ti -1c .RI "SbBool \fBappendConnection\fP (\fBSoEngineOutput\fP *master, SbBool \fBnotnotify\fP=FALSE)" .br .ti -1c .RI "\fBvoid\fP \fBdisconnect\fP (\fBSoEngineOutput\fP *\fBengineoutput\fP)" .br .ti -1c .RI "SbBool \fBisConnectedFromEngine\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBgetConnectedEngine\fP (\fBSoEngineOutput\fP *&master) \fBconst\fP" .br .ti -1c .RI "SbBool \fBconnectFrom\fP (\fBSoField\fP *master, SbBool \fBnotnotify\fP=FALSE, SbBool append=FALSE)" .br .ti -1c .RI "SbBool \fBappendConnection\fP (\fBSoField\fP *master, SbBool \fBnotnotify\fP=FALSE)" .br .ti -1c .RI "\fBvoid\fP \fBdisconnect\fP (\fBSoField\fP *\fBfield\fP)" .br .ti -1c .RI "SbBool \fBisConnectedFromField\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBgetConnectedField\fP (\fBSoField\fP *&master) \fBconst\fP" .br .ti -1c .RI "int \fBgetNumConnections\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetForwardConnections\fP (\fBSoFieldList\fP &\fBslavelist\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetConnections\fP (\fBSoFieldList\fP &\fBmasterlist\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBdisconnect\fP (\fBvoid\fP)" .br .ti -1c .RI "SbBool \fBisConnected\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetContainer\fP (\fBSoFieldContainer\fP *\fBcont\fP)" .br .ti -1c .RI "\fBSoFieldContainer\fP * \fBgetContainer\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBset\fP (\fBconst\fP char *\fBvaluestring\fP)" .br .ti -1c .RI "\fBvoid\fP \fBget\fP (\fBSbString\fP &\fBvaluestring\fP)" .br .ti -1c .RI "SbBool \fBshouldWrite\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBtouch\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBstartNotify\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBnotify\fP (\fBSoNotList\fP *\fBnlist\fP)" .br .ti -1c .RI "SbBool \fBenableNotify\fP (SbBool on)" .br .ti -1c .RI "SbBool \fBisNotifyEnabled\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBaddAuditor\fP (\fBvoid\fP *f, \fBSoNotRec::Type\fP type)" .br .ti -1c .RI "\fBvoid\fP \fBremoveAuditor\fP (\fBvoid\fP *f, \fBSoNotRec::Type\fP type)" .br .ti -1c .RI "int \fBoperator==\fP (\fBconst\fP \fBSoField\fP &f) \fBconst\fP" .br .ti -1c .RI "int \fBoperator!=\fP (\fBconst\fP \fBSoField\fP &f) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBconnectionStatusChanged\fP (int \fBnumconnections\fP)" .br .ti -1c .RI "SbBool \fBisReadOnly\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBfixCopy\fP (SbBool \fBcopyconnections\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBreferencesCopy\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBcopyConnection\fP (\fBconst\fP \fBSoField\fP *fromfield)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBread\fP (\fBSoInput\fP *input, \fBconst\fP \fBSbName\fP &name)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBwrite\fP (\fBSoOutput\fP *\fBout\fP, \fBconst\fP \fBSbName\fP &name) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBcountWriteRefs\fP (\fBSoOutput\fP *\fBout\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetFieldType\fP (int type)" .br .ti -1c .RI "int \fBgetFieldType\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBgetDirty\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetDirty\fP (SbBool dirty)" .br .ti -1c .RI "\fBvoid\fP \fBevaluate\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP * \fBcreateInstance\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .in -1c Static Public Member Functions inherited from \fBSoSField\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBatexit_cleanup\fP (\fBvoid\fP)" .br .in -1c Static Public Member Functions inherited from \fBSoField\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClasses\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBcleanupClass\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBvirtual\fP SbBool \fBfindEnumValue\fP (\fBconst\fP \fBSbName\fP &name, int &\fBval\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBfindEnumName\fP (int value, \fBconst\fP \fBSbName\fP *&name) \fBconst\fP" .br .in -1c Protected Member Functions inherited from \fBSoSField\fP .in +1c .ti -1c .RI "\fBSoSField\fP (\fBvoid\fP)" .br .in -1c Protected Member Functions inherited from \fBSoField\fP .in +1c .ti -1c .RI "\fBSoField\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBvalueChanged\fP (SbBool \fBresetdefault\fP=TRUE)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBevaluateConnection\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBreadConnection\fP (\fBSoInput\fP *\fBin\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBwriteConnection\fP (\fBSoOutput\fP *\fBout\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBisDestructing\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBSoNotRec\fP \fBcreateNotRec\fP (\fBSoBase\fP *\fBcont\fP)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "int \fBvalue\fP" .br .ti -1c .RI "int \fBnumEnums\fP" .br .ti -1c .RI "int * \fBenumValues\fP" .br .ti -1c .RI "\fBSbName\fP * \fBenumNames\fP" .br .ti -1c .RI "SbBool \fBlegalValuesSet\fP" .br .in -1c .SS "Additional Inherited Members" Public Types inherited from \fBSoField\fP .in +1c .ti -1c .RI "enum \fBFieldType\fP { \fBNORMAL_FIELD\fP = 0, \fBEVENTIN_FIELD\fP, \fBEVENTOUT_FIELD\fP, \fBEXPOSED_FIELD\fP }" .br .in -1c .SH "Detailed Description" .PP The \fBSoSFEnum\fP class is a container for an enum value\&. This field is used where nodes, engines or other field containers needs to store one particular value out of an enumerated set\&. .PP A field of this type stores its value to file as the symbolic name, rather than the actual integer value\&. .PP \fBSoSFEnum\fP instances are initialized on an instance basis, usually in the constructor of the field container 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()\&. .PP Example initialization from the constructor of the \fBSoCone\fP class: .PP .nf 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); .fi .PP .PP \fBSee also\fP .RS 4 \fBSoMFEnum\fP, \fBSoSFBitMask\fP .RE .PP .SH "Member Function Documentation" .PP .SS "\fBvoid\fP * SoSFEnum::createInstance (\fBvoid\fP)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br Creates a new instance of the class type corresponding to the \fBSoType\fP object\&. .br .SS "\fBSoType\fP SoSFEnum::getClassTypeId (\fBvoid\fP)\fC [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .br .SS "\fBSoType\fP SoSFEnum::getTypeId (\fBvoid\fP) const\fC [virtual]\fP" Returns the type identification of an object derived from a class inheriting \fBSoField\fP\&. This is used for runtime type checking and 'downward' casting\&. .br .PP Implements \fBSoField\fP\&. .PP Reimplemented in \fBSoSFBitMask\fP\&. .SS "\fBvoid\fP SoSFEnum::copyFrom (\fBconst\fP \fBSoField\fP & f)\fC [virtual]\fP" Copy value(s) from \fIf\fP into this field\&. \fIf\fP must be of the same type as this field\&. .PP Implements \fBSoField\fP\&. .PP Reimplemented in \fBSoSFBitMask\fP\&. .SS "SbBool SoSFEnum::isSame (\fBconst\fP \fBSoField\fP & f) const\fC [virtual]\fP" Check for equal type and value(s)\&. .PP Implements \fBSoField\fP\&. .PP Reimplemented in \fBSoSFBitMask\fP\&. .SS "\fBvoid\fP SoSFEnum::initClass (\fBvoid\fP)\fC [static]\fP" Internal method called upon initialization of the library (from \fBSoDB::init()\fP) to set up the type system\&. .SS "\fBvoid\fP SoSFEnum::setValue (\fBconst\fP \fBSbName\fP name)" Set the value of this field by specifying an enumeration string value\&. .SS "\fBvoid\fP SoSFEnum::setEnums (\fBconst\fP int num, \fBconst\fP int * vals, \fBconst\fP \fBSbName\fP * names)" Makes a set of \fInum\fP enumeration \fInames\fP map to integer values, given by \fIvals\fP\&. .SS "int SoSFEnum::getNumEnums (\fBvoid\fP) const" Returns the number of enum names the \fBSoSFEnum\fP object understands\&. .PP Note that this API method is not part of the original SGI Inventor \fB2\&.1\fP API, and is an extension specific to Coin\&. .PP This function is an extension for Coin, and it is not available in the original SGI Open Inventor \fBv2\&.1\fP API\&. .br .PP \fBSince\fP .RS 4 Coin \fB2\&.0\fP .RE .PP .SS "int SoSFEnum::getEnum (\fBconst\fP int idx, \fBSbName\fP & name) const" Returns the value of the Nth enum this \fBSoSFEnum\fP object understands, and mutates \fIname\fP to contain the Nth enum's name\&. .PP Note that this API method is not part of the original SGI Inventor \fB2\&.1\fP API, and is an extension specific to Coin\&. .PP This function is an extension for Coin, and it is not available in the original SGI Open Inventor \fBv2\&.1\fP API\&. .br .PP \fBSince\fP .RS 4 Coin \fB2\&.0\fP .RE .PP .SS "SbBool SoSFEnum::findEnumValue (\fBconst\fP \fBSbName\fP & name, int & val)\fC [protected]\fP, \fC [virtual]\fP" Return in \fIval\fP the enumeration value which matches the given enumeration \fIname\fP\&. .PP Returns \fCTRUE\fP if \fIname\fP is a valid enumeration string, otherwise \fCFALSE\fP\&. .SS "SbBool SoSFEnum::findEnumName (int valuearg, \fBconst\fP \fBSbName\fP *& name) const\fC [protected]\fP, \fC [virtual]\fP" Set the enumeration \fIname\fP which matches the given enumeration value\&. .PP Returns \fCTRUE\fP if \fIvalue\fP is a valid enumeration value, otherwise \fCFALSE\fP\&. .SH "Member Data Documentation" .PP .SS "int SoSFEnum::numEnums\fC [protected]\fP" Number of enumeration mappings\&. .SS "int * SoSFEnum::enumValues\fC [protected]\fP" Array of enumeration values\&. Maps 1-to-1 with the enumNames\&. .SS "\fBSbName\fP * SoSFEnum::enumNames\fC [protected]\fP" Array of enumeration names\&. Maps 1-to-1 with the enumValues\&. .SS "SbBool SoSFEnum::legalValuesSet\fC [protected]\fP" Is \fCTRUE\fP if a set of enum name-to-value mappings has been set\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.