diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h index 10f8d462933..e1424cba6b3 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h @@ -38,8 +38,11 @@ typedef Hidden_type Do_intersect_3; /*! A functor object to construct the intersection between two geometric objects. +Provides the nested type `Result` where `Result::Type` is the return +type of the `operator()(A, B)`. + Provides the operators: -`CGAL::Object operator()(const Type_1& type_1, const Type_2& type_2);` where `Type_1` and `Type_2` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Relevant herein means that a line primitive (ray, segment, line) is tested against a planar or solid primitive (plane, triangle, box). The operator computes a `CGAL::Object` which is the intersection between the objects `type_1` and `type_2`. +`Result operator()(const A& a, const B& b);` where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Relevant herein means that a line primitive (ray, segment, line) is tested against a planar or solid primitive (plane, triangle, box). A model of `Kernel::Intersect_3` fulfills those requirements. */ typedef Hidden_type Intersect_3; diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h index 62cf31ba638..7252f1c06cf 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h @@ -53,9 +53,20 @@ typedef Hidden_type Bounding_box; typedef std::pair Point_and_primitive_id; /*! - +\deprecated */ -typedef std::pair Object_and_primitive_id; +typedef std::pair Object_and_primitive_id; + + + /*! A nested class template to aquire the pair of the return type of +intersections with an object of type `Query` and a +`Primitive::Id` through the member typedef `Type`. + +This class is convertible to `Point_and_primitive_id`. + */ + + template + struct Intersection_and_primitive_id{}; /// @} @@ -112,7 +123,7 @@ typedef Hidden_type Do_intersect; /*! A functor object to compute the intersection of a query and a primitive. Provides the operator: -`boost::optional operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive. +`boost::optional::type operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive. */ typedef Hidden_type Intersect; diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index c95e9998993..05a10ffcf7c 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -74,8 +74,16 @@ namespace CGAL { typedef typename AABBTraits::Bounding_box Bounding_box; /// typedef typename AABBTraits::Point_and_primitive_id Point_and_primitive_id; - /// + /// \deprecated typedef typename AABBTraits::Object_and_primitive_id Object_and_primitive_id; + + /*! +\todo Fill in the types in the std::pair. +A nested type to aquire the return type of intersections +with an object of type `Query` through the member typedef +`Type` equal to `std::pair< >` + */ + template struct Intersection_and_primitive_id { typedef typename AABBTraits::template Intersection_and_primitive_id::Type Type; @@ -232,22 +240,25 @@ public: /// \name Intersections ///@{ - /// Outputs to the iterator the list of all intersections between - /// the query and input data, as objects of type - /// `Object_and_primitive_id`. Type `Query` must be a type - /// for which `do_intersect` predicates - /// and intersections are defined in the traits class AABBTraits. + /// Outputs the list of all intersections, as objects of + /// `Intersection_and_primitive_id::Type`, + /// between the query and the input data to + /// the iterator. `do_intersect()` + /// predicates and intersections must be defined for Query` + /// in the `AABBTraits` class. + template OutputIterator all_intersections(const Query& query, OutputIterator out) const; - /// Returns the first encountered intersection, iff the query - /// intersects at least one of the input primitives. No particular - /// order is guaranteed over the tree traversal, such that, e.g, - /// the primitive returned is not necessarily the closest from the + /// Returns the first encountered intersection. No particular + /// order is guaranteed over the tree traversal, e.g, the + /// primitive returned is not necessarily the closest from the /// source point of a ray query. Type `Query` must be a type /// for which `do_intersect` predicates /// and intersections are defined in the traits class AABBTraits. + + template #if CGAL_INTERSECTION_VERSION < 2 boost::optional