From 01252a3d7dc1df55c32b12cba14611417428846e Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 10 Sep 2019 12:03:48 +0200 Subject: [PATCH 1/3] Fix no_interpolation_program declaration --- Polyhedron/demo/Polyhedron/Viewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Viewer.cpp b/Polyhedron/demo/Polyhedron/Viewer.cpp index 2594e35da51..cc5cb24d158 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.cpp +++ b/Polyhedron/demo/Polyhedron/Viewer.cpp @@ -1354,8 +1354,8 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const return 0; } QOpenGLShaderProgram* program = declare_program(name, - ":/cgal/Polyhedron_3/resources/solid_wireframe_shader.vert", - ":/cgal/Polyhedron_3/resources/solid_wireframe_shader.frag"); + ":/cgal/Polyhedron_3/resources/no_interpolation_shader.vert", + ":/cgal/Polyhedron_3/resources/no_interpolation_shader.frag"); program->setProperty("hasLight", true); program->setProperty("hasNormals", true); program->setProperty("drawLinesAdjacency", true); From 9383a7607cfc411c03076295f45c5c322bb5b39a Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 10 Sep 2019 12:17:02 +0200 Subject: [PATCH 2/3] Keep the user from saving an invalid c3t3 file. --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 2f203b52541..4a7c004be2b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -196,6 +196,11 @@ Polyhedron_demo_c3t3_binary_io_plugin:: save(QFileInfo fileinfo, QList &items) { Scene_item* item = items.front(); + if(!qobject_cast(item)->is_valid()) + { + QMessageBox::warning(CGAL::Three::Three::mainWindow(), "", "The c3t3_item is not valid. You cannot save it."); + return false; + } const Scene_c3t3_item* c3t3_item = qobject_cast(item); if ( NULL == c3t3_item ) { From fc41a09ace9bc9d72e868bf365ac56d0652ca7e1 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 12 Sep 2019 13:58:45 +0200 Subject: [PATCH 3/3] 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)"); }