135#define SO__MF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) { \
136 int _value_false= 0; \
138 if (vals == NULL && firstInstance) \
139 SoDebugError::post("SO_SET_MF_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); \
144 } while (_value_false); \
147#define SO__MF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) { int _value_false= 0; while(_value_false) {} }
157#define SO__MF_ENUM_SET_TYPE(fieldName, enumType, contMacroName, contData) { \
158 int _value_false= 0; \
160 int _so_mf_enum_num; \
161 int *_so_mf_enum_vals; \
162 SbName *_so_mf_enum_names; \
163 contData->getEnumData(SO__QUOTE(enumType), \
166 _so_mf_enum_names); \
167 SO__MF_ENUM_CHECK_DATA(_so_mf_enum_vals, \
168 SO__QUOTE(enumType), \
169 SO__QUOTE(fieldName), \
171 fieldName.setEnums(_so_mf_enum_num, \
173 _so_mf_enum_names); \
174 } while (_value_false); \
177#define SO_NODE_SET_MF_ENUM_TYPE(fieldName, enumType) \
178 SO__MF_ENUM_SET_TYPE(fieldName,enumType,"NODE",fieldData)
180#define SO_ENGINE_SET_MF_ENUM_TYPE(fieldName, enumType) \
181 SO__MF_ENUM_SET_TYPE(fieldName,enumType,"ENGINE",inputData)
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
#define SO_MFIELD_HEADER(className, valueType, valueRef)
This macro is all that is needed for most multiple-value field classes.
Character string stored in a hash table.
Multiple-value field containing any number of enumerated type values.
void setEnums(int num, int *vals, SbName *names)
Sets up value/name correspondances.
SbName * enumNames
Mnemonic names of values.
void setValue(const SbName &name)
Sets this field to contain one and only one value, which is the mnemonic name as a string.
int * enumValues
Enumeration values.
void set1Value(int index, const SbName &name)
Sets the index'th value to be the integer corresponding to the mnemonic name in the given string.
virtual bool findEnumValue(const SbName &name, int &val)
Looks up enum name, returns value. Returns FALSE if not found.
bool legalValuesSet
TRUE if setEnums called.
int numEnums
Number of enumeration values.
virtual bool findEnumName(int val, const SbName *&name) const
Looks up enum value, returns ptr to name. Returns FALSE if not found.
Base class for all multiple-valued fields.