From 6dccde35eff840ec22470fee4dc9f73e9cf65691 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 13 Jan 2020 16:20:51 +0100 Subject: [PATCH 1/7] Fix c++11 errors --- .../Surface_mesh_shortest_path/Surface_mesh_shortest_path.h | 6 +++--- .../CGAL/Surface_mesh_shortest_path/function_objects.h | 2 +- .../Surface_mesh_shortest_path_test_6.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index bb797e5e5bc..6f1a465df7f 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -1201,7 +1201,7 @@ private: if (m_debugOutput) { std::cout << "\t Distance to target: " << currentNodeDistance << std::endl; - std::cout << "\t Is there a current occupier? " << (currentOccupier.first != nullptr) << std::endl; + std::cout << "\t Is there a current occupier? " << (currentOccupier.first != NULL) << std::endl; } // the relative position of the ray between node.source() and node.target_vertex() and the ray @@ -1329,7 +1329,7 @@ private: } // If equal times, give priority to vertex sources since it's cleaner and simpler to handle than interval windows - if (currentClosest.first == nullptr || + if (currentClosest.first == NULL || currentClosest.second > currentNodeDistance || (currentClosest.second == currentNodeDistance && node->node_type() == Cone_tree_node::VERTEX_SOURCE)) { @@ -2070,7 +2070,7 @@ private: std::cout << "Prio Queue size = " << m_expansionPriqueue.size() << std::endl; std::cout << "Queue:" << std::endl; - auto duplicate_queue = m_expansionPriqueue; + Expansion_priqueue duplicate_queue = m_expansionPriqueue; while(duplicate_queue.size() > 0) { Cone_expansion_event* event = duplicate_queue.top(); diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h index de838369d8b..86fa5a05379 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h @@ -622,7 +622,7 @@ public: { FT angle_sum = 0; - for(halfedge_descriptor h : halfedges_around_target(v, g)) + BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(v, g)) { if(is_border(h, g)) continue; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_6.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_6.cpp index 71d52570350..7737f99627a 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_6.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_6.cpp @@ -22,8 +22,8 @@ int main() input >> mesh; input.close(); - for (Triangle_mesh::Vertex_index v1 : vertices(mesh)) - for (Triangle_mesh::Vertex_index v2 : vertices(mesh)) + BOOST_FOREACH(Triangle_mesh::Vertex_index v1, vertices(mesh)) + BOOST_FOREACH(Triangle_mesh::Vertex_index v2, vertices(mesh)) { Surface_mesh_shortest_path shortest_paths(mesh); shortest_paths.add_source_point(v1); From 2bb22ad954dd0435356edc99064f33b3afa6bdea Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 2 Jan 2020 10:00:05 +0100 Subject: [PATCH 2/7] Replace `QTime`s by `QElapsedTimer`s. It seems the header of QTime has been deprecated but it has not been documented... --- GraphicsView/include/CGAL/Qt/manipulatedFrame.h | 3 ++- GraphicsView/include/CGAL/Qt/qglviewer.h | 4 ++-- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/manipulatedFrame.h b/GraphicsView/include/CGAL/Qt/manipulatedFrame.h index ca3102713ee..c6e9a67e90e 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedFrame.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedFrame.h @@ -29,6 +29,7 @@ #include #include #include +#include namespace CGAL{ namespace qglviewer { @@ -356,7 +357,7 @@ private: qreal zoomSensitivity_; // Mouse speed and spinning - QTime last_move_time; + QElapsedTimer last_move_time; qreal mouseSpeed_; int delay_; bool isSpinning_; diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index 17b91c38b45..48a26f3b602 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -1034,7 +1034,7 @@ protected: int animationTimerId_; // F P S d i s p l a y - QTime fpsTime_; + QElapsedTimer fpsTime_; unsigned int fpsCounter_; QString fpsString_; qreal f_p_s_; diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index b9e7e8bc90e..a1e6204606a 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -54,6 +54,7 @@ #include #include #include +#include namespace CGAL{ // Static private variable @@ -2240,7 +2241,7 @@ void CGAL::QGLViewer::keyPressEvent(QKeyEvent *e) { unsigned int index = pathIndex_[::Qt::Key(key)]; // not safe, but try to double press on two viewers at the same time ! - static QTime doublePress; + static QElapsedTimer doublePress; if (modifiers == playPathKeyboardModifiers()) { int elapsed = doublePress.restart(); From 3debd4813e58fe086bf85bef98665df1f100ff5a Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 9 Jan 2020 09:55:26 +0100 Subject: [PATCH 3/7] Use QVaraitn::fromValue() --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 930c3529fd2..596d89018c7 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1399,11 +1399,11 @@ void MainWindow::showSceneContextMenu(int selectedItemIndex, this, SLOT(reloadItem())); } QAction* saveas = menu->addAction(tr("&Save as...")); - saveas->setData(qVariantFromValue((void*)item)); + saveas->setData(QVariant::fromValue((void*)item)); connect(saveas, SIGNAL(triggered()), this, SLOT(on_actionSaveAs_triggered())); QAction* showobject = menu->addAction(tr("&Zoom to this Object")); - showobject->setData(qVariantFromValue((void*)item)); + showobject->setData(QVariant::fromValue((void*)item)); connect(showobject, SIGNAL(triggered()), this, SLOT(viewerShowObject())); From 93c22473357aae4db36f3d7af01c6f6010338050 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 9 Jan 2020 14:11:50 +0100 Subject: [PATCH 4/7] Replace all QTimers --- .../demo/Periodic_Lloyd_3/MainWindow.cpp | 14 ++++++------- Polyhedron/demo/Polyhedron/MainWindow.cpp | 2 +- .../Plugins/AABB_tree/Cut_plugin.cpp | 4 ++-- .../Convex_decomposition/Nef_plugin.cpp | 10 +++++----- .../Convex_hull/Convex_hull_plugin.cpp | 4 ++-- .../Plugins/Mesh_2/Mesh_2_plugin.cpp | 6 +++--- .../Plugins/Mesh_3/Meshing_thread.cpp | 4 ++-- .../Plugins/Mesh_3/Optimizer_thread.cpp | 4 ++-- .../Partition_graph_plugin.cpp | 2 +- .../Plugins/PCA/Affine_transform_plugin.cpp | 2 +- .../Polyhedron/Plugins/PMP/Fairing_plugin.cpp | 2 +- .../Plugins/PMP/Hole_filling_plugin.cpp | 2 +- .../PMP/Isotropic_remeshing_plugin.cpp | 8 ++++---- .../Mean_curvature_flow_skeleton_plugin.cpp | 20 +++++++++---------- .../Plugins/PMP/Polyhedron_slicer_plugin.cpp | 6 +++--- .../PMP/Random_perturbation_plugin.cpp | 4 ++-- .../PMP/Surface_intersection_plugin.cpp | 8 ++++---- .../Surface_reconstruction_plugin.cpp | 2 +- .../Subdivision_methods_plugin.cpp | 10 +++++----- .../Mesh_plane_detection_plugin.cpp | 4 ++-- .../Surface_mesh/Mesh_segmentation_plugin.cpp | 6 +++--- .../Mesh_simplification_plugin.cpp | 4 ++-- .../Surface_mesh/Parameterization_plugin.cpp | 4 ++-- .../Scene_polyhedron_shortest_path_item.cpp | 2 +- .../Surface_mesh/Shortest_path_plugin.cpp | 2 +- .../Surface_mesh_approximation_plugin.cpp | 4 ++-- .../Scene_edit_polyhedron_item.cpp | 2 +- Surface_mesher/demo/Surface_mesher/volume.cpp | 6 +++--- 28 files changed, 74 insertions(+), 74 deletions(-) diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp index 6fd19cdf7c9..6c6a6e25659 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp @@ -16,8 +16,8 @@ MainWindow::MainWindow(QWidget* parent): CGAL::Qt::DemosMainWindow(parent) scene.eight_copies=false; scene.two_dimensional=false; - qtimer = new QTimer(this); - connect(qtimer, SIGNAL(timeout()), this, SLOT(lloydStep())); + QTimer = new QTimer(this); + connect(QTimer, SIGNAL(timeout()), this, SLOT(lloydStep())); } void @@ -65,9 +65,9 @@ MainWindow::togglePause(bool p) { if (p) { int speed = (100-(speedSlider->value()))*100; - qtimer->start(speed); + QTimer->start(speed); } - else qtimer->stop(); + else QTimer->stop(); } void @@ -158,9 +158,9 @@ void MainWindow::speedChanged(int i) { int speed = (100-i)*100; - if (qtimer->isActive()) { - qtimer->stop(); - qtimer->start(speed); + if (QTimer->isActive()) { + QTimer->stop(); + QTimer->start(speed); } } diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 596d89018c7..feaeea7a004 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #ifdef QT_SCRIPT_LIB diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp index 7b46387398b..05df529adad 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp @@ -23,7 +23,7 @@ #include -#include +#include #include #include @@ -1370,7 +1370,7 @@ void Polyhedron_demo_cut_plugin::computeIntersection() Simple_kernel::Plane_3 plane(n[0], n[1], n[2], - n * pos); //std::cerr << plane << std::endl; edges_item->edges.clear(); - QTime time; + QElapsedTimer time; time.start(); bool does_intersect = false; for(Facet_sm_trees::iterator it = facet_sm_trees.begin(); it != facet_sm_trees.end(); ++it) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp index 2d932bed12c..f93d72df11d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include using namespace CGAL::Three; class Polyhedron_demo_nef_plugin : @@ -115,7 +115,7 @@ Polyhedron_demo_nef_plugin::on_actionToNef_triggered() } QApplication::setOverrideCursor(Qt::WaitCursor); - QTime time; + QElapsedTimer time; time.start(); std::cerr << "Convert facegraph to nef polyhedron..."; @@ -146,7 +146,7 @@ Polyhedron_demo_nef_plugin::on_actionConvexDecomposition_triggered() : qobject_cast(scene->item(index)); QApplication::restoreOverrideCursor(); if(item) { - QTime time; + QElapsedTimer time; time.start(); std::cerr << "Convex decomposition..."; @@ -188,7 +188,7 @@ Polyhedron_demo_nef_plugin::on_actionToPoly_triggered() if(item) { QApplication::setOverrideCursor(Qt::WaitCursor); - QTime time; + QElapsedTimer time; time.start(); std::cerr << "Convert nef polyhedron to facegraph..."; @@ -277,7 +277,7 @@ void Polyhedron_demo_nef_plugin::boolean_operation(const Boolean_operation opera // perform Boolean operation std::cout << "Boolean operation..."; - QTime time; + QElapsedTimer time; time.start(); switch(operation) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp index 860b88e4461..3722f916e42 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -74,7 +74,7 @@ void Polyhedron_demo_convex_hull_plugin::on_actionConvexHull_triggered() // wait cursor QApplication::setOverrideCursor(Qt::WaitCursor); - QTime time; + QElapsedTimer time; time.start(); std::cout << "Convex hull..."; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp index b00669c131a..2f07bed6bc3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp @@ -35,7 +35,7 @@ #include -#include +#include #include #include #include @@ -267,14 +267,14 @@ private: typedef CGAL::Delaunay_mesh_size_criteria_2 Criteria; typedef CGAL::Delaunay_mesher_2 Mesher; - QTime time; // global timer + QElapsedTimer time; // global timer time.start(); std::cout << " Building Constrained_Delaunay_triangulation_2..." << std::flush; CDT cdt; - QTime ltime; //local timer + QElapsedTimer ltime; //local timer ltime.start(); double constant_coordinate = polylines_items.back()->polylines.back().back()[constant_coordinate_index]; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Meshing_thread.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Meshing_thread.cpp index 54e31d5d0a1..19e2a4ef3f3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Meshing_thread.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Meshing_thread.cpp @@ -25,7 +25,7 @@ #include "config.h" -#include +#include #include #include "Meshing_thread.h" @@ -61,7 +61,7 @@ void Meshing_thread:: run() { - QTime timer; + QElapsedTimer timer; timer.start(); CGAL::Three::Three::CursorScopeGuard guard(Qt::BusyCursor); f_->launch(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimizer_thread.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimizer_thread.cpp index 38c397dab09..ebad67f57bb 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimizer_thread.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimizer_thread.cpp @@ -25,7 +25,7 @@ #include "config_mesh_3.h" -#include +#include #include #include "Optimizer_thread.h" #include "Scene_c3t3_item.h" @@ -56,7 +56,7 @@ void Optimizer_thread:: run() { - QTime timer; + QElapsedTimer timer; timer.start(); //SEGFAULT rc_ = f_->launch(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp index c2b390a14bd..4d89a8a8316 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include typedef Scene_surface_mesh_item Scene_facegraph_item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp index d55d517ddea..b83d8e42161 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include "ui_Transformation_widget.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp index d54a23fb011..fa9293655fc 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp @@ -14,7 +14,7 @@ typedef Scene_surface_mesh_item Scene_facegraph_item; #include #include -#include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp index 76764b80c23..0d71e1e77a9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp index 9aa174d01f7..e9c0e9f6256 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -340,7 +340,7 @@ public Q_SLOTS: // wait cursor QApplication::setOverrideCursor(Qt::WaitCursor); - QTime time; + QElapsedTimer time; time.start(); typedef boost::graph_traits::edge_descriptor edge_descriptor; @@ -698,7 +698,7 @@ public Q_SLOTS: detect_and_split_duplicates(selection, edges_to_protect, target_length); #ifdef CGAL_LINKED_WITH_TBB - QTime time; + QElapsedTimer time; time.start(); tbb::parallel_for( @@ -714,7 +714,7 @@ public Q_SLOTS: target_length, nb_iter, protect, smooth_features); BOOST_FOREACH(Scene_facegraph_item* poly_item, selection) { - QTime time; + QElapsedTimer time; time.start(); remesher(poly_item, edges_to_protect[poly_item->polyhedron()]); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp index 3e72878e7ea..514fb87b411 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include @@ -368,7 +368,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionSegment() if (num_vertices(item->skeleton_curve)==0 ) { QApplication::restoreOverrideCursor(); return;} QApplication::setOverrideCursor(Qt::WaitCursor); - QTime time; + QElapsedTimer time; time.start(); // init the polyhedron simplex indices @@ -461,7 +461,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionConvert_to_me if ( !is_mesh_valid(pMesh) ) return; - QTime time; + QElapsedTimer time; time.start(); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -499,7 +499,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionContract() return; } - QTime time; + QElapsedTimer time; time.start(); std::cout << "Contract...\n"; QApplication::setOverrideCursor(Qt::WaitCursor); @@ -524,7 +524,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionCollapse() return; } - QTime time; + QElapsedTimer time; time.start(); std::cout << "Collapse...\n"; QApplication::setOverrideCursor(Qt::WaitCursor); @@ -550,7 +550,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionSplit() return; } - QTime time; + QElapsedTimer time; time.start(); std::cout << "Split...\n"; QApplication::setOverrideCursor(Qt::WaitCursor); @@ -575,7 +575,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionDegeneracy() return; } - QTime time; + QElapsedTimer time; time.start(); std::cout << "Detect degeneracy...\n"; QApplication::setOverrideCursor(Qt::WaitCursor); @@ -626,7 +626,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionRun() return; } - QTime time; + QElapsedTimer time; time.start(); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -749,7 +749,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionSkeletonize() return; } - QTime time; + QElapsedTimer time; time.start(); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -810,7 +810,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionConverge() return; } - QTime time; + QElapsedTimer time; time.start(); QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp index dea7f885bb3..ed060c27bee 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -287,7 +287,7 @@ void Polyhedron_demo_polyhedron_slicer_plugin::on_Generate_button_clicked() if(!new_polyline_item_for_polylines) { Scene_polylines_item* new_polylines_item = new Scene_polylines_item(); - QTime time; time.start(); + QElapsedTimer time; time.start(); // call algorithm and fill polylines in polylines_item intersection_of_plane_Polyhedra_3_using_AABB_wrapper(*smesh, planes, plane_positions, new_polylines_item->polylines); // set names etc and print timing @@ -301,7 +301,7 @@ void Polyhedron_demo_polyhedron_slicer_plugin::on_Generate_button_clicked() scene->addItem(new_polylines_item); } else { - QTime time; time.start(); + QElapsedTimer time; time.start(); std::list > polylines; // call algorithm and fill polylines in polylines_item intersection_of_plane_Polyhedra_3_using_AABB_wrapper(*smesh, planes, plane_positions, polylines); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp index 7a12447e978..b34509590e4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -94,7 +94,7 @@ public Q_SLOTS: // wait cursor QApplication::setOverrideCursor(Qt::WaitCursor); - QTime time; + QElapsedTimer time; time.start(); std::cout << "Perturbation..." << std::endl; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp index f437347ab0d..84a33065f42 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include typedef Scene_surface_mesh_item Scene_face_graph_item; @@ -131,7 +131,7 @@ void Polyhedron_demo_intersection_plugin::intersectionSurfaces() Scene_polylines_item* new_item = new Scene_polylines_item(); // perform Boolean operation - QTime time; + QElapsedTimer time; time.start(); try{ @@ -194,7 +194,7 @@ void Polyhedron_demo_intersection_plugin::intersectionPolylines() Scene_points_with_normal_item* new_point_item = new Scene_points_with_normal_item(); Scene_polylines_item* new_pol_item = new Scene_polylines_item(); // perform Boolean operation - QTime time; + QElapsedTimer time; time.start(); std::vector polyA, polyB; Q_FOREACH(const Polyline_3& poly, itemA->polylines) @@ -290,7 +290,7 @@ void Polyhedron_demo_intersection_plugin::intersectionSurfacePolyline() Scene_points_with_normal_item* new_point_item = new Scene_points_with_normal_item(); Scene_polylines_item* new_pol_item = new Scene_polylines_item(); // perform Boolean operation - QTime time; + QElapsedTimer time; time.start(); Scene_face_graph_item::Face_graph tm = *itemA->face_graph(); std::vector Afaces; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp index f5dcb92714a..98bff0c0a32 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp index 0d00de8eb16..cdb67ae214c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -81,7 +81,7 @@ template void Polyhedron_demo_subdivision_methods_plugin::apply_loop(FaceGraphItem* item, int nb_steps) { typename FaceGraphItem::Face_graph* graph = item->face_graph(); - QTime time; + QElapsedTimer time; time.start(); CGAL::Three::Three::information("Loop subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -113,7 +113,7 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_catmullclark(FaceGraphIte { typename FaceGraphItem::Face_graph* graph = item->face_graph(); if(!graph) return; - QTime time; + QElapsedTimer time; time.start(); CGAL::Three::Three::information("Catmull-Clark subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -143,7 +143,7 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_sqrt3(FaceGraphItem* item { typename FaceGraphItem::Face_graph* graph = item->face_graph(); if(!graph) return; - QTime time; + QElapsedTimer time; time.start(); CGAL::Three::Three::information("Sqrt-3 subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -175,7 +175,7 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_doosabin(FaceGraphItem* i { typename FaceGraphItem::Face_graph* graph = item->face_graph(); if(!graph) return; - QTime time; + QElapsedTimer time; time.start(); CGAL::Three::Three::information("Doo-Sabin subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp index 28de24b4acc..f1748635b1f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -196,7 +196,7 @@ void Polyhedron_demo_mesh_plane_detection_plugin::on_actionPlaneDetection_trigge if(dialog.exec() == QDialog::Rejected) return; - QTime time; + QElapsedTimer time; time.start(); std::cerr << "Detecting planes... "; QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp index 02b3740984f..3bab0f6b349 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -210,7 +210,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_SDF_button_clicked(Facegrap typename boost::property_map::type fidmap = get(CGAL::face_index, *pair->first->face_graph()); FaceGraph_with_id_to_vector_property_map sdf_pmap(&pair->second, fidmap); - QTime time; + QElapsedTimer time; time.start(); std::pair min_max_sdf = sdf_values(*(pair->first->face_graph()), sdf_pmap, cone_angle, number_of_rays); std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; @@ -283,7 +283,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_Partition_button_clicked(Fa QApplication::setOverrideCursor(Qt::WaitCursor); } check_and_set_ids(pair->first->face_graph()); - QTime time; + QElapsedTimer time; time.start(); typename boost::property_map::type fidmap = get(CGAL::face_index, *pair->first->face_graph()); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp index 1bff2f5dfc2..9c1a39d172a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include @@ -137,7 +137,7 @@ void Polyhedron_demo_mesh_simplification_plugin::on_actionSimplify_triggered() return; // simplify - QTime time; + QElapsedTimer time; time.start(); std::cout << "Simplify..."; QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp index bfd1c597ff7..6c3ca9268bf 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -11,7 +11,7 @@ #include #include #include "Scene.h" -#include +#include #include #include #include @@ -594,7 +594,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio ////////// PARAMETERIZE /////////// /////////////////////////////////// - QTime time; + QElapsedTimer time; time.start(); // add textured polyhedon to the scene diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp index 9df5eec30ac..8fec5feea29 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp @@ -445,7 +445,7 @@ bool Scene_polyhedron_shortest_path_item_priv::run_point_select(const Ray_3& ray CGAL::Three::Three::information(QObject::tr("Computing shortest path polyline...")); - QTime time; + QElapsedTimer time; time.start(); //~ m_shortestPaths->m_debugOutput=true; m_shortestPaths->shortest_path_points_to_source_points(faceLocation.first, faceLocation.second, std::back_inserter(polylines->polylines.back())); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp index b411c8c6a17..c54a1d7d8db 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp index 1712959d7f1..84c7aba5604 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -303,7 +303,7 @@ void Polyhedron_demo_surface_mesh_approximation_plugin::on_buttonSeeding_clicked approx.set_metric(static_cast( ui_widget.comboMetric->currentIndex())); - QTime time; + QElapsedTimer time; time.start(); approx.initialize_seeds(CGAL::parameters::seeding_method( static_cast(ui_widget.comboMethod->currentIndex())) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp index f961417eca1..9eff46031e2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include diff --git a/Surface_mesher/demo/Surface_mesher/volume.cpp b/Surface_mesher/demo/Surface_mesher/volume.cpp index ef025f9ca6a..7e7fb8bd3c7 100644 --- a/Surface_mesher/demo/Surface_mesher/volume.cpp +++ b/Surface_mesher/demo/Surface_mesher/volume.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -709,7 +709,7 @@ void Volume::display_marchin_cube() #ifdef CGAL_SURFACE_MESH_DEMO_USE_MARCHING_CUBE if(m_surface_mc.empty()) { - QTime total_time; + QElapsedTimer total_time; total_time.start(); values_list->save_values(fileinfo.absoluteFilePath()); @@ -825,7 +825,7 @@ void Volume::display_surface_mesher_result() m_view_surface) // Or it is computed and displayed, and one want // to recompute it. { - QTime total_time; + QElapsedTimer total_time; total_time.start(); values_list->save_values(fileinfo.absoluteFilePath()); From c1acf50252804bbced81693de02373876aed8665 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 9 Jan 2020 15:01:58 +0100 Subject: [PATCH 5/7] clean-up P3T3 demo --- .../demo/Periodic_Lloyd_3/MainWindow.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp index 6c6a6e25659..9d82538f863 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp @@ -16,8 +16,8 @@ MainWindow::MainWindow(QWidget* parent): CGAL::Qt::DemosMainWindow(parent) scene.eight_copies=false; scene.two_dimensional=false; - QTimer = new QTimer(this); - connect(QTimer, SIGNAL(timeout()), this, SLOT(lloydStep())); + qtimer= new QTimer(this); + connect(qtimer, SIGNAL(timeout()), this, SLOT(lloydStep())); } void @@ -65,9 +65,9 @@ MainWindow::togglePause(bool p) { if (p) { int speed = (100-(speedSlider->value()))*100; - QTimer->start(speed); + qtimer->start(speed); } - else QTimer->stop(); + else qtimer->stop(); } void @@ -158,9 +158,9 @@ void MainWindow::speedChanged(int i) { int speed = (100-i)*100; - if (QTimer->isActive()) { - QTimer->stop(); - QTimer->start(speed); + if (qtimer->isActive()) { + qtimer->stop(); + qtimer->start(speed); } } From fd1a14d74e97f13fb3ce0f035f39d78547fa4254 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 13 Jan 2020 15:52:36 +0100 Subject: [PATCH 6/7] remove obsolete hint fon antialiasing --- GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h index 05e39d7bc47..199eff0f31c 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h @@ -204,7 +204,6 @@ void DemosMainWindow::setUseAntialiasing(bool checked) { view->setRenderHint(QPainter::Antialiasing, checked); - view->setRenderHint(QPainter::HighQualityAntialiasing, checked); statusBar()->showMessage(tr("Antialiasing %1activated").arg(checked?"":"de-"), 1000); From ddbfdfcfa90468f3f62f4c3b449fc26db7a74a2f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 13 Jan 2020 16:25:48 +0100 Subject: [PATCH 7/7] Fix sprintf issue --- .../demo/Periodic_3_triangulation_3/Scene.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.h b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.h index 296d1bc5427..a5e6347280b 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.h +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.h @@ -106,9 +106,8 @@ public Q_SLOTS: void insert_mp() { insert_point(moving_point); - QString str; - ui->viewer->displayMessage(str.sprintf("Added point (%f, %f, %f)", - moving_point.x(),moving_point.y(),moving_point.z())); + ui->viewer->displayMessage(QString("Added point (%1, %2, %3)").arg( + moving_point.x()).arg(moving_point.y()).arg(moving_point.z())); changed(); }