Wildmeshing Toolkit
HalfClosedStarIterable.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wmtk/Mesh.hpp>
7 
9 
10 namespace wmtk::simplex {
11 
22 {
23 public:
25 
26  class Iterator
27  {
28  public:
29  Iterator(HalfClosedStarIterable& container, const Tuple& t = Tuple());
31  bool operator!=(const Iterator& other) const;
33  const IdSimplex operator*() const;
34 
35  private:
38 
39  bool step_faces();
40 
41  private:
43  const Mesh& m_mesh;
44 
47  int8_t m_pt = -1;
48  int8_t m_face_counter = 0;
49  IteratorPhase m_phase = IteratorPhase::Faces;
50  };
51 
52 public:
53  HalfClosedStarIterable(const Mesh& mesh, const Tuple& tuple);
54 
55  Iterator begin() { return Iterator(*this, m_tuple); }
56  Iterator end() { return Iterator(*this); }
57 
58 private:
59  const Mesh& m_mesh;
60  const Tuple m_tuple;
63 
64  std::array<simplex::internal::VisitedArray<simplex::IdSimplex>, 2>
65  m_visited_cofaces; // for depth 3 iteration
66  std::array<simplex::internal::VisitedArray<simplex::IdSimplex>, 2>
67  m_visited_link; // for depth 3 iteration
68 };
69 
70 } // namespace wmtk::simplex
Iterator(HalfClosedStarIterable &container, const Tuple &t=Tuple())
This iterator internally uses TopDimensionCofacesIterable.
std::array< simplex::internal::VisitedArray< simplex::IdSimplex >, 2 > m_visited_cofaces
TopDimensionCofacesIterable::Iterator m_it_end
HalfClosedStarIterable(const Mesh &mesh, const Tuple &tuple)
std::array< simplex::internal::VisitedArray< simplex::IdSimplex >, 2 > m_visited_link
Iterating through the d-simplices of a mesh can be done in different ways, depending on the simplex d...