MeshAttributeClassInterface Class Reference

#include <mesh_attribute_base.h>

Inheritance diagram for MeshAttributeClassInterface:

详细描述

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.

公共成员函数

const MAXON_METHOD DataType GetDataType () 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

私有成员函数

  MAXON_INTERFACE ( MeshAttributeClassInterface , MAXON_REFERENCE_CONST , "net.maxon.mesh_misc.interface.meshattributeclass")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( MeshAttributeClassInterface   ,
MAXON_REFERENCE_CONST   ,
"net.maxon.mesh_misc.interface.meshattributeclass"   
)
private

◆  GetDataType()

const MAXON_METHOD DataType & GetDataType ( ) const

Returns the DataType this class manages, e.g. Vector2d32 for UV maps.

返回
The DataType .

◆  InterpolateLinear()

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]

◆  InterpolateInOutline()

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.

◆  GetDefaultValue()

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.

◆  AtrLessThen()

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.
返回
True if the content of data1 is smaller then data2.

◆  AtrIsEqual()

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.
返回
True if the content of data1 is equal to data2.

◆  AtrAdd()

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.

◆  AtrSubstract()

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.

◆  AtrMultiply() [1/2]

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.

◆  AtrMultiply() [2/2]

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.

◆  AtrDivide() [1/2]

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.

◆  AtrDivide() [2/2]

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.

◆  AtrToString()

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.
返回
The converted result.