mirror of https://github.com/CGAL/cgal
using 'contained elements' instead of elements to descripe split predicate
This commit is contained in:
parent
546888c6d1
commit
a8fd56c724
|
|
@ -57,7 +57,7 @@ split, `false` otherwise: this enables users to choose on what
|
|||
criterion should the orthtree be refined. Predefined predicates are
|
||||
provided for the point-set orthtree,
|
||||
including [Maximum_depth](@ref CGAL::Orthtrees::Maximum_depth)
|
||||
and [Maximum_number_of_inliers](@ref CGAL::Orthtrees::Maximum_number_of_inliers).
|
||||
and [Maximum_contained_elements](@ref CGAL::Orthtrees::Maximum_contained_elements).
|
||||
|
||||
The simplest way to create a point-set orthtree is from a vector of points.
|
||||
The constructor generally expects a separate point range and map,
|
||||
|
|
@ -75,8 +75,8 @@ For convenience, the alias `CGAL::Quadtree` is provided.
|
|||
|
||||
The following example shows the construction of %quadtree from a vector of `Point_2` objects.
|
||||
`quadtree.refine(10, 5)` uses the default split predicate, which
|
||||
enforces a max-depth and a maximum number of inliers per node ("bucket size").
|
||||
Nodes are split if their depth is less than 10, and they contain more than 5 inliers.
|
||||
enforces a max-depth and a maximum of elements contained per node ("bucket size").
|
||||
Nodes are split if their depth is less than 10, and they contain more than 5 points.
|
||||
|
||||
|
||||
\cgalExample{Orthtree/quadtree_build_from_point_vector.cpp}
|
||||
|
|
@ -103,7 +103,7 @@ An %octree is constructed from the point set and its corresponding map,
|
|||
and then written to the standard output.
|
||||
|
||||
The split predicate is manually constructed and passed to the refine method.
|
||||
In this case, we use a maximum number of inliers with no corresponding maximum depth.
|
||||
In this case, we use a maximum number of contained elements with no corresponding maximum depth.
|
||||
This means that nodes will continue to be split until none contain more than 10 points.
|
||||
|
||||
\cgalExample{Orthtree/octree_build_from_point_set.cpp}
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ Quadtree, Octree and Orthtree Reference
|
|||
- `CGAL::Orthtree_traits_face_graph<TriangleMesh, VertexPointMap>`
|
||||
|
||||
\cgalCRPSection{Split Predicates}
|
||||
- `CGAL::Orthtrees::Maximum_number_of_inliers`
|
||||
- `CGAL::Orthtrees::Maximum_contained_elements`
|
||||
- `CGAL::Orthtrees::Maximum_depth`
|
||||
- `CGAL::Orthtrees::Maximum_depth_and_maximum_number_of_inliers`
|
||||
- `CGAL::Orthtrees::Maximum_depth_and_maximum_contained_elements`
|
||||
|
||||
\cgalCRPSection{%Traversal}
|
||||
- `CGAL::Orthtrees::Preorder_traversal`
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ int main(int argc, char **argv) {
|
|||
Octree octree(points, points.point_map());
|
||||
|
||||
// Build the octree with a small bucket size, using a more verbose method
|
||||
octree.refine(CGAL::Orthtrees::Maximum_number_of_inliers(10));
|
||||
octree.refine(CGAL::Orthtrees::Maximum_contained_elements(10));
|
||||
|
||||
// Print out the tree
|
||||
std::cout << octree << std::endl;
|
||||
|
|
|
|||
|
|
@ -366,17 +366,17 @@ public:
|
|||
|
||||
/*!
|
||||
\brief convenience overload that refines an orthtree using a
|
||||
maximum depth and maximum number of inliers in a node as split
|
||||
maximum depth and maximum number of contained elements in a node as split
|
||||
predicate.
|
||||
|
||||
This is equivalent to calling
|
||||
`refine(Orthtrees::Maximum_depth_and_maximum_number_of_inliers(max_depth,
|
||||
`refine(Orthtrees::Maximum_depth_and_maximum_contained_elements(max_depth,
|
||||
bucket_size))`.
|
||||
|
||||
The refinement is stopped as soon as one of the conditions is
|
||||
violated: if a node has more inliers than `bucket_size` but is
|
||||
violated: if a node contains more elements than `bucket_size` but is
|
||||
already at `max_depth`, it is not split. Similarly, a node that is
|
||||
at a depth smaller than `max_depth` but already has fewer inliers
|
||||
at a depth smaller than `max_depth` but already contains fewer elements
|
||||
than `bucket_size`, it is not split.
|
||||
|
||||
\warning This convenience method is only appropriate for trees with traits classes where
|
||||
|
|
@ -386,7 +386,7 @@ public:
|
|||
\param bucket_size maximum number of items a node is allowed to contain.
|
||||
*/
|
||||
void refine(size_t max_depth = 10, size_t bucket_size = 20) {
|
||||
refine(Orthtrees::Maximum_depth_and_maximum_number_of_inliers(max_depth, bucket_size));
|
||||
refine(Orthtrees::Maximum_depth_and_maximum_contained_elements(max_depth, bucket_size));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Orthtrees {
|
|||
|
||||
/*!
|
||||
\ingroup PkgOrthtreeSplitPredicates
|
||||
\brief A class used to choose when a node should be split depending on the number of inliers.
|
||||
\brief A class used to choose when a node should be split depending on the number of contained elements.
|
||||
|
||||
This is a bucket size predicate that considers a node should be
|
||||
split if it contains more than a certain number of items.
|
||||
|
|
@ -33,15 +33,15 @@ namespace Orthtrees {
|
|||
\warning This split predicate is only appropriate for trees with traits classes which are models of `OrthtreeTraitsWithData`
|
||||
and where `Node_data` is a model of `Range`. `RandomAccessRange` is suggested for performance.
|
||||
*/
|
||||
class Maximum_number_of_inliers {
|
||||
class Maximum_contained_elements {
|
||||
|
||||
std::size_t m_bucket_size;
|
||||
|
||||
public:
|
||||
/*!
|
||||
\brief creates a predicate based on the number of inliers (bucket size).
|
||||
\brief creates a predicate based on the number of contained elements.
|
||||
*/
|
||||
Maximum_number_of_inliers(std::size_t bucket_size) :
|
||||
Maximum_contained_elements(std::size_t bucket_size) :
|
||||
m_bucket_size(bucket_size) {}
|
||||
|
||||
/*!
|
||||
|
|
@ -83,22 +83,22 @@ public:
|
|||
|
||||
/*!
|
||||
\ingroup PkgOrthtreeSplitPredicates
|
||||
\brief A class used to choose when a node should be split depending on the depth and the number of inliers.
|
||||
\brief A class used to choose when a node should be split depending on the depth and the number of contained elements.
|
||||
|
||||
This predicate makes a note split if it contains more than a
|
||||
certain number of items and if its depth is lower than a certain
|
||||
limit.
|
||||
|
||||
The refinement is stopped as soon as one of the conditions is
|
||||
violated: if a node has more inliers than `bucket_size` but is
|
||||
violated: if a node has more elements than `bucket_size` but is
|
||||
already at `max_depth`, it is not split. Similarly, a node that is
|
||||
at a depth smaller than `max_depth` but already has fewer inliers
|
||||
at a depth smaller than `max_depth` but already has fewer elements
|
||||
than `bucket_size`, it is not split.
|
||||
|
||||
\warning This split predicate is only appropriate for trees with traits classes which are models of `OrthtreeTraitsWithData`
|
||||
and where `Node_data` is a model of `Range`. `RandomAccessRange` is suggested for performance.
|
||||
*/
|
||||
class Maximum_depth_and_maximum_number_of_inliers {
|
||||
class Maximum_depth_and_maximum_contained_elements {
|
||||
|
||||
std::size_t m_max_depth, m_bucket_size;
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ public:
|
|||
|
||||
/*! \brief creates a predicate using maximum depth or bucket size.
|
||||
*/
|
||||
Maximum_depth_and_maximum_number_of_inliers(std::size_t max_depth, std::size_t bucket_size) :
|
||||
Maximum_depth_and_maximum_contained_elements(std::size_t max_depth, std::size_t bucket_size) :
|
||||
m_max_depth(max_depth), m_bucket_size(bucket_size) {}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
Loading…
Reference in New Issue