Commit cc66cd7d authored by Mike Kremer's avatar Mike Kremer

Critically improved performance when floodfilling mesh in order to count components.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10214 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d8838a1f
......@@ -125,15 +125,17 @@ int componentCount(MeshT* _mesh ) {
_mesh->property(visited, v_it) = false;
typename MeshT::VertexHandle vh;
typename MeshT::VertexIter current_pos = _mesh->vertices_begin();
while( true ){
//find an unvisited vertex
bool found = false;
for (v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it)
for (v_it = current_pos ; v_it != v_end; ++v_it)
if ( !_mesh->property(visited, v_it) ){
found = true;
vh = v_it.handle();
_mesh->property(visited, v_it) = true;
current_pos = v_it;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment