From 4fa826b3edc114788c86b964fcc9663370cfbd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 10 Jan 2022 15:38:18 +0100 Subject: [PATCH] keep only the static version of is_default_parameter --- .../boost/graph/IO/Generic_facegraph_builder.h | 8 ++++---- .../boost/graph/IO/Generic_facegraph_printer.h | 8 ++++---- BGL/include/CGAL/boost/graph/IO/PLY.h | 4 ++-- .../CGAL/boost/graph/named_params_helper.h | 2 +- .../include/CGAL/IO/write_off_points.h | 2 +- .../include/CGAL/mst_orient_normals.h | 2 +- .../include/CGAL/structure_point_set.h | 4 ++-- .../Polygon_mesh_processing/compute_normal.h | 4 ++-- .../connected_components.h | 12 ++++++------ .../CGAL/Polygon_mesh_processing/distance.h | 2 +- .../internal/Snapping/snap.h | 1 - .../CGAL/Polygon_mesh_processing/remesh.h | 4 ++-- .../CGAL/Polygon_mesh_processing/repair.h | 4 ++-- .../self_intersections.h | 2 +- .../include/CGAL/Polyhedral_envelope.h | 6 +++--- .../test_pmp_np_function.cpp | 17 +++++++++++++---- .../include/CGAL/IO/Polyhedron_OFF_iostream.h | 18 +++++++++--------- .../include/CGAL/Named_function_parameters.h | 13 +------------ .../Shape_regularization/regularize_planes.h | 4 ++-- .../include/CGAL/Surface_mesh/IO/OFF.h | 18 +++++++++--------- .../approximate_triangle_mesh.h | 12 ++++++------ 21 files changed, 72 insertions(+), 75 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h index c5249e4db75..76b3e48836b 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h @@ -76,10 +76,10 @@ public: using parameters::is_default_parameter; using parameters::get_parameter; - const bool is_vnm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_normal_map))); - const bool is_vcm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_color_map))); - const bool is_vtm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_texture_map))); - const bool is_fcm_requested = !(is_default_parameter(get_parameter(np, internal_np::face_color_map))); + const bool is_vnm_requested = !(is_default_parameter()); + const bool is_vcm_requested = !(is_default_parameter()); + const bool is_vtm_requested = !(is_default_parameter()); + const bool is_fcm_requested = !(is_default_parameter()); std::vector vertex_normals; std::vector vertex_colors; diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h index 4774e6b693f..de848713e89 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h @@ -122,10 +122,10 @@ public: VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, g)); - const bool has_vertex_normals = !(is_default_parameter(get_parameter(np, internal_np::vertex_normal_map))); - const bool has_vertex_colors = !(is_default_parameter(get_parameter(np, internal_np::vertex_color_map))); - const bool has_vertex_textures = !(is_default_parameter(get_parameter(np, internal_np::vertex_texture_map))); - const bool has_face_colors = !(is_default_parameter(get_parameter(np, internal_np::face_color_map))); + const bool has_vertex_normals = !(is_default_parameter()); + const bool has_vertex_colors = !(is_default_parameter()); + const bool has_vertex_textures = !(is_default_parameter()); + const bool has_face_colors = !(is_default_parameter()); VNM vnm = get_parameter(np, internal_np::vertex_normal_map); VTM vtm = get_parameter(np, internal_np::vertex_texture_map); diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h index 75641130b13..05633ae85f7 100644 --- a/BGL/include/CGAL/boost/graph/IO/PLY.h +++ b/BGL/include/CGAL/boost/graph/IO/PLY.h @@ -326,8 +326,8 @@ bool write_PLY(std::ostream& os, VCM vcm = choose_parameter(get_parameter(np, internal_np::vertex_color_map), VCM()); FCM fcm = choose_parameter(get_parameter(np, internal_np::face_color_map), FCM()); - bool has_vcolor = !is_default_parameter(get_parameter(np, internal_np::vertex_color_map)); - bool has_fcolor = !is_default_parameter(get_parameter(np, internal_np::face_color_map)); + bool has_vcolor = !is_default_parameter(); + bool has_fcolor = !is_default_parameter(); VIMap vim = CGAL::get_initialized_vertex_index_map(g, np); Vpm vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(boost::vertex_point, g)); diff --git a/BGL/include/CGAL/boost/graph/named_params_helper.h b/BGL/include/CGAL/boost/graph/named_params_helper.h index aa1d46a55b3..0cc6eb0e638 100644 --- a/BGL/include/CGAL/boost/graph/named_params_helper.h +++ b/BGL/include/CGAL/boost/graph/named_params_helper.h @@ -508,7 +508,7 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits::fa using parameters::choose_parameter; using parameters::is_default_parameter; - if(!is_default_parameter(get_parameter(np, internal_np::stream_precision))) + if(!is_default_parameter()) { const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision)); diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index 8e707fe251d..a611b24bfeb 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -48,7 +48,7 @@ bool write_OFF_PSP(std::ostream& os, typedef typename NP_helper::Const_point_map PointMap; typedef typename NP_helper::Normal_map NormalMap; - const bool has_normals = !(is_default_parameter(get_parameter(np, internal_np::normal_map))); + const bool has_normals = !(is_default_parameter()); PointMap point_map = NP_helper::get_const_point_map(points, np); NormalMap normal_map = NP_helper::get_normal_map(points, np); diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index 5de84c761a5..438e7ce0598 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -665,7 +665,7 @@ mst_orient_normals( // or vertex j is in the k-neighborhood of vertex i. Riemannian_graph riemannian_graph; - if (is_default_parameter(get_parameter(np, internal_np::point_is_constrained))) + if (is_default_parameter()) riemannian_graph = create_riemannian_graph(points, point_map, normal_map, index_map, Default_constrained_map diff --git a/Point_set_processing_3/include/CGAL/structure_point_set.h b/Point_set_processing_3/include/CGAL/structure_point_set.h index 720b7e6402d..00222956e44 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -225,7 +225,7 @@ public: { using parameters::choose_parameter; using parameters::get_parameter; - using parameters::is_default_parameter_static; + using parameters::is_default_parameter; // basic geometric types typedef Point_set_processing_3_np_helper NP_helper; @@ -235,7 +235,7 @@ public: typedef typename Point_set_processing_3::GetPlaneIndexMap::type PlaneIndexMap; CGAL_static_assertion_msg(NP_helper::has_normal_map(), "Error: no normal map"); - CGAL_static_assertion_msg((!is_default_parameter_static()), + CGAL_static_assertion_msg((!is_default_parameter()), "Error: no plane index map"); PointMap point_map = NP_helper::get_const_point_map(points, np); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index c38f5eff3df..4fabb08700f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -672,7 +672,7 @@ compute_vertex_normal(typename boost::graph_traits::vertex_descript Face_vector_map default_fvmap; Face_normal_map face_normals = choose_parameter(get_parameter(np, internal_np::face_normal), Default_map(default_fvmap)); - const bool must_compute_face_normals = is_default_parameter(get_parameter(np, internal_np::face_normal)); + const bool must_compute_face_normals = is_default_parameter(); #ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP std::cout << "<----- compute vertex normal at " << get(vpmap, v) @@ -786,7 +786,7 @@ void compute_vertex_normals(const PolygonMesh& pmesh, Face_normal_dmap>::type Face_normal_map; Face_normal_map face_normals = choose_parameter(get_parameter(np, internal_np::face_normal), get(Face_normal_tag(), pmesh)); - const bool must_compute_face_normals = is_default_parameter(get_parameter(np, internal_np::face_normal)); + const bool must_compute_face_normals = is_default_parameter(); if(must_compute_face_normals) compute_face_normals(pmesh, face_normals, np); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index b04aec0758f..aec7ad596e9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -600,12 +600,12 @@ std::size_t keep_large_connected_components(PolygonMesh& pmesh, template + , typename CGAL_BGL_NP_TEMPLATE_PARAMETERS> void keep_or_remove_connected_components(PolygonMesh& pmesh , const ComponentRange& components_to_keep , const FaceComponentMap& fcm , bool keep - , const NamedParameters& np = parameters::default_values()) + , const CGAL_BGL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -616,7 +616,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; - typedef typename GetInitializedVertexIndexMap::type VertexIndexMap; + typedef typename GetInitializedVertexIndexMap::type VertexIndexMap; VertexIndexMap vim = get_initialized_vertex_index_map(pmesh, np); std::set cc_to_keep; @@ -720,13 +720,13 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh for(vertex_descriptor v: vertices(pmesh)) if (!keep_vertex[v]) vertices_to_remove.push_back(v); - if ( is_default_parameter(get_parameter(np, internal_np::vertex_is_constrained)) ) + if ( is_default_parameter() ) for (vertex_descriptor v : vertices_to_remove) remove_vertex(v, pmesh); else { typedef typename internal_np::Lookup_named_param_def // default (not used) >::type Vertex_map; Vertex_map is_cst = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), @@ -995,7 +995,7 @@ void split_connected_components_impl(FIMap fim, get(CGAL::dynamic_face_property_t(), tm)); faces_size_type nb_patches = 0; - if(is_default_parameter(get_parameter(np, internal_np::face_patch))) + if(is_default_parameter()) { nb_patches = CGAL::Polygon_mesh_processing::connected_components( tm, pidmap, CGAL::parameters::face_index_map(fim) 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 791eaff09f7..5c7307aa8c5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -220,7 +220,7 @@ struct Triangle_structure_sampler_base bool use_ms = choose_parameter(get_parameter(np, internal_np::monte_carlo_sampling), false); if(use_gs || use_ms) - if(is_default_parameter(get_parameter(np, internal_np::random_uniform_sampling))) + if(is_default_parameter()) use_rs = false; bool smpl_vrtcs = choose_parameter(get_parameter(np, internal_np::do_sample_vertices), true); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index 8fc643a532c..7d24a7e88b3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -1094,7 +1094,6 @@ std::size_t snap_non_conformal(HalfedgeRange& halfedge_range_A, >::reference Visitor; using CGAL::parameters::choose_parameter; - using CGAL::parameters::is_default_parameter; using CGAL::parameters::get_parameter; using CGAL::parameters::get_parameter_reference; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index 325700cc70e..6d34f67bd9a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -217,7 +217,7 @@ void isotropic_remeshing(const FaceRange& faces #endif static const bool need_aabb_tree = - parameters::is_default_parameter(get_parameter(np, internal_np::projection_functor)); + parameters::is_default_parameter(); typedef typename GetGeomTraits::type GT; GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); @@ -254,7 +254,7 @@ void isotropic_remeshing(const FaceRange& faces FPMap fpmap = choose_parameter( get_parameter(np, internal_np::face_patch), internal::Connected_components_pmap(faces, pmesh, ecmap, fimap, - parameters::is_default_parameter(get_parameter(np, internal_np::face_patch)) && (need_aabb_tree + parameters::is_default_parameter() && (need_aabb_tree #if !defined(CGAL_NO_PRECONDITIONS) || protect // face patch map is used to identify patch border edges to check protected edges are short enough #endif diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 72ce4a5f3cf..2c60db87688 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -175,8 +175,8 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, FT volume_threshold = choose_parameter(get_parameter(np, internal_np::volume_threshold), FT(-1)); // If no threshold is provided, compute it as a % of the bbox - const bool is_default_area_threshold = is_default_parameter(get_parameter(np, internal_np::area_threshold)); - const bool is_default_volume_threshold = is_default_parameter(get_parameter(np, internal_np::volume_threshold)); + const bool is_default_area_threshold = is_default_parameter(); + const bool is_default_volume_threshold = is_default_parameter(); const bool dry_run = choose_parameter(get_parameter(np, internal_np::dry_run), false); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h index 1c28b4ff67b..5f3bf9720f5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h @@ -249,7 +249,7 @@ self_intersections_impl(const FaceRange& face_range, VPM vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(boost::vertex_point, tmesh)); - const bool do_limit = !(is_default_parameter(get_parameter(np, internal_np::maximum_number))); + const bool do_limit = !(is_default_parameter()); const unsigned int maximum_number = choose_parameter(get_parameter(np, internal_np::maximum_number), 0); if(do_limit && maximum_number == 0) { diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index af1a8ea8d67..b75bd7f1b38 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -402,7 +402,7 @@ public: else deg_faces.insert(f); } - if (is_default_parameter(get_parameter(np, internal_np::face_epsilon_map))) + if (is_default_parameter()) init(epsilon); else { @@ -511,7 +511,7 @@ public: deg_faces.insert(f); } - if (is_default_parameter(get_parameter(np, internal_np::face_epsilon_map))) + if (is_default_parameter()) init(epsilon); else { @@ -594,7 +594,7 @@ public: env_faces.emplace_back(face); } - if (is_default_parameter(get_parameter(np, internal_np::face_epsilon_map))) + if (is_default_parameter()) init(epsilon); else { diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp index 8c29d53a7ad..98ff3653464 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp @@ -44,6 +44,9 @@ void my_function_with_named_parameters(PolygonMesh& mesh, const NamedParameters& //boolean NP example. Default value is `false` bool do_project = choose_parameter(get_parameter(np, internal_np::do_project), false); + // check is a parameter has been given by the user + constexpr bool do_project_is_default = is_default_parameter(); + VCM vcm_np = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), Default_VCM()); @@ -53,10 +56,16 @@ void my_function_with_named_parameters(PolygonMesh& mesh, const NamedParameters& std::cout<<"vertex #"<()) || + !(is_default_parameter()) || + !(is_default_parameter()) || + !(is_default_parameter())) { return CGAL::IO::internal::read_OFF_BGL(in, P, np); } CGAL::scan_OFF(in, P, verbose); - if(!parameters::is_default_parameter(get_parameter(np, internal_np::vertex_point))) + if(!parameters::is_default_parameter()) { Def_VPM def_vpm = get_property_map(CGAL::vertex_point, P); VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -132,10 +132,10 @@ bool write_OFF(std::ostream& out, using parameters::get_parameter; using parameters::is_default_parameter; - if(!(is_default_parameter(get_parameter(np, internal_np::vertex_color_map))) || - !(is_default_parameter(get_parameter(np, internal_np::face_color_map))) || - !(is_default_parameter(get_parameter(np, internal_np::vertex_normal_map))) || - !(is_default_parameter(get_parameter(np, internal_np::vertex_texture_map)))) + if(!(is_default_parameter()) || + !(is_default_parameter()) || + !(is_default_parameter()) || + !(is_default_parameter())) { return CGAL::IO::internal::write_OFF_BGL(out, P, np); } diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 0f651a94769..b0aa3efddc8 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -356,19 +356,8 @@ const T& choose_parameter(const T& t) return t; } -bool inline is_default_parameter(const internal_np::Param_not_found&) -{ - return true; -} - -template -bool is_default_parameter(const T&) -{ - return false; -} - template -constexpr bool is_default_parameter_static() +constexpr bool is_default_parameter() { return std::is_same< typename internal_np::Get_param::type, internal_np::Param_not_found> ::value; diff --git a/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h b/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h index 8820caa4d87..b542efb012a 100644 --- a/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h +++ b/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h @@ -292,11 +292,11 @@ namespace Planes { using parameters::get_parameter; using parameters::choose_parameter; - using parameters::is_default_parameter_static; + using parameters::is_default_parameter; using PlaneIndexMap = typename CGAL::Point_set_processing_3:: GetPlaneIndexMap::type; - CGAL_static_assertion_msg((!is_default_parameter_static()), + CGAL_static_assertion_msg((!is_default_parameter()), "Error: no plane index map"); const PlaneIndexMap index_map = diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h index db942e22131..66f6f3b891c 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h @@ -110,7 +110,7 @@ bool read_OFF_with_or_without_fcolors(std::istream& is, typename Mesh::template Property_map fcm; - bool is_fcm_requested = !(is_default_parameter(get_parameter(np, internal_np::face_color_map))); + bool is_fcm_requested = !(is_default_parameter()); if(!is_fcm_requested && scanner.has_colors()) { bool created; @@ -149,7 +149,7 @@ bool read_OFF_with_or_without_vtextures(std::istream& is, typename Mesh::template Property_map vtm; - bool is_vtm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_texture_map))); + bool is_vtm_requested = !(is_default_parameter()); if(!is_vtm_requested && scanner.has_textures()) { bool created; @@ -187,7 +187,7 @@ bool read_OFF_with_or_without_vcolors(std::istream& is, typename Mesh::template Property_map vcm; - bool is_vcm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_color_map))); + bool is_vcm_requested = !(is_default_parameter()); if(!is_vcm_requested && scanner.has_colors()) { bool created; @@ -226,7 +226,7 @@ bool read_OFF_with_or_without_vnormals(std::istream& is, typename Mesh::template Property_map vnm; - bool is_vnm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_normal_map))); + bool is_vnm_requested = !(is_default_parameter()); if(!is_vnm_requested && scanner.has_normals()) { bool created; @@ -394,7 +394,7 @@ bool write_OFF_with_or_without_fcolors(std::ostream& os, using parameters::is_default_parameter; using parameters::get_parameter; - const bool has_fcolors = !(is_default_parameter(get_parameter(np, internal_np::face_color_map))); + const bool has_fcolors = !(is_default_parameter()); typename Mesh::template Property_map fcolors; bool has_internal_fcolors; @@ -421,7 +421,7 @@ bool write_OFF_with_or_without_vtextures(std::ostream& os, using parameters::is_default_parameter; using parameters::get_parameter; - const bool has_vtextures = !(is_default_parameter(get_parameter(np, internal_np::vertex_texture_map))); + const bool has_vtextures = !(is_default_parameter()); typename Mesh::template Property_map vtextures; bool has_internal_vtextures; @@ -446,7 +446,7 @@ bool write_OFF_with_or_without_vcolors(std::ostream& os, using parameters::is_default_parameter; using parameters::get_parameter; - const bool has_vcolors = !(is_default_parameter(get_parameter(np, internal_np::vertex_color_map))); + const bool has_vcolors = !(is_default_parameter()); typename Mesh::template Property_map vcolors; bool has_internal_vcolors; @@ -473,7 +473,7 @@ bool write_OFF_with_or_without_vnormals(std::ostream& os, using parameters::is_default_parameter; using parameters::get_parameter; - const bool has_vnormals = !(is_default_parameter(get_parameter(np, internal_np::vertex_normal_map))); + const bool has_vnormals = !(is_default_parameter()); typename Mesh::template Property_map vnormals; bool has_internal_vnormals; @@ -563,7 +563,7 @@ bool write_OFF(std::ostream& os, using parameters::is_default_parameter; using parameters::get_parameter; - const bool has_vpoints = !(is_default_parameter(get_parameter(np, internal_np::vertex_point))); + const bool has_vpoints = !(is_default_parameter()); if(has_vpoints) return internal::write_OFF_with_or_without_vnormals(os, sm, np); diff --git a/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/approximate_triangle_mesh.h b/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/approximate_triangle_mesh.h index 4c1be88e754..d85b3f8c2c5 100644 --- a/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/approximate_triangle_mesh.h +++ b/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/approximate_triangle_mesh.h @@ -247,21 +247,21 @@ bool approximate_triangle_mesh(const TriangleMesh &tm, const NamedParameters &np // get proxy map approx.proxy_map( get_parameter(np, internal_np::face_proxy_map) ); - if (!parameters::is_default_parameter(get_parameter(np, internal_np::face_proxy_map)) + if (!parameters::is_default_parameter() && (vl == MAIN_STEPS || vl == VERBOSE)) std::cout << "Filling face proxy map done." << std::endl; // get proxies approx.proxies( get_parameter(np, internal_np::proxies) ); - if (!is_default_parameter( get_parameter(np, internal_np::proxies) ) + if (!is_default_parameter() && (vl == MAIN_STEPS || vl == VERBOSE)) std::cout << "Get proxies done." << std::endl; // meshing bool is_manifold = false; - if (!is_default_parameter( get_parameter(np, internal_np::anchors)) - || !is_default_parameter( get_parameter(np, internal_np::triangles) )) + if (!is_default_parameter() + || !is_default_parameter()) { if (vl == VERBOSE) { const FT subdivision_ratio = choose_parameter(get_parameter(np, internal_np::subdivision_ratio), FT(5.0)); @@ -287,14 +287,14 @@ bool approximate_triangle_mesh(const TriangleMesh &tm, const NamedParameters &np // get anchor points approx.anchor_points( get_parameter(np, internal_np::anchors) ); - if (!is_default_parameter( get_parameter(np, internal_np::anchors) ) + if (!is_default_parameter() && (vl == MAIN_STEPS || vl == VERBOSE)) std::cout << "Get anchors done." << std::endl; // get indexed triangles approx.indexed_triangles( get_parameter(np, internal_np::triangles) ); - if (!is_default_parameter( get_parameter(np, internal_np::triangles) ) + if (!is_default_parameter() && (vl == MAIN_STEPS || vl == VERBOSE)) std::cout << "Get indexed triangles done." << std::endl;