From ec53e0a8ddb4975c089e66ec510799edb465db2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 21 Apr 2022 06:51:12 +0200 Subject: [PATCH] avoid spamming the console if CERES is not available --- .../angle_and_area_smoothing.h | 12 +++++++++--- .../repair_self_intersections.h | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h index b34fb9331cf..03e9103df9e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h @@ -189,13 +189,19 @@ void angle_and_area_smoothing(const FaceRange& faces, bool use_area_smoothing = choose_parameter(get_parameter(np, internal_np::use_area_smoothing), true); #ifndef CGAL_PMP_USE_CERES_SOLVER - std::cerr << "Area-based smoothing requires the Ceres Library, which is not available." << std::endl; - std::cerr << "No such smoothing will be performed!" << std::endl; - use_area_smoothing = false; + if (use_area_smoothing) + { + std::cerr << "Area-based smoothing requires the Ceres Library, which is not available." << std::endl; + std::cerr << "No such smoothing will be performed!" << std::endl; + use_area_smoothing = false; + } #endif if(!use_angle_smoothing && !use_area_smoothing) + { std::cerr << "Called PMP::angle_and_area_smoothing() without any smoothing method selected or available" << std::endl; + return; + } unsigned int nb_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 1); const bool do_project = choose_parameter(get_parameter(np, internal_np::do_project), true); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h index b69aab6dd91..2bc720fc1dc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h @@ -550,7 +550,11 @@ bool remove_self_intersections_with_smoothing(std::set