diff --git a/Octree/include/CGAL/Octree.h b/Octree/include/CGAL/Octree.h index 2689f0cbf02..db3193b1a62 100644 --- a/Octree/include/CGAL/Octree.h +++ b/Octree/include/CGAL/Octree.h @@ -123,11 +123,11 @@ private: // Private types private: // data members : - Node m_root; /* root node of the octree */ - Point_range &m_ranges; /* input point range */ Point_map m_points_map; /* property map: `value_type of InputIterator` -> `Point` (Position) */ + Node m_root; /* root node of the octree */ + Point m_bbox_min; /* input bounding box min value */ FT m_bbox_side; /* input bounding box side length (cube) */ diff --git a/Octree/include/CGAL/Octree/Node.h b/Octree/include/CGAL/Octree/Node.h index bbf4bd51ffa..78a9a99ff4d 100644 --- a/Octree/include/CGAL/Octree/Node.h +++ b/Octree/include/CGAL/Octree/Node.h @@ -77,8 +77,6 @@ public: */ typedef boost::iterator_range Point_range; - /// @} - // TODO: There's probably a better name for this // TODO: Should I use an enum class? enum Child { @@ -101,6 +99,7 @@ public: FRONT }; + /// @} private: diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h index 294fefee236..277973957ec 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h @@ -212,7 +212,7 @@ public: private: typedef internal::Direct_octree Direct_octree; - typedef internal::Indexed_octree Indexed_octree; + typedef internal::Direct_octree Indexed_octree; //--------------------------------------------typedef 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 dcaa922098c..1139cb732f1 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h @@ -130,89 +130,6 @@ public: } }; -template -class Indexed_octree { - - typedef typename Traits::Input_range::iterator Input_iterator; - typedef typename Traits::Point_map Point_map; - typedef typename Traits::FT FT; - typedef std::vector Input_range; - typedef Point_map_to_indexed_point_map Indexed_point_map; - - typedef Octree::Octree Octree; - - Traits m_traits; - Input_range m_input_range; - Indexed_point_map m_index_map; - Octree m_octree; - -public: - - typedef typename Octree::Node Node; - - Indexed_octree(const Traits &traits, - Input_iterator begin, - Input_iterator end, - Point_map point_map, - std::size_t offset = 0) : - m_traits(traits), - m_input_range(boost::counting_iterator(0), - boost::counting_iterator(end - begin)), - m_index_map(begin, point_map), - m_octree(m_input_range, m_index_map, 1.0) {} - - std::size_t size() const { - return m_octree.root().size(); - } - - Bbox_3 bbox() const { - return m_octree.bbox(m_octree.root()); - } - - std::size_t maxLevel() const { - return m_octree.max_depth_reached(); - } - - std::size_t offset() const { return 0; } - - void refine(double cluster_epsilon_for_max_level_recomputation = -1., std::size_t bucketSize = 2, - std::size_t maxLevel = 10) { - - if (cluster_epsilon_for_max_level_recomputation > 0.) { - - auto m_bBox = m_octree.bbox(m_octree.root()); - - FT bbox_diagonal = (FT) CGAL::sqrt( - (m_bBox.xmax() - m_bBox.xmin()) * (m_bBox.xmax() - m_bBox.xmin()) - + (m_bBox.ymax() - m_bBox.ymin()) * (m_bBox.ymax() - m_bBox.ymin()) - + (m_bBox.zmax() - m_bBox.zmin()) * (m_bBox.zmax() - m_bBox.zmin())); - - maxLevel = std::size_t(std::log(bbox_diagonal - / cluster_epsilon_for_max_level_recomputation) - / std::log(2.0)); - - } - - m_octree.refine(maxLevel, bucketSize); - } - - std::size_t index(std::size_t i) { return m_index_map[i]; } - - typename Traits::FT width() const { - return m_octree.bbox(m_octree.root()).xmax() - m_octree.bbox(m_octree.root()).xmin(); - } - - const Node &locate(const typename Traits::Point_3 &p) const { - return m_octree.locate(p); - } - - const Node &root() const { return m_octree.root(); } - - typename Traits::Point_3 barycenter(const Node &node) const { - return m_octree.barycenter(node); - } -}; - } } }