From fc41a09ace9bc9d72e868bf365ac56d0652ca7e1 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 12 Sep 2019 13:58:45 +0200 Subject: [PATCH] Fix deformation+selection bug --- .../Edit_polyhedron_plugin.cpp | 13 +++++++++++-- .../Polyhedron/Scene_polyhedron_selection_item.cpp | 4 +++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp index 24b6bb6281e..72bd09b3bd3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp @@ -565,6 +565,10 @@ void Polyhedron_demo_edit_polyhedron_plugin::importSelection(Scene_polyhedron_se edit_item->insert_roi_vertex(vh); } edit_item->invalidateOpenGLBuffers(); + if(selection_item->property("is_highlighting").toBool()){ + selection_item->setProperty("need_hl_restore", true); + selection_item->set_highlighting(false); + } selection_item->setVisible(false); Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) v->update(); @@ -579,14 +583,19 @@ void Polyhedron_demo_edit_polyhedron_plugin::updateSelectionItems(Scene_facegrap && sel_item->polyhedron() == target->polyhedron()) { sel_item->invalidateOpenGLBuffers(); - if(!ui_widget.RemeshingCheckBox->isChecked()) + if(!ui_widget.RemeshingCheckBox->isChecked()){ sel_item->setVisible(true); + if(sel_item->property("need_hl_restore").toBool()){ + sel_item->set_highlighting(true); + sel_item->setProperty("need_hl_restore", false); + } + } else scene->erase(scene->item_id(sel_item)); } - } } + void Polyhedron_demo_edit_polyhedron_plugin::dispatchAction() { if(applicable(actionDeformation)) diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index b2521146f2e..8c8a1dcab5f 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -1964,8 +1964,10 @@ void Scene_polyhedron_selection_item::validateMoveVertex() viewer->setManipulatedFrame(NULL); invalidateOpenGLBuffers(); poly_item->itemChanged(); - if(property("need_hl_restore").toBool()) + if(property("need_hl_restore").toBool()){ set_highlighting(true); + setProperty("need_hl_restore", false); + } Q_EMIT updateInstructions("Select a vertex. (1/2)"); }