diff --git a/BGL/include/CGAL/boost/graph/named_function_params.h b/BGL/include/CGAL/boost/graph/named_function_params.h index fa42e03a4f8..ef6299da88b 100644 --- a/BGL/include/CGAL/boost/graph/named_function_params.h +++ b/BGL/include/CGAL/boost/graph/named_function_params.h @@ -103,11 +103,12 @@ namespace boost{ namespace CGAL { +namespace parameters{ #define CGAL_add_pmp_parameter(X, Y, Z) \ - enum X { Y }; \ - + enum X { Y }; #include #undef CGAL_add_pmp_parameter +}//parameters template struct cgal_bgl_named_params : boost::bgl_named_params @@ -119,13 +120,13 @@ namespace CGAL { cgal_bgl_named_params(T v, const Base& b) : base(v, b) {} -#define CGAL_add_pmp_parameter(X, Y, Z) \ - template \ - cgal_bgl_named_params \ - Z(const K& k) const \ - { \ - typedef cgal_bgl_named_params Params;\ - return Params(k, *this); \ +#define CGAL_add_pmp_parameter(X, Y, Z) \ + template \ + cgal_bgl_named_params \ + Z(const K& k) const \ + { \ + typedef cgal_bgl_named_params Params;\ + return Params(k, *this); \ } #include #undef CGAL_add_pmp_parameter diff --git a/BGL/test/BGL/test_cgal_bgl_named_params.cpp b/BGL/test/BGL/test_cgal_bgl_named_params.cpp index 2d118bdf99a..1d8466ab4d2 100644 --- a/BGL/test/BGL/test_cgal_bgl_named_params.cpp +++ b/BGL/test/BGL/test_cgal_bgl_named_params.cpp @@ -24,32 +24,32 @@ void test(const NamedParameters& np) assert( get_param(np,boost::halfedge_index).v == 1 ); assert( get_param(np,boost::face_index).v == 2 ); assert( get_param(np,boost::vertex_point).v == 3 ); - assert( get_param(np,CGAL::vertex_is_fixed).v == 4 ); + assert( get_param(np,CGAL::parameters::vertex_is_fixed).v == 4 ); assert( get_param(np,boost::edge_index).v == 5 ); assert( get_param(np,boost::graph_visitor).v == 6 ); - assert( get_param(np,CGAL::set_cache_policy).v == 7 ); - assert( get_param(np,CGAL::get_cost_policy).v == 8 ); - assert( get_param(np,CGAL::get_cost_policy_params).v == 9 ); - assert( get_param(np,CGAL::get_placement_policy).v == 10 ); - assert( get_param(np,CGAL::get_placement_policy_params).v == 11 ); - assert( get_param(np,CGAL::edge_is_constrained).v == 12 ); - assert( get_param(np,CGAL::edge_is_constrained_params).v == 13 ); + assert( get_param(np,CGAL::parameters::set_cache_policy).v == 7 ); + assert( get_param(np,CGAL::parameters::get_cost_policy).v == 8 ); + assert( get_param(np,CGAL::parameters::get_cost_policy_params).v == 9 ); + assert( get_param(np,CGAL::parameters::get_placement_policy).v == 10 ); + assert( get_param(np,CGAL::parameters::get_placement_policy_params).v == 11 ); + assert( get_param(np,CGAL::parameters::edge_is_constrained).v == 12 ); + assert( get_param(np,CGAL::parameters::edge_is_constrained_params).v == 13 ); //test types check_same_type<0>( get_param(np,boost::vertex_index) ); check_same_type<1>( get_param(np,boost::halfedge_index) ); check_same_type<2>( get_param(np,boost::face_index) ); check_same_type<3>( get_param(np,boost::vertex_point) ); - check_same_type<4>( get_param(np,CGAL::vertex_is_fixed) ); + check_same_type<4>( get_param(np,CGAL::parameters::vertex_is_fixed) ); check_same_type<5>( get_param(np,boost::edge_index) ); check_same_type<6>( get_param(np,boost::graph_visitor) ); - check_same_type<7>( get_param(np,CGAL::set_cache_policy) ); - check_same_type<8>( get_param(np,CGAL::get_cost_policy) ); - check_same_type<9>( get_param(np,CGAL::get_cost_policy_params) ); - check_same_type<10>( get_param(np,CGAL::get_placement_policy) ); - check_same_type<11>( get_param(np,CGAL::get_placement_policy_params) ); - check_same_type<12>( get_param(np,CGAL::edge_is_constrained) ); - check_same_type<13>( get_param(np,CGAL::edge_is_constrained_params) ); + check_same_type<7>( get_param(np,CGAL::parameters::set_cache_policy) ); + check_same_type<8>( get_param(np,CGAL::parameters::get_cost_policy) ); + check_same_type<9>( get_param(np,CGAL::parameters::get_cost_policy_params) ); + check_same_type<10>( get_param(np,CGAL::parameters::get_placement_policy) ); + check_same_type<11>( get_param(np,CGAL::parameters::get_placement_policy_params) ); + check_same_type<12>( get_param(np,CGAL::parameters::edge_is_constrained) ); + check_same_type<13>( get_param(np,CGAL::parameters::edge_is_constrained_params) ); } int main() diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 1f5fd89ae96..f8f7bc5d7d0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -72,7 +72,7 @@ namespace CGAL { get_const_property_map(CGAL::vertex_point, pmesh)); typedef typename GetGeomTraits::type GT; - GT gt = choose_param(get_param(np, geom_traits), GT()); + GT gt = choose_param(get_param(np, CGAL::parameters::geom_traits), GT()); typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object(); typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -123,7 +123,7 @@ namespace CGAL { get_const_property_map(CGAL::vertex_point, pmesh)); typedef typename GetGeomTraits::type GT; - GT gt = choose_param(get_param(np, geom_traits), GT()); + GT gt = choose_param(get_param(np, CGAL::parameters::geom_traits), GT()); typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object(); return get_bbox( get(vpm, vd) ); @@ -166,7 +166,7 @@ namespace CGAL { get_const_property_map(CGAL::vertex_point, pmesh)); typedef typename GetGeomTraits::type GT; - GT gt = choose_param(get_param(np, geom_traits), GT()); + GT gt = choose_param(get_param(np, CGAL::parameters::geom_traits), GT()); typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object(); return get_bbox( get(vpm, source(ed, pmesh)) ) + @@ -210,7 +210,7 @@ namespace CGAL { get_const_property_map(CGAL::vertex_point, pmesh)); typedef typename GetGeomTraits::type GT; - GT gt = choose_param(get_param(np, geom_traits), GT()); + GT gt = choose_param(get_param(np, CGAL::parameters::geom_traits), GT()); typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object(); typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; 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 85a5f696b0b..db3a5226cf5 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 @@ -138,7 +138,7 @@ compute_face_normal(typename boost::graph_traits::face_descriptor f using boost::choose_param; using boost::get_param; - GT traits = choose_param(get_param(np, CGAL::geom_traits), GT()); + GT traits = choose_param(get_param(np, CGAL::parameters::geom_traits), GT()); Vector normal = traits.construct_vector_3_object()(CGAL::NULL_VECTOR); sum_normals(pmesh, f @@ -232,14 +232,14 @@ compute_vertex_normal(typename boost::graph_traits::vertex_descript typedef typename GetGeomTraits::type GT; typedef typename GT::Vector_3 Vector; - GT traits = choose_param(get_param(np, CGAL::geom_traits), GT()); + GT traits = choose_param(get_param(np, CGAL::parameters::geom_traits), GT()); typedef typename GetFaceNormalMap::NoMap DefaultMap; typedef typename boost::lookup_named_param_def < - CGAL::face_normal_t, + CGAL::parameters::face_normal_t, NamedParameters, DefaultMap> ::type FaceNormalMap; - FaceNormalMap fnmap = choose_param(get_param(np, face_normal), DefaultMap()); + FaceNormalMap fnmap = choose_param(get_param(np, CGAL::parameters::face_normal), DefaultMap()); bool fnmap_valid = !boost::is_same::face_descriptor s using boost::get_param; typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters, internal::No_constraint//default > ::type EdgeConstraintMap; EdgeConstraintMap ecmap - = choose_param(get_param(np, edge_is_constrained), + = choose_param(get_param(np, CGAL::parameters::edge_is_constrained), internal::No_constraint()); typedef typename boost::graph_traits::face_descriptor face_descriptor; @@ -516,12 +516,12 @@ connected_components(const PolygonMesh& pmesh, using boost::get_param; typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters, internal::No_constraint//default > ::type EdgeConstraintMap; EdgeConstraintMap ecmap - = choose_param(get_param(np, edge_is_constrained), + = choose_param(get_param(np, CGAL::parameters::edge_is_constrained), internal::No_constraint()); typedef Dual Dual; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index cb095d3d51b..c5ce7672c29 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -231,12 +231,12 @@ bool does_bound_a_volume(const TriangleMesh& tm) #define CGAL_COREF_SET_OUTPUT_EDGE_MARK_MAP(I) \ typedef typename boost::lookup_named_param_def < \ - CGAL::edge_is_constrained_t, \ + CGAL::parameters::edge_is_constrained_t, \ NamedParametersOut##I, \ Corefinement::No_mark \ > ::type Ecm_out_##I; \ Ecm_out_##I ecm_out_##I = \ - boost::choose_param( get_param(cpp11::get(nps_out), edge_is_constrained), \ + boost::choose_param( get_param(cpp11::get(nps_out), CGAL::parameters::edge_is_constrained), \ Corefinement::No_mark() ); @@ -328,20 +328,20 @@ boolean_operation( TriangleMesh& tm1, // Edge is-constrained maps //for input meshes typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters1, Corefinement::No_mark//default > ::type Ecm1; typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters2, Corefinement::No_mark//default > ::type Ecm2; - Ecm1 ecm1 = boost::choose_param( boost::get_param(np1, edge_is_constrained), + Ecm1 ecm1 = boost::choose_param( boost::get_param(np1, CGAL::parameters::edge_is_constrained), Corefinement::No_mark() ); - Ecm2 ecm2 = boost::choose_param( boost::get_param(np2, edge_is_constrained), + Ecm2 ecm2 = boost::choose_param( boost::get_param(np2, CGAL::parameters::edge_is_constrained), Corefinement::No_mark() ); typedef Corefinement::Ecm_bind Ecm_in; @@ -626,20 +626,20 @@ corefine_and_compute_difference( TriangleMesh& tm1, // Edge is-constrained maps typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters1, Corefinement::No_mark//default > ::type Ecm1; typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters2, Corefinement::No_mark//default > ::type Ecm2; - Ecm1 ecm1 = boost::choose_param( get_param(np1, edge_is_constrained), + Ecm1 ecm1 = boost::choose_param( get_param(np1, CGAL::parameters::edge_is_constrained), Corefinement::No_mark() ); - Ecm2 ecm2 = boost::choose_param( get_param(np2, edge_is_constrained), + Ecm2 ecm2 = boost::choose_param( get_param(np2, CGAL::parameters::edge_is_constrained), Corefinement::No_mark() ); typedef Corefinement::Ecm_bind Ecm; 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 0dc9f110825..a512ced7446 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -345,23 +345,23 @@ sample_triangle_mesh(const TriangleMesh& tm, typedef Creator_uniform_3 Creator; - Geom_traits geomtraits = choose_param(get_param(np, geom_traits), Geom_traits()); + Geom_traits geomtraits = choose_param(get_param(np, CGAL::parameters::geom_traits), Geom_traits()); - bool use_rs = choose_param(get_param(np, random_uniform_sampling), true); - bool use_gs = choose_param(get_param(np, grid_sampling), false); - bool use_ms = choose_param(get_param(np, monte_carlo_sampling), false); + bool use_rs = choose_param(get_param(np, CGAL::parameters::random_uniform_sampling), true); + bool use_gs = choose_param(get_param(np, CGAL::parameters::grid_sampling), false); + bool use_ms = choose_param(get_param(np, CGAL::parameters::monte_carlo_sampling), false); if (use_gs || use_ms) - if (is_default_param(get_param(np, random_uniform_sampling))) + if (is_default_param(get_param(np, CGAL::parameters::random_uniform_sampling))) use_rs=false; - bool smpl_vrtcs = choose_param(get_param(np, do_sample_vertices), true); - bool smpl_dgs = choose_param(get_param(np, do_sample_edges), true); - bool smpl_fcs = choose_param(get_param(np, do_sample_faces), true); + bool smpl_vrtcs = choose_param(get_param(np, CGAL::parameters::do_sample_vertices), true); + bool smpl_dgs = choose_param(get_param(np, CGAL::parameters::do_sample_edges), true); + bool smpl_fcs = choose_param(get_param(np, CGAL::parameters::do_sample_faces), true); - double nb_pts_a_u = choose_param(get_param(np, nb_points_per_area_unit), 0.); - double nb_pts_l_u = choose_param(get_param(np, nb_points_per_distance_unit), 0.); + double nb_pts_a_u = choose_param(get_param(np, CGAL::parameters::nb_points_per_area_unit), 0.); + double nb_pts_l_u = choose_param(get_param(np, CGAL::parameters::nb_points_per_distance_unit), 0.); // sample vertices if (smpl_vrtcs) @@ -376,7 +376,7 @@ sample_triangle_mesh(const TriangleMesh& tm, // grid sampling if (use_gs) { - double grid_spacing_ = choose_param(get_param(np, grid_spacing), 0.); + double grid_spacing_ = choose_param(get_param(np, CGAL::parameters::grid_spacing), 0.); if (grid_spacing_==0.) { // set grid spacing to the shortest edge length @@ -403,9 +403,9 @@ sample_triangle_mesh(const TriangleMesh& tm, double min_edge_length = (std::numeric_limits::max)(); std::size_t nb_points_per_face = - choose_param(get_param(np, number_of_points_per_face), 0); + choose_param(get_param(np, CGAL::parameters::number_of_points_per_face), 0); std::size_t nb_points_per_edge = - choose_param(get_param(np, number_of_points_per_edge), 0); + choose_param(get_param(np, CGAL::parameters::number_of_points_per_edge), 0); if ((nb_points_per_face == 0 && nb_pts_a_u ==0.) || (nb_points_per_edge == 0 && nb_pts_l_u ==0.) ) @@ -484,7 +484,7 @@ sample_triangle_mesh(const TriangleMesh& tm, // sample faces if(smpl_fcs) { - std::size_t nb_points = choose_param(get_param(np, number_of_points_on_faces), 0); + std::size_t nb_points = choose_param(get_param(np, CGAL::parameters::number_of_points_on_faces), 0); Random_points_in_triangle_mesh_3 g(tm, pmap); if (nb_points == 0) { @@ -500,7 +500,7 @@ sample_triangle_mesh(const TriangleMesh& tm, if (smpl_dgs) { std::size_t nb_points = - choose_param(get_param(np, number_of_points_on_edges), 0); + choose_param(get_param(np, CGAL::parameters::number_of_points_on_edges), 0); Random_points_on_edge_list_graph_3 g(tm, pmap); if (nb_points == 0) { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h index eec4f1a742b..f41448b587f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h @@ -151,9 +151,9 @@ namespace internal { get_property_map(vertex_point, tmesh)); return internal::fair(tmesh, vertices, - choose_param(get_param(np, sparse_linear_solver), Default_solver()), - choose_param(get_param(np, weight_calculator), Default_Weight_calculator(tmesh, vpmap_)), - choose_param(get_param(np, fairing_continuity), 1), + choose_param(get_param(np, CGAL::parameters::sparse_linear_solver), Default_solver()), + choose_param(get_param(np, CGAL::parameters::weight_calculator), Default_Weight_calculator(tmesh, vpmap_)), + choose_param(get_param(np, CGAL::parameters::fairing_continuity), 1), vpmap_ ); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/clip.h index 1ba7a85dcdb..064c6ee063d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/clip.h @@ -205,7 +205,7 @@ clip( TriangleMesh& tm, return corefine_and_compute_intersection(tm, clipper, tm, np_tm, np_c); return internal::clip_open_impl(tm, clipper, - get_param(np_tm, edge_is_constrained), np_tm, np_c); + get_param(np_tm, CGAL::parameters::edge_is_constrained), np_tm, np_c); } /// \todo document me diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h index 5758b507918..46cbe80d9d8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h @@ -30,14 +30,15 @@ #define CGAL_PMP_NP_CLASS CGAL::pmp_bgl_named_params namespace CGAL{ +namespace parameters{ enum all_default_t { all_default }; //cannot use macro because it takes no argument #define CGAL_add_pmp_parameter(X, Y, Z) \ - enum X { Y }; \ + enum X { Y }; #include #undef CGAL_add_pmp_parameter - +}//parameters template struct pmp_bgl_named_params : CGAL::cgal_bgl_named_params @@ -47,18 +48,18 @@ enum all_default_t { all_default }; //cannot use macro because it takes no argum pmp_bgl_named_params(T v = T()) : base(v) {} pmp_bgl_named_params(T v, const Base& b) : base(v, b) {} - pmp_bgl_named_params + pmp_bgl_named_params all_default() const { - typedef pmp_bgl_named_params Params; + typedef pmp_bgl_named_params Params; return Params(*this); } #define CGAL_add_pmp_parameter(X, Y, Z) \ template \ - pmp_bgl_named_params \ + pmp_bgl_named_params \ Z(const K& k) const \ { \ - typedef pmp_bgl_named_params Params; \ + typedef pmp_bgl_named_params Params; \ return Params(k, *this); \ } @@ -81,10 +82,10 @@ namespace Polygon_mesh_processing{ namespace parameters{ -pmp_bgl_named_params +pmp_bgl_named_params inline all_default() { - typedef pmp_bgl_named_params Params; + typedef pmp_bgl_named_params Params; return Params(); } @@ -99,10 +100,10 @@ pmp_bgl_named_params #define CGAL_add_pmp_parameter(X, Y, Z) \ template \ - pmp_bgl_named_params \ + pmp_bgl_named_params \ Z(const K& k) \ { \ - typedef pmp_bgl_named_params Params; \ + typedef pmp_bgl_named_params Params; \ return Params(k); \ } #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h index 94ba4d260a2..33a39d366e4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h @@ -118,7 +118,7 @@ public: typedef typename CGAL::Kernel_traits::Kernel Kernel; }; -template > +template > class GetGeomTraits { typedef typename boost::graph_has_property::type @@ -132,7 +132,7 @@ class GetGeomTraits public: typedef typename boost::lookup_named_param_def < - CGAL::geom_traits_t, + CGAL::parameters::geom_traits_t, NamedParameters, DefaultKernel > ::type type; @@ -203,7 +203,7 @@ class GetFaceNormalMap public: typedef DummyNormalPmap NoMap; typedef typename boost::lookup_named_param_def < - CGAL::face_normal_t, + CGAL::parameters::face_normal_t, NamedParameters, DummyNormalPmap//default > ::type type; @@ -214,7 +214,7 @@ class GetSolver { public: typedef typename boost::lookup_named_param_def < - CGAL::sparse_linear_solver_t, + CGAL::parameters::sparse_linear_solver_t, NamedParameters, DefaultSolver > ::type type; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/parameters_interface.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/parameters_interface.h index 513c6bf2c75..cdae2558a3a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/parameters_interface.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/parameters_interface.h @@ -11,8 +11,8 @@ CGAL_add_pmp_parameter(number_of_iterations_t, number_of_iterations, number_of_i CGAL_add_pmp_parameter(number_of_relaxation_steps_t, number_of_relaxation_steps, number_of_relaxation_steps) CGAL_add_pmp_parameter(protect_constraints_t, protect_constraints, protect_constraints) CGAL_add_pmp_parameter(relax_constraints_t, relax_constraints, relax_constraints) -CGAL_add_pmp_parameter(vertex_is_constrained_t, vertex_is_constrained, vertex_is_constrained) -CGAL_add_pmp_parameter(face_patch_t, face_patch, face_patch) +CGAL_add_pmp_parameter(vertex_is_constrained_t, vertex_is_constrained, vertex_is_constrained_map) +CGAL_add_pmp_parameter(face_patch_t, face_patch, face_patch_map) CGAL_add_pmp_parameter(random_uniform_sampling_t, random_uniform_sampling, random_uniform_sampling) CGAL_add_pmp_parameter(grid_sampling_t, grid_sampling, grid_sampling) CGAL_add_pmp_parameter(monte_carlo_sampling_t, monte_carlo_sampling, monte_carlo_sampling) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h index d3a3d966f12..aa6a9c0bedf 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h @@ -95,7 +95,7 @@ namespace Polygon_mesh_processing { refine_functor.refine(faces, faces_out, vertices_out, - choose_param(get_param(np, density_control_factor), CGAL::sqrt(2.))); + choose_param(get_param(np, CGAL::parameters::density_control_factor), CGAL::sqrt(2.))); return std::make_pair(faces_out, vertices_out); } 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 272cafb68f7..b73f6b1d296 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -153,40 +153,40 @@ void isotropic_remeshing(const FaceRange& faces get_property_map(face_index, pmesh)); typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters, internal::Border_constraint_pmap//default > ::type ECMap; ECMap ecmap = (boost::is_same >::value) //avoid constructing the Border_constraint_pmap if it's not used - ? choose_param(get_param(np, edge_is_constrained) + ? choose_param(get_param(np, CGAL::parameters::edge_is_constrained) , internal::Border_constraint_pmap(pmesh, faces, fimap)) - : choose_param(get_param(np, edge_is_constrained) + : choose_param(get_param(np, CGAL::parameters::edge_is_constrained) , internal::Border_constraint_pmap()); typedef typename boost::lookup_named_param_def < - CGAL::vertex_is_constrained_t, + CGAL::parameters::vertex_is_constrained_t, NamedParameters, internal::No_constraint_pmap//default > ::type VCMap; - VCMap vcmap = choose_param(get_param(np, vertex_is_constrained), + VCMap vcmap = choose_param(get_param(np, CGAL::parameters::vertex_is_constrained), internal::No_constraint_pmap()); typedef typename boost::lookup_named_param_def < - CGAL::face_patch_t, + CGAL::parameters::face_patch_t, NamedParameters, internal::Connected_components_pmap//default > ::type FPMap; FPMap fpmap = (boost::is_same >::value) - ? choose_param(get_param(np, face_patch), + ? choose_param(get_param(np, CGAL::parameters::face_patch), internal::Connected_components_pmap(pmesh, ecmap, fimap)) - : choose_param(get_param(np, face_patch), + : choose_param(get_param(np, CGAL::parameters::face_patch), internal::Connected_components_pmap());//do not compute cc's double low = 4. / 5. * target_edge_length; double high = 4. / 3. * target_edge_length; - bool protect = choose_param(get_param(np, protect_constraints), false); + bool protect = choose_param(get_param(np, CGAL::parameters::protect_constraints), false); if(protect) { std::string msg("Isotropic remeshing : protect_constraints cannot be set to"); @@ -214,9 +214,9 @@ void isotropic_remeshing(const FaceRange& faces std::cout << " done ("<< t.time() <<" sec)." << std::endl; #endif - unsigned int nb_iterations = choose_param(get_param(np, number_of_iterations), 1); - bool smoothing_1d = choose_param(get_param(np, relax_constraints), false); - unsigned int nb_laplacian = choose_param(get_param(np, number_of_relaxation_steps), 1); + unsigned int nb_iterations = choose_param(get_param(np, CGAL::parameters::number_of_iterations), 1); + bool smoothing_1d = choose_param(get_param(np, CGAL::parameters::relax_constraints), false); + unsigned int nb_laplacian = choose_param(get_param(np, CGAL::parameters::number_of_relaxation_steps), 1); #ifdef CGAL_PMP_REMESHING_VERBOSE std::cout << std::endl; @@ -321,11 +321,11 @@ void split_long_edges(const EdgeRange& edges get_property_map(face_index, pmesh)); typedef typename boost::lookup_named_param_def < - CGAL::edge_is_constrained_t, + CGAL::parameters::edge_is_constrained_t, NamedParameters, internal::No_constraint_pmap//default > ::type ECMap; - ECMap ecmap = choose_param(get_param(np, edge_is_constrained), + ECMap ecmap = choose_param(get_param(np, CGAL::parameters::edge_is_constrained), internal::No_constraint_pmap()); typename internal::Incremental_remesher::type Traits; - Traits traits = choose_param(get_param(np, geom_traits), Traits()); + Traits traits = choose_param(get_param(np, CGAL::parameters::geom_traits), Traits()); std::size_t nb_deg_faces = 0; @@ -690,7 +690,7 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, VertexPointMap vpmap = choose_param(get_param(np, vertex_point), get_property_map(vertex_point, tmesh)); typedef typename GetGeomTraits::type Traits; - Traits traits = choose_param(get_param(np, geom_traits), Traits()); + Traits traits = choose_param(get_param(np, CGAL::parameters::geom_traits), Traits()); // First remove edges of length 0 std::size_t nb_deg_faces = remove_null_edges(edges(tmesh), tmesh, np); 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 e155f236561..a21c83e8513 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 @@ -357,7 +357,7 @@ self_intersections( const FaceRange& face_range, typedef typename GetGeomTraits::type GeomTraits; CGAL::internal::Intersect_facets intersect_facets(tmesh, out, vpmap, - boost::choose_param(get_param(np, geom_traits), GeomTraits())); + boost::choose_param(get_param(np, CGAL::parameters::geom_traits), GeomTraits())); std::ptrdiff_t cutoff = 2000; CGAL::box_self_intersection_d(box_ptr.begin(), box_ptr.end(),intersect_facets,cutoff); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h index a290d83a023..38640681bc2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h @@ -94,7 +94,7 @@ namespace Polygon_mesh_processing { #ifdef CGAL_HOLE_FILLING_DO_NOT_USE_DT3 false; #else - choose_param(get_param(np, use_delaunay_triangulation), true); + choose_param(get_param(np, CGAL::parameters::use_delaunay_triangulation), true); #endif CGAL_precondition(face(border_halfedge, pmesh) == boost::graph_traits::null_face()); @@ -104,7 +104,7 @@ namespace Polygon_mesh_processing { out, choose_param(get_param(np, vertex_point), get_property_map(vertex_point, pmesh)), use_dt3, - choose_param(get_param(np, geom_traits), typename GetGeomTraits::type())) + choose_param(get_param(np, CGAL::parameters::geom_traits), typename GetGeomTraits::type())) .first; } @@ -339,7 +339,7 @@ namespace Polygon_mesh_processing { #ifdef CGAL_HOLE_FILLING_DO_NOT_USE_DT3 false; #else - choose_param(get_param(np, use_delaunay_triangulation), true); + choose_param(get_param(np, CGAL::parameters::use_delaunay_triangulation), true); #endif typedef CGAL::internal::Weight_min_max_dihedral_and_area Weight; @@ -359,7 +359,7 @@ namespace Polygon_mesh_processing { triangulate_hole_polyline(points, third_points, tracer, WC(), use_dt3, - choose_param(get_param(np, CGAL::geom_traits), + choose_param(get_param(np, CGAL::parameters::geom_traits), typename CGAL::Kernel_traits::Kernel())); CGAL_assertion(holes.empty()); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_bgl_named_params.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_bgl_named_params.cpp index e4310691a66..80610baedd9 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_bgl_named_params.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_bgl_named_params.cpp @@ -32,14 +32,14 @@ void test_np(const NamedParameters& np) // assert( get_param(np,CGAL::get_cost_policy_params).v == 9 ); // assert( get_param(np,CGAL::get_placement_policy).v == 10 ); // assert( get_param(np,CGAL::get_placement_policy_params).v == 11 ); - assert( get_param(np,CGAL::edge_is_constrained).v == 12 ); + assert( get_param(np,CGAL::parameters::edge_is_constrained).v == 12 ); // assert( get_param(np,CGAL::edge_is_constrained_params).v == 13 ); // - assert( get_param(np,CGAL::density_control_factor).v == 14 ); - assert( get_param(np,CGAL::use_delaunay_triangulation).v == 15 ); - assert( get_param(np,CGAL::fairing_continuity).v == 16 ); - assert( get_param(np,CGAL::sparse_linear_solver).v == 17 ); - assert( get_param(np,CGAL::weight_calculator).v == 18 ); + assert( get_param(np,CGAL::parameters::density_control_factor).v == 14 ); + assert( get_param(np,CGAL::parameters::use_delaunay_triangulation).v == 15 ); + assert( get_param(np,CGAL::parameters::fairing_continuity).v == 16 ); + assert( get_param(np,CGAL::parameters::sparse_linear_solver).v == 17 ); + assert( get_param(np,CGAL::parameters::weight_calculator).v == 18 ); //test types check_same_type<0>( get_param(np,boost::vertex_index) ); @@ -54,14 +54,14 @@ void test_np(const NamedParameters& np) // check_same_type<9>( get_param(np,CGAL::get_cost_policy_params) ); // check_same_type<10>( get_param(np,CGAL::get_placement_policy) ); // check_same_type<11>( get_param(np,CGAL::get_placement_policy_params) ); - check_same_type<12>( get_param(np,CGAL::edge_is_constrained) ); + check_same_type<12>( get_param(np,CGAL::parameters::edge_is_constrained) ); // check_same_type<13>( get_param(np,CGAL::edge_is_constrained_params) ); // - check_same_type<14>( get_param(np,CGAL::density_control_factor) ); - check_same_type<15>( get_param(np,CGAL::use_delaunay_triangulation) ); - check_same_type<16>( get_param(np,CGAL::fairing_continuity) ); - check_same_type<17>( get_param(np,CGAL::sparse_linear_solver) ); - check_same_type<18>( get_param(np,CGAL::weight_calculator) ); + check_same_type<14>( get_param(np,CGAL::parameters::density_control_factor) ); + check_same_type<15>( get_param(np,CGAL::parameters::use_delaunay_triangulation) ); + check_same_type<16>( get_param(np,CGAL::parameters::fairing_continuity) ); + check_same_type<17>( get_param(np,CGAL::parameters::sparse_linear_solver) ); + check_same_type<18>( get_param(np,CGAL::parameters::weight_calculator) ); } int main()