From 98f0bc2d86d7d2ca209792238f31d7d8e27a3f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 17 Dec 2013 08:24:49 +0100 Subject: [PATCH] add timer in the demo --- .../Polyhedron_demo_mesh_segmentation_plugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_segmentation_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_segmentation_plugin.cpp index 9395c325811..64f3d2da09c 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_segmentation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_segmentation_plugin.cpp @@ -195,7 +195,11 @@ void Polyhedron_demo_mesh_segmentation_plugin::on_SDF_button_clicked() check_and_set_ids(pair->first->polyhedron()); pair->second.resize(item->polyhedron()->size_of_facets(), 0.0); Polyhedron_with_id_to_vector_property_map sdf_pmap(&pair->second); + QTime time; + time.start(); std::pair min_max_sdf = sdf_values(*(pair->first->polyhedron()), sdf_pmap, cone_angle, number_of_rays); + std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; + std::cout << "SDF computation is completed. Min-SDF : " << min_max_sdf.first << " " "Max-SDF : " << min_max_sdf.second << std::endl; pair->first->set_color_vector_read_only(true); @@ -251,6 +255,8 @@ void Polyhedron_demo_mesh_segmentation_plugin::on_Partition_button_clicked() } check_and_set_ids(pair->first->polyhedron()); + QTime time; + time.start(); if(pair->second.empty()) { // SDF values are empty, calculate pair->second.resize(pair->first->polyhedron()->size_of_facets(), 0.0); Polyhedron_with_id_to_vector_property_map sdf_pmap(&pair->second); @@ -263,6 +269,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::on_Partition_button_clicked() std::size_t nb_segments = segmentation_from_sdf_values(*(pair->first->polyhedron()) ,sdf_pmap, segment_pmap, number_of_clusters, smoothness, extract_segments); + std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; std::cout << "Segmentation is completed. Number of segments : " << nb_segments << std::endl; pair->first->set_color_vector_read_only(true);