Skip to content

Commit

Permalink
Add more typedefs for cleaner function signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jul 1, 2020
1 parent 483ced9 commit 0490d26
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Octree/include/CGAL/Octree.h
Expand Up @@ -95,11 +95,21 @@ namespace CGAL {
*/
typedef Octree_node <Kernel, PointRange> Node;

/*!
* \brief A function that determines whether a node needs to be split when refining a tree
*/
typedef std::function<bool(const Node &)> Split_criterion;

/*!
* \brief A range that provides input-iterator access to the nodes of a tree
*/
typedef boost::iterator_range <Walker_iterator<const Node>> Node_range;

/*!
* \brief A function that determines the next node in a traversal given the current one
*/
typedef std::function<const Node *(const Node *)> Node_walker;

/// @}

// TODO: These typedefs might not be kept
Expand Down Expand Up @@ -201,7 +211,7 @@ namespace CGAL {
*
* \param split_criterion
*/
void refine(const std::function<bool(const Node &)> &split_criterion) {
void refine(const Split_criterion &split_criterion) {

// create a side length map
for (int i = 0; i <= (int) 10; i++)
Expand Down Expand Up @@ -237,7 +247,7 @@ namespace CGAL {
}

/*!
* \brief Refine an octree using a max depth and max number of points in a node
* \brief Refine an octree using a max depth and max number of points in a node as split criterion
*
* \todo
*
Expand Down Expand Up @@ -282,7 +292,7 @@ namespace CGAL {
* \return
*/
Node_range
nodes(const Node *first, const std::function<const Node *(const Node *)> &tree_walker) const {
nodes(const Node *first, const Node_walker &tree_walker) const {
return boost::make_iterator_range(Walker_iterator<const Node>(first, tree_walker),
Walker_iterator<const Node>());
}
Expand Down

0 comments on commit 0490d26

Please sign in to comment.