NAP
Public Member Functions | List of all members
TriangleData< T > Class Template Reference

#include <triangleiterator.h>

Public Member Functions

 TriangleData (const T &first, const T &second, const T &third)
 
 TriangleData ()=default
 
const T & first () const
 
void setFirst (const T &data)
 
const T & second () const
 
void setSecond (const T &data)
 
const T & third () const
 
void setThird (const T &data) const
 
T & operator[] (std::size_t index)
 
const T & operator[] (std::size_t index) const
 

Description

template<class T>
class nap::TriangleData< T >

Data associated with a single triangle. The data is extracted from a VertexAttribute using the Triangle interface or can be constructed manually.

Constructor & Destructor Documentation

◆ TriangleData() [1/2]

TriangleData ( const T &  first,
const T &  second,
const T &  third 
)

◆ TriangleData() [2/2]

TriangleData ( )
default

Member Function Documentation

◆ first()

const T& first ( ) const
Returns
The data belonging to the first vertex of the triangle

◆ operator[]() [1/2]

T& operator[] ( std::size_t  index)

Array subscript overload

Parameters
indexthe index of the attribute value
Returns
the vertex attribute value at index

◆ operator[]() [2/2]

const T& operator[] ( std::size_t  index) const

Const array subscript overload

Parameters
indexthe index of the attribute value
Returns
the vertex attribute value at index

◆ second()

const T& second ( ) const
Returns
The data belonging to the second vertex of the triangle

◆ setFirst()

void setFirst ( const T &  data)

Set the data belonging to the first vertex of the triangle

Parameters
datadata associated with the first vertex

◆ setSecond()

void setSecond ( const T &  data)

Set the data belonging to the second vertex of the triangle

Parameters
datadata associated with the second vertex

◆ setThird()

void setThird ( const T &  data) const

Set the data belonging to the third vertex of the triangle

Parameters
datadata associated with the third vertex

◆ third()

const T& third ( ) const
Returns
The data belonging to the third vertex of the triangle