PolyData< T > Class Template Reference

#include <mesh_attribute_utilities.h>

详细描述

template<typename T>
class maxon::PolyData< T >

Template class used to attach data to polygon vertices. The polygon could be either a triangle or a quadrangle.

Public Types

using  ValueType = T

公共成员函数

  PolyData ()
  PolyData ( ENUM_DONT_INITIALIZE )
  PolyData (const T &av, const T &bv, const T &cv, const T &dv)
  PolyData (const PolyData & src )
  MAXON_OPERATOR_COPY_ASSIGNMENT ( PolyData )
T &  operator[] ( Int index)
const T &  operator[] ( Int index) const
Bool   IsTriangle () const
Int   FindCornerIndex (const T &value) const
Int   FindEdge (const T &value1, const T &value2) const
void  GetEdgeValues ( Int edge, T &av, T &bv) const
Int   GetMemorySize () const
  MAXON_OPERATOR_EQUALITY_HASHCODE ( PolyData , a , b , c , d )
String   ToString (const FormatStatement *formatStatement=nullptr) const

Public Attributes

a
b
c
d

Member Typedef Documentation

◆  ValueType

using ValueType = T

构造函数 & 析构函数文档编制

◆  PolyData() [1/4]

PolyData ( )

◆  PolyData() [2/4]

PolyData ( ENUM_DONT_INITIALIZE   )
explicit

◆  PolyData() [3/4]

PolyData ( const T &  av ,
const T &  bv ,
const T &  cv ,
const T &  dv  
)

◆  PolyData() [4/4]

PolyData ( const PolyData < T > &  src )

成员函数文档编制

◆  MAXON_OPERATOR_COPY_ASSIGNMENT()

MAXON_OPERATOR_COPY_ASSIGNMENT ( PolyData < T >  )

◆  operator[]() [1/2]

T& operator[] ( Int   index )

Vertex data array operator. Accesses the polygon's vertex values through their polygon vertex numbers ( 0 - 3 ) instead of a , b , c , d .

参数
[in] index The vertex index ( 0 - 3 ) to retrieve in the polygon.
返回
The vertex value.

◆  operator[]() [2/2]

const T& operator[] ( Int   index ) const

Vertex data array operator. Accesses the polygon's vertex values through their polygon vertex numbers ( 0 - 3 ) instead of a , b , c , d .

参数
[in] index The vertex index ( 0 - 3 ) to retrieve in the polygon.
返回
The vertex value.

◆  IsTriangle()

Bool IsTriangle ( ) const

Checks if the polygon is a triangle.

返回
true if the polygon is a triangle, otherwise false .

◆  FindCornerIndex()

Int FindCornerIndex ( const T &  value ) const

Checks if one of the polygon vertex value is equal to value and returns the found polygon vertex number ( 0 - 3 , equals a - d ).

参数
[in] value The vertex value to check.
返回
The matching polygon vertex number ( 0 - 3 , equals a - d ). NOTOK is returned if there is no match.

◆  FindEdge()

Int FindEdge ( const T &  value1 ,
const T &  value2  
) const

Finds the polygon edge that contains vertex values value1 and value2 and returns the edge index within ( 0 - 3 ).

参数
[in] value1 The index of the first edge vertex.
[in] value2 The index of the second edge vertex.
返回
The found polygon edge index ( 0 - 3 ), or NOTOK if there is no match.

◆  GetEdgeValues()

void GetEdgeValues ( Int   edge ,
T &  av ,
T &  bv  
) const

Gets the vertex values for a polygon edge index within ( 0 - 3 ).

参数
[in] edge The polygon edge index.
[out] av Assigned the value of the first edge vertex.
[out] bv Assigned the value of the second edge vertex.

◆  GetMemorySize()

Int GetMemorySize ( ) const

Returns the size of the data.

返回
The size of the data.

◆  MAXON_OPERATOR_EQUALITY_HASHCODE()

MAXON_OPERATOR_EQUALITY_HASHCODE ( PolyData < T >  ,
a   ,
b   ,
c   ,
d    
)

◆  ToString()

String ToString ( const FormatStatement formatStatement = nullptr ) const

Returns a string which represents the data.

参数
[in] formatStatement Optional format statement.
返回
A human readable string.

Member Data Documentation

◆  a

T a

Value of the first polygon vertex.

◆  b

T b

Value of the second polygon vertex.

◆  c

T c

Value of the third polygon vertex.

◆  d

T d

Value of the fourth polygon vertex.