From 46c27fdf857359fe886e29f2fc9e790809e6cbbd Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 29 Apr 2016 12:23:39 +0200 Subject: [PATCH] fix for segfaults after reload from itefix for segfaults after reload from itemm --- .../Plugins/PMP/Selection_plugin.cpp | 3 +++ .../Scene_polyhedron_selection_item.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index 6ccd523992e..1e0589d9286 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -220,6 +220,9 @@ public Q_SLOTS: scene->setSelectedItem(item_id); on_ModeBox_changed(ui_widget.modeBox->currentIndex()); on_Selection_type_combo_box_changed(ui_widget.Selection_type_combo_box->currentIndex()); + ui_widget.modeBox->setCurrentIndex(0); + on_ModeBox_changed(0); + } void on_Selection_type_combo_box_changed(int index) { typedef Scene_polyhedron_selection_item::Active_handle Active_handle; diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index 7d8423d825d..9f5b16694ca 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -728,7 +728,7 @@ bool Scene_polyhedron_selection_item::treat_selection(const std::setjoin_vertex(target); - temp_selected_edges.erase(to_join_ed); + temp_selected_edges.clear(); //set to select edge set_active_handle_type(static_cast(2)); tempInstructions("Vertices joined.", @@ -831,8 +831,8 @@ bool Scene_polyhedron_selection_item::treat_selection(const std::set(1)); @@ -1087,8 +1087,8 @@ bool Scene_polyhedron_selection_item:: treat_selection(const std::setvertex()); + temp_selected_edges.clear(); + temp_selected_vertices.clear(); invalidateOpenGLBuffers(); polyhedron_item()->invalidateOpenGLBuffers(); tempInstructions("Face and vertex added.", @@ -1192,8 +1192,8 @@ bool Scene_polyhedron_selection_item:: treat_selection(const std::setvertex()); - temp_selected_edges.erase(edge(t,*polyhedron())); + temp_selected_vertices.clear(); + temp_selected_edges.clear(); invalidateOpenGLBuffers(); polyhedron_item()->invalidateOpenGLBuffers(); tempInstructions("Face added.", @@ -1280,7 +1280,7 @@ bool Scene_polyhedron_selection_item::treat_selection(const std::setfacet()); + temp_selected_facets.clear(); Polyhedron::Point_3 p1t = h1->vertex()->point(); Polyhedron::Point_3 p1s = h1->opposite()->vertex()->point(); double x = p1t.x() + 0.01 * (p1s.x() - p1t.x()); @@ -1288,7 +1288,7 @@ bool Scene_polyhedron_selection_item::treat_selection(const std::setopposite()->vertex()->point() = Polyhedron::Point_3(x,y,z);; first_selected = false; - temp_selected_vertices.erase(to_split_vh); + temp_selected_vertices.clear(); invalidateOpenGLBuffers(); //reset selection mode set_active_handle_type(static_cast(0));