From 3263e54a3a9a20e65ae4a82665b350b92e81a730 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Mon, 28 Jun 2021 18:42:32 +0200 Subject: [PATCH] added missing deprecated constructors for old classes --- .../K_neighbor_query.h | 30 +++++++++++ .../Least_squares_line_fit_region.h | 54 +++++++++++++++++++ .../Least_squares_line_fit_sorting.h | 28 ++++++++++ .../Least_squares_plane_fit_region.h | 54 +++++++++++++++++++ .../Least_squares_plane_fit_sorting.h | 28 ++++++++++ .../Sphere_neighbor_query.h | 30 +++++++++++ .../Least_squares_plane_fit_region.h | 47 ++++++++++++++++ .../Least_squares_plane_fit_sorting.h | 28 ++++++++++ 8 files changed, 299 insertions(+) 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 4f9d2484c68..ee1db418739 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,6 +154,36 @@ namespace Point_set { m_tree.build(); } + /*! + \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)) + { } + /// @} /// \name Access 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 7393f245525..e64dbff0fcd 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,6 +182,60 @@ namespace Point_set { m_cos_value_threshold = cos_value; } + /*! + \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:: + max_distance(distance_threshold). + max_angle(angle_threshold). + min_region_size(min_region_size). + point_map(point_map). + normal_map(normal_map). + geom_traits(traits)) + { } + /// @} /// \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 bc1dda39bfd..a16585a9369 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,6 +130,34 @@ namespace Point_set { m_scores.resize(m_input_range.size()); } + /*! + \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)) + { } + /// @} /// \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 053a3778d6b..b8340d3a720 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,6 +182,60 @@ namespace Point_set { m_cos_value_threshold = cos_value; } + /*! + \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:: + max_distance(distance_threshold). + max_angle(angle_threshold). + min_region_size(min_region_size). + point_map(point_map). + normal_map(normal_map). + geom_traits(traits)) + { } + /// @} /// \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 ef098f60f12..06daef9f164 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,6 +130,34 @@ namespace Point_set { m_scores.resize(m_input_range.size()); } + /*! + \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)) + { } + /// @} /// \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 18e6f17ceb5..7e6a832edf5 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,6 +149,36 @@ namespace Point_set { m_tree.build(); } + /*! + \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)) + { } + /// @} /// \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 50f09c6fa32..638b093e5dc 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,6 +196,53 @@ namespace Polygon_mesh { m_cos_value_threshold = cos_value; } + /*! + \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:: + max_distance(distance_threshold). + max_angle(angle_threshold). + min_region_size(min_region_size). + vertex_point_map(vertex_to_point_map). + geom_traits(traits)) + { } + /// @} /// \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 5602092a584..2479e968b9f 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,6 +137,34 @@ namespace Polygon_mesh { m_scores.resize(m_face_range.size()); } + /*! + \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)) + { } + /// @} /// \name Sorting