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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -76,10 +76,10 @@ public:
|
||||
*/
|
||||
//@{
|
||||
/// Linear iterator
|
||||
typedef Iterators::GenericIteratorT<This, This::VertexHandle, ArrayKernel, &This::has_vertex_status> VertexIter;
|
||||
typedef Iterators::GenericIteratorT<This, This::HalfedgeHandle, ArrayKernel, &This::has_halfedge_status> HalfedgeIter;
|
||||
typedef Iterators::GenericIteratorT<This, This::EdgeHandle, ArrayKernel, &This::has_edge_status> EdgeIter;
|
||||
typedef Iterators::GenericIteratorT<This, This::FaceHandle, ArrayKernel, &This::has_face_status> FaceIter;
|
||||
typedef Iterators::GenericIteratorT<This, This::VertexHandle, ArrayKernel, &This::has_vertex_status, &This::n_vertices> VertexIter;
|
||||
typedef Iterators::GenericIteratorT<This, This::HalfedgeHandle, ArrayKernel, &This::has_halfedge_status, &This::n_halfedges> HalfedgeIter;
|
||||
typedef Iterators::GenericIteratorT<This, This::EdgeHandle, ArrayKernel, &This::has_edge_status, &This::n_edges> EdgeIter;
|
||||
typedef Iterators::GenericIteratorT<This, This::FaceHandle, ArrayKernel, &This::has_face_status, &This::n_faces> FaceIter;
|
||||
|
||||
typedef VertexIter ConstVertexIter;
|
||||
typedef HalfedgeIter ConstHalfedgeIter;
|
||||
|
||||
Reference in New Issue
Block a user