From 6f24d198cc974f6d0b01f8c8303cb039f5a4be5d Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 6 Jul 2022 14:58:29 +0200 Subject: [PATCH] removal of Result_type and Unassigned_type from Region_growing changed Primitive type declarations --- ...enchmark_region_growing_on_point_set_3.cpp | 2 +- .../Shape_detection/Concepts/NeighborQuery.h | 2 +- .../doc/Shape_detection/Concepts/RegionType.h | 9 ++---- .../region_growing_lines_on_point_set_2.cpp | 4 +-- .../region_growing_lines_on_polyline.cpp | 8 ++--- .../region_growing_lines_on_segment_set.cpp | 6 ++-- .../region_growing_planes_on_polygon_mesh.cpp | 4 +-- .../region_growing_with_custom_classes.cpp | 2 +- .../Least_squares_circle_fit_region.h | 28 ++++++++++------- .../Least_squares_cylinder_fit_region.h | 30 +++++++++++-------- .../Point_set/Least_squares_line_fit_region.h | 20 ++++++------- .../Least_squares_plane_fit_region.h | 18 +++++------ .../Least_squares_sphere_fit_region.h | 16 +++++----- .../Least_squares_plane_fit_region.h | 20 ++++++------- .../Least_squares_plane_fit_sorting.h | 7 ++--- .../Polygon_mesh/One_ring_neighbor_query.h | 4 +-- .../Polyline/Least_squares_line_fit_region.h | 7 +++-- .../Polyline/Least_squares_line_fit_sorting.h | 13 ++++---- .../Polyline/One_ring_neighbor_query.h | 2 +- .../Region_growing/Region_growing.h | 29 ++++++++---------- .../Least_squares_line_fit_region.h | 10 ++++--- .../Least_squares_line_fit_sorting.h | 11 ++++--- .../test_region_growing_basic.cpp | 4 +-- .../test_region_growing_on_cube.cpp | 4 +-- ...est_region_growing_on_degenerated_mesh.cpp | 4 +-- .../test_region_growing_on_point_set_2.cpp | 4 +-- ...on_growing_on_point_set_2_with_sorting.cpp | 4 +-- .../test_region_growing_on_point_set_3.cpp | 4 +-- ...on_growing_on_point_set_3_with_sorting.cpp | 4 +-- .../test_region_growing_on_polygon_mesh.cpp | 4 +-- ...n_growing_on_polygon_mesh_with_sorting.cpp | 2 +- .../test_region_growing_on_polyline.cpp | 8 ++--- ...egion_growing_on_polyline_with_sorting.cpp | 10 +++---- .../test_region_growing_strict.cpp | 6 ++-- 34 files changed, 154 insertions(+), 156 deletions(-) diff --git a/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp b/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp index 5efa83fa1c1..640c1b27cc8 100644 --- a/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp +++ b/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp @@ -100,7 +100,7 @@ void benchmark_region_growing_on_point_set_3( // Run the algorithm. Timer timer; - Region_growing::Result_type regions; + std::vector regions; timer.start(); region_growing.detect(std::back_inserter(regions)); diff --git a/Shape_detection/doc/Shape_detection/Concepts/NeighborQuery.h b/Shape_detection/doc/Shape_detection/Concepts/NeighborQuery.h index ed1b5383d64..bbd1ff2c654 100644 --- a/Shape_detection/doc/Shape_detection/Concepts/NeighborQuery.h +++ b/Shape_detection/doc/Shape_detection/Concepts/NeighborQuery.h @@ -16,7 +16,7 @@ class NeighborQuery { public: - /// The reference type to the elements of the input range. + /// The reference type to the elements of the input range, e.g., a const_iterator of the input range. typedef unspecified_type Item; /*! diff --git a/Shape_detection/doc/Shape_detection/Concepts/RegionType.h b/Shape_detection/doc/Shape_detection/Concepts/RegionType.h index ef81870b40a..2f7e065ad00 100644 --- a/Shape_detection/doc/Shape_detection/Concepts/RegionType.h +++ b/Shape_detection/doc/Shape_detection/Concepts/RegionType.h @@ -5,8 +5,7 @@ A concept that describes the set of methods used by the `CGAL::Shape_detection::Region_growing` to maintain a region. -A region is represented by a set of `indices` of the items, which are included in -this region. +A region is represented by a set items, which are included in this region. \cgalHasModel - `CGAL::Shape_detection::Point_set::Least_squares_line_fit_region` @@ -25,15 +24,12 @@ public: /// The parameters of the primitive covering the region. typedef unspecified_type Primitive; - /// The reference type to the elements of the input range. + /// The reference type to the elements of the input range, e.g., a const_iterator of the input range. typedef unspecified_type Item; // The region types is defined by a vector of Items. typedef std::vector Region; - /// The result type of the region growing provides the Primitive of each region with the Items combined in a `std::pair`. - typedef std::vector > Result_type; - /*! a model of `ReadWritePropertyMap` whose key type is `Item` and value type is `std::size_t`. This map associates item of the input range @@ -41,7 +37,6 @@ public: */ typedef unspecified_type Region_index_map; - /*! checks if the item `to`, which is a neighbor of the item `from`, can be added to the region represented by `region`. diff --git a/Shape_detection/examples/Shape_detection/region_growing_lines_on_point_set_2.cpp b/Shape_detection/examples/Shape_detection/region_growing_lines_on_point_set_2.cpp index f5870d28c15..3d274113a1b 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_lines_on_point_set_2.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_lines_on_point_set_2.cpp @@ -62,14 +62,14 @@ int main(int argc, char *argv[]) { point_set_2, neighbor_query, region_type); // Run the algorithm. - Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); std::cout << "* number of found lines: " << regions.size() << std::endl; assert(is_default_input && regions.size() == 72); // Save regions to a file. const std::string fullpath = (argc > 2 ? argv[2] : "lines_point_set_2.ply"); - utils::save_point_regions_2( + utils::save_point_regions_2, Point_map>( regions, fullpath); return EXIT_SUCCESS; } diff --git a/Shape_detection/examples/Shape_detection/region_growing_lines_on_polyline.cpp b/Shape_detection/examples/Shape_detection/region_growing_lines_on_polyline.cpp index 0130e8f7459..fd7234b7ce9 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_lines_on_polyline.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_lines_on_polyline.cpp @@ -65,14 +65,14 @@ int main(int argc, char *argv[]) { polyline_3, neighbor_query_3, region_type_3); // Run the algorithm on a 3D polyline. - Region_growing_3::Result_type regions; + std::vector regions; region_growing_3.detect(std::back_inserter(regions)); std::cout << "* number of found 3D regions: " << regions.size() << std::endl; assert(is_default_input && regions.size() == 17); // Save 3D regions to a file. std::string fullpath = (argc > 2 ? argv[2] : "regions_polyline_3.ply"); - utils::save_point_regions_3( + utils::save_point_regions_3, Point_map_3>( regions, fullpath); // Create the 2D polyline. @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) { polyline_2, neighbor_query_2, region_type_2); // Run the algorithm on a 2D polyline. - Region_growing_2::Result_type regions2; + std::vector regions2; region_growing_2.detect(std::back_inserter(regions2)); std::cout << "* number of found 2D regions: " << regions2.size() << std::endl; assert(is_default_input && regions2.size() == 5); @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) { } fullpath = (argc > 2 ? argv[2] : "regions_polyline_2.ply"); - utils::save_point_regions_2( + utils::save_point_regions_2, Point_map_2>( regions2, fullpath); return EXIT_SUCCESS; diff --git a/Shape_detection/examples/Shape_detection/region_growing_lines_on_segment_set.cpp b/Shape_detection/examples/Shape_detection/region_growing_lines_on_segment_set.cpp index a536dc11abf..cf8f5526d0e 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_lines_on_segment_set.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_lines_on_segment_set.cpp @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) { Plane_region plane_region(surface_mesh); RG_planes rg_planes(face_range, one_ring_query, plane_region); - RG_planes::Result_type regions; + std::vector regions; rg_planes.detect(std::back_inserter(regions)); std::cout << "* number of found planar regions: " << regions.size() << std::endl; assert(is_default_input && regions.size() == 9); @@ -72,13 +72,13 @@ int main(int argc, char *argv[]) { RG_lines rg_lines( segment_range, pgraph, line_region, line_sorting.ordered()); - RG_lines::Result_type subregions; + std::vector subregions; rg_lines.detect(std::back_inserter(subregions)); std::cout << "* number of found linear regions: " << subregions.size() << std::endl; assert(is_default_input && subregions.size() == 21); fullpath = (argc > 2 ? argv[2] : "subregions_sm.ply"); - utils::save_segment_regions_3( + utils::save_segment_regions_3, Segment_map>( subregions, fullpath, pgraph.segment_map()); return EXIT_SUCCESS; diff --git a/Shape_detection/examples/Shape_detection/region_growing_planes_on_polygon_mesh.cpp b/Shape_detection/examples/Shape_detection/region_growing_planes_on_polygon_mesh.cpp index d8ee17f6b6e..b59ea3cab75 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_planes_on_polygon_mesh.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_planes_on_polygon_mesh.cpp @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) { face_range, neighbor_query, region_type, sorting.ordered()); // Run the algorithm. - Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); std::cout << "* number of found planes: " << regions.size() << std::endl; assert(is_default_input && regions.size() == 355); @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) { } } - Region_growing::Unassigned_type unassigned; + std::vector unassigned; region_growing.unassigned_items(std::back_inserter(unassigned)); for (auto& item : unassigned) { diff --git a/Shape_detection/examples/Shape_detection/region_growing_with_custom_classes.cpp b/Shape_detection/examples/Shape_detection/region_growing_with_custom_classes.cpp index 92c9aca22bf..10d711776a9 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_with_custom_classes.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_with_custom_classes.cpp @@ -145,7 +145,7 @@ int main() { objects, neighbor_query, region_type); // Run the algorithm. - Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); std::cout << "* number of found regions: " << regions.size() << std::endl; assert(regions.size() == 2); diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h index 833db8dc1fa..7756b74aedc 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h @@ -65,7 +65,6 @@ namespace Point_set { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Point_map = PointMap; using Normal_map = NormalMap; @@ -78,25 +77,32 @@ namespace Point_set { using Item = typename InputRange::const_iterator; using Region = std::vector; +#ifdef DOXYGEN_RUNNING + /// Primitive + using Primitive = struct { + typename GeomTraits::Point_2 center; + typename GeomTraits::FT radius; + }; +#else /// Primitive using Primitive = struct P { - P(const typename Traits::Point_2& c, typename Traits::FT r) : center(c), radius(r) {} - typename Traits::Point_2 center; - typename Traits::FT radius; - }; - using Result_type = std::vector >; + P(const typename GeomTraits::Point_2& c, typename GeomTraits::FT r) : center(c), radius(r) {} + typename GeomTraits::Point_2 center; + typename GeomTraits::FT radius; + }; +#endif /// Region map using Region_unordered_map = boost::unordered_map >; using Region_index_map = boost::associative_property_map; /// @} private: - using Point_2 = typename Traits::Point_2; - using Vector_2 = typename Traits::Vector_2; + using Point_2 = typename GeomTraits::Point_2; + using Vector_2 = typename GeomTraits::Vector_2; - using Squared_distance_2 = typename Traits::Compute_squared_distance_2; - using Get_sqrt = internal::Get_sqrt; + using Squared_distance_2 = typename GeomTraits::Compute_squared_distance_2; + using Get_sqrt = internal::Get_sqrt; using Sqrt = typename Get_sqrt::Sqrt; public: @@ -372,7 +378,7 @@ namespace Point_set { const Input_range& m_input_range; const Point_map m_point_map; const Normal_map m_normal_map; - const Traits m_traits; + const GeomTraits m_traits; Region_unordered_map m_region_map; FT m_distance_threshold; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h index 402413de0f9..367718bd61b 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h @@ -65,7 +65,6 @@ namespace Point_set { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Point_map = PointMap; using Normal_map = NormalMap; @@ -79,12 +78,19 @@ namespace Point_set { using Region = std::vector; /// Primitive - using Primitive = struct P { - P(const typename Traits::Line_3& a, const typename Traits::FT r) : axis(a), radius(r) {} - typename Traits::Line_3 axis; - typename Traits::FT radius; +#ifdef DOXYGEN_RUNNING + using Primitive = struct { + typename GeomTraits::Line_3 axis; + typename GeomTraits::FT radius; }; - using Result_type = std::vector >; +#else + using Primitive = struct P { + P(const typename GeomTraits::Line_3& a, const typename GeomTraits::FT r) : axis(a), radius(r) {} + + typename GeomTraits::Line_3 axis; + typename GeomTraits::FT radius; + }; +#endif /// Region map using Region_unordered_map = boost::unordered_map >; @@ -92,12 +98,12 @@ namespace Point_set { /// @} private: - using Point_3 = typename Traits::Point_3; - using Vector_3 = typename Traits::Vector_3; - using Line_3 = typename Traits::Line_3; + using Point_3 = typename GeomTraits::Point_3; + using Vector_3 = typename GeomTraits::Vector_3; + using Line_3 = typename GeomTraits::Line_3; - using Squared_distance_3 = typename Traits::Compute_squared_distance_3; - using Get_sqrt = internal::Get_sqrt; + using Squared_distance_3 = typename GeomTraits::Compute_squared_distance_3; + using Get_sqrt = internal::Get_sqrt; using Sqrt = typename Get_sqrt::Sqrt; public: @@ -381,7 +387,7 @@ namespace Point_set { const Input_range& m_input_range; const Point_map m_point_map; const Normal_map m_normal_map; - const Traits m_traits; + const GeomTraits m_traits; Region_unordered_map m_region_map; FT m_distance_threshold; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h index b97153fec57..127f9ccc123 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h @@ -65,7 +65,6 @@ namespace Point_set { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Point_map = PointMap; using Normal_map = NormalMap; @@ -79,8 +78,7 @@ namespace Point_set { using Region = std::vector; /// Primitive - using Primitive = typename Traits::Line_2; - using Result_type = std::vector >; + using Primitive = typename GeomTraits::Line_2; /// Region map using Region_unordered_map = boost::unordered_map >; @@ -88,13 +86,13 @@ namespace Point_set { /// @} private: - using Point_2 = typename Traits::Point_2; - using Vector_2 = typename Traits::Vector_2; - using Line_2 = typename Traits::Line_2; + using Point_2 = typename GeomTraits::Point_2; + using Vector_2 = typename GeomTraits::Vector_2; + using Line_2 = typename GeomTraits::Line_2; - using Squared_length_2 = typename Traits::Compute_squared_length_2; - using Squared_distance_2 = typename Traits::Compute_squared_distance_2; - using Scalar_product_2 = typename Traits::Compute_scalar_product_2; + using Squared_length_2 = typename GeomTraits::Compute_squared_length_2; + using Squared_distance_2 = typename GeomTraits::Compute_squared_distance_2; + using Scalar_product_2 = typename GeomTraits::Compute_scalar_product_2; public: /// \name Initialization @@ -202,7 +200,7 @@ namespace Point_set { /*! \brief implements `RegionType::region_index_map()`. - This function creates an empty property map that maps iterators on the input range `Item` to std::size_t. + This function creates an empty property map that maps iterators on the input range `Item` to `std::size_t`. */ Region_index_map region_index_map() { return Region_index_map(m_region_map); @@ -364,7 +362,7 @@ namespace Point_set { const Input_range& m_input_range; const Point_map m_point_map; const Normal_map m_normal_map; - const Traits m_traits; + const GeomTraits m_traits; Region_unordered_map m_region_map; FT m_distance_threshold; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h index fbd97f13074..324caa7acbb 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h @@ -65,7 +65,6 @@ namespace Point_set { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Point_map = PointMap; using Normal_map = NormalMap; @@ -79,8 +78,7 @@ namespace Point_set { using Region = std::vector; /// Primitive - using Primitive = typename Traits::Plane_3; - using Result_type = std::vector >; + using Primitive = typename GeomTraits::Plane_3; /// Region map using Region_unordered_map = boost::unordered_map >; @@ -88,13 +86,13 @@ namespace Point_set { /// @} private: - using Point_3 = typename Traits::Point_3; - using Vector_3 = typename Traits::Vector_3; - using Plane_3 = typename Traits::Plane_3; + using Point_3 = typename GeomTraits::Point_3; + using Vector_3 = typename GeomTraits::Vector_3; + using Plane_3 = typename GeomTraits::Plane_3; - using Squared_length_3 = typename Traits::Compute_squared_length_3; - using Squared_distance_3 = typename Traits::Compute_squared_distance_3; - using Scalar_product_3 = typename Traits::Compute_scalar_product_3; + using Squared_length_3 = typename GeomTraits::Compute_squared_length_3; + using Squared_distance_3 = typename GeomTraits::Compute_squared_distance_3; + using Scalar_product_3 = typename GeomTraits::Compute_scalar_product_3; public: /// \name Initialization @@ -363,7 +361,7 @@ namespace Point_set { const Input_range& m_input_range; const Point_map m_point_map; const Normal_map m_normal_map; - const Traits m_traits; + const GeomTraits m_traits; Region_unordered_map m_region_map; FT m_distance_threshold; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h index 2d5c18e5249..2f5bc4cbc5d 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h @@ -65,7 +65,6 @@ g /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Point_map = PointMap; using Normal_map = NormalMap; @@ -79,8 +78,7 @@ g using Region = std::vector; /// Primitive - using Primitive = typename Traits::Sphere_3; - using Result_type = std::vector >; + using Primitive = typename GeomTraits::Sphere_3; /// Region map using Region_unordered_map = boost::unordered_map >; @@ -88,12 +86,12 @@ g /// @} private: - using Point_3 = typename Traits::Point_3; - using Vector_3 = typename Traits::Vector_3; - using Sphere_3 = typename Traits::Sphere_3; + using Point_3 = typename GeomTraits::Point_3; + using Vector_3 = typename GeomTraits::Vector_3; + using Sphere_3 = typename GeomTraits::Sphere_3; - using Squared_distance_3 = typename Traits::Compute_squared_distance_3; - using Get_sqrt = internal::Get_sqrt; + using Squared_distance_3 = typename GeomTraits::Compute_squared_distance_3; + using Get_sqrt = internal::Get_sqrt; using Sqrt = typename Get_sqrt::Sqrt; public: @@ -370,7 +368,7 @@ g const Input_range& m_input_range; const Point_map m_point_map; const Normal_map m_normal_map; - const Traits m_traits; + const GeomTraits m_traits; Region_unordered_map m_region_map; FT m_distance_threshold; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h index 98a17160b62..02bc18962dc 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h @@ -62,7 +62,6 @@ namespace Polygon_mesh { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Face_graph = PolygonMesh; using Face_range = FaceRange; using Vertex_to_point_map = VertexToPointMap; @@ -78,8 +77,7 @@ namespace Polygon_mesh { using Region = std::vector; /// Primitive - using Primitive = typename Traits::Plane_3; - using Result_type = std::vector >; + using Primitive = typename GeomTraits::Plane_3; /// Region map using Region_index_map = typename boost::property_map >::const_type; @@ -87,14 +85,14 @@ namespace Polygon_mesh { /// @} private: - using Point_3 = typename Traits::Point_3; - using Vector_3 = typename Traits::Vector_3; - using Plane_3 = typename Traits::Plane_3; + using Point_3 = typename GeomTraits::Point_3; + using Vector_3 = typename GeomTraits::Vector_3; + using Plane_3 = typename GeomTraits::Plane_3; - using Squared_length_3 = typename Traits::Compute_squared_length_3; - using Squared_distance_3 = typename Traits::Compute_squared_distance_3; - using Scalar_product_3 = typename Traits::Compute_scalar_product_3; - using Cross_product_3 = typename Traits::Construct_cross_product_vector_3; + using Squared_length_3 = typename GeomTraits::Compute_squared_length_3; + using Squared_distance_3 = typename GeomTraits::Compute_squared_distance_3; + using Scalar_product_3 = typename GeomTraits::Compute_scalar_product_3; + using Cross_product_3 = typename GeomTraits::Construct_cross_product_vector_3; public: /// \name Initialization @@ -358,7 +356,7 @@ namespace Polygon_mesh { const Face_graph& m_face_graph; const Face_range m_face_range; const Vertex_to_point_map m_vertex_to_point_map; - const Traits m_traits; + const GeomTraits m_traits; FT m_distance_threshold; FT m_cos_value_threshold; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_sorting.h index 85d4fcd1708..68156e630a3 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_sorting.h @@ -28,7 +28,7 @@ namespace Polygon_mesh { \brief Sorting of polygon mesh faces with respect to the local plane fit quality. - Indices of faces in a polygon mesh are sorted with respect to the quality of the + `Items` of faces in a polygon mesh are sorted with respect to the quality of the least squares plane fit applied to the vertices of incident faces of each face. \tparam GeomTraits @@ -61,7 +61,6 @@ namespace Polygon_mesh { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Face_graph = PolygonMesh; using Neighbor_query = NeighborQuery; using Face_range = FaceRange; @@ -77,7 +76,7 @@ namespace Polygon_mesh { /// @} private: - using FT = typename Traits::FT; + using FT = typename GeomTraits::FT; using Compare_scores = internal::Compare_scores; public: @@ -180,7 +179,7 @@ namespace Polygon_mesh { Neighbor_query& m_neighbor_query; const Face_range m_face_range; const Vertex_to_point_map m_vertex_to_point_map; - const Traits m_traits; + const GeomTraits m_traits; Seed_range m_ordered; std::vector m_scores; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/One_ring_neighbor_query.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/One_ring_neighbor_query.h index d20319673a4..6d718ee1b9e 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/One_ring_neighbor_query.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/One_ring_neighbor_query.h @@ -54,7 +54,7 @@ namespace Polygon_mesh { /// \endcond /// Item type. - using Item = face_descriptor; + using Item = typename boost::graph_traits::face_descriptor; using Region = std::vector; /// \name Initialization @@ -82,7 +82,7 @@ namespace Polygon_mesh { This operator retrieves all faces, which are edge-adjacent to the face `query`. - These indices are returned in `neighbors`. + These `Items` are returned in `neighbors`. \param query `Item` of the query face diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_region.h index 89604fc42e5..dfc17db69fd 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_region.h @@ -80,9 +80,12 @@ namespace Polyline { /// Number type. typedef typename GeomTraits::FT FT; - /// Primitive + /// Primitive type depends on the dimension of the input data. +#ifdef DOXYGEN_RUNNING + using Primitive = typename GeomTraits::Line_2 or typename GeomTraits::Line_3 +#else using Primitive = typename Polyline_traits::Line; - using Result_type = std::vector >; +#endif /// Region map using Region_unordered_map = boost::unordered_map >; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_sorting.h index 6e206e18746..4747fccd7f8 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/Least_squares_line_fit_sorting.h @@ -28,7 +28,7 @@ namespace Polyline { \brief Sorting of polyline vertices with respect to the local line fit quality. - Indices of input vertices are sorted with respect to the quality of the + `Items` of input vertices are sorted with respect to the quality of the least squares line fit applied to the incident vertices of each vertex. \tparam GeomTraits @@ -56,7 +56,6 @@ namespace Polyline { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Neighbor_query = NeighborQuery; using Point_map = PointMap; @@ -72,11 +71,11 @@ namespace Polyline { /// @} private: - using FT = typename Traits::FT; + using FT = typename GeomTraits::FT; using Polyline_traits = typename std::conditional< - std::is_same::value, - internal::Region_growing_traits_2, - internal::Region_growing_traits_3 >::type; + std::is_same::value, + internal::Region_growing_traits_2, + internal::Region_growing_traits_3 >::type; using Compare_scores = internal::Compare_scores; using Dereference_pmap = internal::Dereference_property_map_adaptor; @@ -182,7 +181,7 @@ namespace Polyline { Neighbor_query& m_neighbor_query; const Point_map m_point_map; Dereference_pmap m_deref_pmap; - const Traits m_traits; + const GeomTraits m_traits; const Polyline_traits m_polyline_traits; Seed_range m_ordered; std::vector m_scores; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/One_ring_neighbor_query.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/One_ring_neighbor_query.h index 9ede89d6b6f..2175ce91487 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/One_ring_neighbor_query.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polyline/One_ring_neighbor_query.h @@ -31,7 +31,7 @@ namespace Polyline { \brief Direct neighbors connectivity in a polyline. - This class returns indices of the previous and next vertex + This class returns `Items` of the previous and next vertex in a polyline given as `InputRange.` \tparam GeomTraits diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h index 836fc97af2a..49515c9d53b 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h @@ -72,10 +72,9 @@ namespace Shape_detection { /// Item type. using Item = typename RegionType::Item; using Region = std::vector; - using Unassigned_type = std::vector; - /// Result type - using Result_type = std::vector > >; + /// Primitive and region type + using Primitive_and_region = std::pair; /// Item to region property map. using Region_map = typename Region_type::Region_index_map; @@ -174,19 +173,18 @@ namespace Shape_detection { /*! \brief runs the region growing algorithm and fills an output iterator - with the found regions. + with the fitted primitive and their region. - \tparam OutputIterator - a model of output iterator whose value type is `std::vector` + \tparam PrimitiveAndRegionOutputIterator + a model of `OutputIterator` whose value type is `Primitive_and_region` \param regions - an output iterator to get for all items corresponding to each region its corresponding region. - Elements put are of type `std::pair >`. + an iterator of type `PrimitiveAndRegionOutputIterator`. \return past-the-end position in the output sequence */ - template - OutputIterator detect(OutputIterator regions) { + template + PrimitiveAndRegionOutputIterator detect(PrimitiveAndRegionOutputIterator regions) { clear(); Region region; @@ -232,17 +230,16 @@ namespace Shape_detection { /*! \brief fills an output iterator with all unassigned items. - \tparam OutputIterator - a model of output iterator whose value type is `std::size_t` + \tparam ItemOutputIterator + a model of `OutputIterator` whose value type is `Item` \param output - an output iterator that stores indices of all items, which are not assigned - to any region + an iterator of type `PrimitiveAndRegionOutputIterator`. \return past-the-end position in the output sequence */ - template - OutputIterator unassigned_items(OutputIterator output) const { + template + ItemOutputIterator unassigned_items(ItemOutputIterator output) const { for (auto it = m_input_range.begin(); it != m_input_range.end(); it++) { Item i = internal::conditional_deref()(it); if (!get(m_visited, i)) diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h index ebe741087f5..885c544abda 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h @@ -69,7 +69,6 @@ namespace Segment_set { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Segment_map = SegmentMap; using Segment_type = typename Segment_map::value_type; @@ -82,9 +81,12 @@ namespace Segment_set { using Item = typename InputRange::const_iterator; using Region = std::vector; - /// Primitive + /// Primitive type depends on the dimension of the input data. +#ifdef DOXYGEN_RUNNING + using Primitive = typename GeomTraits::Line_2 or typename GeomTraits::Line_3 +#else using Primitive = typename Segment_set_traits::Line; - using Result_type = std::vector >; +#endif /// Region map using Region_unordered_map = boost::unordered_map >; @@ -340,7 +342,7 @@ namespace Segment_set { private: const Input_range& m_input_range; const Segment_map m_segment_map; - const Traits m_traits; + const GeomTraits m_traits; const Segment_set_traits m_segment_set_traits; Region_unordered_map m_region_map; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_sorting.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_sorting.h index a17bcb48694..83d7c5e89a9 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_sorting.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_sorting.h @@ -56,7 +56,6 @@ namespace Segment_set { /// @{ /// \cond SKIP_IN_MANUAL - using Traits = GeomTraits; using Input_range = InputRange; using Neighbor_query = NeighborQuery; using Segment_map = SegmentMap; @@ -72,11 +71,11 @@ namespace Segment_set { /// @} private: - using FT = typename Traits::FT; + using FT = typename GeomTraits::FT; using Segment_set_traits = typename std::conditional< - std::is_same::value, - internal::Region_growing_traits_2, - internal::Region_growing_traits_3 >::type; + std::is_same::value, + internal::Region_growing_traits_2, + internal::Region_growing_traits_3 >::type; using Compare_scores = internal::Compare_scores; public: @@ -180,7 +179,7 @@ namespace Segment_set { const Input_range& m_input_range; Neighbor_query& m_neighbor_query; const Segment_map m_segment_map; - const Traits m_traits; + const GeomTraits m_traits; const Segment_set_traits m_segment_set_traits; Seed_range m_ordered; std::vector m_scores; diff --git a/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp b/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp index 3e823530216..3582d60bcf0 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp @@ -52,11 +52,11 @@ int main(int argc, char *argv[]) { Region_growing region_growing( input_range, neighbor_query, region_type); - Region_growing::Unassigned_type unassigned_points; + std::vector unassigned_points; region_growing.unassigned_items(std::back_inserter(unassigned_points)); assert(unassigned_points.size() == 3634); - Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); const std::size_t num_regions = regions.size(); assert(num_regions != 0); diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp index 0d4d96127bb..e1d812c66ba 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp @@ -81,13 +81,13 @@ bool test_region_growing_on_cube(int argc, char *argv[]) { Region_growing region_growing( face_range, neighbor_query, region_type, sorting.ordered()); - typename Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); assert(regions.size() == face_range.size()); for (const auto& region : regions) assert(region_type.is_valid_region(region.second)); - typename Region_growing::Unassigned_type unassigned_faces; + std::vector unassigned_faces; region_growing.unassigned_items(std::back_inserter(unassigned_faces)); assert(unassigned_faces.size() == 0); diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp index 6c654746bb7..2ebf28522ce 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp @@ -67,13 +67,13 @@ bool test_region_growing_on_degenerated_mesh(int argc, char *argv[]) { Region_growing region_growing( face_range, neighbor_query, region_type); - typename Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); assert(regions.size() == 296); for (const auto& region : regions) assert(region_type.is_valid_region(region.second)); - typename Region_growing::Unassigned_type unassigned_faces; + std::vector unassigned_faces; region_growing.unassigned_items(std::back_inserter(unassigned_faces)); assert(unassigned_faces.size() == 509); return true; diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp index 400fb53cdaa..c0f01ff154b 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp @@ -72,13 +72,13 @@ bool test_region_growing_on_point_set_2(int argc, char *argv[]) { Region_growing region_growing( input_range, neighbor_query, region_type); - typename Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); assert(regions.size() == 72); for (const auto& region : regions) assert(region_type.is_valid_region(region.second)); - typename Region_growing::Unassigned_type unassigned_points; + std::vector unassigned_points; region_growing.unassigned_items(std::back_inserter(unassigned_points)); assert(unassigned_points.size() == 86); return true; diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp index 12472cb4ad9..587efc7ff91 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp @@ -79,7 +79,7 @@ bool test(int argc, char** argv, const std::string name, const std::size_t minr, Region_growing region_growing( input_range, neighbor_query, region_type, sorting.ordered()); - typename Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); std::cout << "- num regions " + name + ": " << regions.size() << std::endl; @@ -97,7 +97,7 @@ bool test(int argc, char** argv, const std::string name, const std::size_t minr, } } - typename Region_growing::Unassigned_type unassigned; + std::vector unassigned; region_growing.unassigned_items(std::back_inserter(unassigned)); for (auto& item : unassigned) { diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp index 1f49cca143f..f6bc31ace81 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp @@ -69,13 +69,13 @@ bool test_region_growing_on_point_set_3(int argc, char *argv[]) { Region_growing region_growing( input_range, neighbor_query, region_type); - typename Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); assert(regions.size() == 10); for (const auto& region : regions) assert(region_type.is_valid_region(region.second)); - typename Region_growing::Unassigned_type unassigned_points; + std::vector unassigned_points; region_growing.unassigned_items(std::back_inserter(unassigned_points)); assert(unassigned_points.size() == 246); return true; diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp index cc60d9a21cc..2bf6c760991 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp @@ -76,7 +76,7 @@ bool test( Region_growing region_growing( input_range, neighbor_query, region_type, sorting.ordered()); - typename Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); bool result = lambda_assertion(regions); assert(result); @@ -91,7 +91,7 @@ bool test( } } - typename Region_growing::Unassigned_type unassigned; + std::vector unassigned; region_growing.unassigned_items(std::back_inserter(unassigned)); for (auto& item : unassigned) { diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp index f5525cb1c42..7f703d850b9 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp @@ -66,13 +66,13 @@ bool test_region_growing_on_polygon_mesh(int argc, char *argv[]) { Region_growing region_growing( face_range, neighbor_query, region_type); - typename Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); assert(regions.size() == 414); for (const auto& region : regions) assert(region_type.is_valid_region(region.second)); - typename Region_growing::Unassigned_type unassigned_faces; + std::vector unassigned_faces; region_growing.unassigned_items(std::back_inserter(unassigned_faces)); assert(unassigned_faces.size() == 992); return true; diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp index 2d3f8242d9a..c0df0e0a38c 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) { Region_growing region_growing( face_range, neighbor_query, region_type, sorting.ordered()); - Region_growing::Result_type regions; + std::vector regions; region_growing.detect(std::back_inserter(regions)); region_growing.clear(); assert(regions.size() == 355); diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_polyline.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_polyline.cpp index 6197ed1af4f..82a1e60cc90 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_polyline.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_polyline.cpp @@ -74,13 +74,13 @@ bool test_region_growing_on_polyline(int argc, char *argv[]) { Region_growing_3 region_growing_3( polyline_3, neighbor_query_3, region_type_3); - typename Region_growing_3::Result_type regions_3; + std::vector regions_3; region_growing_3.detect(std::back_inserter(regions_3)); assert(regions_3.size() == 17); for (const auto& region : regions_3) assert(region_type_3.is_valid_region(region.second)); - typename Region_growing_3::Unassigned_type unassigned_points; + std::vector unassigned_points; region_growing_3.unassigned_items(std::back_inserter(unassigned_points)); assert(unassigned_points.size() == 0); @@ -111,12 +111,12 @@ bool test_region_growing_on_polyline(int argc, char *argv[]) { Region_growing_2 region_growing_2( polyline_2, neighbor_query_2, region_type_2); - typename Region_growing_2::Result_type regions_2; + std::vector regions_2; region_growing_2.detect(std::back_inserter(regions_2)); assert(regions_2.size() == 5); for (const auto& region : regions_2) assert(region_type_2.is_valid_region(region.second)); - typename Region_growing_2::Unassigned_type unassigned_points2; + std::vector unassigned_points2; region_growing_2.unassigned_items(std::back_inserter(unassigned_points2)); assert(unassigned_points2.size() == 0); diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_polyline_with_sorting.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_polyline_with_sorting.cpp index 6e77aa6a32b..4881c11b798 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_polyline_with_sorting.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_polyline_with_sorting.cpp @@ -79,11 +79,11 @@ int main(int argc, char *argv[]) { Region_growing_3 region_growing_3( polyline_3, neighbor_query_3, region_type_3, sorting_3.ordered()); - Region_growing_3::Result_type regions3; + std::vector regions3; region_growing_3.detect(std::back_inserter(regions3)); assert(regions3.size() == 16); - Region_growing_3::Unassigned_type unassigned_points; + std::vector unassigned_points; region_growing_3.unassigned_items(std::back_inserter(unassigned_points)); assert(unassigned_points.size() == 1); @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { Region_growing_2 region_growing_2( polyline_2, neighbor_query_2, region_type_2, sorting_2.ordered()); - typename Region_growing_2::Result_type regions2; + std::vector regions2; region_growing_2.detect(std::back_inserter(regions2)); assert(regions2.size() == 5); for (const auto& region : regions2) @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) { } } - Region_growing_2::Unassigned_type unassigned; + std::vector unassigned; region_growing_2.unassigned_items(std::back_inserter(unassigned)); for (auto& item : unassigned) { @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) { } } - Region_growing_2::Unassigned_type unassigned2; + std::vector unassigned2; region_growing_2.unassigned_items(std::back_inserter(unassigned2)); assert(unassigned2.size() == 0); diff --git a/Shape_detection/test/Shape_detection/test_region_growing_strict.cpp b/Shape_detection/test/Shape_detection/test_region_growing_strict.cpp index 66a26ddbc00..6d8d4a9023c 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_strict.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_strict.cpp @@ -235,7 +235,7 @@ bool test_lines_segment_set_2_sorting() { Region_type region_type(segments); - typename Region_type::Result_type regions; + std::vector regions; Region_growing region_growing( segments, neighbor_query, region_type, sorting.ordered()); region_growing.detect(std::back_inserter(regions)); @@ -299,7 +299,7 @@ bool test_lines_segment_set_3() { face_range, one_ring_query, plane_type, plane_sorting.ordered()); assert(surface_mesh.number_of_faces() == 7320); - typename RG_planes::Result_type regions; + std::vector regions; rg_planes.detect(std::back_inserter(regions)); assert(regions.size() == 9); @@ -314,7 +314,7 @@ bool test_lines_segment_set_3() { segment_range, pgraph, CGAL::parameters::segment_map(pgraph.segment_map())); sorting.sort(); - typename RG_lines::Result_type regions2; + std::vector regions2; RG_lines region_growing( segment_range, pgraph, region_type, sorting.ordered()); region_growing.detect(std::back_inserter(regions2));