diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index 9d36a4986f0..31daf3a441c 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -214,8 +214,7 @@ public: \param enlarge_ratio ratio to which the bounding box should be enlarged. \param traits the traits object. */ - Orthtree(Traits traits, - const FT enlarge_ratio = 1.2) : + explicit Orthtree(Traits traits, const FT enlarge_ratio = 1.2) : m_traits(traits), m_node_points(m_node_properties.add_property("points")), m_node_depths(m_node_properties.add_property("depths", 0)), @@ -325,13 +324,6 @@ public: // Check if this node needs to be processed if (split_predicate(current, *this)) { - // Check if we've reached a new max depth - if (depth(current) == depth()) { - - // Update the side length map - m_side_per_depth.push_back(*(m_side_per_depth.end() - 1) / 2); - } - // Split the node, redistributing its points to its children split(current); @@ -839,6 +831,12 @@ public: m_node_parents[c] = n; } + // Check if we've reached a new max depth + if (depth(n) + 1 == m_side_per_depth.size()) { + // Update the side length map + m_side_per_depth.push_back(*(m_side_per_depth.end() - 1) / 2); + } + // Find the point around which the node is split Point center = barycenter(n);