Replace `tree.points(node)` with `tree.data(node)`

This commit is contained in:
JacksonCampolattaro 2023-06-27 14:58:13 +02:00
parent 22e76aac65
commit dc18e1b1db
6 changed files with 12 additions and 13 deletions

View File

@ -248,7 +248,7 @@ public:
// save orthtree attributes
m_bbox_min = construct_point_d_from_array(bbox_min);
m_side_per_depth.push_back(bbox_max[0] - bbox_min[0]);
points(root()) = m_traits.root_node_contents();
data(root()) = m_traits.root_node_contents();
}
/// @}
@ -699,11 +699,11 @@ public:
return m_node_depths[n];
}
Node_data& points(Node_index n) {
Node_data& data(Node_index n) {
return m_node_points[n];
}
const Node_data& points(Node_index n) const {
const Node_data& data(Node_index n) const {
return m_node_points[n];
}
@ -841,7 +841,6 @@ public:
// Add the node's points to its children
m_traits.distribute_node_contents(n, *this, center);
//reassign_points(n, points(n).begin(), points(n).end(), center);
}
/*!
@ -1038,7 +1037,7 @@ private: // functions :
// Loop through each of the points contained by the node
// Note: there might be none, and that should be fine!
for (auto p: points(node)) {
for (auto p: data(node)) {
// Pair that point with its distance from the search point
Node_element_with_distance current_point_with_distance =

View File

@ -47,7 +47,7 @@ std::ostream& print_orthtree_node(std::ostream& os, const Node_index& node, cons
<< ") ";
os << "("
<< tree.points(node).size()
<< tree.data(node).size()
<< ") ";
// If a node is a leaf, mark it

View File

@ -51,7 +51,7 @@ public:
*/
template<typename Node_index, typename Tree>
bool operator()(Node_index i, const Tree &tree) const {
return (tree.points(i).size() > m_bucket_size);
return (tree.data(i).size() > m_bucket_size);
}
};
@ -132,7 +132,7 @@ public:
*/
template<typename Node_index, typename Tree>
bool operator()(Node_index i, const Tree &tree) const {
std::size_t num_points = tree.points(i).size();
std::size_t num_points = tree.data(i).size();
std::size_t depth = tree.depth(i);
return (num_points > m_bucket_size && depth < m_max_depth);
}

View File

@ -185,7 +185,7 @@ public:
template <typename Node_index, typename Tree>
void distribute_node_contents(Node_index n, Tree& tree, const Point_d& center) {
CGAL_precondition(!tree.is_leaf(n));
reassign_points(n, tree, center, tree.points(n));
reassign_points(n, tree, center, tree.data(n));
}
Point_d get_element(const Node_data_element& index) const {
@ -207,7 +207,7 @@ private:
// Root case: reached the last dimension
if (dimension == Dimension::value) {
tree.points(tree.child(n, coord.to_ulong())) = points;
tree.data(tree.child(n, coord.to_ulong())) = points;
return;
}

View File

@ -202,7 +202,7 @@ public:
template <typename Node_index, typename Tree>
void distribute_node_contents(Node_index n, Tree& tree, const Point_d& center) {
CGAL_precondition(!tree.is_leaf(n));
reassign_points(n, tree, center, tree.points(n));
reassign_points(n, tree, center, tree.data(n));
}
Point_d get_element(const Node_data_element& index) const {
@ -224,7 +224,7 @@ private:
// Root case: reached the last dimension
if (dimension == Dimension::value) {
tree.points(tree.child(n, coord.to_ulong())) = points;
tree.data(tree.child(n, coord.to_ulong())) = points;
return;
}

View File

@ -176,7 +176,7 @@ public:
template <typename Node_index, typename Tree>
void distribute_node_contents(Node_index n, Tree& tree, const Point_d& center) {
CGAL_precondition(!tree.is_leaf(n));
reassign_points(n, tree, center, tree.points(n));
reassign_points(n, tree, center, tree.data(n));
}
Point_d get_element(const Node_data_element& index) const {