From dda6b95ee4264df82fcdef3057b516f84e25bd22 Mon Sep 17 00:00:00 2001 From: Jackson Campolattaro Date: Wed, 29 Jul 2020 14:42:08 -0400 Subject: [PATCH] Remove drawSamplesFromCellContainingPoint from octree --- .../Shape_detection/Efficient_RANSAC/Octree.h | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h index 42eb6cb844f6..0a6d9d3bfceb 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h @@ -444,56 +444,6 @@ class Octree : public PointAccessor { } } - // TODO: Can this be externalized? - bool drawSamplesFromCellContainingPoint(const Point_3 &p, - std::size_t level, - std::set &indices, - const std::vector &shapeIndex, - std::size_t requiredSamples) { - - bool upperZ, upperY, upperX; - Cell *cur = m_root; - - while (cur && cur->level < level) { - upperX = cur->center.x() <= p.x(); - upperY = cur->center.y() <= p.y(); - upperZ = cur->center.z() <= p.z(); - - if (upperZ) { - if (upperY) - cur = (upperX) ? cur->child[0] : cur->child[1]; - else cur = (upperX) ? cur->child[2] : cur->child[3]; - } else { - if (upperY) - cur = (upperX) ? cur->child[4] : cur->child[5]; - else cur = (upperX) ? cur->child[6] : cur->child[7]; - } - } - - if (cur) { - std::size_t enough = 0; - for (std::size_t i = cur->first; i <= cur->last; i++) { - std::size_t j = this->index(i); - if (shapeIndex[j] == -1) { - enough++; - if (enough >= requiredSamples) - break; - } - } - if (enough >= requiredSamples) { - do { - std::size_t p = CGAL::get_default_random(). - uniform_int(0, cur->size() - 1); - std::size_t j = this->index(cur->first + p); - if (shapeIndex[j] == -1) - indices.insert(j); - } while (indices.size() < requiredSamples); - - return true; - } else return false; - } else return false; - } - std::size_t maxLevel() { return m_max_level; }