List of all members | Public Member Functions
thor::Triangle< V > Class Template Reference

Triangle class consisting of 3 vertices (its corners). More...

Public Member Functions

 Triangle (V &corner0, V &corner1, V &corner2)
 Triangle constructor. More...
 
V & operator[] (std::size_t cornerIndex)
 Accesses a corner of the triangle. More...
 
const V & operator[] (std::size_t cornerIndex) const
 Accesses a corner of the triangle (const overload). More...
 

Detailed Description

template<typename V>
class thor::Triangle< V >

Triangle class consisting of 3 vertices (its corners).

The invariant of this class is that the corners 0, 1, 2 are aligned in clockwise order.

Template Parameters
VThe type of the vertices, for which the template thor::TriangulationTraits shall be specialized. If V is const-qualified, the corners cannot be changed through this triangle.

Constructor & Destructor Documentation

template<typename V >
thor::Triangle< V >::Triangle ( V &  corner0,
V &  corner1,
V &  corner2 
)

Triangle constructor.

Parameters
corner0,corner1,corner2form the corners of the triangle. They are only referenced and not copied. The corners shall always be clockwise-oriented.

Member Function Documentation

template<typename V >
V& thor::Triangle< V >::operator[] ( std::size_t  cornerIndex)

Accesses a corner of the triangle.

Parameters
cornerIndexThe index of the corner. Must be 0, 1 or 2.
Returns
Reference to the vertex at the specified corner.
template<typename V >
const V& thor::Triangle< V >::operator[] ( std::size_t  cornerIndex) const

Accesses a corner of the triangle (const overload).

Parameters
cornerIndexThe index of the corner. Must be 0, 1 or 2.
Returns
Const-reference to the vertex at the specified corner.

The documentation for this class was generated from the following file: