Mesh_analyzer
Loading...
Searching...
No Matches
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 <fstream>
11#include <sstream>
12#include <string>
13
14
15#include "geometry/point.h"
16
21struct Edge {
22 int 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
32struct 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#endif
A hash function for the Edge struct to allow it to be used in an unordered_set.
Definition edge.h:32
A struct representing an edge in the mesh.
Definition edge.h:21