131#define SO__SF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) { \
132 if (vals == NULL && firstInstance) \
133 SoDebugError::post("SO_SET_SF_ENUM_TYPE", \
134 "Field %s (%s, line %d): Did you forget to" \
135 " use SO_%s_DEFINE_ENUM_VALUE(%s, ...)?", \
136 fieldName, __FILE__, __LINE__, \
137 containerMacroName, typeName); \
140#define SO__SF_ENUM_CHECK_DATA(vals, typeName, fieldName, containerMacroName) { int _value_false= 0; while(_value_false) {} }
150#define SO__SF_ENUM_SET_TYPE(fieldName, enumType, contMacroName, contData) { \
151 int _so_sf_enum_num; \
152 int *_so_sf_enum_vals; \
153 SbName *_so_sf_enum_names; \
154 contData->getEnumData(SO__QUOTE(enumType), \
157 _so_sf_enum_names); \
158 SO__SF_ENUM_CHECK_DATA(_so_sf_enum_vals, \
159 SO__QUOTE(enumType), \
160 SO__QUOTE(fieldName), \
162 fieldName.setEnums(_so_sf_enum_num, \
164 _so_sf_enum_names); \
167#define SO_NODE_SET_SF_ENUM_TYPE(fieldName, enumType) \
168 SO__SF_ENUM_SET_TYPE(fieldName,enumType,"NODE",fieldData)
170#define SO_ENGINE_SET_SF_ENUM_TYPE(fieldName, enumType) \
171 SO__SF_ENUM_SET_TYPE(fieldName,enumType,"ENGINE",inputData)
187 inline T
getValue()
const {
return static_cast<T
>(SoSFEnum::getValue()); }
#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_SFIELD_HEADER(className, valueType, valueRef)
This macro is all that is needed for most single-value field classes.
Character string stored in a hash table.
Field containing an enumerated value.
void setEnums(int num, int *vals, SbName *names)
Sets up value/name correspondances.
int numEnums
Number of enumeration values.
void setValue(const SbName &name)
Sets this field to contain the given mnemonic name, passed in as a name or string.
bool legalValuesSet
TRUE if setEnums called.
virtual bool findEnumValue(const SbName &name, int &val)
Looks up enum name, returns value. Returns FALSE if not found.
virtual bool findEnumName(int val, const SbName *&name) const
Looks up enum value, returns ptr to name. Returns FALSE if not found.
int * enumValues
Enumeration values.
SbName * enumNames
Mnemonic names of values.
T getValue() const
Get the enum value.
void setValue(T val)
Set the enum value.
Abstract base class for all single-value fields.