Fix an issue where side-per-depth wasn't updated when a node was manually split

This commit is contained in:
JacksonCampolattaro 2023-07-26 09:57:44 +02:00
parent cfdb167e35
commit 61a29f0fdb
1 changed files with 7 additions and 9 deletions

View File

@ -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<Node_data>("points")),
m_node_depths(m_node_properties.add_property<std::uint8_t>("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);