From 808fd024c6e073b9c5376d8b54eb6f1952456380 Mon Sep 17 00:00:00 2001 From: Jackson Campolattaro Date: Wed, 15 Jul 2020 10:31:48 -0400 Subject: [PATCH] Add do_intersect invocation --- Octree/include/CGAL/Octree.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Octree/include/CGAL/Octree.h b/Octree/include/CGAL/Octree.h index 53e5d3b4e16..7b310723642 100644 --- a/Octree/include/CGAL/Octree.h +++ b/Octree/include/CGAL/Octree.h @@ -122,6 +122,7 @@ class Octree { typedef typename Kernel::Vector_3 Vector; typedef typename Kernel::Iso_cuboid_3 Iso_cuboid; typedef typename Kernel::Sphere_3 Sphere; + typedef typename CGAL::Bbox_3 Bbox; typedef typename PointRange::iterator Range_iterator; typedef typename std::iterator_traits::value_type Range_type; @@ -429,13 +430,17 @@ class Octree { reassign_points(node, node.value().begin(), node.value().end(), center); } - bool do_intersect(const Node &node, Sphere sphere) const { + bool do_intersect(const Node &node, const Sphere &sphere) const { + + // TODO // Create a cubic bounding box from the node // Check for overlap between the node's box and the sphere as a box, to quickly eliminate some cases // Check for intersection between the node and the sphere + + return true; } FT nearest_k_neighbours_recursive(const Point &p, std::vector &out, const Node &node, @@ -493,9 +498,7 @@ class Octree { auto &n = node[index]; // Check whether this node is capable of containing closer points - // TODO: Maybe I should write a function for determining the distance between a node and a point? - // FIXME: For now, this checks every child (which degenerates to the brute force method) - if (true /*TODO: Replace this with the equation*/) { + if (do_intersect(n, Sphere{p, largest_radius_squared_found})) { // Recursive case largest_radius_squared_found =