EBGeometry  1.0
EBGeometry_DCEL_Iterator.hpp
Go to the documentation of this file.
1 /* EBGeometry
2  * Copyright © 2022 Robert Marskar
3  * Please refer to Copyright.txt and LICENSE in the EBGeometry root directory.
4  */
5 
12 #ifndef EBGeometry_DCEL_Iterator
13 #define EBGeometry_DCEL_Iterator
14 
15 // Std includes
16 #include <memory>
17 
18 // Our includes
20 
21 namespace DCEL {
22 
26  template <class T, class Meta>
28  {
29  public:
34 
39 
44 
48  using VertexPtr = std::shared_ptr<Vertex>;
49 
53  using EdgePtr = std::shared_ptr<Edge>;
54 
58  using FacePtr = std::shared_ptr<Face>;
59 
63  EdgeIteratorT() = delete;
64 
72  EdgeIteratorT(Face& a_face);
73 
81  EdgeIteratorT(const Face& a_face);
82 
86  virtual ~EdgeIteratorT() = default;
87 
91  inline EdgePtr&
92  operator()() noexcept;
93 
97  inline const EdgePtr&
98  operator()() const noexcept;
99 
104  inline void
105  reset() noexcept;
106 
110  inline void
111  operator++() noexcept;
112 
119  inline bool
120  ok() const noexcept;
121 
122  protected:
127 
131  std::shared_ptr<Edge> m_startEdge;
132 
136  std::shared_ptr<Edge> m_curEdge;
137  };
138 } // namespace DCEL
139 
140 #include "EBGeometry_NamespaceFooter.hpp"
141 
142 #include "EBGeometry_DCEL_IteratorImplem.hpp"
143 
144 #endif
Edge iterator class.
Definition: EBGeometry_DCEL_Iterator.hpp:28
std::shared_ptr< Edge > m_curEdge
Current half-edge.
Definition: EBGeometry_DCEL_Iterator.hpp:136
void reset() noexcept
Reset function for the iterator. This resets the iterator so that it begins from the starting half-ed...
EdgeIteratorT(const Face &a_face)
Constructor, taking a face as argument. The iterator begins at the half-edge pointer contained in the...
bool m_fullLoop
If true, a full loop has been made around the polygon face.
Definition: EBGeometry_DCEL_Iterator.hpp:126
std::shared_ptr< Edge > m_startEdge
Starting half-edge.
Definition: EBGeometry_DCEL_Iterator.hpp:131
EdgeIteratorT(Face &a_face)
Constructor, taking a face as argument. The iterator begins at the half-edge pointer contained in the...
virtual ~EdgeIteratorT()=default
Destructor.
EdgePtr & operator()() noexcept
Operator returning a pointer to the current half-edge.
std::shared_ptr< Edge > EdgePtr
Alias for edge pointer.
Definition: EBGeometry_DCEL_Iterator.hpp:53
bool ok() const noexcept
Function which checks if the iteration can be continued.
std::shared_ptr< Face > FacePtr
Alias for face pointer.
Definition: EBGeometry_DCEL_Iterator.hpp:58
std::shared_ptr< Vertex > VertexPtr
Alias for vertex pointer.
Definition: EBGeometry_DCEL_Iterator.hpp:48
EdgeIteratorT()=delete
Default construction is not allowed. Use one of the full constructors.
Edge class.
Definition: EBGeometry_DCEL_Edge.hpp:47
Face class.
Definition: EBGeometry_DCEL_Face.hpp:49
Vertex class.
Definition: EBGeometry_DCEL_Vertex.hpp:40
Namespace containing various double-connected edge list (DCEL) functionality.