yet another small refactoring

This commit is contained in:
Paolo Cignoni 2017-03-13 15:47:55 +01:00
parent ebb747ecf5
commit 18d070f9eb
1 changed files with 4 additions and 13 deletions

View File

@ -84,22 +84,13 @@ protected:
if (CCV.size() == 1) if (CCV.size() == 1)
return ret; return ret;
ConnectedComponentIterator<MeshType> ci;
for(size_t i=0; i<CCV.size(); ++i) for(size_t i=0; i<CCV.size(); ++i)
{ {
// clear selection
UpdateSelection<MeshType>::Clear(mesh); UpdateSelection<MeshType>::Clear(mesh);
for(ci.start(mesh, CCV[i].second); !ci.completed(); ++ci) CCV[i].second->SetS();
{ UpdateSelection<MeshType>::FaceConnectedFF(mesh);
// select all faces for a CC ret.push_back(std::make_shared<MeshType>());
(*ci)->SetS(); Append<MeshType, MeshType>::MeshCopy(*(ret.back()), mesh, true);
}
// create from selected
MeshPtr cc = std::make_shared<MeshType>();
Append<MeshType, MeshType>::MeshCopy(*cc, mesh, true);
ret.push_back(cc);
} }
return ret; return ret;