Enmesh
Loading...
Searching...
No Matches
include
Enmesh
geometry
edge.h
1
#ifndef EDGE_H
2
#define EDGE_H
3
4
#include <vector>
5
#include <array>
6
#include <iostream>
7
#include <cmath>
8
#include <unordered_set>
9
#include <unordered_map>
10
#include <string>
11
12
13
#include "geometry/point.h"
14
15
namespace
Enmesh {
16
21
struct
Edge
{
22
size_t
v1, v2;
23
bool
operator==(
const
Edge
& other)
const
{
24
return
(v1 == other.v1 && v2 == other.v2) || (v1 == other.v2 && v2 == other.v1);
25
}
26
};
27
32
struct
EdgeHash
{
33
size_t
operator()(
const
Edge
& e)
const
{
34
return
std::hash<int>{}(e.v1) ^ (std::hash<int>{}(e.v2) << 1);
// Combine hashes of v1 and v2
35
}
36
};
37
38
}
// namespace Enmesh
39
40
#endif
Enmesh::EdgeHash
A hash function for the Edge struct to allow it to be used in an unordered_set.
Definition
edge.h:32
Enmesh::Edge
A struct representing an edge in the mesh.
Definition
edge.h:21
Generated by
1.14.0