Fixed another bug in the new consolidated iterator. Unit tests seem to be passing, now.

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@550 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Hans-Christian Ebke
2012-03-01 17:27:38 +00:00
parent 62ef24047a
commit d44c4bedf7
2 changed files with 8 additions and 8 deletions

View File

@@ -77,7 +77,7 @@ template <class Mesh> class ConstFaceIterT;
template <class Mesh> class FaceIterT;
template <class Mesh, class ValueHandle, class PrimitiveStatusFnOwner, bool (PrimitiveStatusFnOwner::*PrimitiveStatusFn)() const>
template <class Mesh, class ValueHandle, class MemberOwner, bool (MemberOwner::*PrimitiveStatusMember)() const, uint (MemberOwner::*PrimitiveCountMember)() const>
class GenericIteratorT {
public:
//--- Typedefs ---
@@ -103,7 +103,7 @@ class GenericIteratorT {
if (_skip) enable_skipping();
// Set vertex handle invalid if the mesh contains no vertex
if(_mesh.n_vertices() == 0) hnd_ = value_handle(-1);
if((mesh_->*PrimitiveCountMember)() == 0) hnd_ = value_handle(-1);
}
/// Standard dereferencing operator.
@@ -154,7 +154,7 @@ class GenericIteratorT {
/// Turn on skipping: automatically skip deleted/hidden elements
void enable_skipping() {
if (mesh_ && (mesh_->*PrimitiveStatusFn)()) {
if (mesh_ && (mesh_->*PrimitiveStatusMember)()) {
Attributes::StatusInfo status;
status.set_deleted(true);
status.set_hidden(true);
@@ -173,7 +173,7 @@ class GenericIteratorT {
void skip_fwd() {
assert(mesh_ && skip_bits_);
while ((hnd_.idx() < (signed) mesh_->n_vertices())
while ((hnd_.idx() < (signed) (mesh_->*PrimitiveCountMember)())
&& (mesh_->status(hnd_).bits() & skip_bits_))
hnd_.__increment();
}