diff --git a/Classification/include/CGAL/Classification/Point_set_feature_generator.h b/Classification/include/CGAL/Classification/Point_set_feature_generator.h index 58e58bb54dc..859f3b7f02e 100644 --- a/Classification/include/CGAL/Classification/Point_set_feature_generator.h +++ b/Classification/include/CGAL/Classification/Point_set_feature_generator.h @@ -161,9 +161,9 @@ private: CGAL::Real_timer t; t.start(); if (lower_grid == nullptr) - neighborhood = new Neighborhood (input, point_map); + neighborhood = new Neighborhood (input, point_map, ConcurrencyTag()); else - neighborhood = new Neighborhood (input, point_map, voxel_size); + neighborhood = new Neighborhood (input, point_map, voxel_size, ConcurrencyTag()); t.stop(); if (lower_grid == nullptr) diff --git a/Classification/include/CGAL/Classification/Point_set_neighborhood.h b/Classification/include/CGAL/Classification/Point_set_neighborhood.h index 7ecfecb2492..1b79cb8a01c 100644 --- a/Classification/include/CGAL/Classification/Point_set_neighborhood.h +++ b/Classification/include/CGAL/Classification/Point_set_neighborhood.h @@ -173,12 +173,32 @@ public: /*! \brief Constructs a neighborhood object based on the input range. + \tparam ConcurrencyTag enables sequential versus parallel + algorithm. Possible values are `Sequential_tag`, `Parallel_tag`, + and `Parallel_if_available_tag`. If no tag is provided, + `Parallel_if_available_tag` is used. + \param input point range. \param point_map property map to access the input points. */ + template Point_set_neighborhood (const PointRange& input, - PointMap point_map) + PointMap point_map, + const ConcurrencyTag&) : m_tree (nullptr) + { + init (input, point_map); + } + + /// \cond SKIP_IN_MANUAL + Point_set_neighborhood (const PointRange& input, PointMap point_map) + : m_tree (nullptr) + { + init (input, point_map); + } + + template + void init (const PointRange& input, PointMap point_map) { My_point_property_map pmap (&input, point_map); m_tree = new Tree (boost::counting_iterator (0), @@ -186,8 +206,9 @@ public: Splitter(), Search_traits (pmap)); m_distance = Distance (pmap); - m_tree->build(); + m_tree->template build(); } + /// \endcond /*! \brief Constructs a simplified neighborhood object based on the input range. @@ -197,14 +218,36 @@ public: present in one cell, only the point closest to the centroid of this subset is used. + \tparam ConcurrencyTag enables sequential versus parallel + algorithm. Possible values are `Sequential_tag`, `Parallel_tag`, + and `Parallel_if_available_tag`. If no tag is provided, + `Parallel_if_available_tag` is used. + \param input input range. \param point_map property map to access the input points. \param voxel_size size of the cells of the 3D grid used for simplification. */ + template + Point_set_neighborhood (const PointRange& input, + PointMap point_map, + float voxel_size, + const ConcurrencyTag&) + : m_tree (nullptr) + { + init (input, point_map, voxel_size); + } + + /// \cond SKIP_IN_MANUAL Point_set_neighborhood (const PointRange& input, PointMap point_map, float voxel_size) : m_tree (nullptr) + { + init (input, point_map, voxel_size); + } + + template + void init (const PointRange& input, PointMap point_map, float voxel_size) { // First, simplify std::vector indices; @@ -215,8 +258,9 @@ public: Splitter(), Search_traits (pmap)); m_distance = Distance (pmap); - m_tree->build(); + m_tree->template build(); } + /// \endcond /// @}