109 void setEnums(
int num,
int *vals,
SbName *names);
113 static void initClass();
114 static void exitClass();
117 virtual SbBool findEnumValue(
const SbName &name,
int &val);
126 virtual SbBool findEnumName(
int val,
const SbName *&name)
const;
137#define SO__SF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) { \
138 if (vals == NULL && firstInstance) \
139 SoDebugError::post("SO_SET_SF_ENUM_TYPE", \
140 "Field %s (%s, line %d): Did you forget to" \
141 " use SO_%s_DEFINE_ENUM_VALUE(%s, ...)?", \
142 fieldName, __FILE__, __LINE__, \
143 containerMacroName, typeName); \
146#define SO__SF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) {}
156#define SO__SF_ENUM_SET_TYPE(fieldName, enumType, contMacroName, contData) { \
157 int _so_sf_enum_num; \
158 int *_so_sf_enum_vals; \
159 SbName *_so_sf_enum_names; \
160 contData->getEnumData((char *)SO__QUOTE(enumType), \
163 _so_sf_enum_names); \
164 SO__SF_ENUM_CHECK_DATA(_so_sf_enum_vals, \
165 SO__QUOTE(enumType), \
166 SO__QUOTE(fieldName), \
168 fieldName.setEnums(_so_sf_enum_num, \
170 _so_sf_enum_names); \
173#define SO_NODE_SET_SF_ENUM_TYPE(fieldName, enumType) \
174 SO__SF_ENUM_SET_TYPE(fieldName,enumType,"NODE",fieldData)
176#define SO_ENGINE_SET_SF_ENUM_TYPE(fieldName, enumType) \
177 SO__SF_ENUM_SET_TYPE(fieldName,enumType,"ENGINE",inputData)
#define SO_SFIELD_HEADER(className, valueType, valueRef)
Character string stored in a hash table.
Field containing an enumerated value.
void getEnums(int &num, int *&vals, SbName *&names)
Gets value/name correspondances.
void setValue(const SbName &name)
Sets this field to contain the given mnemonic name, passed in as a name or string.
Abstract base class for all single-value fields.