mirror of https://github.com/CGAL/cgal
added concept for orthtree without data
This commit is contained in:
parent
446d39664f
commit
c04b584ce6
|
|
@ -3,12 +3,14 @@
|
|||
\cgalConcept
|
||||
|
||||
The concept `OrthtreeTraits` defines the requirements for the
|
||||
template parameter of the `CGAL::Orthtree` class.
|
||||
template parameter of the `CGAL::Orthtree` class for a node type that stores data.
|
||||
|
||||
\cgalRefines{OrthtreeTraitsWithoutData}
|
||||
|
||||
\cgalHasModelsBegin
|
||||
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension >}
|
||||
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>}
|
||||
\cgalHasModels{CGAL::Orthtree_traits_face_graph<PolygonMesh, VPM>}
|
||||
\cgalHasModels{CGAL::Orthtree_traits_base< K, dimension >}
|
||||
\cgalHasModels{CGAL::Orthtree_traits_base<K, dimension>}
|
||||
\cgalHasModelsEnd
|
||||
*/
|
||||
class OrthtreeTraits
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
/*!
|
||||
\ingroup PkgOrthtreeConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `OrthtreeTraitsWithoutData` defines the requirements for the
|
||||
template parameter of the `CGAL::Orthtree` class.
|
||||
|
||||
\cgalHasModelsBegin
|
||||
\cgalHasModels{CGAL::Orthtree_traits_without_data<GeomTraits, dimension>}
|
||||
\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 OrthtreeTraitsWithoutData
|
||||
{
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
using Node_index = unspecified_type; ///< An integer type for nodes
|
||||
constexpr int dimension; ///< Dimension.
|
||||
using FT = unspecified_type; ///< The number type of the %Cartesian coordinates of types `Point_d`
|
||||
using Point_d = unspecified_type; ///< Point type.
|
||||
using Bbox_d = unspecified_type; ///< Bounding box type. Must be constructible from a pair of `Point_d` types.
|
||||
|
||||
/*!
|
||||
A random access iterator type to enumerate the
|
||||
%Cartesian coordinates of a point of type `Point_d`.
|
||||
*/
|
||||
using Cartesian_const_iterator_d = unspecified_type;
|
||||
|
||||
/*!
|
||||
* \brief Integral number type which can take on values indicating adjacency directions.
|
||||
*
|
||||
* Must be able to take on values ranging from 0 to the number of faces of the (hyper)rectangle type, equivalent to 2 * D.
|
||||
*/
|
||||
using Adjacency = unspecified_type; ///< Specify the adjacency directions
|
||||
|
||||
/*!
|
||||
* \brief Functor with an operator to create the bounding box of the root node.
|
||||
*
|
||||
* Provides the operator:
|
||||
* `Bbox_d operator()()`
|
||||
*
|
||||
* The bounding box must enclose all elements contained by the tree.
|
||||
* It may be tight-fitting. The orthtree constructor produces a bounding box surrounding this region.
|
||||
* For traits which assign no data to each node, this can be defined to return a fixed region.
|
||||
*/
|
||||
using Construct_root_node_bbox = unspecified_type;
|
||||
|
||||
/*!
|
||||
* \brief Functor with an operator to construct a `Point_d` from an initializer list.
|
||||
*
|
||||
* For trees which use a different kernel for the bounding box type,
|
||||
* the return type of this functor must match the kernel used by the bounding box type and not that of the contents.
|
||||
*/
|
||||
using Construct_point_d = unspecified_type;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
* constructs an object of type `Construct_root_node_bbox`.
|
||||
*/
|
||||
Construct_root_node_bbox construct_root_node_bbox_object() const;
|
||||
|
||||
/*!
|
||||
* constructs an object of type `Construct_point_d`.
|
||||
*/
|
||||
Construct_point_d construct_point_d_object() const;
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
|
@ -40,6 +40,7 @@ Quadtree, Octree and Orthtree Reference
|
|||
\cgalClassifedRefPages
|
||||
|
||||
\cgalCRPSection{Concepts}
|
||||
- `OrthtreeTraitsWithoutData`
|
||||
- `OrthtreeTraits`
|
||||
- `OrthtreeTraversal`
|
||||
- `CollectionPartitioningOrthtreeTraits`
|
||||
|
|
@ -50,7 +51,8 @@ Quadtree, Octree and Orthtree Reference
|
|||
- `CGAL::Orthtree<GeomTraits, PointRange, PointMap>`
|
||||
|
||||
\cgalCRPSection{Traits}
|
||||
- `CGAL::Orthtree_traits_point<GeomTraits>`
|
||||
- `CGAL::Orthtree_traits_without_data<GeomTraits, dimension>`
|
||||
- `CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>`
|
||||
- `CGAL::Orthtree_traits_base<GeomTraits>`
|
||||
- `CGAL::Orthtree_traits_face_graph<TriangleMesh, VertexPointMap>`
|
||||
|
||||
|
|
|
|||
|
|
@ -27,25 +27,25 @@ namespace CGAL {
|
|||
The class `Orthtree_traits_base` is a base class providing common choices for types and functors.
|
||||
The base class is extended by `CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>` and by `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>`.
|
||||
|
||||
\tparam K a model of `Kernel`.
|
||||
\tparam GeomTraits a model of `Kernel`.
|
||||
\tparam dim dimension of the ambient Euclidean space.
|
||||
|
||||
\sa `CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dim>`
|
||||
\sa `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>`
|
||||
*/
|
||||
|
||||
template <typename K, int dim>
|
||||
template <typename GeomTraits, int dim>
|
||||
struct Orthtree_traits_base {
|
||||
/// \name Types
|
||||
/// @{
|
||||
using Node_index = std::size_t;
|
||||
using Kernel = K;
|
||||
using Kernel = GeomTraits;
|
||||
static constexpr int dimension = dim;
|
||||
using FT = typename K::FT;
|
||||
using Point_d = typename K::Point_d;
|
||||
using Bbox_d = typename K::Iso_box_d;
|
||||
using Sphere_d = typename K::Sphere_d;
|
||||
using Cartesian_const_iterator_d = typename K::Cartesian_const_iterator_d;
|
||||
using FT = typename GeomTraits::FT;
|
||||
using Point_d = typename GeomTraits::Point_d;
|
||||
using Bbox_d = typename GeomTraits::Iso_box_d;
|
||||
using Sphere_d = typename GeomTraits::Sphere_d;
|
||||
using Cartesian_const_iterator_d = typename GeomTraits::Cartesian_const_iterator_d;
|
||||
/*!
|
||||
* Adjacency type.
|
||||
*
|
||||
|
|
@ -99,16 +99,16 @@ struct Orthtree_traits_base {
|
|||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
struct Orthtree_traits_base<K, 2> {
|
||||
template <typename GeomTraits>
|
||||
struct Orthtree_traits_base<GeomTraits, 2> {
|
||||
using Node_index = std::size_t;
|
||||
using Kernel = K;
|
||||
using Kernel = GeomTraits;
|
||||
static constexpr int dimension = 2;
|
||||
using FT = typename K::FT;
|
||||
using Point_d = typename K::Point_2;
|
||||
using Bbox_d = typename K::Iso_rectangle_2;
|
||||
using Sphere_d = typename K::Circle_2;
|
||||
using Cartesian_const_iterator_d = typename K::Cartesian_const_iterator_2;
|
||||
using FT = typename GeomTraits::FT;
|
||||
using Point_d = typename GeomTraits::Point_2;
|
||||
using Bbox_d = typename GeomTraits::Iso_rectangle_2;
|
||||
using Sphere_d = typename GeomTraits::Circle_2;
|
||||
using Cartesian_const_iterator_d = typename GeomTraits::Cartesian_const_iterator_2;
|
||||
|
||||
enum Adjacency {
|
||||
LEFT,
|
||||
|
|
@ -124,16 +124,16 @@ struct Orthtree_traits_base<K, 2> {
|
|||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
struct Orthtree_traits_base<K, 3> {
|
||||
template <typename GeomTraits>
|
||||
struct Orthtree_traits_base<GeomTraits, 3> {
|
||||
using Node_index = std::size_t;
|
||||
using Kernel = K;
|
||||
using Kernel = GeomTraits;
|
||||
static constexpr int dimension = 3;
|
||||
using FT = typename K::FT;
|
||||
using Point_d = typename K::Point_3;
|
||||
using Bbox_d = typename K::Iso_cuboid_3;
|
||||
using Sphere_d = typename K::Sphere_3;
|
||||
using Cartesian_const_iterator_d = typename K::Cartesian_const_iterator_3;
|
||||
using FT = typename GeomTraits::FT;
|
||||
using Point_d = typename GeomTraits::Point_3;
|
||||
using Bbox_d = typename GeomTraits::Iso_cuboid_3;
|
||||
using Sphere_d = typename GeomTraits::Sphere_3;
|
||||
using Cartesian_const_iterator_d = typename GeomTraits::Cartesian_const_iterator_3;
|
||||
|
||||
enum Adjacency {
|
||||
LEFT,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ void reassign_points(
|
|||
\cgalModels{OrthtreeTraits}
|
||||
\sa `CGAL::Octree`
|
||||
\sa `CGAL::Quadtree`
|
||||
\sa `CGAL::Orthtree_traits_base<GeomTraits, DimensionTag>`
|
||||
\sa `CGAL::Orthtree_traits_base<GeomTraits, dimension>`
|
||||
*/
|
||||
template <
|
||||
typename GeomTraits,
|
||||
|
|
|
|||
Loading…
Reference in New Issue