42 #ifndef OPENMESH_ITERATORS_HH
43 #define OPENMESH_ITERATORS_HH
55 #include <OpenMesh/Core/System/config.h>
56 #include <OpenMesh/Core/Mesh/Status.hh>
70 template <
class Mesh>
class ConstVertexIterT;
71 template <
class Mesh>
class VertexIterT;
72 template <
class Mesh>
class ConstHalfedgeIterT;
73 template <
class Mesh>
class HalfedgeIterT;
74 template <
class Mesh>
class ConstEdgeIterT;
75 template <
class Mesh>
class EdgeIterT;
76 template <
class Mesh>
class ConstFaceIterT;
77 template <
class Mesh>
class FaceIterT;
80 template <
class Mesh,
class ValueHandle,
class MemberOwner,
bool (MemberOwner::*PrimitiveStatusMember)() const, u
int (MemberOwner::*PrimitiveCountMember)() const>
85 typedef ValueHandle value_handle;
86 typedef value_handle value_type;
87 typedef std::bidirectional_iterator_tag iterator_category;
88 typedef std::ptrdiff_t difference_type;
89 typedef const value_type& reference;
90 typedef const value_type* pointer;
91 typedef const Mesh* mesh_ptr;
92 typedef const Mesh& mesh_ref;
96 : mesh_(0), skip_bits_(0)
101 : mesh_(&_mesh), hnd_(_hnd), skip_bits_(0)
106 if((mesh_->*PrimitiveCountMember)() == 0) hnd_ = value_handle(-1);
125 operator value_handle()
const {
131 return ((mesh_ == _rhs.mesh_) && (hnd_ == _rhs.hnd_));
157 if (mesh_ && (mesh_->*PrimitiveStatusMember)()) {
161 skip_bits_ = status.
bits();
175 assert(mesh_ && skip_bits_);
176 while ((hnd_.idx() < (signed) (mesh_->*PrimitiveCountMember)())
177 && (mesh_->status(hnd_).bits() & skip_bits_))
182 assert(mesh_ && skip_bits_);
183 while ((hnd_.idx() >= 0) && (mesh_->status(hnd_).bits() & skip_bits_))
190 unsigned int skip_bits_;