31 #include <type_traits>
43 class OutputConnector;
92 void setValue(
bool boolValue) { setBoolValue(boolValue); }
95 void updateValue(
bool boolValue) { updateBoolValue(boolValue); }
98 bool getValue()
const {
return getBoolValue(); }
185 EnumField(
const std::string& name,
const std::string enumerationItemNames[],
size_t numEnumerationItems);
194 EnumField(
const std::string& name,
const char*
const* enumerationItemNames,
size_t numEnumerationItems);
203 EnumField(
const std::string& name,
const std::vector<std::string> &enumerationItemNames);
235 EnumEntry(
const std::string& sv,
int v) : stringValue(sv), value(v) { }
253 void setValue(
int enumValue) { setEnumValue(enumValue); }
279 bool _linearEntries{};
291 template <
typename EnumType>
297 Entry():stringValue(nullptr), value(-1) {}
298 Entry(
const char* sv, EnumType v) : stringValue(sv), value(v) { }
308 void add(
const char* stringValue, EnumType value) {
309 _entries.emplace_back(stringValue,
static_cast<int>(value));
313 void add(
const std::string& stringValue, EnumType value) {
314 _entries.emplace_back(stringValue,
static_cast<int>(value));
329 const std::vector<EnumField::EnumEntry>&
getEntries()
const {
return _entries; }
338 #define ML_ENUM_VALUE(enumValue) internal::createEnumEntry(#enumValue, enumValue)
342 #define ML_EXTERNAL_ENUM_VALUE(enumClass, enumValue) internal::createEnumEntry(#enumValue, enumClass::enumValue)
346 template <
typename EnumType>
356 template <
typename EnumType>
360 static_assert(
sizeof(std::underlying_type<EnumType>) <=
sizeof(
int),
"The underlying type cannot be bigger than int!");
365 const std::vector<EnumField::EnumEntry>& entries = enumValues.
getEntries();
366 _initialize(name, entries.size());
367 _setEnumerationNames(entries,
static_cast<int>(initialValue));
371 EnumType
getEnumValue()
const {
return static_cast<EnumType
>(EnumField::getEnumValue()); }
373 void setEnumValue(EnumType enumValue) { EnumField::setEnumValue(
static_cast<int>(enumValue)); }
375 void updateEnumValue(EnumType enumValue) { EnumField::updateEnumValue(
static_cast<int>(enumValue)); }
377 EnumType
getValue()
const {
return getEnumValue(); }
379 void setValue(EnumType enumValue) { setEnumValue(enumValue); }
381 void updateValue(EnumType enumValue) { updateEnumValue(enumValue); }
423 void setValue(
float floatValue) { setFloatValue(floatValue); }
426 void updateValue(
float floatValue) { updateFloatValue(floatValue); }
481 void setValue(
float floatValue) { setFloatValue(floatValue); }
485 float _difference{0.02f};
528 void setValue(
double doubleValue) { setDoubleValue(doubleValue); }
531 void updateValue(
double doubleValue) { updateDoubleValue(doubleValue); }
534 double getValue()
const {
return getDoubleValue(); }
581 void updateValue(
const std::string& stringValue) { updateStringValue(stringValue); }
773 template <
typename T>
779 template <
typename T>
784 template <
typename T>
795 void setValue(
Base* basePointerValue) { setBaseValue(basePointerValue); }
798 void setValue(
const RefCountedBasePtr& value) { setBaseValue(value); }
804 template <
class Type>
808 template <
class Type>
820 std::vector<const RuntimeType*> _allowedTypes;
823 bool _unallowedType{};
825 bool _isRefCountedBase{};
841 void setValue(
T* basePointerValue) { setBaseValue(basePointerValue); }
851 using BaseField::addAllowedType;
853 using BaseField::setBaseValueAndAddAllowedType;
893 void setValue(SoNode* soNodeValue) { setSoNodeValue(soNodeValue); }
896 SoNode*
getValue()
const {
return getSoNodeValue(); }
945 void setValue(
void* voidPointerValue) { setPointerValue(voidPointerValue); }
948 void*
getValue()
const {
return getPointerValue(); }
1984 std::string _origString;
1988 std::string _strValue;
Field to encapsulate a pointer to an ML base object.
void setBaseValue(const RefCountedBasePtr &value)
Sets the value from intrusive pointer.
Base * getBaseValue() const
Returns current field value.
void setValue(Base *basePointerValue)
Same as setBaseValue(Base*).
Base * getValue() const
Same as getBaseValue().
BaseField(const std::string &name)
Constructor; creates a field with a name to manage a base pointer.
void setValue(const RefCountedBasePtr &value)
Same as setBaseValue(const RefCountedBasePtr&).
std::string getStringValue() const override
Returns the value of the field as a string value.
void setBaseValue(Base *basePointerValue)
Sets the value of the field to basePointerValue.
void setStringValue(const std::string &stringValue) override
Sets pointer value from string stringValue. If string cannot be parsed successfully,...
BaseField()=default
Implements the runtime type system interface for this class.
void setBaseValueAndAddAllowedType(const ::boost::intrusive_ptr< T > &value)
Convenience routine for setting the base value and its type at the same time using an intrusive point...
bool hasUnallowedType() const
Returns true if the last call of setBaseValue had a not allowed type as argument, getBaseValue will r...
void addAllowedType(const RuntimeType *allowedType)
Adds type to the list of allowed types.
void addAllowedType()
Same as above, with template parameter where the Base type can be specified directly.
~BaseField() override
Destructor.
Type getTypedBaseValue() const
Returns the typed value if the contained base object is derived from the given Type.
Type getTypedValue() const
Returns the typed value if the contained base object is derived from the given Type.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
virtual void touchSourceFields()
Touches the source fields.
std::vector< const RuntimeType * > getAllowedTypes() const
Returns a list of allowed Base types for this field.
void setBaseValueAndAddAllowedType(T *value)
Convenience routine for setting the base value and its type at the same time.
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Field to encapsulate a boolean value.
void setBoolValue(bool boolValue)
Sets the field value to boolValue.
std::string getStringValue() const override
Returns the value of the field as string value.
bool getValue() const
Same as getBoolValue().
bool isOn() const
Returns the value of the field as a boolean.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void toggleValue()
Toggles the boolean field value.
void setStringValue(const std::string &value) override
Sets the value of the field to value.
BoolField(const std::string &name)
Constructor, creates a field with a name to manage a boolean value.
bool getBoolValue() const
Returns the value of the field as a boolean.
void setValue(bool boolValue)
Same as setBoolValue().
void updateValue(bool boolValue)
Same as updateBoolValue().
void updateBoolValue(bool boolValue)
Sets the field value to boolValue, but only touches the field if the new value is different from the ...
BoolField()=default
Implements the runtime type system interface for this class.
Field to encapsulate a vector of three float values representing an (RGB) color with all properties o...
void setColorValue(float r, float g, float b)
Sets the field value to r, g, and b.
ColorField()
Implements the runtime type system interface for this class.
void setPackedColorValue(MLuint32 rgba)
Sets the packed uint32 color value to rgba.
ColorField(const std::string &name)
Constructor; creates a field with a name to manage a vector of three float values interpreted as RGB-...
void updateColorValue(float r, float g, float b)
Sets the field value to r, g, and b, but only touches the field if the new value is different from th...
MLuint32 getPackedColorValue() const
Returns the packed uint32 color value.
void getColorValue(float &r, float &g, float &b) const
Returns the value of the field into the floats r, g, and b.
const Vector3 & getColorValue() const
Returns the value of the field as a Vector3.
Field to encapsulate a double value.
void setValueFromField(const Field &field) override
Reimplementation from Field, which copies the field value more efficiently.
void updateDoubleValue(double doubleValue)
Sets the field value to doubleValue, but only touches the field if the new value is different from th...
double getDoubleValue() const
Returns the current field value.
DoubleField()=default
Implements the runtime type system interface for this class.
DoubleField(const std::string &name)
Constructor; creates a field with a name to manage a double value.
std::string getStringValue() const override
Returns the value of the field as a string value setStringValue must be able to reinterpret this retu...
void setDoubleValue(double doubleValue)
Sets the field value to doubleValue. By default, the entire double type range can be set.
void setValue(double doubleValue)
Same as setDoubleValue().
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
void updateValue(double doubleValue)
Same as updateDoubleValue().
static void setValueCallback(void *field, double value)
Callback method that can be used as a MLRequestProgressCB to set the progress to the field.
double getValue() const
Same as getDoubleValue().
Field to encapsulate an enumerated value.
void setEnumValue(int enumValue)
Sets field value to enumValue.
void _setEnumerationNames(const std::vector< EnumField::EnumEntry > &enumValues, int initialValue)
Sets the enumeration item names.
void setStringValue(const std::string &value) override
Sets value of the field to the enum item with given name value.
std::vector< EnumEntry > _entries
Stores the possible enum values and names.
void _setEnumerationNames(const std::vector< std::string > &enumNames)
Sets the enumeration item names.
std::string getStringValue() const override
Returns the value of the field as string value.
void updateEnumValue(int enumValue)
Sets field value to enumValue, but only touches the field if the new value is different from the old ...
EnumField(const std::string &name, const char *const *enumerationItemNames, size_t numEnumerationItems)
Constructor, creates a field with a name to manage an enum value.
EnumField(const std::string &name, const std::string enumerationItemNames[], size_t numEnumerationItems)
Implements the runtime type system interface for this class.
~EnumField() override=default
Destroys this field and releases internally allocated memory.
size_t getNumEnumerationItems() const
Returns the number of registered enum values defined in constructor.
void setStringValueDefaulted(const std::string &value)
If value equals one of the enum item names, set the field to this item; otherwise,...
void setValue(int enumValue)
Same as setEnumValue().
int getEnumValue() const
Returns the current enum value as integer.
void _setEnumerationNames(const std::string enumNames[])
Sets the enumeration item names.
void updateValue(int enumValue)
Same as updateEnumValue().
void _initialize(const std::string &name="", size_t numEnums=0)
Initializes this field.
void _setEnumerationNames(const char *const *enumNames)
Sets the enumeration item names.
EnumField()=default
Protected constructor to allow derived classes.
EnumField(const std::string &name, const std::vector< std::string > &enumerationItemNames)
Constructor, creates a field with a name to manage an enum value.
int getValue() const
Same as getEnumValue().
const EnumEntry & getEnumEntryAtIndex(size_t index) const
Returns the enum entry at given index, which allows to enumerate all existing enum entries.
Helper class that stores a list of typed enum values and their string names.
void add(const Entry &value)
Adds an enum value via the given entry, typically created with the ML_ENUM_VALUE() macro.
const std::vector< EnumField::EnumEntry > & getEntries() const
Returns access to the collected list of enum entries.
void add(const std::string &stringValue, EnumType value)
Adds an enum value, manually passing in the name and value.
std::vector< EnumField::EnumEntry > _entries
void add(const char *stringValue, EnumType value)
Adds an enum value, manually passing in the name and value.
EnumValues & operator<<(const Entry &value)
Adds an enum value via the given entry, typically created with the ML_ENUM_VALUE() macro.
Strength
Enumeration type describing the strength of notifications.
Base class for all fields used in the ML.
virtual std::string getStringValue() const =0
Returns the value of the field as string value.
virtual void setStringValue(const std::string &value)=0
Sets the field value as string value.
Field to encapsulate a float value.
std::string getStringValue() const override
Returns the value of the field as a string value.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
float getFloatValue() const
Returns the value of the field.
void setFloatValue(float floatValue)
Sets the field value to floatValue.
FloatField(const std::string &name)
Constructor; creates a field with a name to manage a float value with 0 as a default value.
float getValue() const
Same as getFloatValue().
void updateValue(float floatValue)
Same as updateFloatValue().
void updateFloatValue(float floatValue)
Sets the field value to floatValue, but only touches the field if the new value is different from the...
void setValue(float floatValue)
Same as setFloatValue().
FloatField()=default
Implements the runtime type system interface for this class.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
static void setValueCallback(void *field, double value)
Callback method that can be used as a MLRequestProgressCB to set the progress to the field.
Field to encapsulate an ML vector ImageVector with six integer components.
const ImageVector & getValue() const
Same as getImageVectorValue().
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
const ImageVector & getImageVectorValue() const
Returns the value of the field.
void updateImageVectorValue(const ImageVector &imageVectorValue)
Sets the value of the field to imageVectorValue, but only touches the field if the new value is diffe...
ImageVectorField()=default
Implements the runtime type system interface for this class.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void setImageVectorValue(const ImageVector &imageVectorValue)
Sets the value of the field to imageVectorValue.
ImageVectorField(const std::string &name)
Constructor; creates a field with a name to manage a vector of six integer values.
void setValue(const ImageVector &imageVectorValue)
Same as setImageVectorValue().
std::string getStringValue() const override
Returns the value of the field as a string value.
void updateValue(const ImageVector &imageVectorValue)
Same as updateImageVectorValue().
Field to encapsulate an integer value.
void setIntValue(MLint intValue)
Sets field value to intValue.
IntField(const std::string &name)
Constructor, creates a field with a name to manage an integer value.
MLint getValue() const
Same as getIntValue().
void updateValue(MLint intValue)
Same as updateIntValue().
void setStringValue(const std::string &value) override
Sets value of the field to value.
MLint getIntValue() const
Returns the value of the field as an MLint.
std::string getStringValue() const override
Returns the value of the field as a string value.
void setValue(MLint intValue)
Same as setIntValue().
void updateIntValue(MLint intValue)
Sets field value to intValue, but only touches the field if the new value is different from the old v...
IntField()=default
Implements the runtime type system interface for this class.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
Field to encapsulate an MLDataType value.
MLDataType getMLDataTypeValue() const
Returns the value of the field.
MLDataTypeField(const std::string &name)
Constructor; creates a field with a name to manage an MLDataType value.
MLDataType getValue() const
Same as getMLDataTypeValue().
MLDataTypeField()=default
Implements the runtime type system interface for this class.
std::string getStringValue() const override
Returns the value of the field as a string value.
void setMLDataTypeValue(MLDataType dataType)
Sets the field value to data type dataType.
void setValue(MLDataType dataType)
Same as setMLDataTypeValue().
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue. Invalid types set the type to MLint8Type.
Field encapsulating a 2x2 matrix.
const Matrix2 & getMatrixValue() const
Returns the value of the field.
void updateMatrix2Value(const Matrix2 &matrixValue)
Sets the value of the field to matrixValue, but only touches the field if the new value is different ...
void setMatrixValue(const Matrix2 &matrixValue)
Sets the value of the field to matrixValue.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
const Matrix2 & getValue() const
Same as getMatrix2Value().
void setStringValue(const std::string &stringValue) override
Sets the field value to stringValue="a11 a12 a21 a22".
const Matrix2 & getMatrix2Value() const
Returns the value of the field; same as getMatrixValue for symmetry to other fields.
Matrix2Field(const std::string &name="")
Implements the runtime type system interface for this class.
void setValue(const Matrix2 &matrixValue)
Same as setMatrix2Value().
void updateValue(const Matrix2 &matrixValue)
Same as updateMatrix2Value().
std::string getStringValue() const override
Returns the value of the field as a string value.
void setMatrix2Value(const Matrix2 &matrixValue)
Sets the value of the field to matrixValue; same as setMatrixValue for symmetry to other fields.
Field encapsulating a 3x3 matrix.
const Matrix3 & getMatrix3Value() const
Returns the value of the field; same as getMatrixValue for symmetry to other fields.
void setStringValue(const std::string &stringValue) override
Sets the field value to stringValue="a11 a12 ... a33".
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void setValue(const Matrix3 &matrixValue)
Same as setMatrix3Value().
void setMatrixValue(const Matrix3 &matrixValue)
Sets the value of the field to matrixValue.
void updateValue(const Matrix3 &matrixValue)
Same as updateMatrix3Value().
Matrix3Field(const std::string &name="")
Implements the runtime type system interface for this class.
void setMatrix3Value(const Matrix3 &matrixValue)
Sets the value of the field to matrixValue; same as setMatrixValue for symmetry to other fields.
void updateMatrix3Value(const Matrix3 &matrixValue)
Sets the value of the field to matrixValue, but only touches the field if the new value is different ...
const Matrix3 & getMatrixValue() const
Returns the value of the field.
std::string getStringValue() const override
Returns the value of the field as a string value.
const Matrix3 & getValue() const
Same as getMatrix3Value().
Field to encapsulate a 4x4 matrix.
Matrix4Field(const std::string &name="")
Implements the runtime type system interface for this class.
Field encapsulating a 5x5 matrix.
void setMatrix5Value(const Matrix5 &matrixValue)
Sets the value of the field to matrixValue; same as setMatrixValue for symmetry to other fields.
void setMatrixValue(const Matrix5 &matrixValue)
Sets the value of the field to matrixValue.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
Matrix5Field(const std::string &name="")
Implements the runtime type system interface for this class.
const Matrix5 & getValue() const
Same as getMatrix4Value().
void setValue(const Matrix5 &matrixValue)
Same as setMatrix5Value().
std::string getStringValue() const override
Returns the value of the field as a string value.
void updateValue(const Matrix5 &matrixValue)
Same as updateMatrix5Value().
const Matrix5 & getMatrix5Value() const
Returns the value of the field; same as getMatrixValue for symmetry to other fields.
void setStringValue(const std::string &stringValue) override
Sets the field value to stringValue="a11 a12 ... a55".
const Matrix5 & getMatrixValue() const
Returns the value of the field.
void updateMatrix5Value(const Matrix5 &matrixValue)
Sets the value of the field to matrixValue, but only touches the field if the new value is different ...
Field encapsulating a 6x6 matrix.
void updateValue(const Matrix6 &matrixValue)
Same as updateMatrix6Value().
std::string getStringValue() const override
Returns the value of the field as a string value.
Matrix6Field(const std::string &name="")
Implements the runtime type system interface for this class.
void setValue(const Matrix6 &matrixValue)
Same as setMatrix6Value().
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void setMatrixValue(const Matrix6 &matrixValue)
Sets the value of the field to matrixValue.
const Matrix6 & getValue() const
Same as getMatrix6Value().
void updateMatrix6Value(const Matrix6 &matrixValue)
Sets the value of the field to matrixValue, but only touches the field if the new value is different ...
void setStringValue(const std::string &stringValue) override
Sets the field value to stringValue="a11 a12 ... a66".
void setMatrix6Value(const Matrix6 &matrixValue)
Sets the value of the field to matrixValue; same as setMatrixValue for symmetry to other fields.
const Matrix6 & getMatrix6Value() const
Returns the value of the field; same as getMatrixValue for symmetry to other fields.
const Matrix6 & getMatrixValue() const
Returns the value of the field.
Field to encapsulate a 4x4 matrix, same as Matrix4Field for backward compatibility.
void setStringValue(const std::string &stringValue) override
Sets the field value to stringValue="a11 a12 ... a44".
const Matrix4 & getMatrix4Value() const
Returns the value of the field; same as getMatrixValue for symmetry to other fields.
void setValue(const Matrix4 &matrixValue)
Same as setMatrix4Value().
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void setMatrix4Value(const Matrix4 &matrixValue)
Sets the value of the field to matrixValue; same as setMatrixValue for symmetry to other fields.
MatrixField(const std::string &name)
Constructor; creates a field with a name to manage a 4x4 matrix.
void updateMatrix4Value(const Matrix4 &matrixValue)
Sets the value of the field to matrixValue, but only touches the field if the new value is different ...
MatrixField()=default
Implements the runtime type system interface for this class.
const Matrix4 & getMatrixValue() const
Returns the value of the field.
std::string getStringValue() const override
Returns the value of the field as a string value.
void setMatrixValue(const Matrix4 &matrixValue)
Sets the value of the field to matrixValue.
void updateValue(const Matrix4 &matrixValue)
Same as updateMatrix4Value().
const Matrix4 & getValue() const
Same as getMatrix4Value().
Base class for an image processing module of the ML.
Field without value for notifications.
std::string getStringValue() const override
Returns an empty string, as the field has no value.
void setStringValue(const std::string &) override
Only calls notifyAttachments() to notify attached fields or sensors.
void notify()
Calls touch() to notify connected sensors or fields.
NotifyField()
Implements the runtime type system interface for this class.
NotifyField(const std::string &name)
Constructor; creates a notification field with a name.
Field to encapsulate a pointer to an output connector which represents a module output.
std::string getStringValue() const override
Reference to OutputConnector as C-string to return.
MLint isValidValue() override
Returns 1 if connector field contains a valid connector pointer.
OutputConnectorField()
Implements the runtime type system interface for this class.
OutputConnectorField(const std::string &name, Module *module, MLint outputImageIndex)
Constructor; creates a field with a name to manage an OutputConnector on the Module module at index o...
void setStringValue(const std::string &) override
Only calls touch() to propagate notifications.
void touch(FieldSensor::Strength strength=FieldSensor::CHANGED) override
A notified output image must also clear its PagedImage if it is considered as changed.
~OutputConnectorField() override
Destroys the field.
OutputConnector & getOutputConnectorValue() const
Returns a reference to the OutputConnector.
Class to manage an output connection for a Module module.
Field to encapsulate a vector of four double values representing a plane with all properties of Vecto...
void setPlaneValue(double f0, double f1, double f2, double f3)
Sets field value to f0, f1, f2, and f3.
void getPlaneValue(double &f0, double &f1, double &f2, double &f3) const
Returns the value of the field.
void setPlaneValue(const Plane &p)
Sets field value to p.
PlaneField(const std::string &name="")
Implements the runtime type system interface for this class.
Plane getPlaneValue() const
Returns the value of the field.
void getPlaneValue(Plane &plane) const
Returns the value of the field.
Class defining a plane in 3D.
Field to encapsulate a void pointer to arbitrary data.
void setStringValue(const std::string &stringValue) override
Sets the field value from string to stringValue.
std::string getStringValue() const override
Returns the value of the field as string value.
void * getPointerValue() const
Returns the value of the field.
void setValue(void *voidPointerValue)
Same as setPointerValue().
PointerField()=default
Implements the runtime type system interface for this class.
void setPointerValue(void *voidPointerValue)
Sets the value of the field to voidPointerValue.
void * getValue() const
Same as getPointerValue().
PointerField(const std::string &name)
Constructor; creates a field with a name to manage a void pointer.
Field to encapsulate an increasing float value from range [0,1].
void setProgressValue(float floatValue)
Same as setFloatValue().
void setValue(float floatValue)
Same as setFloatValue().
ProgressField(const std::string &name)
Constructor, creates a field with a name to manage a progressive float value.
ProgressField()
Implements the runtime type system interface for this class.
void setFloatValue(float floatValue)
Sets field value to floatValue if floatValue==0, floatValue==1, or floatValue > previous floatValue +...
void setUpdateDifference(float epsilonValue)
Sets an epsilon value such that a new value must be greater than the previous value to be accepted as...
float getProgressValue()
Same as getFloatValue().
Field to encapsulate a vector of four double values representing a rotation with all properties of Ve...
RotationField(const std::string &name="")
Implements the runtime type system interface for this class.
Rotation getRotationValue() const
Returns the rotation value as a rotation class instance.
void setRotationValue(const Rotation &rot)
Sets the rotation value by a rotation instance.
void setRotationValue(const Vector3 &vec, double angle)
Sets the rotation as rotation axis and angle how much to rotate.
void getRotationValue(Vector3 &vec, double &angle) const
Returns the rotation as vector (axis) and rotation angle.
Class to handle Rotations (internally, the rotation is stored as a unit quaternion)
RuntimeType contains type and inheritance information of a class and a static dictionary with informa...
Field to encapsulate a pointer to an SoNode instance of OpenInventor.
SoNode * getSoNodeValue() const
Returns the value of the field.
SoNode * getValue() const
Same as getSoNodeValue().
SoNodeField(const std::string &name)
Constructor; creates a field with a name to manage a SoNode pointer.
void setSoNodeValue(SoNode *soNodeValue)
Sets the value of the field to soNodeValue.
void setValue(SoNode *soNodeValue)
Same as setSoNodeValue().
std::string getStringValue() const override
Returns the value of the field as string value.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
SoNodeField()=default
Implements the runtime type system interface for this class.
void setStringValue(const std::string &stringValue) override
Sets the field value from string to stringValue. On non-successful string parsing,...
Field to encapsulate a string value.
std::string getStringValue() const override
Returns the value of the field as a string value setStringValue must be able to reinterpret this retu...
std::string getValue() const
Same as getStringValue().
void updateStringValue(const std::string &stringValue)
Sets value of the field to stringValue, but only touches the field if the new value is different from...
StringField(const std::string &name)
Constructor; creates a field with a name to manage a string value.
void setStringValue(const std::string &stringValue) override
Sets value of the field to stringValue.
StringField()=default
Implements the runtime type system interface for this class.
void updateValue(const std::string &stringValue)
Same as updateStringValue().
void setValue(const std::string &stringValue)
Same as setStringValue().
Field to encapsulate an ML integer SubimgBox.
void setValue(const SubImageBox &subImageBoxValue)
Same as setSubImageBoxValue().
SubImageBoxField(const std::string &name)
Constructor; creates a field with a name to manage an integer box.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
std::string getStringValue() const override
Returns the value of the field as a string value.
const SubImageBox & getSubImageBoxValue() const
Returns the value of the field.
void updateSubImageBoxValue(const SubImageBox &subImageBoxValue)
Sets the value of the field to subImageBoxValue, but only touches the field if the new value is diffe...
void setSubImageBoxValue(const SubImageBox &subImageBoxValue)
Sets the value of the field to subImageBoxValue.
SubImageBoxField()=default
Implements the runtime type system interface for this class.
void updateValue(const SubImageBox &subImageBoxValue)
Same as updateSubImageBoxValue().
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
const SubImageBox & getValue() const
Same as getSubImageBoxValue().
Field to encapsulate an ML double SubimgBox.
void updateSubImageBoxdValue(const SubImageBoxd &subImageBoxfValue)
Sets the value of the field to subImageBoxfValue, but only touches the field if the new value is diff...
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
const SubImageBoxd & getSubImageBoxdValue() const
Returns the value of the field.
void setValue(const SubImageBoxd &subImageBoxValue)
Same as setSubImageBoxdValue().
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
const SubImageBoxd & getValue() const
Same as getSubImageBoxdValue().
std::string getStringValue() const override
Returns the value of the field as a string value.
SubImageBoxdField()=default
Implements the runtime type system interface for this class.
SubImageBoxdField(const std::string &name)
Constructor; creates a field with a name to manage a float box.
void updateValue(const SubImageBoxd &subImageBoxValue)
Same as updateSubImageBoxdValue().
void setSubImageBoxdValue(const SubImageBoxd &subImageBoxfValue)
Sets the value of the field to subImageBoxfValue.
SubImageBoxd - SubImageBox with coordinates of float data type.
static Tmat4< MLdouble > getIdentity()
Returns the identity matrix.
Templated version of BaseField that only stores the template type as pointer.
void setValue(T *basePointerValue)
Sets the value of the field to basePointerValue.
void setValue(const ::boost::intrusive_ptr< T > &value)
Sets the value from intrusive pointer.
T * getValue() const
Returns the current field value.
TypedBaseField(const std::string &name)
Constructor; creates a field with a name to manage a typed Base pointer. Default value is NULL.
TypedEnumField is used to encapsulate a C++ enum value and work with a real enum value instead of int...
TypedEnumField(const std::string &name, const EnumValues< EnumType > &enumValues, EnumType initialValue)
Creates the TypedEnumField with given name, enumValues, and initialValue.
EnumType getEnumValue() const
Returns the current enum value.
void setEnumValue(EnumType enumValue)
Sets the current enum value and touches the field.
EnumType getValue() const
Same as getEnumValue().
void updateValue(EnumType enumValue)
Same as updateEnumValue().
void updateEnumValue(EnumType enumValue)
Sets the current enum value and only touches the field if the value has changed.
void setValue(EnumType enumValue)
Same as setEnumValue().
Field to encapsulate any of the registered ML types.
virtual void _updateIsValidAndTypeDataFromOrigString()
Parses _origString depending on the current data type and updates _isValid and _typeData.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
virtual void _updateIsValidAndStrValueFromTypeData()
Parses _typeData depending on the current data type and updates _isValid and _strValue.
virtual void setDataType(MLDataType dataType)
Sets the data type to dataType.
virtual MLTypeData * getUniversalTypeValue() const
Returns the current value of the field as a memory copy, which can be changed by the caller.
void setValue(const MLTypeData *typeData)
Same as setUniversalTypeValue().
void _updateFieldFromOrigString()
Combines the above methods, returns _origString on invalid data type, and touches the field.
MLint isValidValue() override
Returns true (=1) if field value is valid, otherwise false (=0).
const MLTypeData * getValue() const
Same as getShortLivedUniversalTypeValue().
virtual void setUniversalTypeValue(const MLTypeData *dataType)
Sets the value of the field to dataType. The passed data is copied.
virtual MLDataType getDataType() const
Returns the current data type of this field. Default is invalid, i.e., -1.
UniversalTypeField(const std::string &name="", MLDataType dt=-1)
Implements the runtime type system interface for this class.
std::string getStringValue() const override
Returns the value of the field as a string value.
~UniversalTypeField() override
Destructor, frees buffer for type data.
virtual const MLTypeData * getShortLivedUniversalTypeValue() const
Returns the temporary internal buffer value of the field, which is short-lived and must NOT be modifi...
virtual MLldouble getValueCastToLDouble() const
Returns the current value of the field cast to MLldouble.
Field to encapsulate a vector of ten double values.
Vector10Field()=default
Implements the runtime type system interface for this class.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
void setValue(const Vector10 &vectorValue)
Same as setVector10Value().
const Vector10 & getValue() const
Same as getVector10Value().
void setVectorValue(const Vector10 &vectorValue)
Sets the value of the field to vectorValue.
void setVector10Value(const Vector10 &vectorValue)
Sets the value of the field to vectorValue.
void updateValue(const Vector10 &vectorValue)
Same as updateVector10Value().
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void updateVector10Value(const Vector10 &vectorValue)
Sets the value of the field to vectorValue, but only touches the field if the new value is different ...
const Vector10 & getVectorValue() const
Returns the value of the field.
Vector10Field(const std::string &name)
Constructor; creates a field with a name to manage a vector of ten double values initialized to (0,...
const Vector10 & getVector10Value() const
Returns the value of the field.
std::string getStringValue() const override
Returns the value of the field as string value.
Field to encapsulate a vector of two double values.
const Vector2 & getValue() const
Same as getVector2Value().
std::string getStringValue() const override
Returns the value of the field as a string value.
const Vector2 & getVectorValue() const
Returns the value of the field.
Vector2Field()=default
Implements the runtime type system interface for this class.
void setVectorValue(const Vector2 &vectorValue)
Sets the value of the field to vectorValue.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void updateValue(const Vector2 &vectorValue)
Same as updateVector2Value().
void setValue(const Vector2 &vectorValue)
Same as setVector2Value().
void updateVector2Value(const Vector2 &vectorValue)
Sets the value of the field to vectorValue, but only touches the field if the new value is different ...
Vector2Field(const std::string &name)
Constructor; creates a field with a name to manage a vector of two double values.
const Vector2 & getVector2Value() const
Returns the value of the field.
void setVector2Value(const Vector2 &vectorValue)
Sets the value of the field to vectorValue.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
Field to encapsulate a vector of three double values.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
Vector3Field()=default
Implements the runtime type system interface for this class.
const Vector3 & getValue() const
Same as getVector3Value().
void updateValue(const Vector3 &vectorValue)
Same as updateVector3Value().
const Vector3 & getVectorValue() const
Returns the value of the field.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
void setVector3Value(const Vector3 &vectorValue)
Sets the value of the field to vectorValue.
Vector3Field(const std::string &name)
Constructor; creates a field with a name to manage a vector of three double values.
void updateVector3Value(const Vector3 &vectorValue)
Sets the value of the field to vectorValue, but only touches the field if the new value is different ...
const Vector3 & getVector3Value() const
Returns the value of the field.
void setVectorValue(const Vector3 &vectorValue)
Sets the value of the field to vectorValue.
void setValue(const Vector3 &vectorValue)
Same as setVector3Value().
std::string getStringValue() const override
Returns the value of the field as string value.
Field to encapsulate a vector of four double values.
Vector4Field()=default
Implements the runtime type system interface for this class.
const Vector4 & getVector4Value() const
Returns the value of the field.
std::string getStringValue() const override
Returns the value of the field as a string value.
void updateVector4Value(const Vector4 &vectorValue)
Sets the value of the field to vectorValue, but only touches the field if the new value is different ...
void setValue(const Vector4 &vectorValue)
Same as setVector4Value().
Vector4Field(const std::string &name)
Constructor; creates a field with a name to manage a vector of four double values.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
void setVectorValue(const Vector4 &vectorValue)
Sets the value of the field to vectorValue.
void setVector4Value(const Vector4 &vectorValue)
Sets the value of the field to vectorValue.
const Vector4 & getVectorValue() const
Returns the value of the field.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void updateValue(const Vector4 &vectorValue)
Same as updateVector4Value().
const Vector4 & getValue() const
Same as getVector4Value().
Field to encapsulate a vector of five double values.
const Vector5 & getVector5Value() const
Returns the value of the field.
void updateValue(const Vector5 &vectorValue)
Same as updateVector5Value().
Vector5Field()=default
Implements the runtime type system interface for this class.
const Vector5 & getValue() const
Same as getVector5Value().
std::string getStringValue() const override
Returns the value of the field as a string value.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
const Vector5 & getVectorValue() const
Returns the value of the field.
void setVector5Value(const Vector5 &vectorValue)
Sets the value of the field to vectorValue.
Vector5Field(const std::string &name)
Constructor; creates a field with a name to manage a vector of five double values initialized to (0,...
void setVectorValue(const Vector5 &vectorValue)
Sets the value of the field to vectorValue.
void updateVector5Value(const Vector5 &vectorValue)
Sets the value of the field to vectorValue, but only touches the field if the new value is different ...
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
void setValue(const Vector5 &vectorValue)
Same as setVector5Value().
Field to encapsulate a vector of six double values.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
const Vector6 & getVectorValue() const
Returns the value of the field.
void setVectorValue(const Vector6 &vectorValue)
Sets the value of the field to vectorValue.
const Vector6 & getValue() const
Same as getVector6Value().
void updateValue(const Vector6 &vectorValue)
Same as updateVector6Value().
void updateVector6Value(const Vector6 &vectorValue)
Sets the value of the field to vectorValue, but only touches the field if the new value is different ...
void setVector6Value(const Vector6 &vectorValue)
Sets the value of the field to vectorValue.
const Vector6 & getVector6Value() const
Returns the value of the field.
void setValue(const Vector6 &vectorValue)
Same as setVector6Value().
std::string getStringValue() const override
Returns the value of the field as a string value.
Vector6Field()=default
Implements the runtime type system interface for this class.
Vector6Field(const std::string &name)
Constructor; creates a field with a name to manage a vector of six double values.
void setValueFromField(const Field &field) override
Reimplementation from Field that copies the field value more efficiently.
#define ML_ABSTRACT_CLASS_HEADER(className)
Similar to ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non-existing export symbol.
MLint32 MLDataType
MLDataType.
@ MLuint8Type
Enumerator for the unsigned 8-bit ML integer type.
#define MLEXPORT
To export symbols from a DLL/shared object, we need to mark them with the MLEXPORT symbol.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non-existing export symbol.
unsigned char MLTypeData
This is the pointer type used to point to the data of MLType data instances.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
EnumValues< EnumType >::Entry createEnumEntry(const char *value, EnumType enumValue)
Helper method to infer the EnumType via the function signature.
NotifyField TriggerField
TriggerField is an alias for the NotifyField, which is easier to find for Open Inventor users who are...
MLEXPORT void MLInitFields()
Initialize all standard fields of the ML.
Defines the entry for one enum value.
EnumEntry(const std::string &sv, int v)
std::string stringValue
The string value of the entry.
int value
The enum value of the entry.
Defines the entry for one enum value.
EnumType value
The enum value of the entry.
const char * stringValue
The string value of the entry.
Entry(const char *sv, EnumType v)