mirror of https://github.com/CGAL/cgal
clean up
This commit is contained in:
parent
b503b42636
commit
14089f54f9
|
|
@ -2,7 +2,7 @@
|
|||
\ingroup PkgOrthtreeConcepts
|
||||
\cgalConcept
|
||||
|
||||
Refinement of the OrthtreeTraitsWithData concept, adding requirements for the
|
||||
Refinement of the `OrthtreeTraitsWithData` concept, adding requirements for the
|
||||
traits class of a `CGAL::Orthtree` in order to supports nearest-neighbor searching.
|
||||
|
||||
Nearest neighbor searches expect a tree where `Node_data` is a model of `ForwardRange`.
|
||||
|
|
@ -36,7 +36,7 @@ public:
|
|||
using Node_data_element = unspecified_type;
|
||||
|
||||
/*!
|
||||
* \brief Functor with an operator calculate the squared distance of `Node_data_element` from a point.
|
||||
* \brief Functor with an operator that calculates the squared distance of a `Node_data_element` from a point.
|
||||
*
|
||||
* Provides the operator:
|
||||
* `FT operator()(const Node_data_element&, const Point_d&)`
|
||||
|
|
|
|||
|
|
@ -25,11 +25,10 @@ public:
|
|||
using Node_data = unspecified_type;
|
||||
|
||||
/*!
|
||||
* \brief Functor which initializes the contained elements for the root node.
|
||||
* \brief Functor which initializes elements contained by the root node.
|
||||
*
|
||||
* Each node of a tree has an associated `Node_data` value.
|
||||
* For most nodes, this is set by `Distribute_node_contents`, but that is not possible for the root node.
|
||||
* Instead, this functor initializes the `Node_data` of the root node.
|
||||
* This functor initializes the `Node_data` of the root node.
|
||||
* It takes no arguments, and returns an instance of `Node_data`.
|
||||
*
|
||||
* Provides the operator:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgOrthtreeConcepts
|
||||
\cgalConcept
|
||||
|
|
@ -24,7 +23,7 @@ public:
|
|||
Node_index first_index() const;
|
||||
|
||||
/*!
|
||||
\brief returns the next node to iterate to, given the previous node.
|
||||
\brief returns the next node to be traversed given the previous node `n`.
|
||||
*/
|
||||
Node_index next(Node_index n) const;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -110,12 +110,10 @@ struct Node_data_wrapper<GT, false>
|
|||
\sa `CGAL::Quadtree`
|
||||
\sa `CGAL::Octree`
|
||||
|
||||
\tparam GeomTraits must be a model of `OrthtreeTraits`
|
||||
\tparam GeomTraits must be a model of `OrthtreeTraits` or `OrthtreeTraitswithData`.
|
||||
*/
|
||||
template <typename GeomTraits>
|
||||
class Orthtree {
|
||||
static inline constexpr bool has_data = Orthtree_impl::has_Node_data<GeomTraits>::value;
|
||||
|
||||
public:
|
||||
/// \name Template Types
|
||||
/// @{
|
||||
|
|
@ -124,6 +122,11 @@ public:
|
|||
|
||||
/// \name Traits Types
|
||||
/// @{
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
static inline constexpr bool has_data = Orthtree_impl::has_Node_data<GeomTraits>::value;
|
||||
#else
|
||||
static inline constexpr bool has_data = bool_value; ///< `true` if `GeomTraits` is a model of `OrthtreeTraitswithData` and `false` otherwise.
|
||||
#endif
|
||||
static constexpr int dimension = Traits::dimension; ///< Dimension of the tree
|
||||
using Kernel = typename Traits::Kernel; ///< Kernel type.
|
||||
using FT = typename Traits::FT; ///< Number type.
|
||||
|
|
@ -133,7 +136,11 @@ public:
|
|||
using Adjacency = typename Traits::Adjacency; ///< Adjacency type.
|
||||
|
||||
using Node_index = typename Traits::Node_index; ///< Index of a given node in the tree; the root always has index 0.
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
using Node_data = typename Orthtree_impl::Node_data_wrapper<Traits, has_data>::Node_data;
|
||||
#else
|
||||
using Node_data = std::conditional_t<has_data,typename GeomTraits::Node_data,void*>;
|
||||
#endif
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgOrthtreeTraits
|
||||
|
||||
Traits class for the `Orthtree` class to be used to contruct a 3D octree around
|
||||
Traits class for the `Orthtree` class to be used to construct a 3D octree around
|
||||
a triangulated surface mesh. Each node of the octree will store all the faces of the
|
||||
mesh intersected by its bounding box. The subdivision of the octree is controlled
|
||||
by the nested class `Orthtree_traits_face_graph::Split_predicate_node_min_extent`
|
||||
|
|
@ -93,13 +93,13 @@ struct Orthtree_traits_face_graph : public Orthtree_traits_base<
|
|||
};
|
||||
}
|
||||
|
||||
auto construct_root_node_contents_object() {
|
||||
auto construct_root_node_contents_object() const {
|
||||
return [&]() -> Node_data {
|
||||
return {faces(m_pm).begin(), faces(m_pm).end()};
|
||||
};
|
||||
}
|
||||
|
||||
auto distribute_node_contents_object() {
|
||||
auto distribute_node_contents_object() const {
|
||||
return [&](Node_index n, Tree& tree, const Point_d& /* center */) -> void {
|
||||
Node_data& ndata = tree.data(n);
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue