#include <mesh_attribute_base.h>
By implementing this interface, it is possible to define a new mesh attribute type so that a data type can be attached to mesh vertices or to mesh polyvertices. The interface needs to be implemented with the data type description, which has to be registered using MAXON_MESHATTRIBUTE and MAXON_DATATYPE, and all arithmetic and comparison functions.
Public Member Functions | |
MAXON_METHOD const DataType & | GetDataType () const |
MAXON_METHOD const DataType & | GetUnderlyingDataType () const |
MAXON_METHOD void | InterpolateLinear (void *data1, const void *data2, Float blend) const |
MAXON_METHOD void | InterpolateInOutline (void *data, const Block< void * > &outline, const Block< Float > &weights) const |
MAXON_METHOD void | GetDefaultValue (void *data) const |
MAXON_METHOD Bool | AtrLessThen (const void *data1, const void *data2) const |
MAXON_METHOD Bool | AtrIsEqual (const void *data1, const void *data2) const |
MAXON_METHOD void | AtrAdd (void *data1, const void *data2) const |
MAXON_METHOD void | AtrSubstract (void *data1, const void *data2) const |
MAXON_METHOD void | AtrMultiply (void *data1, const void *data2) const |
MAXON_METHOD void | AtrMultiply (void *data, Float value) const |
MAXON_METHOD void | AtrDivide (void *data1, const void *data2) const |
MAXON_METHOD void | AtrDivide (void *data, Float value) const |
MAXON_METHOD String | AtrToString (const void *data, const FormatStatement *formatStatement) const |
Private Member Functions | |
MAXON_INTERFACE (MeshAttributeClassInterface, MAXON_REFERENCE_CONST, "net.maxon.mesh_misc.interface.meshattributeclass") | |
|
private |
MAXON_METHOD const DataType& GetDataType | ( | ) | const |
MAXON_METHOD const DataType& GetUnderlyingDataType | ( | ) | const |
Returns the datatype of the underlying type if the mesh vertex allows multiple values. Returns the main type if it doesn't allow multiple values
MAXON_METHOD void InterpolateLinear | ( | void * | data1, |
const void * | data2, | ||
Float | blend | ||
) | const |
Interpolates linearly between two values. Both addresses need to be cast to the appropriate data type.
[in,out] | data1 | The address of the first value. The value will be overwritten with the result. |
[in] | data2 | The address of the second value. |
[in] | blend | The blend percentage [0.0..blend..1.0] |
MAXON_METHOD void InterpolateInOutline | ( | void * | data, |
const Block< void * > & | outline, | ||
const Block< Float > & | weights | ||
) | const |
Interpolates a value in the outline using the specified weights. The addresses in data and outline need to be cast to the appropriate data type.
[in,out] | data | The address of the value. The value will be overwritten with the result. |
[in] | outline | The outline data used to perform the interpolation. |
[in] | weights | Weights to be used for the interpolation, represent the interpolation distance from each outline edge. |
MAXON_METHOD void GetDefaultValue | ( | void * | data | ) | const |
Returns the default value for this attribute. The caller owns the passed pointer.
[out] | data | A pointer filled with the default value. |
MAXON_METHOD Bool AtrLessThen | ( | const void * | data1, |
const void * | data2 | ||
) | const |
Compares two data values for "less than". In most cases this returns the MeshAttributeClassInterface::GetDataType()Compare() but the developer is free to customize comparison if needed.
[in] | data1 | First data to compare. |
[in] | data2 | Second data to compare. |
MAXON_METHOD Bool AtrIsEqual | ( | const void * | data1, |
const void * | data2 | ||
) | const |
Compares two data values for equality. In most of cases just returns the MeshAttributeClassInterface::GetDataType()IsEqual() but the developer is free to customize comparison if needed.
[in] | data1 | First data to compare. |
[in] | data2 | Second data to compare. |
MAXON_METHOD void AtrAdd | ( | void * | data1, |
const void * | data2 | ||
) | const |
Defines how to add two data values.
[in,out] | data1 | The address of the first value. The value will be overwritten with the result. |
[in] | data2 | The address of the second value. |
MAXON_METHOD void AtrSubstract | ( | void * | data1, |
const void * | data2 | ||
) | const |
Defines how to subtract two data values.
[in,out] | data1 | The address of the first value. The value will be overwritten with the result. |
[in] | data2 | The address of the second value. |
MAXON_METHOD void AtrMultiply | ( | void * | data1, |
const void * | data2 | ||
) | const |
Defines how to multiply two data values.
[in,out] | data1 | The address of the first value. The value will be overwritten with the result. |
[in] | data2 | The address of the second value. |
MAXON_METHOD void AtrMultiply | ( | void * | data, |
Float | value | ||
) | const |
Defines how to multiply a data value by a float value.
[in,out] | data | The address of the data value. The value will be overwritten with the result. |
[in] | value | The value to be used for the multiplication. |
MAXON_METHOD void AtrDivide | ( | void * | data1, |
const void * | data2 | ||
) | const |
Defines how to divide two data values.
[in,out] | data1 | The address of the first value. The value will be overwritten with the result. |
[in] | data2 | The address of the second value. |
MAXON_METHOD void AtrDivide | ( | void * | data, |
Float | value | ||
) | const |
Defines how to divide a data value by a float value.
[in,out] | data | The address of the data value. The value will be overwritten with the result. |
[in] | value | The value to be used for the division. |
MAXON_METHOD String AtrToString | ( | const void * | data, |
const FormatStatement * | formatStatement | ||
) | const |
Returns a readable string of the content of a data pointer.
[in,out] | data | The address of the data value. |
[in] | formatStatement | Nullptr or additional formatting instructions. Currently no additional formatting instructions are supported. |