diff --git a/Intersections_3/include/CGAL/Intersection_traits_3.h b/Intersections_3/include/CGAL/Intersection_traits_3.h index a515eb99c2e..c82307ed8b4 100644 --- a/Intersections_3/include/CGAL/Intersection_traits_3.h +++ b/Intersections_3/include/CGAL/Intersection_traits_3.h @@ -23,26 +23,6 @@ #include -namespace CGAL { -// global intersection declarations -#define INTERSECT_SELF ((Line_3, 3))((Plane_3, 3))((Ray_3, 3))((Segment_3, 3))((Sphere_3, 3))((Triangle_3, 3))((Iso_cuboid_3, 3)) -#define INTERSECT ((Plane_3, Line_3, 3))((Ray_3, Line_3, 3))((Segment_3, Line_3, 3))((Triangle_3, Line_3, 3))((Ray_3, Plane_3, 3)) \ - ((Segment_3, Plane_3, 3))((Sphere_3, Plane_3, 3))((Triangle_3, Plane_3, 3))((Segment_3, Ray_3, 3)) \ - ((Triangle_3, Ray_3, 3))((Triangle_3, Segment_3, 3))((Iso_cuboid_3, Segment_3, 3))((Iso_cuboid_3, Line_3, 3)) \ - ((Iso_cuboid_3, Ray_3, 3)) -#define EXPAND_SELF(s, state, x) CGAL_INTERSECTION_FUNCTION_SELF( BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM(2, 0, x)), BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM(2, 1, x)) ) -#define EXPAND_BINARY(s, state, x) CGAL_INTERSECTION_FUNCTION( BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM(3, 0, x)), BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM(3, 1, x)), BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM(3, 2, x)) ) - -// BOOST_PP_SEQ_FOR_EACH(EXPAND_SELF, _, INTERSECT_SELF) -// BOOST_PP_SEQ_FOR_EACH(EXPAND_BINARY, _, INTERSECT) - -#undef EXPAND_SELF -#undef EXPAND_BINARY -#undef INTERSECT_SELF -#undef INTERSECT -} - - #if !(CGAL_INTERSECTION_VERSION < 2) namespace CGAL { diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objects.h b/Kernel_d/include/CGAL/Kernel_d/function_objects.h index 1a88daa25f2..88545b42d4e 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objects.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objects.h @@ -142,6 +142,18 @@ template class Intersect { public: + template + struct Result { + typedef typename Intersection_traits::result_type Type; + // Boost MPL compatibility + typedef Type type; + }; + + // Solely to make the lazy kernel work + #if CGAL_INTERSECTION_VERSION < 2 + typedef CGAL::Object result_type; + #endif + template typename Intersection_traits::result_type operator()(const T1& t1, const T2& t2) const diff --git a/Kernel_d/include/CGAL/intersections_d.h b/Kernel_d/include/CGAL/intersections_d.h index 4574334310a..22a149aa6d9 100644 --- a/Kernel_d/include/CGAL/intersections_d.h +++ b/Kernel_d/include/CGAL/intersections_d.h @@ -26,9 +26,6 @@ #include #include -#include -#include - namespace CGAL { namespace internal { @@ -358,5 +355,37 @@ inline bool do_intersect(const typename R::Hyperplane_d& h, const typename R::Se { return do_intersect(s,h,r); } } //namespace internal + +template +class Hyperplane_d; +template +class Line_d; +template +class Segment_d; +template +class Ray_d; + +// global intersection +CGAL_INTERSECTION_FUNCTION_SELF(Line_d, d) +CGAL_INTERSECTION_FUNCTION_SELF(Ray_d, d) +CGAL_INTERSECTION_FUNCTION_SELF(Segment_d, d) +CGAL_INTERSECTION_FUNCTION(Line_d, Ray_d, d) +CGAL_INTERSECTION_FUNCTION(Ray_d, Segment_d, d) +CGAL_INTERSECTION_FUNCTION(Line_d, Segment_d, d) +CGAL_INTERSECTION_FUNCTION(Line_d, Hyperplane_d, d) +CGAL_INTERSECTION_FUNCTION(Ray_d, Hyperplane_d, d) +CGAL_INTERSECTION_FUNCTION(Segment_d, Hyperplane_d, d) + +// global do_intersect +CGAL_DO_INTERSECT_FUNCTION_SELF(Line_d, d) +CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_d, d) +CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_d, d) +CGAL_DO_INTERSECT_FUNCTION(Line_d, Ray_d, d) +CGAL_DO_INTERSECT_FUNCTION(Line_d, Segment_d, d) +CGAL_DO_INTERSECT_FUNCTION(Ray_d, Segment_d, d) +CGAL_DO_INTERSECT_FUNCTION(Line_d, Hyperplane_d, d) +CGAL_DO_INTERSECT_FUNCTION(Ray_d, Hyperplane_d, d) +CGAL_DO_INTERSECT_FUNCTION(Segment_d, Hyperplane_d, d) + } //namespace CGAL #endif //CGAL_INTERSECTIONS_D_H