From 79757328fe83af30d044375f8cd2cdb68b6909cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 16 Nov 2021 22:22:45 +0100 Subject: [PATCH 1/3] create normal map only if normal estimation is done --- .../Point_set/Point_set_normal_estimation_plugin.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp index 9b36f3194be..2f05e738308 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp @@ -202,6 +202,11 @@ void Polyhedron_demo_point_set_normal_estimation_plugin::on_actionNormalEstimati if(item) { + // Gets options + Point_set_demo_normal_estimation_dialog dialog; + if(!dialog.exec()) + return; + // Gets point set Point_set* points = item->point_set(); if(points == nullptr) @@ -209,11 +214,6 @@ void Polyhedron_demo_point_set_normal_estimation_plugin::on_actionNormalEstimati if (!(points->has_normal_map())) points->add_normal_map(); - // Gets options - Point_set_demo_normal_estimation_dialog dialog; - if(!dialog.exec()) - return; - QApplication::setOverrideCursor(Qt::BusyCursor); QApplication::processEvents(); From f61b088576b0b81ada5fc9116477dd2d1286f998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 24 Nov 2021 10:43:07 +0100 Subject: [PATCH 2/3] update applicable filters when an item is updated --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 3 +++ Polyhedron/demo/Polyhedron/MainWindow.h | 1 + 2 files changed, 4 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index b595087b242..ea615a40bcd 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -227,6 +227,9 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), this, SLOT(updateInfo())); + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), + this, SLOT(filterOperations())); + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), this, SLOT(updateDisplayInfo())); diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index 7202c8ac629..99e6bc66b13 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -366,6 +366,7 @@ protected Q_SLOTS: //!Hides not available operations and show available operations in all the //!menus. void filterOperations(bool hide); + void filterOperations(){ filterOperations(false); }; //!Updates the bounding box and moves the camera to fits the scene. void recenterScene(); //!Resizes the header of the scene view From 0ff77b2751d02c244c7cf76a2bc3adbaf68a365f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 24 Nov 2021 11:08:37 +0100 Subject: [PATCH 3/3] simplify connection --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 5 +++-- Polyhedron/demo/Polyhedron/MainWindow.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index ea615a40bcd..641e3a1a9a1 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -227,8 +227,9 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), this, SLOT(updateInfo())); - connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), - this, SLOT(filterOperations())); + connect(scene, &Scene::dataChanged, + this, [this]() { filterOperations(false); }); + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), this, SLOT(updateDisplayInfo())); diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index 99e6bc66b13..7202c8ac629 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -366,7 +366,6 @@ protected Q_SLOTS: //!Hides not available operations and show available operations in all the //!menus. void filterOperations(bool hide); - void filterOperations(){ filterOperations(false); }; //!Updates the bounding box and moves the camera to fits the scene. void recenterScene(); //!Resizes the header of the scene view