diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h index 577bad2f6f7..7d2c7313812 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h @@ -37,12 +37,12 @@ among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Rele 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)`. +A functor object to construct the intersection between two geometric objects. +This functor must support the result_of protocol, that is the return +type of the `operator()(A, B)` is `CGAL::cpp11::result`. Provides the operators: -`Result::type operator()(const A& a, const B& b);` +`CGAL::cpp11::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 diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h index 7252f1c06cf..2d892f36bb0 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h @@ -58,12 +58,10 @@ typedef std::pair Point_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`. - */ +/*! A nested class template providing as a pair the intersection result of a `Query` object +and a `Primitive::Datum`, together with the `Primitive::Id` of the primitive intersected. +The type of the pair is given by the nested type `Type`. +*/ template struct Intersection_and_primitive_id{}; @@ -123,7 +121,9 @@ typedef Hidden_type Do_intersect; /*! A functor object to compute the intersection of a query and a primitive. Provides the operator: -`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. +`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. +\cgalHeading{Note on Backward Compatibility} +Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional`. */ typedef Hidden_type Intersect; diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index d6e1f2ac335..02fd3e968a0 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -68,6 +68,7 @@ public: typedef typename std::pair Point_and_primitive_id; + ///\todo update this to use the return type of `GeomTraits::Intersection` together with an helper to remove optional template struct Intersection_and_primitive_id { typedef std::pair< diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index ce637c52880..6405e38f18b 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -87,17 +87,12 @@ namespace CGAL { /// \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< >` + /*! + An alias to AABBTraits::Interesction_and_primitive_id */ - template struct Intersection_and_primitive_id { typedef typename AABBTraits::template Intersection_and_primitive_id::Type Type; - typedef Type type; }; @@ -246,7 +241,7 @@ public: /// `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` + /// predicates and intersections must be defined for `Query` /// in the `AABBTraits` class. template OutputIterator all_intersections(const Query& query, OutputIterator out) const;