diff --git a/Octree/include/CGAL/Octree/IO.h b/Octree/include/CGAL/Octree/IO.h index 3ae74b90898..5ea3f95340c 100644 --- a/Octree/include/CGAL/Octree/IO.h +++ b/Octree/include/CGAL/Octree/IO.h @@ -17,7 +17,7 @@ template &octree) { // Create a range of nodes - auto nodes = octree.template walk(); + auto nodes = octree.template walk(); // Iterate over the range and print each node for (auto &n : nodes) diff --git a/Octree/include/CGAL/Octree/Walker_criterion.h b/Octree/include/CGAL/Octree/Walker_criterion.h index dca931d21e6..abfd28d5b07 100644 --- a/Octree/include/CGAL/Octree/Walker_criterion.h +++ b/Octree/include/CGAL/Octree/Walker_criterion.h @@ -75,7 +75,7 @@ struct Preorder { } template - const Node::Node *operator()(const Node::Node *n) const { + const Node::Node *next(const Node::Node *n) const { if (n->is_leaf()) { @@ -100,13 +100,13 @@ struct Preorder { struct Postorder { template - const Node::Node *first(const Node::Node *root) { + const Node::Node *first(const Node::Node *root) const { return deepest_first_child(root); } template - const Node::Node *operator()(const Node::Node *n) { + const Node::Node *next(const Node::Node *n) const { auto next = deepest_first_child(next_sibling(n)); @@ -120,13 +120,13 @@ struct Postorder { struct Leaves { template - const Node::Node *first(const Node::Node *root) { + const Node::Node *first(const Node::Node *root) const { return deepest_first_child(root); } template - const Node::Node *operator()(const Node::Node *n) { + const Node::Node *next(const Node::Node *n) const { auto next = deepest_first_child(next_sibling(n)); @@ -137,38 +137,6 @@ struct Leaves { } }; -class Preorder_tree_walker { - -public: - - template - const Node::Node *first(const Node::Node *root) const { - return root; - } - - template - const Node::Node *next(const Node::Node *n) const { - - if (n->is_leaf()) { - - auto next = next_sibling(n); - - if (nullptr == next) { - - return next_sibling_up(n); - } - - return next; - - } else { - - return &(*n)[0]; - } - - } -}; - - } } diff --git a/Octree/test/Octree/test_tree_walk.cpp b/Octree/test/Octree/test_tree_walk.cpp index 05973050f8a..93cf8f5abae 100644 --- a/Octree/test/Octree/test_tree_walk.cpp +++ b/Octree/test/Octree/test_tree_walk.cpp @@ -28,7 +28,7 @@ bool test_preorder_1_node() { octree.refine(10, 1); // Create the range - auto nodes = octree.walk(); + auto nodes = octree.walk(); // Check each item in the range auto iter = nodes.begin(); @@ -50,7 +50,7 @@ bool test_preorder_9_nodes() { octree.refine(10, 1); // Create the range - auto nodes = octree.walk(); + auto nodes = octree.walk(); // Check each item in the range auto iter = nodes.begin(); @@ -78,7 +78,7 @@ bool test_preorder_25_nodes() { octree.refine(10, 1); // Create the range - auto nodes = octree.walk(); + auto nodes = octree.walk(); // Check each item in the range auto iter = nodes.begin();