27#ifndef COOT_UTILS_G_TRIANGLE_HH
28#define COOT_UTILS_G_TRIANGLE_HH
37 const unsigned int &a1,
38 const unsigned int &a2) {
45 unsigned int point_id[3];
47 unsigned int &
operator[] (
const unsigned int &i) {
return point_id[i]; }
48 const unsigned int &
operator[] (
const unsigned int &i)
const {
return point_id[i]; }
50 void rebase(
const unsigned int &idx_base) {
51 for (
unsigned int i=0; i<3; i++) {
52 point_id[i] += idx_base;
57 std::swap(point_id[0], point_id[1]);
59 friend std::ostream& operator <<(std::ostream &s,
const g_triangle &t);
62std::ostream& operator <<(std::ostream &s,
const g_triangle &t);
72 g_triangle_with_colour_index(
const unsigned int &a0,
73 const unsigned int &a1,
74 const unsigned int &a2) :
g_triangle(a0, a1, a2) {
g_triangle is the container for the vertices of a triangles (indexing into the vertices vector).
Definition g_triangle.hh:33
g_triangle(const unsigned int &a0, const unsigned int &a1, const unsigned int &a2)
constructor
Definition g_triangle.hh:36
void reverse_winding()
in-place reverse the winding of this triangle
Definition g_triangle.hh:56
void rebase(const unsigned int &idx_base)
use rebase() when adding more vertices and triangles into a mesh.
Definition g_triangle.hh:50
unsigned int & operator[](const unsigned int &i)
int colour_index;
Definition g_triangle.hh:47