Unexpected circulator behavior
Hi,
I am currently encountering some unexpected behavior when using circulators. According to the documentation page at
http://www.openmesh.org/media/Documentations/OpenMesh-Doc-Latest/a00026.html
given a vertex handle, I should be able to iterate over the faces around that vertex using the following code:
auto vertex_face_iter(mesh.cvf_iter(vertex_handle));
for (; vertex_face_iter.is_valid(); ++vertex_face_iter)
{
std::cout << vertex_face_iter->idx() << "\n";
}
The code above basically works, the loop just never terminates. When I look at the indices printed, I detect an endless loop over the adjacent faces, e.g.
47833
47838
47834
47842
47833
47838
47834
47842
47833
...
According to the documentation, is_valid() should return false once the cycle is completed, shouldn't it? The documentation says:
"While it is possible to use operator bool(), which returns true, as
long as the circulator hasn't reached the end of the sequence, this
function is deprecated. Use the function is_valid() instead."
I also looked at the issue list and found a recent remark about updating the documentation with respect to CW and CCW circulators, referencing the OpenMesh 4.0 changelog. There, I found a hint stating
"These new iterator versions also fix the problems that
circulators could get valid again, if iterating past the end [...]"
Unfortunately, replacing my existing code with calls to cvf_cwiter() or cvf_ccwiter() does not alter the behavior in any way, the loop is still not terminating.
Any ideas as to what is happening here?
Cheers,
Matthew