Wildmeshing Toolkit
LinkIterable.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wmtk/Mesh.hpp>
7 
9 
10 namespace wmtk::simplex {
11 
20 {
21 public:
22  class Iterator
23  {
24  public:
25  Iterator(LinkIterable& container, const Tuple& t = Tuple());
27  bool operator!=(const Iterator& other) const;
29  const IdSimplex operator*() const;
30 
31  private:
37  int64_t depth();
38 
42  void init();
43 
49 
51 
52  private:
56  int8_t m_pt = 0;
57  int8_t m_edge_counter = 0;
58  };
59 
60 public:
61  LinkIterable(const Mesh& mesh, const Simplex& simplex);
62 
63  Iterator begin() { return Iterator(*this, m_simplex.tuple()); }
64  Iterator end() { return Iterator(*this); }
65 
66 private:
67  const Mesh& m_mesh;
71 
72  std::array<simplex::internal::VisitedArray<simplex::IdSimplex>, 2>
73  m_visited_link; // for depth 3 iteration
74 };
75 
76 } // namespace wmtk::simplex
const Tuple & tuple() const
Definition: Simplex.hpp:53
Iterating through the d-simplices of a mesh can be done in different ways, depending on the simplex d...