31 #include <type_traits>
42 #if ML_DEPRECATED_SINCE(3,5,0)
43 #define ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER ML_DEPRECATED
48 class OutputConnector;
99 void setValue(
bool boolValue) { setBoolValue(boolValue); }
121 void _initialize(
const std::string& name=
"",
bool* valuePtr=
nullptr);
123 #if ML_DEPRECATED_SINCE(3,5,0)
137 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
146 BoolField(
const std::string &name,
bool *valuePtr);
212 MLint _internalValue;
215 void _initialize(
const std::string& name=
"",
MLintPtr valuePtr=
nullptr);
224 #if ML_DEPRECATED_SINCE(3,5,0)
247 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
264 #if ML_DEPRECATED_SINCE(3,5,0)
284 ToggleField(
const std::string& name);
290 void setIntValue(
int intValue);
293 void setToggleValue(
bool b);
304 int getIntValue()
const;
323 void _initialize(
const std::string& name=
"",
int* valuePtr=
nullptr);
325 #if ML_DEPRECATED_SINCE(3,5,0)
339 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
348 ToggleField(
const std::string &name,
int* valuePtr);
375 EnumField(
const std::string& name,
const std::string enumerationItemNames[],
size_t numEnumerationItems);
384 EnumField(
const std::string& name,
const char*
const* enumerationItemNames,
size_t numEnumerationItems);
393 EnumField(
const std::string& name,
const std::vector<std::string> &enumerationItemNames);
425 EnumEntry(
const std::string& sv,
int v) : stringValue(sv), value(v) { }
443 void setValue(
int enumValue) { setEnumValue(enumValue); }
454 void _initialize(
const std::string& name=
"",
size_t numEnums=0,
int* valuePtr=
nullptr);
482 #if ML_DEPRECATED_SINCE(3,5,0)
491 inline ML_DEPRECATED size_t getEnumNum()
const {
return getNumEnumerationItems(); }
498 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
507 EnumField(
const std::string &name,
const std::string enumNames[],
size_t enumNum,
int *valuePtr);
511 EnumField(
const std::string &name,
const char*
const* enumNames,
size_t enumNum,
int *valuePtr);
529 template <
typename EnumType>
535 Entry():stringValue(nullptr), value(-1) {}
536 Entry(
const char* sv, EnumType v) : stringValue(sv), value(v) { }
546 void add(
const char* stringValue, EnumType value) {
551 void add(
const std::string& stringValue, EnumType value) {
567 const std::vector<EnumField::EnumEntry>&
getEntries()
const {
return _entries; }
576 #define ML_ENUM_VALUE(enumValue) internal::createEnumEntry(#enumValue, enumValue)
580 #define ML_EXTERNAL_ENUM_VALUE(enumClass, enumValue) internal::createEnumEntry(#enumValue, enumClass::enumValue)
584 template <
typename EnumType>
594 template <
typename EnumType>
598 static_assert(
sizeof(std::underlying_type<EnumType>) <=
sizeof(
int),
"The underlying type cannot be bigger than int!");
603 const std::vector<EnumField::EnumEntry>& entries = enumValues.
getEntries();
604 _initialize(name, entries.size());
605 _setEnumerationNames(entries,
static_cast<int>(initialValue));
609 EnumType
getEnumValue()
const {
return static_cast<EnumType
>(EnumField::getEnumValue()); }
611 void setEnumValue(EnumType enumValue) { EnumField::setEnumValue(
static_cast<int>(enumValue)); }
613 void updateEnumValue(EnumType enumValue) { EnumField::updateEnumValue(
static_cast<int>(enumValue)); }
615 EnumType
getValue()
const {
return getEnumValue(); }
617 void setValue(EnumType enumValue) { setEnumValue(enumValue); }
619 void updateValue(EnumType enumValue) { updateEnumValue(enumValue); }
661 void setValue(
float floatValue) { setFloatValue(floatValue); }
664 void updateValue(
float floatValue) { updateFloatValue(floatValue); }
677 void _initialize(
const std::string& name=
"",
float* valuePtr=
nullptr);
693 #if ML_DEPRECATED_SINCE(3,5,0)
717 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
726 FloatField(
const std::string& name,
float *valuePtr);
774 void setValue(
float floatValue) { setFloatValue(floatValue); }
783 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
840 void setValue(
double doubleValue) { setDoubleValue(doubleValue); }
843 void updateValue(
double doubleValue) { updateDoubleValue(doubleValue); }
846 double getValue()
const {
return getDoubleValue(); }
860 double _internalValue;
863 void _initialize(
const std::string& name=
"",
double* valuePtr=
nullptr);
872 #if ML_DEPRECATED_SINCE(3,5,0)
896 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
905 DoubleField(
const std::string& name,
double *valuePtr);
913 #if ML_DEPRECATED_SINCE(3,5,0)
932 LongDoubleField(
const std::string& name);
939 void setLongDoubleValue(
MLldouble longDoubleValue);
949 void setValue(
MLldouble longDoubleValue);
963 void _initialize(
const std::string& name=
"");
1029 void updateValue(
const std::string& stringValue) { updateStringValue(stringValue); }
1040 void _initialize(
const std::string& name=
"");
1231 template <
typename T>
1237 template <
typename T>
1242 template <
typename T>
1256 void setValue(
const RefCountedBasePtr& value) { setBaseValue(value); }
1262 template <
class Type>
1266 template <
class Type>
1278 std::vector<const RuntimeType*> _allowedTypes;
1281 bool _unallowedType;
1283 bool _isRefCountedBase;
1286 void _initialize(
const std::string& name=
"");
1303 void setValue(
T* basePointerValue) { setBaseValue(basePointerValue); }
1313 void addAllowedType() {}
1315 void setBaseValueAndAddAllowedType() {}
1355 void setValue(SoNode* soNodeValue) { setSoNodeValue(soNodeValue); }
1366 SoNode* _internalValue;
1369 void _initialize(
const std::string& name=
"");
1410 void setValue(
void* voidPointerValue) { setPointerValue(voidPointerValue); }
1420 void _initialize(
const std::string& name=
"");
1485 void _initialize(
const std::string& name=
"",
Vector2* valuePtr=
nullptr);
1488 #if ML_DEPRECATED_SINCE(3,5,0)
1506 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
1515 Vector2Field(
const std::string& name,
Vector2* valuePtr);
1524 #if ML_DEPRECATED_SINCE(3,5,0)
1598 void _initialize(
const std::string& name=
"",
Vector3* valuePtr=
nullptr);
1601 #if ML_DEPRECATED_SINCE(3,5,0)
1618 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
1627 Vector3Field(
const std::string& name,
Vector3* valuePtr);
1635 #if ML_DEPRECATED_SINCE(3,5,0)
1710 void _initialize(
const std::string& name=
"",
Vector4* valuePtr=
nullptr);
1713 #if ML_DEPRECATED_SINCE(3,5,0)
1730 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
1739 Vector4Field(
const std::string& name,
Vector4* valuePtr);
1747 #if ML_DEPRECATED_SINCE(3,5,0)
1819 void _initialize(
const std::string& name=
"");
1822 #if ML_DEPRECATED_SINCE(3,5,0)
1842 #if ML_DEPRECATED_SINCE(3,5,0)
1917 void _initialize(
const std::string& name=
"",
Vector6* valuePtr=
nullptr);
1919 #if ML_DEPRECATED_SINCE(3,5,0)
1937 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
1946 Vector6Field(
const std::string& name,
Vector6* valuePtr);
1954 #if ML_DEPRECATED_SINCE(3,5,0)
2027 void _initialize(
const std::string& name=
"");
2029 #if ML_DEPRECATED_SINCE(3,5,0)
2048 #ifdef ML_DEPRECATED
2104 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
2182 #ifdef ML_DEPRECATED
2203 #ifdef ML_DEPRECATED
2273 #ifdef ML_DEPRECATED
2295 #ifdef ML_DEPRECATED
2375 void _initialize(
const std::string& name=
"",
Matrix4* valuePtr=
nullptr);
2377 #ifdef ML_DEPRECATED
2397 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
2430 #ifdef ML_DEPRECATED
2501 #ifdef ML_DEPRECATED
2523 #ifdef ML_DEPRECATED
2595 #ifdef ML_DEPRECATED
2617 #if ML_DEPRECATED_SINCE(3,5,0)
2673 void _initialize(
const std::string& name=
"",
MLDataType* valuePtr=
nullptr);
2675 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
2749 void _initialize(
const std::string& name=
"",
ImageVector* valuePtr=
nullptr);
2751 #if ML_DEPRECATED_SINCE(3,5,0)
2769 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
2778 ImageVectorField(
const std::string& name,
ImageVector* valuePtr);
2786 #if ML_DEPRECATED_SINCE(3,5,0)
2852 void _initialize(
const std::string& name=
"",
SubImageBox* valuePtr=
nullptr);
2854 #if ML_DEPRECATED_SINCE(3,5,0)
2872 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
2881 SubImageBoxField(
const std::string& name,
SubImageBox* valuePtr);
2890 #if ML_DEPRECATED_SINCE(3,5,0)
2958 void _initialize(
const std::string& name=
"",
SubImageBoxd* valuePtr=
nullptr);
2960 #if ML_DEPRECATED_SINCE(3,5,0)
2975 inline ML_DEPRECATED void setSubImgBoxfValue(
const SubImageBoxd& value) { setSubImageBoxdValue(value); }
2978 inline ML_DEPRECATED const SubImageBoxd& getSubImgBoxfValue()
const {
return getSubImageBoxdValue(); }
2985 #ifdef ML_DEPRECATED_FIELDS_WITH_VALUE_POINTER
2994 SubImageBoxdField(
const std::string& name, SubImageBoxd* valuePtr);
3002 #if ML_DEPRECATED_SINCE(3,5,0)
3086 std::string _origString;
3090 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.
BaseField()
Implements the runtime type system interface for this class.
void setStringValue(const std::string &stringValue) override
Sets pointer value from string stringValue. If string cannot be parsed successfully,...
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
return true if the last call of setBaseValue had an unallowed type as argument, getBaseValue will ret...
void addAllowedType(const RuntimeType *allowedType)
Add type to list of allowed types.
void addAllowedType()
Same as above, with template parameter where the Base type can be specified directly.
~BaseField() override
Destructor.
virtual void touchSourceFields(void)
Touches the source fields.
Type getTypedBaseValue() const
Get typed value if the contained base object is derived from the given Type.
Type getTypedValue() const
Get typed value if the contained base object is derived from the given Type.
void setValueFromField(const Field &field) override
Reimplementation from Field which copies the field value more efficiently.
std::vector< const RuntimeType * > getAllowedTypes() const
Get 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.
BoolField()
Implements the runtime type system interface for this class.
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 Boolean.
void setValueFromField(const Field &field) override
Reimplementation from Field which 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 touch field if the new value is different from the old va...
Field to encapsulate a vector of 3 float values representing an (rgb) color with all properties of Ve...
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, create a field with a name to manage a vector of 3 float values interpreted as rgb-color...
void updateColorValue(float r, float g, float b)
Sets the field value to r, g and b, but only touch field if the new value is different from the old v...
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)
Set field value to doubleValue, but only touch field if the new value is different from the old value...
double getDoubleValue() const
Returns current field value.
DoubleField()
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)
Set 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 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.
int _internalValue
Stores the int value (if no external deprecated reference was given).
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 touch field if the new value is different from the old value.
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()
Protected constructor to allow derived classes.
bool _linearEntries
Stores if enum entry values start at 0 and increase by 1.
size_t getNumEnumerationItems() const
Returns the number of registered enum values defined in constructor.
~EnumField() override
Destroys this field and releases internally allocated memory.
void setStringValueDefaulted(const std::string &value)
If value equals one of the enum item names, set the field to this item, otherwise set it to the first...
void setValue(int enumValue)
Same as setEnumValue().
int getEnumValue() const
Returns the current enum value as integer.
int * _valuePtr
Points to the variable containing the field value; we use an integer to be compatible to normal enum ...
void _setEnumerationNames(const std::string enumNames[])
Sets the enumeration item names.
void _initialize(const std::string &name="", size_t numEnums=0, int *valuePtr=nullptr)
Initializes this field.
void updateValue(int enumValue)
Same as updateEnumValue().
void _setEnumerationNames(const char *const *enumNames)
Sets the enumeration item names.
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)
Add an enum value via the given entry, which is typically created with the ML_ENUM_VALUE() macro.
const std::vector< EnumField::EnumEntry > & getEntries() const
Get access to the collected list of enum entries.
void add(const std::string &stringValue, EnumType value)
Add an enum value, manually passing in the name and value.
std::vector< EnumField::EnumEntry > _entries
void add(const char *stringValue, EnumType value)
Add an enum value, manually passing in the name and value.
EnumValues & operator<<(const Entry &value)
Add an enum value via the given entry, which is 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
Set field value as string value.
virtual void setValueFromField(const Field &field)
Sets the value of this field from the given field.
Field to encapsulate a float value.
float _internalValue
Stores the float value (if no external deprecated reference was given).
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, create a field with a name to manage a float value, with 0 as a default value.
float getValue() const
Same as getFloatValue().
float _maxValue
Maximum float value which can be set.
float * _valuePtr
Points to the variable containing the field value.
FloatField()
Implements the runtime type system interface for this class.
void updateValue(float floatValue)
Same as updateFloatValue().
void updateFloatValue(float floatValue)
Sets the field value to floatValue, but only touch field if the new value is different from the old v...
void setValue(float floatValue)
Same as setFloatValue().
void setValueFromField(const Field &field) override
Reimplementation from Field which copies the field value more efficiently..
void _initialize(const std::string &name="", float *valuePtr=nullptr)
Initializes this field.
float _minValue
Minimum float value which can be set.
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 6 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 touch field if the new value is different f...
ImageVectorField()
Implements the runtime type system interface for this class.
void setValueFromField(const Field &field) override
Reimplementation from Field which 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 6 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 touch field if the new value is different from the old value.
void setValueFromField(const Field &field) override
Reimplementation from Field which copies the field value more efficiently.
IntField()
Implements the runtime type system interface for this class.
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().
std::string getStringValue() const override
Returns the value of the field as a string value.
MLDataTypeField()
Implements the runtime type system interface for this class.
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 touch field if the new value is different from t...
void setMatrixValue(const Matrix2 &matrixValue)
Sets the value of the field to matrixValue.
const Matrix2 & getMat2Value() const
void setValueFromField(const Field &field) override
Reimplementation from Field which copies the field value more efficiently.
const Matrix2 & getValue() const
Same as getMatrix2Value().
void setMat2Value(const Matrix2 &value)
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.
void setMat2fValue(const Matrix2 &value)
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 which copies the field value more efficiently.
const Matrix3 & getMat3Value() const
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 touch field if the new value is different from t...
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().
void setMat3Value(const Matrix3 &value)
void setMat3fValue(const Matrix3 &value)
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 which copies the field value more efficiently.
const Matrix5 & getMat5Value() const
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().
void setMat5fValue(const Matrix5 &value)
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".
void setMat5Value(const Matrix5 &value)
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 touch field if the new value is different from t...
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 which copies the field value more efficiently.
void setMatrixValue(const Matrix6 &matrixValue)
Sets the value of the field to matrixValue.
void setMat6Value(const Matrix6 &value)
const Matrix6 & getValue() const
Same as getMatrix6Value().
void updateMatrix6Value(const Matrix6 &matrixValue)
Sets the value of the field to matrixValue, but only touch field if the new value is different from t...
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.
void setMat6fValue(const Matrix6 &value)
const Matrix6 & getMat6Value() const
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.
MatrixField()
Implements the runtime type system interface for this class.
void setValue(const Matrix4 &matrixValue)
Same as setMatrix4Value().
void setValueFromField(const Field &field) override
Reimplementation from Field which 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 touch field if the new value is different from t...
const Matrix4 & getMatrixValue() const
Returns the value of the field.
void setMat4Value(const Matrix4 &value)
std::string getStringValue() const override
Returns the value of the field as a string value.
const Matrix4 & getMat4Value() const
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().
void setMat4fValue(const Matrix4 &value)
Base class for an image processing module of the ML.
Field without value for notifications.
std::string getStringValue() const override
Returns an empty string, because 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 (OutputConnector do not have a value,...
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 4 double values representing a plane with all properties of Vector4F...
void setPlaneValue(double f0, double f1, double f2, double f3)
Set field value to (f0, f1, f2, f3).
void getPlaneValue(double &f0, double &f1, double &f2, double &f3) const
Returns the value of the field.
void setPlaneValue(const Plane &p)
Set 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 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()
Implements the runtime type system interface for this class.
void setPointerValue(void *voidPointerValue)
Sets 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 which a new value must have more than the previous value to be accepted as new ...
float getProgressValue()
Same as getFloatValue().
Field to encapsulate a vector of 4 double values representing a rotation with all properties of Vecto...
RotationField(const std::string &name="")
Implements the runtime type system interface for this class.
Rotation getRotationValue() const
Returns rotation value as a rotation class instance.
void setRotationValue(const Rotation &rot)
Sets rotation value by a rotation instance.
void setRotationValue(const Vector3 &vec, double angle)
Set rotation as rotation axes and angle how much to rotate.
void getRotationValue(Vector3 &vec, double &angle) const
Returns rotation as vector 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.
SoNodeField()
Implements the runtime type system interface for this class.
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 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 which copies the field value more efficiently.
void setStringValue(const std::string &stringValue) override
Sets field value from string to stringValue. On non-successful string parsing, a NULL pointer is set.
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...
StringField()
Implements the runtime type system interface for this class.
std::string getValue() const
Same as getStringValue().
void updateStringValue(const std::string &stringValue)
Sets value of the field to stringValue, but only touch field if the new value is different from the o...
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.
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 which 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.
SubImageBoxField()
Implements the runtime type system interface for this class.
void updateSubImageBoxValue(const SubImageBox &subImageBoxValue)
Sets the value of the field to subImageBoxValue, but only touch field if the new value is different f...
void setSubImageBoxValue(const SubImageBox &subImageBoxValue)
Sets the value of the field to subImageBoxValue.
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 touch field if the new value is different ...
void setValueFromField(const Field &field) override
Reimplementation from Field which 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()
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.
Templated version of BaseField which 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 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)
Create the TypedEnumField with given name, enumValues and initialValue.
EnumType getEnumValue() const
Gets 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()
Parse _origString dependent on the current data type and update _isValid and _typeData.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
virtual void _updateIsValidAndStrValueFromTypeData()
Parse _typeData dependent on the current data type and update _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.
MLTypeData * getValue() const
Same as getUniversalTypeValue().
void setValue(const MLTypeData *typeData)
Same as setUniversalTypeValue().
void _updateFieldFromOrigString()
Combine the above methods, return _origString on invalid data type, and touch the field.
MLint isValidValue() override
Returns true (=1) if field value is valid, otherwise false (=0).
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 which must NOT be m...
virtual MLldouble getValueCastToLDouble() const
Returns the current value of the field cast to MLldouble.
Field to encapsulate a vector of 10 double values.
Vector10Field()
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 which copies the field value more efficiently.
void updateVector10Value(const Vector10 &vectorValue)
Sets the value of the field to vectorValue, but only touch field if the new value is different from t...
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 10 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 2 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.
void setVectorValue(const Vector2 &vectorValue)
Sets the value of the field to vectorValue.
void setValueFromField(const Field &field) override
Reimplementation from Field which 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 touch field if the new value is different from t...
Vector2Field(const std::string &name)
Constructor, creates a field with a name to manage a vector of 2 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.
Vector2Field()
Implements the runtime type system interface for this class.
void setStringValue(const std::string &stringValue) override
Sets the value of the field to stringValue.
Field to encapsulate a vector of 3 double values.
void setValueFromField(const Field &field) override
Reimplementation from Field which copies the field value more efficiently.
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 3 double values.
void updateVector3Value(const Vector3 &vectorValue)
Sets the value of the field to vectorValue, but only touch field if the new value is different from t...
const Vector3 & getVector3Value() const
Returns the value of the field.
Vector3Field()
Implements the runtime type system interface for this class.
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 setStringValue must be able to reinterpret this return...
Field to encapsulate a vector of 4 double values.
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 touch field if the new value is different from t...
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 4 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 which copies the field value more efficiently.
void updateValue(const Vector4 &vectorValue)
Same as updateVector4Value().
Vector4Field()
Implements the runtime type system interface for this class.
const Vector4 & getValue() const
Same as getVector4Value().
Field to encapsulate a vector of 5 double values.
const Vector5 & getVector5Value() const
Returns the value of the field.
void updateValue(const Vector5 &vectorValue)
Same as updateVector5Value().
const Vector5 & getValue() const
Same as getVector5Value().
std::string getStringValue() const override
Returns the value of the field as a string value.
Vector5Field()
Implements the runtime type system interface for this class.
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 5 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 touch field if the new value is different from t...
void setValueFromField(const Field &field) override
Reimplementation from Field which copies the field value more efficiently.
void setValue(const Vector5 &vectorValue)
Same as setVector5Value().
Field to encapsulate a vector of 6 double values.
Vector6Field()
Implements the runtime type system interface for this class.
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 touch field if the new value is different from t...
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(const std::string &name)
Constructor, creates a field with a name to manage a vector of 6 double values.
void setValueFromField(const Field &field) override
Reimplementation from Field which copies the field value more efficiently.
#define ML_ABSTRACT_CLASS_HEADER(className)
Same like ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non existing export symbol.
MLint32 MLDataType
MLDataType.
#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.
MLint64 * MLintPtr
A pointer to the signed ML integer type MLint.
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.
Tvec4< MLdouble > Vector4
A vector with 4 components of type double.
Tvec3< MLdouble > Vector3
A vector with 3 components of type double.
Tvec6< MLdouble > Vector6
A vector with 6 components of type double.
NotifyField TriggerField
TriggerField is an alias for the NotifyField, which is easier to find for Open Inventor users which a...
Tvec2< MLdouble > Vector2
A vector with 2 components of type double.
TSubImageBox< MLint > SubImageBox
Define the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type.
Vector10Field Vec10fField
MLEXPORT void MLInitFields()
Initialize all standard fields of the ML.
TImageVector< MLint > ImageVector
Defines the standard ImageVector type which is used by the ML for indexing and coordinates.
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)