55 #include <OpenMesh/Core/System/config.h>
56 #include <OpenMesh/Core/Mesh/Status.hh>
81 template <
class Mesh,
class ValueHandle,
class MemberOwner,
bool (MemberOwner::*PrimitiveStatusMember)() const,
size_t (MemberOwner::*PrimitiveCountMember)() const>
86 typedef ValueHandle value_handle;
87 typedef value_handle value_type;
88 typedef std::bidirectional_iterator_tag iterator_category;
89 typedef std::ptrdiff_t difference_type;
98 : hnd_(
make_smart(ValueHandle(),nullptr)), skip_bits_(0)
103 : hnd_(
make_smart(_hnd, _mesh)), skip_bits_(0)
123 OM_DEPRECATED(
"This function clutters your code. Use dereferencing operators -> and * instead.")
134 OM_DEPRECATED(
"Implicit casts of iterators are unsafe. Use dereferencing operators -> and * instead.")
135 operator value_handle()
const {
141 return ((hnd_.mesh() == _rhs.hnd_.mesh()) && (hnd_ == _rhs.hnd_));
164 #if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
165 template<
class T = value_handle>
166 auto operator+=(
int amount) ->
167 typename std::enable_if<
168 sizeof(decltype(std::declval<T>().__increment(amount))) >= 0,
170 static_assert(std::is_same<T, value_handle>::value,
171 "Template parameter must not deviate from default.");
173 throw std::logic_error(
"Skipping iterators do not support "
175 hnd_.__increment(amount);
179 template<
class T = value_handle>
180 auto operator+(
int rhs) ->
181 typename std::enable_if<
182 sizeof(decltype(std::declval<T>().__increment(rhs),
void (),
int {})) >= 0,
184 static_assert(std::is_same<T, value_handle>::value,
185 "Template parameter must not deviate from default.");
187 throw std::logic_error(
"Skipping iterators do not support "
190 result.hnd_.__increment(rhs);
212 if (hnd_.mesh() && (hnd_.mesh()->*PrimitiveStatusMember)()) {
216 skip_bits_ = status.
bits();
230 assert(hnd_.mesh() && skip_bits_);
231 while ((hnd_.idx() < (
signed) (hnd_.mesh()->*PrimitiveCountMember)())
232 && (hnd_.mesh()->status(hnd_).bits() & skip_bits_))
237 assert(hnd_.mesh() && skip_bits_);
238 while ((hnd_.idx() >= 0) && (hnd_.mesh()->status(hnd_).bits() & skip_bits_))
244 unsigned int skip_bits_;
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
SmartVertexHandle make_smart(VertexHandle _vh, const PolyConnectivity *_mesh)
Creats a SmartVertexHandle from a VertexHandle and a Mesh.
Definition: SmartHandles.hh:256
Definition: IteratorsT.hh:71
Definition: IteratorsT.hh:72
Definition: IteratorsT.hh:73
Definition: IteratorsT.hh:74
Definition: IteratorsT.hh:75
Definition: IteratorsT.hh:76
Definition: IteratorsT.hh:77
Definition: IteratorsT.hh:78
Definition: IteratorsT.hh:82
void disable_skipping()
Turn on skipping: automatically skip deleted/hidden elements.
Definition: IteratorsT.hh:223
GenericIteratorT operator--(int)
Standard post-decrement operator.
Definition: IteratorsT.hh:204
GenericIteratorT(mesh_ref _mesh, value_handle _hnd, bool _skip=false)
Construct with mesh and a target handle.
Definition: IteratorsT.hh:102
GenericIteratorT & operator++()
Standard pre-increment operator.
Definition: IteratorsT.hh:150
GenericIteratorT()
Default constructor.
Definition: IteratorsT.hh:97
pointer operator->() const
Standard pointer operator.
Definition: IteratorsT.hh:114
GenericIteratorT operator++(int)
Standard post-increment operator.
Definition: IteratorsT.hh:158
void enable_skipping()
Turn on skipping: automatically skip deleted/hidden elements.
Definition: IteratorsT.hh:211
reference operator*() const
Standard dereferencing operator.
Definition: IteratorsT.hh:109
bool operator==(const GenericIteratorT &_rhs) const
Are two iterators equal? Only valid if they refer to the same mesh!
Definition: IteratorsT.hh:140
GenericIteratorT & operator--()
Standard pre-decrement operator.
Definition: IteratorsT.hh:196
value_handle handle() const
Get the handle of the item the iterator refers to.
Definition: IteratorsT.hh:124
bool operator!=(const GenericIteratorT &_rhs) const
Not equal?
Definition: IteratorsT.hh:145
Polygonal mesh based on the ArrayKernel.
Definition: PolyMesh_ArrayKernelT.hh:96
Definition: SmartHandles.hh:276
Add status information to a base class.
Definition: Status.hh:95
void set_hidden(bool _b)
set hidden
Definition: Status.hh:123
void set_deleted(bool _b)
set deleted
Definition: Status.hh:105
unsigned int bits() const
return whole status
Definition: Status.hh:151