From 3a968a34338af2b5469a2df460d4d79cbc724ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 19 Feb 2020 17:47:43 +0100 Subject: [PATCH] Move GetPointMap to CGAL:: namespace (from CGAL::PSP_3) Since it'll also be used in PMP --- .../CGAL/boost/graph/named_params_helper.h | 72 +++++++++---------- .../CGAL/boost/graph/parameters_interface.h | 3 +- .../include/CGAL/IO/read_las_points.h | 2 +- .../include/CGAL/IO/read_off_points.h | 2 +- .../include/CGAL/IO/read_ply_points.h | 2 +- .../include/CGAL/IO/read_xyz_points.h | 2 +- .../include/CGAL/IO/write_las_points.h | 2 +- .../include/CGAL/IO/write_off_points.h | 2 +- .../include/CGAL/IO/write_ply_points.h | 2 +- .../include/CGAL/IO/write_xyz_points.h | 2 +- .../include/CGAL/bilateral_smooth_point_set.h | 2 +- .../include/CGAL/compute_average_spacing.h | 2 +- .../CGAL/edge_aware_upsample_point_set.h | 2 +- .../include/CGAL/estimate_scale.h | 8 +-- .../include/CGAL/grid_simplify_point_set.h | 2 +- .../include/CGAL/jet_estimate_normals.h | 2 +- .../include/CGAL/mst_orient_normals.h | 2 +- .../include/CGAL/pca_estimate_normals.h | 2 +- .../include/CGAL/remove_outliers.h | 2 +- .../include/CGAL/structure_point_set.h | 2 +- .../include/CGAL/vcm_estimate_normals.h | 4 +- .../wlop_simplify_and_regularize_point_set.h | 2 +- 22 files changed, 62 insertions(+), 61 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/named_params_helper.h b/BGL/include/CGAL/boost/graph/named_params_helper.h index 4c432a311c6..81c773b40cf 100644 --- a/BGL/include/CGAL/boost/graph/named_params_helper.h +++ b/BGL/include/CGAL/boost/graph/named_params_helper.h @@ -230,8 +230,43 @@ namespace CGAL { > ::type type; }; - namespace Point_set_processing_3 + namespace internal { + BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_nested_type_iterator, iterator, false) + } + + template::value> + class GetPointMap { + typedef typename std::iterator_traits::value_type Point; + typedef typename CGAL::Identity_property_map DefaultPMap; + + public: + typedef typename internal_np::Lookup_named_param_def< + internal_np::point_t, + NamedParameters, + DefaultPMap + > ::type type; + + typedef typename internal_np::Lookup_named_param_def< + internal_np::point_t, + NamedParameters, + DefaultPMap + > ::type const_type; + }; + + // to please compiler instantiating non valid overloads + template + class GetPointMap + { + struct Dummy_point{}; + public: + typedef typename CGAL::Identity_property_map type; + typedef typename CGAL::Identity_property_map const_type; + }; + + namespace Point_set_processing_3 { + template struct Fake_point_range { @@ -255,41 +290,6 @@ namespace CGAL { } } - namespace internal{ - BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_nested_type_iterator, iterator, false) - } - - template::value> - class GetPointMap - { - typedef typename std::iterator_traits::value_type Point; - typedef typename CGAL::Identity_property_map DefaultPMap; - - public: - typedef typename internal_np::Lookup_named_param_def< - internal_np::point_t, - NamedParameters, - DefaultPMap - > ::type type; - - typedef typename internal_np::Lookup_named_param_def< - internal_np::point_t, - NamedParameters, - DefaultPMap - > ::type const_type; - }; - - // to please compiler instantiating non valid overloads - template - class GetPointMap - { - struct Dummy_point{}; - public: - typedef typename CGAL::Identity_property_map type; - typedef typename CGAL::Identity_property_map const_type; - }; - template class GetFT { diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h index ebdce042e75..70fb16f778b 100644 --- a/BGL/include/CGAL/boost/graph/parameters_interface.h +++ b/BGL/include/CGAL/boost/graph/parameters_interface.h @@ -17,6 +17,8 @@ CGAL_add_named_parameter(face_index_t, face_index, face_index_map) CGAL_add_named_parameter(vertex_index_t, vertex_index, vertex_index_map) CGAL_add_named_parameter(graph_visitor_t, graph_visitor, visitor) +CGAL_add_named_parameter(point_t, point_map, point_map) + CGAL_add_named_parameter(edge_is_constrained_t, edge_is_constrained, edge_is_constrained_map) CGAL_add_named_parameter(first_index_t, first_index, first_index) CGAL_add_named_parameter(number_of_iterations_t, number_of_iterations, number_of_iterations) @@ -100,7 +102,6 @@ CGAL_add_named_parameter(weight_calculator_t, weight_calculator, weight_calculat CGAL_add_named_parameter(use_bool_op_to_clip_surface_t, use_bool_op_to_clip_surface, use_bool_op_to_clip_surface) // List of named parameters used in the Point Set Processing package -CGAL_add_named_parameter(point_t, point_map, point_map) CGAL_add_named_parameter(query_point_t, query_point_map, query_point_map) CGAL_add_named_parameter(normal_t, normal_map, normal_map) CGAL_add_named_parameter(diagonalize_traits_t, diagonalize_traits, diagonalize_traits) diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index 9762a674d44..30d4afd9600 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -461,7 +461,7 @@ bool read_las_points(std::istream& stream, typedef Point_set_processing_3::Fake_point_range PointRange; - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap()); return read_las_points_with_properties (stream, output, diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index c5e738dc099..418dd144978 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -82,7 +82,7 @@ read_off_points( typedef Point_set_processing_3::Fake_point_range PointRange; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index 9d1797c0709..0fe0ee91844 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -238,7 +238,7 @@ bool read_ply_points(std::istream& stream, typedef Point_set_processing_3::Fake_point_range PointRange; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; bool has_normals = !(boost::is_same PointRange; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index d0540f54c14..ebe8c90efae 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -276,7 +276,7 @@ write_las_points( using parameters::choose_parameter; using parameters::get_parameter; - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap()); return write_las_points_with_properties (stream, points, make_las_point_writer(point_map)); 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 ddbb37ae764..cb8323def2d 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 @@ -66,7 +66,7 @@ write_off_points( using parameters::get_parameter; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; bool has_normals = !(boost::is_same::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; bool has_normals = !(boost::is_same::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; bool has_normals = !(boost::is_same::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index 375a8932a03..6c7e0009fd4 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -195,7 +195,7 @@ compute_average_spacing( using parameters::get_parameter; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::const_type PointMap; + typedef typename CGAL::GetPointMap::const_type PointMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; typedef typename Kernel::Point_3 Point; diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 073e7418622..f9c582152f9 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -323,7 +323,7 @@ edge_aware_upsample_point_set( using parameters::get_parameter; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; diff --git a/Point_set_processing_3/include/CGAL/estimate_scale.h b/Point_set_processing_3/include/CGAL/estimate_scale.h index 5d6755afb71..f90030142c7 100644 --- a/Point_set_processing_3/include/CGAL/estimate_scale.h +++ b/Point_set_processing_3/include/CGAL/estimate_scale.h @@ -488,7 +488,7 @@ estimate_local_k_neighbor_scales( using parameters::choose_parameter; using parameters::get_parameter; - typedef typename Point_set_processing_3::GetPointMap::const_type PointMap; + typedef typename CGAL::GetPointMap::const_type PointMap; typedef typename Point_set_processing_3::GetQueryPointMap::const_type QueryPointMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; @@ -566,7 +566,7 @@ estimate_global_k_neighbor_scale( using parameters::choose_parameter; using parameters::get_parameter; - typedef typename Point_set_processing_3::GetPointMap::const_type PointMap; + typedef typename CGAL::GetPointMap::const_type PointMap; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap()); std::vector scales; estimate_local_k_neighbor_scales (points, points, std::back_inserter (scales), np.query_point_map(point_map)); @@ -641,7 +641,7 @@ estimate_local_range_scales( using parameters::choose_parameter; using parameters::get_parameter; - typedef typename Point_set_processing_3::GetPointMap::const_type PointMap; + typedef typename CGAL::GetPointMap::const_type PointMap; typedef typename Point_set_processing_3::GetQueryPointMap::const_type QueryPointMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; @@ -727,7 +727,7 @@ estimate_global_range_scale( using parameters::get_parameter; std::vector scales; - typedef typename Point_set_processing_3::GetPointMap::const_type PointMap; + typedef typename CGAL::GetPointMap::const_type PointMap; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap()); estimate_local_range_scales (points, points, std::back_inserter (scales), np.query_point_map(point_map)); std::sort (scales.begin(), scales.end()); diff --git a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h index 4720479cba7..fdd360cf2f5 100644 --- a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h @@ -202,7 +202,7 @@ grid_simplify_point_set( using parameters::choose_parameter; using parameters::get_parameter; - typedef typename Point_set_processing_3::GetPointMap::const_type PointMap; + typedef typename CGAL::GetPointMap::const_type PointMap; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap()); const std::function& callback = choose_parameter(get_parameter(np, internal_np::callback), std::function()); diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 9b6fb4a1869..9ce0f90b31b 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -202,7 +202,7 @@ jet_estimate_normals( CGAL_TRACE("Calls jet_estimate_normals()\n"); // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; typedef typename Kernel::FT FT; 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 b8c7030498b..9537131c7ea 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -610,7 +610,7 @@ mst_orient_normals( CGAL_TRACE("Calls mst_orient_normals()\n"); - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; typedef typename Point_set_processing_3::GetIsConstrainedMap::type ConstrainedMap; diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 3a6ead3d5fd..f32345d6fdf 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -191,7 +191,7 @@ pca_estimate_normals( CGAL_TRACE("Calls pca_estimate_normals()\n"); // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; typedef typename Kernel::FT FT; diff --git a/Point_set_processing_3/include/CGAL/remove_outliers.h b/Point_set_processing_3/include/CGAL/remove_outliers.h index 60a5f2c4af0..b7040622944 100644 --- a/Point_set_processing_3/include/CGAL/remove_outliers.h +++ b/Point_set_processing_3/include/CGAL/remove_outliers.h @@ -148,7 +148,7 @@ remove_outliers( using parameters::get_parameter; // geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap()); 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 0a98d88c331..d3d4188662f 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -206,7 +206,7 @@ public: using parameters::get_parameter; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetPlaneMap::type PlaneMap; typedef typename Point_set_processing_3::GetPlaneIndexMap::type PlaneIndexMap; diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h index fde906bd6e0..3988bfee74f 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h @@ -260,7 +260,7 @@ compute_vcm (const PointRange& points, using parameters::get_parameter; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap()); @@ -320,7 +320,7 @@ vcm_estimate_normals_internal (PointRange& points, using parameters::get_parameter; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; typedef typename GetDiagonalizeTraits::type DiagonalizeTraits; diff --git a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h index cbe5b1ca5fb..1a977ffe881 100644 --- a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h +++ b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h @@ -464,7 +464,7 @@ wlop_simplify_and_regularize_point_set( using parameters::get_parameter; // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map), PointMap());