PolyData< T > Class Template Reference

#include <mesh_attribute_utilities.h>

Detailed Description

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
 

Public Member Functions

 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

Constructor & Destructor Documentation

◆ PolyData() [1/4]

PolyData ( )

◆ PolyData() [2/4]

◆ PolyData() [3/4]

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

◆ PolyData() [4/4]

PolyData ( const PolyData< T > &  src)

Member Function Documentation

◆ 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.

Parameters
[in]indexThe vertex index (0 - 3) to retrieve in the polygon.
Returns
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.

Parameters
[in]indexThe vertex index (0 - 3) to retrieve in the polygon.
Returns
The vertex value.

◆ IsTriangle()

Bool IsTriangle ( ) const

Checks if the polygon is a triangle.

Returns
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).

Parameters
[in]valueThe vertex value to check.
Returns
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).

Parameters
[in]value1The index of the first edge vertex.
[in]value2The index of the second edge vertex.
Returns
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).

Parameters
[in]edgeThe polygon edge index.
[out]avAssigned the value of the first edge vertex.
[out]bvAssigned the value of the second edge vertex.

◆ GetMemorySize()

Int GetMemorySize ( ) const

Returns the size of the data.

Returns
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.

Parameters
[in]formatStatementOptional format statement.
Returns
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.