From ecc30d8b0f54fe2f8bd22758b871a49e7e1f0ad0 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 31 Jan 2024 16:22:40 +0100 Subject: [PATCH] removing Locate_halfspace --- Orthtree/doc/Orthtree/Concepts/OrthtreeTraits.h | 13 ------------- Orthtree/include/CGAL/Orthtree.h | 4 ++-- Orthtree/include/CGAL/Orthtree_traits_point.h | 4 +--- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/Orthtree/doc/Orthtree/Concepts/OrthtreeTraits.h b/Orthtree/doc/Orthtree/Concepts/OrthtreeTraits.h index 546c1211637..471ada54c71 100644 --- a/Orthtree/doc/Orthtree/Concepts/OrthtreeTraits.h +++ b/Orthtree/doc/Orthtree/Concepts/OrthtreeTraits.h @@ -70,14 +70,6 @@ public: */ using Construct_root_node_contents = unspecified_type; - /*! - * \brief Functor to locate in which halfspace a number of type `FT` is located with respect to another number of type `FT`. - * - * The functor is used by `Orthtree::locate()` to identify in which leaf node a point is located. - * `Distribute_node_contents` must use `Locate_halfspace` to guarantee consistency wich `Orthtree::locate()`. - */ - using Locate_halfspace = unspecified_type; - /*! * \brief Functor which distributes a node's contents to its children. * @@ -120,11 +112,6 @@ public: */ Distribute_node_contents distribute_node_contents_object() const; - /*! - * constructs an object of type `Locate_halfspace`. - */ - Locate_halfspace locate_halfspace_object() const; - /*! * constructs an object of type `Construct_point_d`. */ diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index 32e54c2b051..7dfb39d6ce5 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -606,8 +606,8 @@ public: // Find the index of the correct sub-node Local_coordinates local_coords; std::size_t dim = 0; - for (const auto& r: cartesian_range(center, point)) - local_coords[dim++] = m_traits.locate_halfspace_object()(get<0>(r), get<1>(r)); + for (const auto& r : cartesian_range(center, point)) + local_coords[dim++] = (get<0>(r) <= get<1>(r)); // Find the correct sub-node of the current node node_for_point = child(node_for_point, local_coords.to_ulong()); diff --git a/Orthtree/include/CGAL/Orthtree_traits_point.h b/Orthtree/include/CGAL/Orthtree_traits_point.h index ca801cd5871..4aa733a9660 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_point.h +++ b/Orthtree/include/CGAL/Orthtree_traits_point.h @@ -42,9 +42,7 @@ void reassign_points( auto split_point = std::partition( points.begin(), points.end(), [&](const auto& p) -> bool { - // This should be done with cartesian iterator, - // but it seems complicated to do efficiently - return traits.locate_halfspace_object()(get(point_map, p)[int(dimension)], center[int(dimension)]); + return (get(point_map, p)[int(dimension)] < center[int(dimension)]); } );