-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7672 from JacksonCampolattaro/orthtree-generaliza…
…tion Orthtree generalization
- Loading branch information
Showing
68 changed files
with
3,895 additions
and
2,451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
Orthtree/doc/Orthtree/Concepts/CollectionPartitioningOrthtreeTraits.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/*! | ||
\ingroup PkgOrthtreeConcepts | ||
\cgalConcept | ||
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`. | ||
The leaf nodes of the tree represent an exclusive partition of the elements contained in the tree. | ||
This means that no element should be contained by more than one node. | ||
\cgalRefines{OrthtreeTraitsWithData} | ||
\cgalHasModelsBegin | ||
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, DimensionTag>} | ||
\cgalHasModelsEnd | ||
*/ | ||
class CollectionPartitioningOrthtreeTraits { | ||
public: | ||
|
||
|
||
/// \name Types | ||
/// @{ | ||
|
||
/*! | ||
* Sphere Type used for the shrinking-sphere approach for neighbor queries; needs to be copy assignable. | ||
*/ | ||
using Sphere_d = unspecified_type; | ||
|
||
/*! | ||
* \brief The data type contained by each node; must be a model of `ForwardRange` in addition to default constructible, copy constructible and copy assignable. | ||
*/ | ||
using Node_data = unspecified_type; | ||
|
||
/*! | ||
* \brief An element of the `Node_data` list-like type. | ||
* | ||
* Must be constructible from the value type of a `Node_data::iterator`. | ||
* Typically the same as that type, but can also be an `std::reference_wrapper<>` if the type is not copyable. | ||
*/ | ||
using Node_data_element = unspecified_type; | ||
|
||
/*! | ||
* \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&)` | ||
*/ | ||
using Squared_distance_of_element = unspecified_type; | ||
|
||
/*! | ||
* \brief Functor with an operator that constructs a `Sphere_d` from a provided center and squared radius. | ||
* | ||
* Provides the operator: | ||
* `Sphere_d operator()(const Point_d&, const FT&)` | ||
*/ | ||
using Construct_sphere_d = unspecified_type; | ||
|
||
/*! | ||
* \brief Functor with an operator that provides the center of a `Sphere_d`. | ||
* | ||
* Provides the operator: | ||
* `Point_d operator()(const Sphere_d&)` | ||
*/ | ||
using Construct_center_d = unspecified_type; | ||
|
||
/*! | ||
* \brief Functor with an operator that provides the squared radius of a `Sphere_d`. | ||
* | ||
* Provides the operator: | ||
* `FT operator()(const Sphere_d&)` | ||
*/ | ||
using Compute_squared_radius_d = unspecified_type; | ||
|
||
/// @} | ||
|
||
/// \name Operations | ||
/// @{ | ||
|
||
/*! | ||
* constructs an object of type `ConstructSphere_d`. | ||
*/ | ||
Construct_sphere_d construct_sphere_d_object() const; | ||
|
||
/*! | ||
* constructs an object of type `ConstructCenter_d`. | ||
*/ | ||
Construct_center_d construct_center_d_object() const; | ||
|
||
/*! | ||
* constructs an object of type `ComputeSquaredRadius_d`. | ||
*/ | ||
Compute_squared_radius_d compute_squared_radius_d_object() const; | ||
|
||
/*! | ||
* constructs an object of type `Squared_distance_of_element`. | ||
*/ | ||
Squared_distance_of_element squared_distance_of_element_object() const; | ||
|
||
/// @} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*! | ||
\ingroup PkgOrthtreeConcepts | ||
\cgalConcept | ||
The concept `OrthtreeTraitsWithData` defines the requirements for the | ||
template parameter of the `CGAL::Orthtree` class for a node type that stores data. | ||
\cgalRefines{OrthtreeTraits} | ||
\cgalHasModelsBegin | ||
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>} | ||
\cgalHasModels{CGAL::Orthtree_traits_face_graph<PolygonMesh, VPM>} | ||
\cgalHasModels{CGAL::Orthtree_traits_base<K, dimension>} | ||
\cgalHasModelsEnd | ||
*/ | ||
class OrthtreeTraitsWithData | ||
{ | ||
public: | ||
|
||
/// \name Types | ||
/// @{ | ||
/*! | ||
* \brief The data type contained by each node. Must be default constructible, copy constructible and copy assignable. | ||
*/ | ||
using Node_data = unspecified_type; | ||
|
||
/*! | ||
* \brief Functor which initializes elements contained by the root node. | ||
* | ||
* Each node of a tree has an associated `Node_data` value. | ||
* This functor initializes the `Node_data` of the root node. | ||
* It takes no arguments, and returns an instance of `Node_data`. | ||
* | ||
* Provides the operator: | ||
* `Node_data operator()()` | ||
* | ||
* Typically, the `Node_data` of the root node contains all the elements in the tree. | ||
* For a tree in which each node contains a span (such as `std::span()`) this function would return the span containing all items. | ||
* | ||
*/ | ||
using Construct_root_node_contents = unspecified_type; | ||
|
||
/*! | ||
* \brief Functor which fills the contents of the nodes children. | ||
* | ||
* Provides the operator: | ||
* `void operator()(Node_index, Orthtree<Traits>&, const Point_d&)` | ||
* | ||
* The functor is called during refinement of the `Orthtree` on a node after it has been split. The purpose of the functor is to | ||
* distribute the `Node_data`, accessible via `tree.data()`, to the data of the nodes children, accessible via `tree.children()`. | ||
* The first parameter is the `Node_index` of the node. The second parameter provides the instance of the `Orthtree` | ||
* and the last parameter is the barycenter of the node which will be used as shared corner amongst the children of the node. | ||
* | ||
* For a tree in which each node contains a span, this may mean rearranging the contents of the original node | ||
* and producing spans containing a subset of its contents for each of its children. | ||
* For compatibility with locate, the center of the node is considered to be part of the upper half. | ||
*/ | ||
using Distribute_node_contents = unspecified_type; | ||
|
||
/// @} | ||
|
||
/// \name Operations | ||
/// @{ | ||
|
||
/*! | ||
* constructs an object of type `Construct_root_node_contents`. | ||
*/ | ||
Construct_root_node_contents construct_root_node_contents_object() const; | ||
|
||
/*! | ||
* constructs an object of type `Distribute_node_contents`. | ||
*/ | ||
Distribute_node_contents distribute_node_contents_object() const; | ||
|
||
/// @} | ||
}; |
Oops, something went wrong.