Commit 7def8577 authored by Jan Möbius's avatar Jan Möbius
Browse files

New handle type

parent 4d02cda6
......@@ -65,7 +65,7 @@ ComponentsPlugin::splitComponent( MeshT* _mesh, MeshT* _copy){
_mesh->property(visited, f_it) = false;
}
typename MeshT::FaceHandle fh;
typename OpenMesh::SmartFaceHandle fh;
//Take the first face in the mesh as we only split one component apart
fh = *(_mesh->faces_begin());
......@@ -74,22 +74,20 @@ ComponentsPlugin::splitComponent( MeshT* _mesh, MeshT* _copy){
//if none was found -> finished
if (!fh.is_valid() ) return;
std::vector< typename MeshT::FaceHandle > handles;
std::vector< typename OpenMesh::SmartFaceHandle > handles;
handles.push_back( fh );
//grow from face and collect faces in this component
// grow from face and collect faces in this component
while( handles.size() > 0 ){
typename MeshT::FaceHandle current = handles.back();
typename OpenMesh::SmartFaceHandle current = handles.back();
handles.pop_back();
typename MeshT::FaceFaceIter ff_it;
for (ff_it=_mesh->ff_iter( current ); ff_it.is_valid(); ++ff_it)
if ( ! _mesh->property(visited, *ff_it) ){
_mesh->property(visited, *ff_it) = true;
handles.push_back( *ff_it );
}
for (auto ff_it : current.faces() )
if ( ! _mesh->property(visited, ff_it) ){
_mesh->property(visited, ff_it) = true;
handles.push_back( ff_it );
}
}
//delete the found component from the original mesh and keep it in the copy
......
Supports Markdown
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