Wildmeshing Toolkit
Loading...
Searching...
No Matches
EdgeOperationData.hpp
Go to the documentation of this file.
1#pragma once
2#include <array>
3#include <vector>
4#include <wmtk/Tuple.hpp>
6
7namespace wmtk {
8class TriMesh;
9}
10
13{
14public:
15 EdgeOperationData() = default;
18 // C
19 // / \ .
20 // F1 / \ F2
21 // / \ .
22 // / \ .
23 // A----------B
24 // \ /
25 // \ /
26 // F1' \ / F2'
27 // \ /
28 // C'
29 // the neighbors are stored in the order of A, B, C, D if they exist
30 // vid, ear fid (-1 if it doesn't exit), ear eid
31
37 struct EarData
38 {
39 int64_t fid = -1; // global fid of the ear, -1 if it doesn't exist
40 int64_t eid = -1; // global eid of the ear, -1 if it doesn't exist
41 };
42
47 {
48 // vid of the vertex opposite of the input edge with respect to the input face
49 int64_t opposite_vid = -1;
50 // the face id from before the operation
51 int64_t fid = -1;
52 // the fids of the split edge - first one has vertex A, second one has vertex B
53 std::array<int64_t, 2> split_f = std::array<int64_t, 2>{{-1, -1}};
54
55 // the copy of edge m_operating_tuple in face(fid)
57
58 // the ear data (i.e FID and EID of the edge/face across the edge.
59 // first face/edge include A, second includes B
60 std::array<EarData, 2> ears;
61
62 // the new edge created by split/collapse
63 // for collapse: merging two ears into this edge
64 // for split: new rib edge
65 int64_t new_edge_id = -1;
66
67 int64_t merged_edge_fid = -1;
68 };
69
70 const std::vector<IncidentFaceData>& incident_face_datas() const
71 {
73 }
74
75 const std::array<int64_t, 2>& incident_vids() const { return m_spine_vids; }
76
77 int64_t operating_edge_id() const { return m_operating_edge_id; }
78
79 // only returns valid tuples for the state before an operation occurred
80 std::vector<std::array<Tuple, 2>> ear_edges(const TriMesh& m) const;
81 std::array<Tuple, 2> input_endpoints(const TriMesh& m) const;
82 std::vector<Tuple> collapse_merged_ear_edges(const TriMesh& m) const;
83
84 std::vector<Tuple> split_new_rib_edges(const TriMesh&) const;
85 std::vector<Tuple> input_faces(const TriMesh&) const;
86 std::array<Tuple, 2> split_output_edges(const TriMesh&) const;
87 std::vector<std::array<Tuple, 2>> split_output_faces(const TriMesh&) const;
88
89 std::vector<simplex::Simplex> new_vertices(const Mesh&) const;
90
91 std::array<std::vector<int64_t>, 3> simplex_ids_to_delete;
92 std::vector<int64_t> cell_ids_to_update_hash;
93
94
95 // common simplicies
96 int64_t spine_eid = -1;
97 int64_t m_operating_edge_id = -1;
98
99 // simplices required per-face
100 std::vector<IncidentFaceData> m_incident_face_datas;
101
102 std::array<int64_t, 2> split_spine_eids = std::array<int64_t, 2>{{-1, -1}};
103 // in a free mesh this encodes the new vertex added to one of the faces
104 int64_t split_new_vid = -1;
105
106 std::array<int64_t, 2> m_free_split_v;
107 std::array<int64_t, 2> m_free_split_e;
108
109 bool is_collapse = false;
110};
111} // namespace wmtk::operations::tri_mesh
The Tuple is the basic navigation tool in our mesh data structure.
Definition Tuple.hpp:19
std::vector< Tuple > input_faces(const TriMesh &) const
std::vector< Tuple > collapse_merged_ear_edges(const TriMesh &m) const
std::vector< std::array< Tuple, 2 > > split_output_faces(const TriMesh &) const
std::vector< simplex::Simplex > new_vertices(const Mesh &) const
EdgeOperationData & operator=(EdgeOperationData &&)=default
std::vector< IncidentFaceData > m_incident_face_datas
std::vector< std::array< Tuple, 2 > > ear_edges(const TriMesh &m) const
std::vector< Tuple > split_new_rib_edges(const TriMesh &) const
const std::array< int64_t, 2 > & incident_vids() const
EdgeOperationData(EdgeOperationData &&)=default
std::array< Tuple, 2 > input_endpoints(const TriMesh &m) const
const std::vector< IncidentFaceData > & incident_face_datas() const
std::array< std::vector< int64_t >, 3 > simplex_ids_to_delete
std::array< Tuple, 2 > split_output_edges(const TriMesh &) const
An ear is a face that is adjacent to a face that is incident to the edge on which the operation is pe...
Data on the incident face relevant for performing operations.