17#ifndef __surface_polygon_h__
18#define __surface_polygon_h__
21#include <initializer_list>
33 template <u
int32_t vertices = 3>
42 for (
size_t i = 0; i != vertices; ++i)
49 assert (d.size() == vertices);
50 for (
size_t i = 0; i != vertices; ++i)
55 Polygon (
const std::initializer_list<T> l)
57 assert (l.size() == vertices);
59 for (
auto i = l.begin(); i != l.end(); ++i, ++counter)
60 indices[counter] = *i;
65 memset (indices, 0, vertices *
sizeof (uint32_t));
69 uint32_t& operator[] (
const size_t i) { assert (i < vertices);
return indices[i]; }
70 uint32_t operator[] (
const size_t i)
const { assert (i < vertices);
return indices[i]; }
72 size_t size()
const {
return vertices; }
74 bool shares_edge (
const Polygon&)
const;
77 uint32_t indices[vertices];