Wildmeshing Toolkit
EdgeOperationData.cpp
Go to the documentation of this file.
1 #include "EdgeOperationData.hpp"
2 #include <wmtk/TriMesh.hpp>
3 
4 
6 
7 
8 std::vector<std::array<Tuple, 2>> EdgeOperationData::ear_edges(const TriMesh& m) const
9 {
10  std::vector<std::array<Tuple, 2>> ret;
11  ret.reserve(incident_face_datas().size());
12 
13  for (const auto& ifd : incident_face_datas()) {
14  std::array<Tuple, 2>& r = ret.emplace_back();
15 
16  for (size_t j = 0; j < 2; ++j) {
17  int64_t eid = ifd.ears[j].eid;
18  r[j] = tuple_from_id(m, PrimitiveType::Edge, eid);
19  }
20  }
21  return ret;
22 }
23 std::array<Tuple, 2> EdgeOperationData::input_endpoints(const TriMesh& m) const
24 {
25  std::array<Tuple, 2> r;
26  r[0] = m_operating_tuple;
28  return r;
29 }
30 
31 std::vector<Tuple> EdgeOperationData::collapse_merged_ear_edges(const TriMesh& m) const
32 {
33  std::vector<Tuple> ret;
34  ret.reserve(incident_face_datas().size());
35 
36  for (const auto& ifd : incident_face_datas()) {
37  ret.emplace_back(tuple_from_id(m, PrimitiveType::Edge, ifd.new_edge_id));
38  }
39  return ret;
40 }
41 
42  std::vector<simplex::Simplex> EdgeOperationData::new_vertices(const Mesh&m) const {
43  if(m.is_free()) {
44  return {
48  };
49  } else {
50  return {
52  };
53  }
54  }
55 std::vector<Tuple> EdgeOperationData::split_new_rib_edges(const TriMesh& m) const
56 {
57  std::vector<Tuple> ret;
58  ret.reserve(incident_face_datas().size());
59 
60  for (const auto& ifd : incident_face_datas()) {
61  ret.emplace_back(tuple_from_id(m, PrimitiveType::Edge, ifd.new_edge_id));
62  }
63  return ret;
64 }
65 std::vector<Tuple> EdgeOperationData::input_faces(const TriMesh& m) const
66 {
67  std::vector<Tuple> ret;
68  ret.reserve(incident_face_datas().size());
69 
70  for (const auto& ifd : incident_face_datas()) {
71  ret.emplace_back(ifd.local_operating_tuple);
72  }
73  return ret;
74 }
75 std::vector<std::array<Tuple, 2>> EdgeOperationData::split_output_faces(const TriMesh& m) const
76 {
77  std::vector<std::array<Tuple, 2>> ret;
78  ret.reserve(incident_face_datas().size());
79 
80  for (const auto& ifd : incident_face_datas()) {
81  std::array<Tuple, 2>& r = ret.emplace_back();
82  for (size_t j = 0; j < 2; ++j) {
83  r[j] = tuple_from_id(m, PrimitiveType::Triangle, ifd.split_f[j]);
84  }
85  // std::swap(r[0],r[1]);
86  }
87  return ret;
88 }
89 
90 std::array<Tuple, 2> EdgeOperationData::split_output_edges(const TriMesh& m) const
91 {
92  std::array<Tuple, 2> r;
93  // logger().trace("[{}] < {}", fmt::join(split_spine_eids, ","),
94  // m.capacity(PrimitiveType::Edge));
95  for (size_t j = 0; j < 2; ++j) {
97  }
98  return r;
99 }
100 } // namespace wmtk::operations::tri_mesh
bool is_free() const
Definition: Mesh.hpp:988
Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const final override
switch the orientation of the Tuple of the given dimension
Definition: TriMesh.cpp:99
static Tuple tuple_from_id(const Mesh &m, const PrimitiveType type, const int64_t gid)
static simplex::Simplex simplex_from_id(const Mesh &m, const PrimitiveType type, const int64_t gid)
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
std::vector< std::array< Tuple, 2 > > ear_edges(const TriMesh &m) const
std::vector< Tuple > split_new_rib_edges(const TriMesh &) const
const std::vector< IncidentFaceData > & incident_face_datas() const
std::array< Tuple, 2 > input_endpoints(const TriMesh &m) const
std::array< Tuple, 2 > split_output_edges(const TriMesh &) const