From b1311fbdb3d1de47abb2fe66d8f55637a1fa6b12 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 28 Jan 2020 10:41:43 +0100 Subject: [PATCH] Add a new PMP_np --- BGL/doc/BGL/NamedParameters.txt | 7 +++++++ BGL/include/CGAL/boost/graph/parameters_interface.h | 1 + BGL/test/BGL/test_cgal_bgl_named_params.cpp | 3 +++ .../include/CGAL/Polygon_mesh_processing/orientation.h | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/BGL/doc/BGL/NamedParameters.txt b/BGL/doc/BGL/NamedParameters.txt index ce3be60f8f4..48d4fb88508 100644 --- a/BGL/doc/BGL/NamedParameters.txt +++ b/BGL/doc/BGL/NamedParameters.txt @@ -180,6 +180,13 @@ operation.\n Default: None. \cgalNPEnd +\cgalNPBegin{maximum_number_of_faces} \anchor BGL_maximum_number_of_faces +is a size_type containing the maximum number of faces a connected component can have to be considered `reversable`.\n +It is used in the function `merge_reversible_connected_components()`.\n +Type: std::size_t.\n +Default: 0. +\cgalNPEnd + \cgalNPTableEnd diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h index ebdce042e75..b87c1043662 100644 --- a/BGL/include/CGAL/boost/graph/parameters_interface.h +++ b/BGL/include/CGAL/boost/graph/parameters_interface.h @@ -122,6 +122,7 @@ CGAL_add_named_parameter(plane_index_t, plane_index_map, plane_index_map) CGAL_add_named_parameter(select_percentage_t, select_percentage, select_percentage) CGAL_add_named_parameter(require_uniform_sampling_t, require_uniform_sampling, require_uniform_sampling) CGAL_add_named_parameter(point_is_constrained_t, point_is_constrained, point_is_constrained_map) +CGAL_add_named_parameter(maximum_number_of_faces_t, maximum_number_of_faces, maximum_number_of_faces) // List of named parameters used in Surface_mesh_approximation package CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level) diff --git a/BGL/test/BGL/test_cgal_bgl_named_params.cpp b/BGL/test/BGL/test_cgal_bgl_named_params.cpp index c3a577f20e3..05f4ae3f0e7 100644 --- a/BGL/test/BGL/test_cgal_bgl_named_params.cpp +++ b/BGL/test/BGL/test_cgal_bgl_named_params.cpp @@ -94,6 +94,7 @@ void test(const NamedParameters& np) assert(get_parameter(np, CGAL::internal_np::area_threshold).v == 57); assert(get_parameter(np, CGAL::internal_np::volume_threshold).v == 58); assert(get_parameter(np, CGAL::internal_np::dry_run).v == 59); + assert(get_param(np, CGAL::internal_np::maximum_number_of_faces).v == 78910); // Named parameters that we use in the package 'Surface Mesh Simplification' assert(get_parameter(np, CGAL::internal_np::get_cost_policy).v == 34); @@ -181,6 +182,7 @@ void test(const NamedParameters& np) check_same_type<57>(get_parameter(np, CGAL::internal_np::area_threshold)); check_same_type<58>(get_parameter(np, CGAL::internal_np::volume_threshold)); check_same_type<59>(get_parameter(np, CGAL::internal_np::dry_run)); + check_same_type<78910>(get_param(np, CGAL::internal_np::maximum_number_of_faces)); // Named parameters that we use in the package 'Surface Mesh Simplification' check_same_type<34>(get_parameter(np, CGAL::internal_np::get_cost_policy)); @@ -274,6 +276,7 @@ int main() .area_threshold(A<57>(57)) .volume_threshold(A<58>(58)) .dry_run(A<59>(59)) + .maximum_number_of_faces(A<78910>(78910)) ); return EXIT_SUCCESS; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h index a012c64a625..d5d63e20fef 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -669,6 +669,10 @@ void orient_to_bound_a_volume(TriangleMesh& tm) * \cgalParamBegin{face_index_map} * a property map containing the index of each face of `tm`. * \cgalParamEnd + * * \cgalParamBegin{maximum_number_of_faces} + * if not 0 (default), a connected component is considered reversible only + * if it has less than the given number of faces. + * \cgalParamEnd * \cgalNamedParamsEnd */ template