53#include <Inventor/SbString.h>
54#include <Inventor/errors/SoDebugError.h>
55#include <Inventor/fields/SoSubField.h>
99 SO_MFIELD_SETVALUESPOINTER_HEADER(
int);
130 void setEnums(
int num,
int *vals,
SbName *names);
133 static void initClass();
134 static void exitClass();
150 virtual SbBool findEnumValue(
const SbName &name,
int &val);
153 virtual SbBool findEnumName(
int val,
const SbName *&name)
const;
164# define SO__MF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) { \
165 if (vals == NULL && firstInstance) { \
166 SoDebugError::post("SO_SET_MF_ENUM_TYPE", \
167 "Field %s (%s, line %d): Did you forget to" \
168 " use SO_%s_DEFINE_ENUM_VALUE(%s, ...)?", \
169 fieldName, __FILE__, __LINE__, \
170 containerMacroName, typeName); \
174# define SO__MF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) ;
184#define SO__MF_ENUM_SET_TYPE(fieldName, enumType, contMacroName, contData) { \
185 int _so_mf_enum_num; \
186 int *_so_mf_enum_vals; \
187 SbName *_so_mf_enum_names; \
188 contData->getEnumData((char *)SO__QUOTE(enumType), \
191 _so_mf_enum_names); \
192 SO__MF_ENUM_CHECK_DATA(_so_mf_enum_vals, \
193 SO__QUOTE(enumType), \
194 SO__QUOTE(fieldName), \
196 fieldName.setEnums(_so_mf_enum_num, \
198 _so_mf_enum_names); \
201#define SO_NODE_SET_MF_ENUM_TYPE(fieldName, enumType) \
202 SO__MF_ENUM_SET_TYPE(fieldName,enumType,"NODE",fieldData)
204#define SO_ENGINE_SET_MF_ENUM_TYPE(fieldName, enumType) \
205 SO__MF_ENUM_SET_TYPE(fieldName,enumType,"ENGINE",inputData)
Character string stored in a hash table.
Multiple-value field containing any number of enumerated type values.
void setValue(const SbName &name)
Sets this field to contain one and only one value, which is the mnemonic name as a string.
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.
void getEnums(int &num, int *&vals, SbName *&names)
Gets value/name correspondances.
Base class for all multiple-valued fields.