8#include <unordered_set>
9#include <unordered_map>
16#include "geometry/point.h"
17#include "geometry/edge.h"
30 std::array<size_t, 3>
v;
57 std::array<size_t, 3> sortedV1 =
v;
58 std::array<size_t, 3> sortedV2 = other.
v;
59 std::sort(sortedV1.begin(), sortedV1.end());
60 std::sort(sortedV2.begin(), sortedV2.end());
61 return sortedV1 == sortedV2;
69 size_t operator()(
const Triangle& triangle)
const {
71 size_t h = std::hash<size_t>{}(triangle.
v[0]);
72 h ^= std::hash<size_t>{}(triangle.
v[1]) + 0x9e3779b9 + (h << 6) + (h >> 2);
73 h ^= std::hash<size_t>{}(triangle.
v[2]) + 0x9e3779b9 + (h << 6) + (h >> 2);
A struct representing a point in 3D space.
Definition point.h:15
A hash function for triangles.
Definition triangle.h:68
A struct representing a triangle in the mesh.
Definition triangle.h:25
bool operator==(const Triangle &other) const
Overload the == operator to compare two triangles based on their vertex indices.
Definition triangle.h:56
std::array< size_t, 3 > v
Indices of the vertices that form the triangle.
Definition triangle.h:30
static constexpr size_t elementType
Gmsh element type for triangles.
Definition triangle.h:27
bool isBad
Flag used in Delaunay triangulation to mark triangles that need to be removed.
Definition triangle.h:31
bool containsEdge(size_t v1, size_t v2) const
Check if the circum circle of the triangle contains a specific edge defined by two vertex indices.
Definition triangle.cpp:5
bool containsPoint(const std::vector< Point > &vertices, const Point &point)
Check if the circum circle of the triangle contains a specific point.
Definition triangle.cpp:12
static constexpr size_t numVertices
Number of vertices in a triangle.
Definition triangle.h:28