From bf9e8ab40d984b908fee107aa245f4aa61928ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 10 Apr 2018 17:33:43 +0200 Subject: [PATCH] restore function deprecated in 4.12 --- .../include/CGAL/structure_point_set.h | 101 ++++++------------ .../CGAL/Shape_detection_3/property_maps.h | 4 +- 2 files changed, 36 insertions(+), 69 deletions(-) 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 52f447b9232..94a3d1e3788 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -1584,91 +1584,58 @@ structure_point_set (const PointRange& points, ///< range of points. #ifndef CGAL_NO_DEPRECATED_CODE // deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::structure_point_set(), please update your code") -OutputIterator -structure_point_set (const PointRange& points, ///< range of points. - PointMap point_map, ///< property map: value_type of `typename PointRange::const_iterator` -> `Point_3` - NormalMap normal_map, ///< property map: value_type of `typename PointRange::const_iterator` -> `Normal_3` - const PlaneRange& planes, ///< range of planes. - PlaneMap plane_map, ///< property map: value_type of `typename PlaneRange::const_iterator` -> `Plane_3` - IndexMap index_map, ///< property map: index of point `std::size_t` -> index of plane `int` (-1 if point does is not assigned to a plane) - OutputIterator output, ///< output iterator where output points are written. - const Kernel&, ///< geometric traits. - double epsilon, ///< size parameter. - double attraction_factor = 3.) ///< attraction factor. -{ - return structure_point_set - (points, planes, output, epsilon, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - plane_map (plane_map). - plane_index_map (index_map). - attraction_factor (attraction_factor). - geom_traits (Kernel())); -} - -// deprecated API -template +> CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::structure_point_set(), please update your code") OutputIterator -structure_point_set (const PointRange& points, - PointMap point_map, - NormalMap normal_map, - const PlaneRange& planes, - PlaneMap plane_map, - IndexMap index_map, +structure_point_set (typename Traits::Input_range::iterator first, ///< iterator over the first input point. + typename Traits::Input_range::iterator beyond, ///< past-the-end iterator over the input points. + typename Traits::Point_map point_map, ///< property map: value_type of InputIterator -> Point_3. + typename Traits::Normal_map normal_map, ///< property map: value_type of InputIterator -> Vector_3. OutputIterator output, ///< output iterator where output points are written + Shape_detection_3::Efficient_RANSAC& + shape_detection, ///< shape detection object double epsilon, ///< size parameter double attraction_factor = 3.) ///< attraction factor { - return structure_point_set - (points, planes, output, epsilon, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - plane_map (plane_map). - plane_index_map (index_map). - attraction_factor (attraction_factor)); + typename Shape_detection_3::Efficient_RANSAC::Plane_range planes = shape_detection.planes(); + return structure_point_set (CGAL::make_range(first, beyond), + planes, + output, + epsilon, // epsilon for structuring points + CGAL::parameters::point_map (point_map). + normal_map (normal_map). + plane_map (CGAL::Shape_detection_3::Plane_map()). + plane_index_map (Shape_detection_3::Point_to_shape_index_map(CGAL::make_range(first, beyond), planes)). + attraction_factor(attraction_factor)); } + +/// \cond SKIP_IN_MANUAL // deprecated API -template +> CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::structure_point_set(), please update your code") OutputIterator -structure_point_set (const PointRange& points, - NormalMap normal_map, - const PlaneRange& planes, - IndexMap index_map, +structure_point_set (typename Traits::Input_range::iterator first, ///< iterator over the first input point. + typename Traits::Input_range::iterator beyond, ///< past-the-end iterator over the input points. OutputIterator output, ///< output iterator where output points are written + Shape_detection_3::Efficient_RANSAC& + shape_detection, ///< shape detection object double epsilon, ///< size parameter double attraction_factor = 3.) ///< attraction factor { - return structure_point_set - (points, planes, output, epsilon, - CGAL::parameters::normal_map (normal_map). - plane_index_map (index_map). - attraction_factor (attraction_factor)); + return structure_point_set (first, beyond, + typename Traits::Point_map(), + typename Traits::Normal_map(), + output, + shape_detection, + epsilon, + attraction_factor); } +/// \endcond #endif // CGAL_NO_DEPRECATED_CODE /// \endcond diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h index 8f787a03822..f26597397a7 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h @@ -64,8 +64,8 @@ namespace Shape_detection_3 { constant iterator type with value type `boost::shared_ptr >`. */ - template - Point_to_shape_index_map (const typename Traits::Input_range& points, + template + Point_to_shape_index_map (const PointRange& points, const ShapeRange& shapes) : m_indices (new std::vector(points.size(), -1)) {