From 87f16a5fa209a596a0f95b8cacca9a3e8ef02675 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 21 Jan 2020 11:04:49 +0100 Subject: [PATCH 1/5] Add menu Operations to the menu even if several items are selected. --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 17ec86d1207..f9ca5b31677 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1493,6 +1493,7 @@ void MainWindow::showSceneContextMenu(int selectedItemIndex, } } menu->addMenu(ui->menuOperations); + if(menu) menu->exec(global_pos); } @@ -1755,6 +1756,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) { QAction* saveas = menu.addAction(tr("&Save as...")); connect(saveas, SIGNAL(triggered()), this, SLOT(on_actionSaveAs_triggered())); + menu.addMenu(ui->menuOperations); menu.exec(sender->mapToGlobal(p)); return; } From 26492a97504a7823f4faec087fd9c26418ca366d Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 21 Jan 2020 14:25:09 +0100 Subject: [PATCH 2/5] Don't rescale the frustum when visibility changes. --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index f9ca5b31677..9db867b1a6e 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -2191,7 +2191,7 @@ void MainWindow::on_actionShowHide_triggered() item->redraw(); } scene->setUpdatesEnabled(true); - updateViewersBboxes(false); +// updateViewersBboxes(false); //Not usable :when the scene changes scale, smaller items disappear. } void MainWindow::on_actionSetPolyhedronA_triggered() From c9fd5822e9c767dd2313bc289f87205a905507e6 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 31 Jan 2020 13:12:03 +0100 Subject: [PATCH 3/5] Fix crash in shuffle_mesh() --- Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp | 4 ++-- Polyhedron/demo/Polyhedron/Scene.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp index 265507b8a9c..6d2d062e002 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp @@ -223,8 +223,8 @@ void Polyhedron_demo_orient_soup_plugin::apply_shuffle( Item* root_item, item->load(root_item); item->shuffle_orientations(); item->setColor(root_item->color()); - scene->replaceItem(index, item); - delete root_item; + scene->replaceItem(index, item, true); + root_item->deleteLater(); QApplication::restoreOverrideCursor(); } diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index 5425285d9ed..4730d595adb 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -143,6 +143,7 @@ Scene::replaceItem(Scene::Item_id index, CGAL::Three::Scene_item* item, bool emi if(emit_item_about_to_be_destroyed) { Q_EMIT itemAboutToBeDestroyed(item); + item->aboutToBeDestroyed(); } Q_EMIT updated(); From 354a3ef670d9f65952329988762c9226ad115983 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 31 Jan 2020 13:13:41 +0100 Subject: [PATCH 4/5] Don't forget to clear() the positions_grid in c3t3_item --- Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 9ad4cfa9dc2..2c383d3b8ed 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -1453,6 +1453,7 @@ void Scene_c3t3_item_priv::computeElements() } positions_poly.clear(); + positions_grid.clear(); normals.clear(); f_colors.clear(); positions_lines.clear(); From c51c7792b84e1b0039d9fb4afc872a38fcfc14cb Mon Sep 17 00:00:00 2001 From: Mael Date: Mon, 10 Feb 2020 10:47:55 +0100 Subject: [PATCH 5/5] Fix grid generation ignoring z coordinates --- .../demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp index 269eb121ae4..4d92aeb7867 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp @@ -766,7 +766,7 @@ struct Point_generator { return Point(bl.x() + i*(ur.x()-bl.x())/(w-1), bl.y() + j*(ur.y()-bl.y())/(h-1), - 0); + bl.z() + j*(ur.z()-bl.z())/(h-1)); } }; template