From 64976a9f991ece21e0533a304e41c629dcecfbe8 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 23 Nov 2023 15:15:38 +0100 Subject: [PATCH] use Real_timer --- .../poisson_reconstruction_example.cpp | 6 ++++-- .../poisson_reconstruction_mesh3_example.cpp | 17 +++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp index d070b1b88b9..e19232017b6 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include // Types typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -54,7 +54,7 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } - CGAL::Timer total_time; + CGAL::Real_timer total_time; total_time.start(); // Creates implicit function from the read points using the default solver. @@ -95,6 +95,8 @@ int main(int argc, char* argv[]) Sphere(inner_point,sm_sphere_radius*sm_sphere_radius), sm_dichotomy_error/sm_sphere_radius); + std::cout << "Surface created." << std::endl; + // Defines surface mesh generation criteria CGAL::Surface_mesh_default_criteria_3 criteria(sm_angle, // Min triangle angle (degrees) sm_radius*average_spacing, // Max triangle size diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_mesh3_example.cpp b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_mesh3_example.cpp index 69245b9a624..057b2a4858d 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_mesh3_example.cpp +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_mesh3_example.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include // Types typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -52,13 +52,13 @@ void poisson_reconstruction(const PointSet& points, const char* output) // Poisson options FT sm_angle = 20.0; // Min triangle angle in degrees. - FT sm_radius = 100; // Max triangle size w.r.t. point set average spacing. + FT sm_radius = 1.; // Max triangle size w.r.t. point set average spacing. FT sm_distance = 0.25; // Surface Approximation error w.r.t. point set average spacing. - CGAL::Timer time; + CGAL::Real_timer time; time.start(); - CGAL::Timer total_time; + CGAL::Real_timer total_time; total_time.start(); // Creates implicit function from the read points using the default solver. @@ -176,15 +176,16 @@ int main(int argc, char* argv[]) std::cerr << "Error: cannot read file input file!" << std::endl; return EXIT_FAILURE; } - std::cout << "File " << file << " has been read." << std::endl; + std::cout << "File " << file << " has been read, " + << points.size() << " points." << std::endl; + + std::cout << "\n\n### Sequential mode ###" << std::endl; + poisson_reconstruction(points, "out_sequential.off"); #ifdef CGAL_LINKED_WITH_TBB std::cout << "\n\n### Parallel mode ###" << std::endl; poisson_reconstruction(points, "out_parallel.off"); #endif - std::cout << "\n\n### Sequential mode ###" << std::endl; - poisson_reconstruction(points, "out_sequential.off"); - return EXIT_SUCCESS; }