From 73581e15adccbbd02a7fc99144b5402ca3e026c3 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Tue, 29 Jun 2021 14:17:00 +0200 Subject: [PATCH] added named param for choosing between one sided and symmetric dist in the is_larger_HD function --- .../CGAL/boost/graph/parameters_interface.h | 1 + .../CGAL/Polygon_mesh_processing/distance.h | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h index 1fa00d7848b..a69d0d4a965 100644 --- a/BGL/include/CGAL/boost/graph/parameters_interface.h +++ b/BGL/include/CGAL/boost/graph/parameters_interface.h @@ -123,6 +123,7 @@ CGAL_add_named_parameter(non_manifold_feature_map_t, non_manifold_feature_map, n CGAL_add_named_parameter(polyhedral_envelope_epsilon_t, polyhedral_envelope_epsilon, polyhedral_envelope_epsilon) CGAL_add_named_parameter(match_faces_t, match_faces, match_faces) CGAL_add_named_parameter(face_epsilon_map_t, face_epsilon_map, face_epsilon_map) +CGAL_add_named_parameter(use_one_sided_hausdorff_t, use_one_sided_hausdorff, use_one_sided_hausdorff) // List of named parameters that we use in the package 'Surface Mesh Simplification' CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index c658b02807f..e0dfa4e2faf 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -2530,7 +2530,16 @@ double bounded_error_symmetric_Hausdorff_distance( * * Instead of computing the full distance and checking it against the user-provided * value, this function early quits in case certain criteria show that the meshes - * do not satisfy the provided distance bound. + * do not satisfy the provided `distance_bound`. + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{use_one_sided_hausdorff} + * \cgalParamDescription{a boolean tag indicating if the one-sided Hausdorff distance should be used.} + * \cgalParamType{Boolean} + * \cgalParamDefault{`true`} + * \cgalParamExtra{If this tag is set to `false`, the symmetric Hausdorff distance is used.} + * \cgalParamNEnd + * \cgalNamedParamsEnd * * @return Boolean `true` or `false` */ @@ -2568,7 +2577,8 @@ bool is_Hausdorff_distance_larger( parameters::get_parameter(np2, internal_np::match_faces), true); const bool match_faces = match_faces1 && match_faces2; - const bool use_one_sided = true; // TODO: Put in the NP! + const bool use_one_sided = parameters::choose_parameter( + parameters::get_parameter(np1, internal_np::use_one_sided_hausdorff), true); CGAL_precondition(error_bound >= 0.0); const FT error_threshold = static_cast(error_bound); CGAL_precondition(distance_bound >= 0.0);