Improve documentation of traversals / split predicates

This commit is contained in:
Simon Giraudot 2021-01-21 09:54:46 +01:00
parent 224766a605
commit 1e02106dd1
5 changed files with 24 additions and 12 deletions

View File

@ -17,7 +17,7 @@ class OrthtreeTraversal {
public: public:
using Node = unspecified_type; ///< An instance of `CGAL::Orthtree<Traits,PointRange,PointMap>::Node` using Node = unspecified_type; ///< An instance of [CGAL::Orthtree<Traits,PointRange,PointMap>::Node](@ref CGAL::Orthtree::Node)
/*! /*!
\brief returns the first node to iterate to, given the root of the Orthtree. \brief returns the first node to iterate to, given the root of the Orthtree.

View File

@ -152,7 +152,7 @@ In this case, we print out the nodes of the tree without indentation instead.
\subsection Section_Orthtree_Custom_Traversal Custom Traversal \subsection Section_Orthtree_Custom_Traversal Custom Traversal
Users can define their own traversal methods by creating models of the Users can define their own traversal methods by creating models of the
`Traversal` concept. The following example shows how to define a `OrthtreeTraversal` concept. The following example shows how to define a
custom traversal that only traverses the first branch of the %octree: custom traversal that only traverses the first branch of the %octree:
\cgalExample{Orthtree/octree_traversal_custom.cpp} \cgalExample{Orthtree/octree_traversal_custom.cpp}

View File

@ -431,7 +431,8 @@ public:
This method allows to iterate on the nodes of the tree with a This method allows to iterate on the nodes of the tree with a
user-selected order (preorder, postorder, leaves only, etc.). user-selected order (preorder, postorder, leaves only, etc.).
\tparam Traversal model of `Traversal` \tparam Traversal model of `OrthtreeTraversal` that provides functions
compatible with the type of the orthree
\param traversal \param traversal
\return a forward input iterator over the nodes of the tree \return a forward input iterator over the nodes of the tree
*/ */

View File

@ -22,7 +22,9 @@ namespace Orthtrees {
/*! /*!
\ingroup PkgOrthtreeSplitPredicates \ingroup PkgOrthtreeSplitPredicates
\brief bucket size predicate that splits a node if it contains more than a certain number of items. \brief A class used to choose when a node should be split depending on the number of inliers.
This is bucket size predicate that splits a node if it contains more than a certain number of items.
*/ */
class Maximum_number_of_inliers { class Maximum_number_of_inliers {
@ -38,7 +40,7 @@ public:
/*! /*!
\brief returns `true` if `n` should be splitted, `false` otherwise. \brief returns `true` if `n` should be splitted, `false` otherwise.
*/ */
template<class Node> template<typename Node>
bool operator()(const Node &n) const { bool operator()(const Node &n) const {
return (n.size() > m_bucket_size); return (n.size() > m_bucket_size);
} }
@ -46,7 +48,9 @@ public:
/*! /*!
\ingroup PkgOrthtreeSplitPredicates \ingroup PkgOrthtreeSplitPredicates
\brief predicate that splits a node if its depth is lower than a certain limit. \brief A class used to choose when a node should be split depending on the depth.
This predicate makes a node splitted if its depth is lower than a certain limit.
*/ */
class Maximum_depth { class Maximum_depth {
@ -62,7 +66,7 @@ public:
/*! /*!
\brief returns `true` if `n` should be splitted, `false` otherwise. \brief returns `true` if `n` should be splitted, `false` otherwise.
*/ */
template<class Node> template<typename Node>
bool operator()(const Node &n) const { bool operator()(const Node &n) const {
return n.depth() < m_max_depth; return n.depth() < m_max_depth;
} }
@ -70,8 +74,9 @@ public:
/*! /*!
\ingroup PkgOrthtreeSplitPredicates \ingroup PkgOrthtreeSplitPredicates
\brief A class used to choose when a node should be split depending on the depth and the number of inliers.
\brief predicate that splits a node if it contains more than a This predicate makes a note splitted if it contains more than a
certain number of items and if its depth is lower than a certain certain number of items and if its depth is lower than a certain
limit. limit.
*/ */
@ -90,7 +95,7 @@ public:
/*! /*!
\brief returns `true` if `n` should be splitted, `false` otherwise. \brief returns `true` if `n` should be splitted, `false` otherwise.
*/ */
template<class Node> template<template Node>
bool operator()(const Node &n) const { bool operator()(const Node &n) const {
size_t num_points = n.size(); size_t num_points = n.size();
size_t depth = n.depth(); size_t depth = n.depth();

View File

@ -89,7 +89,9 @@ Node deepest_first_child(Node n) {
/*! /*!
\ingroup PkgOrthtreeTraversal \ingroup PkgOrthtreeTraversal
\brief preorder traversal, starting from the root towards the leaves. \brief A class used to traverse an orthtree in a preorder way.
A preorder traversal starts from the root towards the leaves.
\cgalModels OrthtreeTraversal \cgalModels OrthtreeTraversal
*/ */
@ -120,7 +122,9 @@ struct Preorder_traversal {
/*! /*!
\ingroup PkgOrthtreeTraversal \ingroup PkgOrthtreeTraversal
\brief preorder traversal, starting from the leaves towards the root. \brief A class used to traverse an orthtree in a postorder way.
A postorder traversal starts from the leaves towards the root.
\cgalModels OrthtreeTraversal \cgalModels OrthtreeTraversal
*/ */
@ -146,7 +150,9 @@ struct Postorder_traversal {
/*! /*!
\ingroup PkgOrthtreeTraversal \ingroup PkgOrthtreeTraversal
\brief leaves traversal, ignoring all non-leave nodes. \brief A class used to traverse the leaves of an orthtree.
All non-leave nodes are ignored.
\cgalModels OrthtreeTraversal \cgalModels OrthtreeTraversal
*/ */