Skip to content

Commit

Permalink
Remove non-const access to root node
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jul 21, 2020
1 parent 110744d commit 5c62edc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
8 changes: 1 addition & 7 deletions Octree/include/CGAL/Octree.h
Expand Up @@ -263,13 +263,6 @@ class Octree {
/// \name Accessors
/// @{

/*!
* \brief Provides read and write access to the root node, and by extension the rest of the tree
*
* \return a reference to the root node of the tree
*/
Node &root() { return m_root; }

/*!
* \brief Provides read-only access to the root node, and by extension the rest of the tree
*
Expand Down Expand Up @@ -464,6 +457,7 @@ class Octree {

private: // functions :

// TODO: Could this method name be reduced to just "center" ?
Point barycenter(const Node &node) const {

// Determine the side length of this node
Expand Down
3 changes: 2 additions & 1 deletion Octree/include/CGAL/Octree/IO.h
Expand Up @@ -27,7 +27,8 @@ template<class PointRange,
ostream &operator<<(ostream &os, const CGAL::Octree::Octree<PointRange, PointMap> &octree) {

// Create a range of nodes
auto nodes = octree.template walk<CGAL::Octree::Walker::Preorder>();
// auto nodes = octree.template walk<CGAL::Octree::Walker::Preorder>();
auto nodes = octree.walk(CGAL::Octree::Walker::Preorder());

// Iterate over the range and print each node
// for (auto &n : nodes) {
Expand Down
10 changes: 0 additions & 10 deletions Octree/test/Octree/test_node.cpp
Expand Up @@ -7,15 +7,5 @@ typedef CGAL::Octree::Node::Node<int> Node;

int main(void) {

Node n{};

n.split();

std::cout << n;
for (int i = 0; i < 8; ++i) {
std::cout << n[i];
}


return 0;
}
2 changes: 1 addition & 1 deletion Octree/test/Octree/test_octree_refine.cpp
Expand Up @@ -29,7 +29,7 @@ void test_1_point() {

// Check that the topology matches
Octree::Node single_node{};
single_node.value() = octree.root().value();
single_node.points() = octree.root().points();
assert(single_node == octree.root());

}
Expand Down

0 comments on commit 5c62edc

Please sign in to comment.