Merge pull request #3222 from sloriot/Demo-join_fix

Fix join plugin
This commit is contained in:
Laurent Rineau 2018-07-16 11:12:50 +02:00
commit 2aff50e027
1 changed files with 3 additions and 2 deletions

View File

@ -103,7 +103,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionJoinPolyhedra_tri
std::cerr<<"No selected polyhedron_item"<<std::endl;
return;
}
QList<int> indices_to_remove;
std::vector<int> indices_to_remove;
Q_FOREACH(int index, scene->selectionIndices()) {
if (index == mainSelectionIndex)
continue;
@ -112,7 +112,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionJoinPolyhedra_tri
qobject_cast<Scene_facegraph_item*>(scene->item(index));
if(item)
{
indices_to_remove.push_front(index);
indices_to_remove.push_back(index);
CGAL::copy_face_graph(*item->polyhedron(), *mainSelectionItem->polyhedron());
}
else
@ -122,6 +122,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionJoinPolyhedra_tri
scene->itemChanged(mainSelectionIndex);
//remove the other items
std::sort(indices_to_remove.begin(), indices_to_remove.end(), std::greater<int>());
Q_FOREACH(int index, indices_to_remove)
{
scene->erase(index);