Skip to content

Commit

Permalink
Change stop criterion to accept node references
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jun 20, 2020
1 parent 194b8fd commit c263f74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Octree/include/CGAL/Octree.h
Expand Up @@ -128,7 +128,7 @@ namespace CGAL {
m_root.unsplit();
}

void refine(std::function<bool(const Node *)> stop_criterion) {
void refine(std::function<bool(const Node &)> stop_criterion) {

// create a side length map
for (int i = 0; i <= (int) 10; i++)
Expand All @@ -147,7 +147,7 @@ namespace CGAL {
int depth = current->depth();

// Check if this node needs to be processed
if (!stop_criterion(current)) {
if (!stop_criterion(*current)) {

// Split this node
current->split();
Expand Down
8 changes: 4 additions & 4 deletions Octree/include/CGAL/Octree/Stop_criterion.h
Expand Up @@ -12,8 +12,8 @@ namespace CGAL {
m_max_depth(max_depth), m_bucket_size(bucket_size) {}

template<class Node>
bool operator()(Node n) const {
return (n->num_points() <= m_bucket_size || n->depth() == m_max_depth);
bool operator()(const Node &n) const {
return (n.num_points() <= m_bucket_size || n.depth() == m_max_depth);
}
};

Expand All @@ -24,8 +24,8 @@ namespace CGAL {
Stop_at_max_depth(std::size_t max_depth) : m_max_depth(max_depth) {}

template<class Node>
bool operator()(Node n) const {
return n->depth() == m_max_depth;
bool operator()(const Node &n) const {
return n.depth() == m_max_depth;
}
};

Expand Down

0 comments on commit c263f74

Please sign in to comment.