From fa81af898f5ce4b6f65c6d049ba42983f0303cb2 Mon Sep 17 00:00:00 2001 From: Lingjie Zhu Date: Mon, 20 Nov 2017 10:53:11 +0800 Subject: [PATCH] named parameter iterations -> nb_of_iterations inner_iterations -> nb_of_relaxations --- .../NamedParameters.txt | 12 ++++---- .../vsa_approximation_example.cpp | 2 +- .../vsa_segmentation_example.cpp | 2 +- .../parameters_interface.h | 4 +-- .../include/CGAL/vsa_mesh_approximation.h | 16 +++++------ .../include/CGAL/vsa_mesh_segmentation.h | 28 +++++++++---------- .../vsa_free_function_test.cpp | 4 +-- .../vsa_kernel_test.cpp | 4 +-- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt b/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt index 479ade785a3..823a3e268d4 100644 --- a/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt +++ b/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt @@ -29,13 +29,13 @@ See below a sample call of a function that uses the optional BGL named parameter // output : output polyhedron mesh // method : seed initialization method // num_proxies : number of proxies used to approximate the geometry -// num_iterations : number of relaxation iterations +// num_iterations : number of iterations after initialization // anchors : the container to store the anchor points vsa_mesh_approximation(input, , output , CGAL::VSA::parameters::init_method(method) .max_nb_proxies(num_proxies) - .iterations(num_iterations) + .nb_of_iterations(num_iterations) .anchor_points(std::back_inserter(anchors))); \endcode @@ -91,14 +91,14 @@ the minimum total error drop to approximate the input mesh.\n \b Default value is `0.01` \cgalNPEnd -\cgalNPBegin{iterations} \anchor VSA_iterations -the number of iterations of relaxation after seeding.\n +\cgalNPBegin{nb_of_iterations} \anchor VSA_nb_of_iterations +the number of partitioning and fitting iterations after initialization.\n \b Type : `std::size_t` \n \b Default value is `10` \cgalNPEnd -\cgalNPBegin{inner_iterations} \anchor VSA_inner_iterations -the number of iterations of relaxation interleaved within seeding.\n +\cgalNPBegin{nb_of_relaxations} \anchor VSA_nb_of_relaxations +the number of relaxations interleaved within initialization seeding.\n \b Type : `std::size_t` \n \b Default value is `10` \cgalNPEnd diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp index 44fe4f1d9e9..6ce78d15b34 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp @@ -29,7 +29,7 @@ int main() std::back_inserter(triangles), CGAL::VSA::parameters::init_method(CGAL::VSA::Hierarchical). // hierarchical init max_nb_proxies(200). // target number of proxies - iterations(30). // number of relaxation iterations after seeding + nb_of_iterations(30). // number of iterations after initialization // output to polyhedron output_mesh(&output)); // valid only if the indexed triangles construct a 2-manifold and oriented surface diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp index f5c789bac01..6c607637006 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp @@ -32,7 +32,7 @@ int main() fpxmap, // output indexed face set CGAL::VSA::parameters::init_method(CGAL::VSA::Hierarchical). // hierarchical init max_nb_proxies(200). // refine until target number of proxies - iterations(30)); // number of relaxation iterations after seeding + nb_of_iterations(30)); // number of iterations after initialization return EXIT_SUCCESS; } diff --git a/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h b/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h index caf27d2c157..75db764d06e 100644 --- a/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h +++ b/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h @@ -5,8 +5,8 @@ CGAL_add_named_parameter(geom_traits_t, geom_traits, geom_traits) CGAL_add_named_parameter(init_method_t, init_method, init_method) CGAL_add_named_parameter(max_nb_proxies_t, max_nb_proxies, max_nb_proxies) CGAL_add_named_parameter(min_error_drop_t, min_error_drop, min_error_drop) -CGAL_add_named_parameter(iterations_t, iterations, iterations) -CGAL_add_named_parameter(inner_iterations_t, inner_iterations, inner_iterations) +CGAL_add_named_parameter(nb_of_iterations_t, nb_of_iterations, nb_of_iterations) +CGAL_add_named_parameter(nb_of_relaxations_t, nb_of_relaxations, nb_of_relaxations) CGAL_add_named_parameter(mesh_chord_error_t, mesh_chord_error, mesh_chord_error) // output parameters diff --git a/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h b/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h index d2d43de88e3..13caed07557 100644 --- a/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h @@ -52,9 +52,9 @@ namespace VSA { * \cgalParamEnd * \cgalParamBegin{min_error_drop} minimum error drop of the approximation, expressed in ratio between two iterations of proxy addition. * \cgalParamEnd - * \cgalParamBegin{iterations} number of relaxation iterations after seeding. + * \cgalParamBegin{nb_of_iterations} number of partitioning and fitting iterations after initialization. * \cgalParamEnd - * \cgalParamBegin{inner_iterations} number of relaxation iterations during seeding. + * \cgalParamBegin{nb_of_relaxations} number of relaxations interleaved within initialization seeding. * \cgalParamEnd * \cgalParamBegin{mesh_chord_error} maximum chord approximation error use for mesh construction. * \cgalParamEnd @@ -104,16 +104,16 @@ bool mesh_approximation(const TriangleMesh &tm_in, get_param(np, internal_np::max_nb_proxies), boost::optional()); boost::optional min_error_drop = choose_param( get_param(np, internal_np::min_error_drop), boost::optional()); - std::size_t inner_iterations = choose_param(get_param(np, internal_np::inner_iterations), 5); - approx.init(method, max_nb_proxies, min_error_drop, inner_iterations); + std::size_t nb_of_relaxations = choose_param(get_param(np, internal_np::nb_of_relaxations), 5); + approx.init(method, max_nb_proxies, min_error_drop, nb_of_relaxations); - const std::size_t iterations = choose_param(get_param(np, internal_np::iterations), 10); - approx.run(iterations); + const std::size_t nb_of_iterations = choose_param(get_param(np, internal_np::nb_of_iterations), 10); + approx.run(nb_of_iterations); #ifdef CGAL_SURFACE_MESH_APPROXIMATION_DEBUG std::cout << "#px = " << approx.get_proxies_size() - << ", #itr = " << iterations - << ", #inner_itr = " << inner_iterations << std::endl; + << ", #itr = " << nb_of_iterations + << ", #relx = " << nb_of_relaxations << std::endl; #endif typedef typename boost::lookup_named_param_def< diff --git a/Surface_mesh_approximation/include/CGAL/vsa_mesh_segmentation.h b/Surface_mesh_approximation/include/CGAL/vsa_mesh_segmentation.h index 7eae05952a9..0833345630b 100644 --- a/Surface_mesh_approximation/include/CGAL/vsa_mesh_segmentation.h +++ b/Surface_mesh_approximation/include/CGAL/vsa_mesh_segmentation.h @@ -45,22 +45,22 @@ namespace VSA { * \cgalParamBegin{geom_traits} a geometric traits class instance, model of `Kernel`. * Exact constructions kernels are not supported by this function. * \cgalParamEnd - * \cgalParamBegin{vertex_point_map} the property map with the points associated + * \cgalParamBegin{vertex_point_map} property map with the points associated * to the vertices of `tm_in`. Instance of a class model of `ReadWritePropertyMap`. * \cgalParamEnd - * \cgalParamBegin{init_method} the selection of seed initialization method. + * \cgalParamBegin{init_method} selection of seed initialization method. * \cgalParamEnd - * \cgalParamBegin{max_nb_proxies} the maximum number of proxies is reached. + * \cgalParamBegin{max_nb_proxies} maximum number of proxies to approximate the geometry. * \cgalParamEnd - * \cgalParamBegin{min_error_drop} the minimum error drop of the approximation. + * \cgalParamBegin{min_error_drop} minimum error drop of the approximation. * \cgalParamEnd - * \cgalParamBegin{iterations} the relaxation iterations after seeding. + * \cgalParamBegin{nb_of_iterations} number of partitioning and fitting iterations after initialization. * \cgalParamEnd - * \cgalParamBegin{inner_iterations} the relaxation iterations when seeding. + * \cgalParamBegin{nb_of_relaxations} number of relaxations interleaved within initialization seeding. * \cgalParamEnd - * \cgalParamBegin{face_proxy_map} a property map containing the assigned proxy index of each face of `tm_in` + * \cgalParamBegin{face_proxy_map} property map containing the assigned proxy index of each face of `tm_in` * \cgalParamEnd - * \cgalParamBegin{proxies} the plane proxies + * \cgalParamBegin{proxies} output iterator over proxies * \cgalParamEnd * \cgalNamedParamsEnd */ @@ -96,16 +96,16 @@ void mesh_segmentation(const TriangleMesh &tm_in, get_param(np, internal_np::max_nb_proxies), boost::optional()); boost::optional min_error_drop = choose_param( get_param(np, internal_np::min_error_drop), boost::optional()); - std::size_t inner_iterations = choose_param(get_param(np, internal_np::inner_iterations), 5); - approx.init(method, max_nb_proxies, min_error_drop, inner_iterations); + std::size_t nb_of_relaxations = choose_param(get_param(np, internal_np::nb_of_relaxations), 5); + approx.init(method, max_nb_proxies, min_error_drop, nb_of_relaxations); - const std::size_t iterations = choose_param(get_param(np, internal_np::iterations), 10); - approx.run(iterations); + const std::size_t nb_of_iterations = choose_param(get_param(np, internal_np::nb_of_iterations), 10); + approx.run(nb_of_iterations); #ifdef CGAL_SURFACE_MESH_APPROXIMATION_DEBUG std::cout << "#px = " << approx.get_proxies_sizes() - << ", #itr = " << iterations - << ", #inner_itr = " << inner_iterations << std::endl; + << ", #itr = " << nb_of_iterations + << ", #relx = " << nb_of_relaxations << std::endl; #endif approx.get_proxy_map(segment_ids); diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_free_function_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_free_function_test.cpp index 15b18f2dea8..029c73daede 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_free_function_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_free_function_test.cpp @@ -34,8 +34,8 @@ int main() std::back_inserter(points), std::back_inserter(triangles), CGAL::VSA::parameters::max_nb_proxies(6). - iterations(30). - inner_iterations(5). + nb_of_iterations(30). + nb_of_relaxations(5). mesh_chord_error(0.5). facet_proxy_map(fpxmap). anchor_vertices(std::back_inserter(anchors)). diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp index 73ebcaff41a..066d223566d 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp @@ -30,8 +30,8 @@ int test() { CGAL::internal_np::vsa_no_output, CGAL::internal_np::vsa_no_output, CGAL::VSA::parameters::max_nb_proxies(6). - iterations(30). - inner_iterations(5). + nb_of_iterations(30). + nb_of_relaxations(5). mesh_chord_error(0.5). output_mesh(&out_mesh));