From dffa2c143c926e7244aeac424ab2b0e435f73414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 11 Jul 2018 14:05:27 +0200 Subject: [PATCH] indices are not necessarily sorted and depend of user selection --- .../Plugins/PMP/Join_and_split_polyhedra_plugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp index 771cf17ef67..50e5a095d88 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp @@ -103,7 +103,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionJoinPolyhedra_tri std::cerr<<"No selected polyhedron_item"< indices_to_remove; + std::vector 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->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()); Q_FOREACH(int index, indices_to_remove) { scene->erase(index);