From 2f9d22225edf8b1a95e90b4405cbf1e7108d2de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 24 Jan 2022 18:31:20 +0100 Subject: [PATCH] remove deprecated functions Because of the default values of the constructors, the API of the new and the deprecated constructors are identical and the deprecated one is always chosen --- Installation/CHANGES.md | 9 + .../K_neighbor_query.h | 34 ---- .../Least_squares_circle_fit_region.h | 70 ------- .../Least_squares_circle_fit_sorting.h | 32 --- .../Least_squares_cylinder_fit_region.h | 70 ------- .../Least_squares_cylinder_fit_sorting.h | 37 ---- .../Least_squares_line_fit_region.h | 58 ------ .../Least_squares_line_fit_sorting.h | 32 --- .../Least_squares_plane_fit_region.h | 57 ------ .../Least_squares_plane_fit_sorting.h | 32 --- .../Least_squares_sphere_fit_region.h | 70 ------- .../Least_squares_sphere_fit_sorting.h | 32 --- .../Sphere_neighbor_query.h | 34 ---- .../Least_squares_plane_fit_region.h | 51 ----- .../Least_squares_plane_fit_sorting.h | 32 --- .../test/Shape_detection/CMakeLists.txt | 4 +- ...region_growing_deprecated_constructors.cpp | 183 ------------------ 17 files changed, 10 insertions(+), 827 deletions(-) delete mode 100644 Shape_detection/test/Shape_detection/test_region_growing_deprecated_constructors.cpp diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index ecd03edcbf8..2872e1aef5d 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -21,6 +21,15 @@ Release date: June 2022 a `boolean` instead of `void` that is used inside the class `Region_growing` for detecting if the input conditions for the new region are satisfied. This change affects only user-defined types of regions. +- **Breaking change**: Constructors of all models of the concepts [`RegionType`](https://doc.cgal.org/5.5/Shape_detection/classRegionType.html`) + and [`NeighborQuery`](https://doc.cgal.org/5.5/Shape_detection/classNeighborQuery.html`) have been updated to used named parameters. + Namely, the following classes are affected: + - [`CGAL::Shape_detection::Point_set::Least_squares_line_fit_region`](https://doc.cgal.org/5.5/Shape_detection/classCGAL_1_1Shape__detection_1_1Point__set_1_1Least__squares__line__fit__region.html) + - [`CGAL::Shape_detection::Point_set::Least_squares_plane_fit_region`](https://doc.cgal.org/5.5/Shape_detection/classCGAL_1_1Shape__detection_1_1Point__set_1_1Least__squares__plane__fit__region.html) + - [`CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_region`](https://doc.cgal.org/5.5/Shape_detection/classCGAL_1_1Shape__detection_1_1Polygon__mesh_1_1Least__squares__plane__fit__region.html) + - [`CGAL::Shape_detection::Point_set::K_neighbor_query`](https://doc.cgal.org/5.5/Shape_detection/classCGAL_1_1Shape__detection_1_1Point__set_1_1K__neighbor__query.html) + - [`CGAL::Shape_detection::Point_set::Sphere_neighbor_query`](https://doc.cgal.org/5.5/Shape_detection/classCGAL_1_1Shape__detection_1_1Point__set_1_1Sphere__neighbor__query.html) + - [`CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query`](https://doc.cgal.org/5.5/Shape_detection/classCGAL_1_1Shape__detection_1_1Polygon__mesh_1_1One__ring__neighbor__query.html) - The constructors of all models used together with the region growing algorithm now enable users to provide parameters through the named parameters mechanism. The old constructors without named parameters are deprecated. diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/K_neighbor_query.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/K_neighbor_query.h index 528cc95cf8b..0b72f5115a4 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/K_neighbor_query.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/K_neighbor_query.h @@ -154,40 +154,6 @@ namespace Point_set { m_tree.build(); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes a Kd-tree with input points. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param input_range - an instance of `InputRange` with 2D or 3D points - - \param k - the number of returned neighbors per each query point. %Default is 12. - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_2` or to `Kernel::Point_3` - - \pre `input_range.size() > 0` - - \pre `k > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - K_neighbor_query( - const InputRange& input_range, - const std::size_t k = 12, - const PointMap point_map = PointMap()) : - K_neighbor_query( - input_range, CGAL::parameters:: - k_neighbors(k). - point_map(point_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_region.h index e33f5738f61..7500f19665f 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_region.h @@ -204,76 +204,6 @@ namespace Point_set { CGAL_precondition(m_max_radius >= m_min_radius); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.5 of \cgal. - - \param input_range - an instance of `InputRange` with 2D points and - corresponding 2D normal vectors - - \param distance_threshold - the maximum distance from a point to a circle. %Default is 1. - - \param angle_threshold - the maximum accepted angle in degrees between the normal of a point - and the radius of a circle. %Default is 25 degrees. - - \param min_region_size - the minimum number of 2D points a region must have. %Default is 3. - - \param minimum_radius - the radius below which an estimated circle is considered as invalid - and discarded. %Default is 0 (no limit). - - \param maximum_radius - the radius above which an estimated circle is considered as invalid - and discarded. %Default is infinity (no limit). - - \param point_map - an instance of `PointMap` that maps an item from `input_range` to `Kernel::Point_2` - - \param normal_map - an instance of `NormalMap` that maps an item from `input_range` to `Kernel::Vector_2` - - \param traits - an instance of `GeomTraits` - - \pre `input_range.size() > 0` - \pre `distance_threshold >= 0` - \pre `angle_threshold >= 0 && angle_threshold <= 90` - \pre `min_region_size > 0` - \pre `minimum_radius >= 0` - \pre `maximum_radius >= minimum_radius` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.5 of CGAL!") - Least_squares_circle_fit_region( - const InputRange& input_range, - const FT distance_threshold = FT(1), - const FT angle_threshold = FT(25), - const std::size_t min_region_size = 3, - const FT minimum_radius = FT(0), - const FT maximum_radius = FT((std::numeric_limits::max)()), - const PointMap point_map = PointMap(), - const NormalMap normal_map = NormalMap(), - const GeomTraits traits = GeomTraits()) : - Least_squares_circle_fit_region( - input_range, CGAL::parameters:: - maximum_distance(distance_threshold). - maximum_angle(angle_threshold). - minimum_region_size(min_region_size). - minimum_radius(minimum_radius). - maximum_radius(maximum_radius). - point_map(point_map). - normal_map(normal_map). - geom_traits(traits)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_sorting.h index 043130f21cd..2bc84eba645 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_circle_fit_sorting.h @@ -130,38 +130,6 @@ namespace Point_set { m_scores.resize(m_input_range.size()); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.5 of \cgal. - - \param input_range - an instance of `InputRange` with 2D points - - \param neighbor_query - an instance of `NeighborQuery` that is used internally to - access point's neighbors - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_2` - - \pre `input_range.size() > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.5 of CGAL!") - Least_squares_circle_fit_sorting( - const InputRange& input_range, - NeighborQuery& neighbor_query, - const PointMap point_map = PointMap()) : - Least_squares_circle_fit_sorting( - input_range, neighbor_query, CGAL::parameters:: - point_map(point_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Sorting diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_region.h index 37ef7d7ccb6..d0d9f3cbf1c 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_region.h @@ -204,76 +204,6 @@ namespace Point_set { CGAL_precondition(m_max_radius >= m_min_radius); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.5 of \cgal. - - \param input_range - an instance of `InputRange` with 3D points and - corresponding 3D normal vectors - - \param distance_threshold - the maximum distance from a point to a cylinder. %Default is 1. - - \param angle_threshold - the maximum accepted angle in degrees between the normal of a point - and the radius of a cylinder. %Default is 25 degrees. - - \param min_region_size - the minimum number of 3D points a region must have. %Default is 3. - - \param minimum_radius - the radius below which an estimated cylinder is considered as invalid - and discarded. %Default is 0 (no limit). - - \param maximum_radius - the radius above which an estimated cylinder is considered as invalid - and discarded. %Default is infinity (no limit). - - \param point_map - an instance of `PointMap` that maps an item from `input_range` to `Kernel::Point_3` - - \param normal_map - an instance of `NormalMap` that maps an item from `input_range` to `Kernel::Vector_3` - - \param traits - an instance of `GeomTraits`. - - \pre `input_range.size() > 0` - \pre `distance_threshold >= 0` - \pre `angle_threshold >= 0 && angle_threshold <= 90` - \pre `min_region_size > 0` - \pre `minimum_radius >= 0` - \pre `maximum_radius >= minimum_radius` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.5 of CGAL!") - Least_squares_cylinder_fit_region( - const InputRange& input_range, - const FT distance_threshold = FT(1), - const FT angle_threshold = FT(25), - const std::size_t min_region_size = 3, - const FT minimum_radius = FT(0), - const FT maximum_radius = FT((std::numeric_limits::max)()), - const PointMap point_map = PointMap(), - const NormalMap normal_map = NormalMap(), - const GeomTraits traits = GeomTraits()) : - Least_squares_cylinder_fit_region( - input_range, CGAL::parameters:: - maximum_distance(distance_threshold). - maximum_angle(angle_threshold). - minimum_region_size(min_region_size). - minimum_radius(minimum_radius). - maximum_radius(maximum_radius). - point_map(point_map). - normal_map(normal_map). - geom_traits(traits)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_sorting.h index 355cb9abc28..439b85accf3 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_sorting.h @@ -143,43 +143,6 @@ namespace Point_set { m_scores.resize(m_input_range.size()); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.5 of \cgal. - - \param input_range - an instance of `InputRange` with 3D points - - \param neighbor_query - an instance of `NeighborQuery` that is used internally to - access point's neighbors - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_3` - - \param normal_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Vector_3` - - \pre `input_range.size() > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.5 of CGAL!") - Least_squares_cylinder_fit_sorting( - const InputRange& input_range, - NeighborQuery& neighbor_query, - const PointMap point_map = PointMap(), - const NormalMap normal_map = NormalMap()) : - Least_squares_cylinder_fit_sorting( - input_range, neighbor_query, CGAL::parameters:: - point_map(point_map).normal_map(normal_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Sorting diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_region.h index f71b77188fb..05cbb9d8420 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_region.h @@ -182,64 +182,6 @@ namespace Point_set { m_cos_value_threshold = cos_value; } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param input_range - an instance of `InputRange` with 2D points and - corresponding 2D normal vectors - - \param distance_threshold - the maximum distance from a point to a line. %Default is 1. - - \param angle_threshold - the maximum accepted angle in degrees between the normal of a point and - the normal of a line. %Default is 25 degrees. - - \param min_region_size - the minimum number of 2D points a region must have. %Default is 2. - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_2` - - \param normal_map - an instance of `NormalMap` that maps an item from `input_range` - to `Kernel::Vector_2` - - \param traits - an instance of `GeomTraits` - - \pre `input_range.size() > 0` - \pre `distance_threshold >= 0` - \pre `angle_threshold >= 0 && angle_threshold <= 90` - \pre `min_region_size > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - Least_squares_line_fit_region( - const InputRange& input_range, - const FT distance_threshold = FT(1), - const FT angle_threshold = FT(25), - const std::size_t min_region_size = 2, - const PointMap point_map = PointMap(), - const NormalMap normal_map = NormalMap(), - const GeomTraits traits = GeomTraits()) : - Least_squares_line_fit_region( - input_range, CGAL::parameters:: - maximum_distance(distance_threshold). - maximum_angle(angle_threshold). - minimum_region_size(min_region_size). - point_map(point_map). - normal_map(normal_map). - geom_traits(traits)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_sorting.h index 8bb9f67f89a..0b8ea162493 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_line_fit_sorting.h @@ -130,38 +130,6 @@ namespace Point_set { m_scores.resize(m_input_range.size()); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param input_range - an instance of `InputRange` with 2D points - - \param neighbor_query - an instance of `NeighborQuery` that is used internally to - access point's neighbors - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_2` - - \pre `input_range.size() > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - Least_squares_line_fit_sorting( - const InputRange& input_range, - NeighborQuery& neighbor_query, - const PointMap point_map = PointMap()) : - Least_squares_line_fit_sorting( - input_range, neighbor_query, CGAL::parameters:: - point_map(point_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Sorting diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_region.h index 37814710117..7d055d8c5d3 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_region.h @@ -182,63 +182,6 @@ namespace Point_set { m_cos_value_threshold = cos_value; } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param input_range - an instance of `InputRange` with 3D points and - corresponding 3D normal vectors - - \param distance_threshold - the maximum distance from a point to a plane. %Default is 1. - - \param angle_threshold - the maximum accepted angle in degrees between the normal of a point and - the normal of a plane. %Default is 25 degrees. - - \param min_region_size - the minimum number of 3D points a region must have. %Default is 3. - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_3` - - \param normal_map - an instance of `NormalMap` that maps an item from `input_range` - to `Kernel::Vector_3` - - \param traits - an instance of `GeomTraits`. - - \pre `input_range.size() > 0` - \pre `distance_threshold >= 0` - \pre `angle_threshold >= 0 && angle_threshold <= 90` - \pre `min_region_size > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - Least_squares_plane_fit_region( - const InputRange& input_range, - const FT distance_threshold = FT(1), - const FT angle_threshold = FT(25), - const std::size_t min_region_size = 3, - const PointMap point_map = PointMap(), - const NormalMap normal_map = NormalMap(), - const GeomTraits traits = GeomTraits()) : - Least_squares_plane_fit_region( - input_range, CGAL::parameters:: - maximum_distance(distance_threshold). - maximum_angle(angle_threshold). - minimum_region_size(min_region_size). - point_map(point_map). - normal_map(normal_map). - geom_traits(traits)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_sorting.h index 482d5c91232..472e9a9433b 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_sorting.h @@ -130,38 +130,6 @@ namespace Point_set { m_scores.resize(m_input_range.size()); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param input_range - an instance of `InputRange` with 3D points - - \param neighbor_query - an instance of `NeighborQuery` that is used internally to - access point's neighbors - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_3` - - \pre `input_range.size() > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - Least_squares_plane_fit_sorting( - const InputRange& input_range, - NeighborQuery& neighbor_query, - const PointMap point_map = PointMap()) : - Least_squares_plane_fit_sorting( - input_range, neighbor_query, CGAL::parameters:: - point_map(point_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Sorting diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_region.h index 03cb2bffcd2..b2626570a7c 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_region.h @@ -203,76 +203,6 @@ namespace Point_set { CGAL_precondition(m_max_radius >= m_min_radius); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.5 of \cgal. - - \param input_range - an instance of `InputRange` with 3D points and - corresponding 3D normal vectors - - \param distance_threshold - the maximum distance from a point to a sphere. %Default is 1. - - \param angle_threshold - the maximum accepted angle in degrees between the normal of a point - and the radius of a sphere. %Default is 25 degrees. - - \param min_region_size - the minimum number of 3D points a region must have. %Default is 3. - - \param minimum_radius - the radius below which an estimated sphere is considered as invalid - and discarded. %Default is 0 (no limit). - - \param maximum_radius - the radius above which an estimated sphere is considered as invalid - and discarded. %Default is infinity (no limit). - - \param point_map - an instance of `PointMap` that maps an item from `input_range` to `Kernel::Point_3` - - \param normal_map - an instance of `NormalMap` that maps an item from `input_range` to `Kernel::Vector_3` - - \param traits - an instance of `GeomTraits` - - \pre `input_range.size() > 0` - \pre `distance_threshold >= 0` - \pre `angle_threshold >= 0 && angle_threshold <= 90` - \pre `min_region_size > 0` - \pre `minimum_radius >= 0` - \pre `maximum_radius >= minimum_radius` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.5 of CGAL!") - Least_squares_sphere_fit_region( - const InputRange& input_range, - const FT distance_threshold = FT(1), - const FT angle_threshold = FT(25), - const std::size_t min_region_size = 3, - const FT minimum_radius = FT(0), - const FT maximum_radius = FT((std::numeric_limits::max)()), - const PointMap point_map = PointMap(), - const NormalMap normal_map = NormalMap(), - const GeomTraits traits = GeomTraits()) : - Least_squares_sphere_fit_region( - input_range, CGAL::parameters:: - maximum_distance(distance_threshold). - maximum_angle(angle_threshold). - minimum_region_size(min_region_size). - minimum_radius(minimum_radius). - maximum_radius(maximum_radius). - point_map(point_map). - normal_map(normal_map). - geom_traits(traits)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_sorting.h index f84de44bec2..54a4eb1996a 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_sphere_fit_sorting.h @@ -130,38 +130,6 @@ namespace Point_set { m_scores.resize(m_input_range.size()); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.5 of \cgal. - - \param input_range - an instance of `InputRange` with 3D points - - \param neighbor_query - an instance of `NeighborQuery` that is used internally to - access point's neighbors - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_3` - - \pre `input_range.size() > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.5 of CGAL!") - Least_squares_sphere_fit_sorting( - const InputRange& input_range, - NeighborQuery& neighbor_query, - const PointMap point_map = PointMap()) : - Least_squares_sphere_fit_sorting( - input_range, neighbor_query, CGAL::parameters:: - point_map(point_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Sorting diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Sphere_neighbor_query.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Sphere_neighbor_query.h index 38b75f71402..542875bc0bb 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Sphere_neighbor_query.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Sphere_neighbor_query.h @@ -149,40 +149,6 @@ namespace Point_set { m_tree.build(); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes a Kd-tree with input points. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param input_range - an instance of `InputRange` with 2D or 3D points - - \param sphere_radius - the fixed radius of the fuzzy sphere used for searching neighbors - of a query point. %Default is 1. - - \param point_map - an instance of `PointMap` that maps an item from `input_range` - to `Kernel::Point_2` or to `Kernel::Point_3` - - \pre `input_range.size() > 0` - \pre `sphere_radius > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - Sphere_neighbor_query( - const InputRange& input_range, - const FT sphere_radius = FT(1), - const PointMap point_map = PointMap()) : - Sphere_neighbor_query( - input_range, CGAL::parameters:: - sphere_radius(sphere_radius). - point_map(point_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h index 85cf2a58414..a8f7af38853 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h @@ -196,57 +196,6 @@ namespace Polygon_mesh { m_cos_value_threshold = cos_value; } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param pmesh - an instance of `PolygonMesh` that represents a polygon mesh - - \param distance_threshold - the maximum distance from the furthest vertex of a face to a plane. %Default is 1. - - \param angle_threshold - the maximum accepted angle in degrees between the normal of a face and - the normal of a plane. %Default is 25 degrees. - - \param min_region_size - the minimum number of faces a region must have. %Default is 1. - - \param vertex_to_point_map - an instance of `VertexToPointMap` that maps a polygon mesh - vertex to `Kernel::Point_3` - - \param traits - an instance of `GeomTraits` - - \pre `faces(pmesh).size() > 0` - \pre `distance_threshold >= 0` - \pre `angle_threshold >= 0 && angle_threshold <= 90` - \pre `min_region_size > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - Least_squares_plane_fit_region( - const PolygonMesh& pmesh, - const FT distance_threshold = FT(1), - const FT angle_threshold = FT(25), - const std::size_t min_region_size = 1, - const VertexToPointMap vertex_to_point_map = VertexToPointMap(), - const GeomTraits traits = GeomTraits()) : - Least_squares_plane_fit_region( - pmesh, CGAL::parameters:: - maximum_distance(distance_threshold). - maximum_angle(angle_threshold). - minimum_region_size(min_region_size). - vertex_point_map(vertex_to_point_map). - geom_traits(traits)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Access diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_sorting.h index e764ab30b26..e92bde79d23 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_sorting.h @@ -137,38 +137,6 @@ namespace Polygon_mesh { m_scores.resize(m_face_range.size()); } - #if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING) - - /*! - \brief initializes all internal data structures. - - \deprecated This constructor is deprecated since the version 5.4 of \cgal. - - \param pmesh - an instance of `PolygonMesh` that represents a polygon mesh - - \param neighbor_query - an instance of `NeighborQuery` that is used internally to - access face's neighbors - - \param vertex_to_point_map - an instance of `VertexToPointMap` that maps a polygon mesh - vertex to `Kernel::Point_3` - - \pre `faces(pmesh).size() > 0` - */ - CGAL_DEPRECATED_MSG("This constructor is deprecated since the version 5.4 of CGAL!") - Least_squares_plane_fit_sorting( - const PolygonMesh& pmesh, - NeighborQuery& neighbor_query, - const VertexToPointMap vertex_to_point_map = VertexToPointMap()) : - Least_squares_plane_fit_sorting( - pmesh, neighbor_query, CGAL::parameters:: - vertex_point_map(vertex_to_point_map)) - { } - - #endif // CGAL_NO_DEPRECATED_CODE - /// @} /// \name Sorting diff --git a/Shape_detection/test/Shape_detection/CMakeLists.txt b/Shape_detection/test/Shape_detection/CMakeLists.txt index d2d5898f188..313d85e704a 100644 --- a/Shape_detection/test/Shape_detection/CMakeLists.txt +++ b/Shape_detection/test/Shape_detection/CMakeLists.txt @@ -24,7 +24,6 @@ if(EIGEN3_FOUND) create_single_source_cgal_program("test_region_growing_on_polygon_mesh_with_sorting.cpp") create_single_source_cgal_program("test_region_growing_on_polyline_with_sorting.cpp") create_single_source_cgal_program("test_region_growing_on_degenerated_mesh.cpp") - create_single_source_cgal_program("test_region_growing_deprecated_constructors.cpp") foreach( target test_region_growing_basic @@ -38,8 +37,7 @@ if(EIGEN3_FOUND) test_region_growing_on_point_set_3_with_sorting test_region_growing_on_polygon_mesh_with_sorting test_region_growing_on_polyline_with_sorting - test_region_growing_on_degenerated_mesh - test_region_growing_deprecated_constructors) + test_region_growing_on_degenerated_mesh) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() diff --git a/Shape_detection/test/Shape_detection/test_region_growing_deprecated_constructors.cpp b/Shape_detection/test/Shape_detection/test_region_growing_deprecated_constructors.cpp deleted file mode 100644 index ae65c4f2ef9..00000000000 --- a/Shape_detection/test/Shape_detection/test_region_growing_deprecated_constructors.cpp +++ /dev/null @@ -1,183 +0,0 @@ -// Turn off warnings. -#include - -// STL includes. -#include -#include -#include -#include - -// CGAL includes. -#include -#include -#include - -#include -#include -#include - -namespace SD = CGAL::Shape_detection; -using Kernel = CGAL::Simple_cartesian; - -using FT = typename Kernel::FT; -using Point_2 = typename Kernel::Point_2; -using Point_3 = typename Kernel::Point_3; -using Vector_2 = typename Kernel::Vector_2; -using Vector_3 = typename Kernel::Vector_3; - -using Point_with_normal_2 = std::pair; -using Point_with_normal_3 = std::pair; - -using Input_range_2 = std::vector; -using Input_range_3 = std::vector; - -using Polygon_mesh = CGAL::Surface_mesh; -using Face_range = typename Polygon_mesh::Face_range; - -using Point_map_2 = CGAL::First_of_pair_property_map; -using Point_map_3 = CGAL::First_of_pair_property_map; - -using Normal_map_2 = CGAL::Second_of_pair_property_map; -using Normal_map_3 = CGAL::Second_of_pair_property_map; - -using NQ1 = SD::Point_set::K_neighbor_query; -using NQ2 = SD::Point_set::Sphere_neighbor_query; -using NQ3 = SD::Polygon_mesh::One_ring_neighbor_query; - -using RT1 = SD::Point_set::Least_squares_line_fit_region; -using RT2 = SD::Point_set::Least_squares_plane_fit_region; -using RT3 = SD::Polygon_mesh::Least_squares_plane_fit_region; - -using RT4 = SD::Point_set::Least_squares_circle_fit_region; -using RT5 = SD::Point_set::Least_squares_sphere_fit_region; -using RT6 = SD::Point_set::Least_squares_cylinder_fit_region; - -using S1 = SD::Point_set::Least_squares_line_fit_sorting; -using S2 = SD::Point_set::Least_squares_plane_fit_sorting; -using S3 = SD::Polygon_mesh::Least_squares_plane_fit_sorting; - -using S4 = SD::Point_set::Least_squares_circle_fit_sorting; -using S5 = SD::Point_set::Least_squares_sphere_fit_sorting; -using S6 = SD::Point_set::Least_squares_cylinder_fit_sorting; - -using RG1 = SD::Region_growing; -using RG2 = SD::Region_growing; -using RG3 = SD::Region_growing; - -using RG4 = SD::Region_growing; -using RG5 = SD::Region_growing; -using RG6 = SD::Region_growing; - -int main() { - - // Default parameter values. - const std::size_t k = 6; - const FT distance_threshold = FT(2); - const FT angle_threshold = FT(15); - const std::size_t min_region_size = 1; - const FT sphere_radius = FT(2); - const FT min_radius = FT(0); - const FT max_radius = FT(1000000); - - const Kernel traits; - const Input_range_2 input_range_2 = { - std::make_pair(Point_2(0, 0), Vector_2(0, 1)), - std::make_pair(Point_2(1, 0), Vector_2(0, 1)) - }; - const Input_range_3 input_range_3 = { - std::make_pair(Point_3(0, 0, 0), Vector_3(0, 0, 1)), - std::make_pair(Point_3(1, 0, 0), Vector_3(0, 0, 1)), - std::make_pair(Point_3(2, 0, 0), Vector_3(0, 0, 1)) - }; - Polygon_mesh polygon_mesh; - CGAL::make_tetrahedron( - Point_3(0, 0, 0), Point_3(2, 0, 0), - Point_3(1, 1, 1), Point_3(1, 0, 2), polygon_mesh); - const auto vertex_to_point_map = - get_const_property_map(CGAL::vertex_point, polygon_mesh); - const auto face_range = faces(polygon_mesh); - - Point_map_2 point_map_2; - Point_map_3 point_map_3; - Normal_map_2 normal_map_2; - Normal_map_3 normal_map_3; - - assert(input_range_2.size() == 2); - assert(input_range_3.size() == 3); - assert(polygon_mesh.number_of_faces() == 4); - - NQ1 nq1(input_range_2, k, point_map_2); - NQ2 nq2(input_range_3, sphere_radius, point_map_3); - NQ3 nq3(polygon_mesh); - - RT1 rt1(input_range_2, - distance_threshold, angle_threshold, min_region_size, - point_map_2, normal_map_2, traits); - RT2 rt2(input_range_3, - distance_threshold, angle_threshold, min_region_size, - point_map_3, normal_map_3, traits); - RT3 rt3(polygon_mesh, - distance_threshold, angle_threshold, min_region_size, - vertex_to_point_map, traits); - - RT4 rt4(input_range_2, - distance_threshold, angle_threshold, min_region_size, min_radius, max_radius, - point_map_2, normal_map_2, traits); - RT5 rt5(input_range_3, - distance_threshold, angle_threshold, min_region_size, min_radius, max_radius, - point_map_3, normal_map_3, traits); - RT6 rt6(input_range_3, - distance_threshold, angle_threshold, min_region_size, min_radius, max_radius, - point_map_3, normal_map_3, traits); - - S1 s1(input_range_2, nq1, point_map_2); - S2 s2(input_range_3, nq2, point_map_3); - S3 s3(polygon_mesh , nq3, vertex_to_point_map); - - S4 s4(input_range_2, nq1, point_map_2); - S5 s5(input_range_3, nq2, point_map_3); - S6 s6(input_range_3, nq2, point_map_3); - - s1.sort(); - s2.sort(); - s3.sort(); - - s4.sort(); - s5.sort(); - s6.sort(); - - RG1 rg1(input_range_2, nq1, rt1, s1.seed_map()); - RG2 rg2(input_range_3, nq2, rt2, s2.seed_map()); - RG3 rg3(face_range , nq3, rt3, s3.seed_map()); - - RG4 rg4(input_range_2, nq1, rt4, s4.seed_map()); - RG5 rg5(input_range_3, nq2, rt5, s5.seed_map()); - RG6 rg6(input_range_3, nq2, rt6, s6.seed_map()); - - std::vector< std::vector > regions1; - std::vector< std::vector > regions2; - std::vector< std::vector > regions3; - - std::vector< std::vector > regions4; - std::vector< std::vector > regions5; - std::vector< std::vector > regions6; - - rg1.detect(std::back_inserter(regions1)); - rg2.detect(std::back_inserter(regions2)); - rg3.detect(std::back_inserter(regions3)); - - rg4.detect(std::back_inserter(regions4)); - rg5.detect(std::back_inserter(regions5)); - rg6.detect(std::back_inserter(regions6)); - - assert(regions1.size() == 1); - assert(regions2.size() == 1); - assert(regions3.size() == 4); - - assert(regions4.size() > 0); - assert(regions5.size() > 0); - assert(regions6.size() > 0); - - std::cout << "rg_deprecated, sc_test_success: " << true << std::endl; - return EXIT_SUCCESS; -}