diff --git a/.gitattributes b/.gitattributes index cf388fd4e15..7f5671cf71e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1798,7 +1798,6 @@ Intersections_2/include/CGAL/Intersection_traits_2.h -text Intersections_3/include/CGAL/Intersection_traits_3.h -text Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h -text Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h -text -Intersections_3/include/CGAL/intersection_3_0.h -text Intersections_3/test/Intersections_3/call_test.cpp -text Intersections_3/test/Intersections_3/segment_segment.cpp -text Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp -text diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index 698cbe28dcd..c9e0e7c4702 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -62,10 +62,51 @@ typedef typename boost::variant variant_type; \ typedef typename boost::optional< variant_type > result_type; \ - }; + }; #endif +#define CGAL_INTERSECTION_FUNCTION(A, B, DIM) \ + template \ + inline \ + typename BOOST_PP_CAT(K::Intersect_, DIM)::template Result::Type \ + intersection(const A& a, const B& b) { \ + return BOOST_PP_CAT(K().intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ + } \ + template \ + inline \ + typename BOOST_PP_CAT(K::Intersect_, DIM)::template Result::Type \ + intersection(const B& a, const A& b) { \ + return BOOST_PP_CAT(K().intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ + } + +#define CGAL_INTERSECTION_FUNCTION_SELF(A, DIM) \ + template \ + inline \ + typename BOOST_PP_CAT(K::Intersect_, DIM)::template Result::Type \ + intersection(const A & a, const A & b) { \ + return BOOST_PP_CAT(K().intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ + } + +#define CGAL_DO_INTERSECT_FUNCTION(A, B, DIM) \ + template \ + inline bool \ + do_intersect(const A& a, const B& b) { \ + return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ + } \ + template \ + inline bool \ + do_intersect(const B& a, const A& b) { \ + return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ + } + +#define CGAL_DO_INTERSECT_FUNCTION_SELF(A, DIM) \ + template \ + inline bool \ + do_intersect(const A & a, const A & b) { \ + return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ + } + namespace CGAL { // only declarationn @@ -224,23 +265,25 @@ do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) { } // internal -template -inline -typename Intersection_traits< typename Kernel_traits::Kernel, A, B>::result_type -intersection(const A& a, const B& b) { - CGAL_static_assertion_msg( (boost::is_same::value), - "intersection with objects of different dimensions not supported"); - return internal::intersection_impl(a, b, typename A::Ambient_dimension()); -} +// See overloads in the respective header files -template -inline -bool -do_intersect(const A& a, const B& b) { - CGAL_static_assertion_msg((boost::is_same::value), - "do_intersect with objects of different dimensions not supported"); - return internal::do_intersect_impl(a, b, typename A::Ambient_dimension()); -} +// template +// inline +// typename Intersection_traits< typename Kernel_traits::Kernel, A, B>::result_type >::type +// intersection(const A& a, const B& b) { +// CGAL_static_assertion_msg( (boost::is_same::value), +// "intersection with objects of different dimensions not supported"); +// return internal::intersection_impl(a, b, typename A::Ambient_dimension()); +// } + +// template +// inline +// bool +// do_intersect(const A& a, const B& b) { +// CGAL_static_assertion_msg((boost::is_same::value), +// "do_intersect with objects of different dimensions not supported"); +// return internal::do_intersect_impl(a, b, typename A::Ambient_dimension()); +// } } // CGAL diff --git a/Intersections_2/include/CGAL/Intersection_traits_2.h b/Intersections_2/include/CGAL/Intersection_traits_2.h index f40bf50bd37..4d3c1b23637 100644 --- a/Intersections_2/include/CGAL/Intersection_traits_2.h +++ b/Intersections_2/include/CGAL/Intersection_traits_2.h @@ -55,7 +55,6 @@ CGAL_INTERSECTION_TRAITS_2(Segment_2, Triangle_2, Point_2, Segment_2) CGAL_INTERSECTION_TRAITS_2(Triangle_2, Ray_2, Point_2, Segment_2) CGAL_INTERSECTION_TRAITS_2(Ray_2, Triangle_2, Point_2, Segment_2) - template struct Intersection_traits { typedef typename @@ -64,6 +63,7 @@ struct Intersection_traits { typedef typename boost::optional< variant_type > result_type; }; + CGAL_INTERSECTION_TRAITS_2(Iso_rectangle_2, Line_2, Point_2, Segment_2) CGAL_INTERSECTION_TRAITS_2(Line_2, Iso_rectangle_2, Point_2, Segment_2) @@ -82,6 +82,8 @@ struct Intersection_traits result_type; }; + +// Point_2 is special template struct Intersection_traits { typedef typename boost::variant variant_type; @@ -94,6 +96,7 @@ struct Intersection_traits { typedef boost::optional result_type; }; + template struct Intersection_traits { @@ -107,6 +110,7 @@ template struct Intersection_traits : public Intersection_traits {}; + // Intersection_traits for the circular kernel template struct Intersection_traits @@ -119,7 +123,6 @@ struct Intersection_traits result_type; }; - template struct Intersection_traits { @@ -193,11 +196,10 @@ struct Intersection_traits }; template -struct Intersection_traits +struct Intersection_traits : public Intersection_traits {}; - // Circular_arc_2 Circle_2 simply aliases template struct Intersection_traits diff --git a/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2_intersection_impl.h b/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2_intersection_impl.h index 1106af18e4c..3d340ab7b99 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2_intersection_impl.h +++ b/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2_intersection_impl.h @@ -349,4 +349,6 @@ intersection(const typename K::Triangle_2 &tr1, } // namespace internal +CGAL_INTERSECTION_FUNCTION_SELF(Triangle_2, 2) + } //namespace CGAL diff --git a/Intersections_2/include/CGAL/Iso_rectangle_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Iso_rectangle_2_Iso_rectangle_2_intersection.h index 215e71fa0c7..af97b76cffc 100644 --- a/Intersections_2/include/CGAL/Iso_rectangle_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Iso_rectangle_2_Iso_rectangle_2_intersection.h @@ -81,17 +81,19 @@ intersection( return intersection_return(construct_iso_rectangle_2(newmin, newmax)); } +template +inline bool +do_intersect(const typename K::Iso_rectangle_2 &irect1, + const typename K::Iso_rectangle_2 &irect2, + const K&) { + return intersection(irect1, irect2); +} } // namespace internal -template -inline bool -do_intersect(const Iso_rectangle_2 &irect1, - const Iso_rectangle_2 &irect2) -{ - return intersection(irect1, irect2); -} +CGAL_INTERSECTION_FUNCTION_SELF(Iso_rectangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_rectangle_2, 2) } //namespace CGAL diff --git a/Intersections_2/include/CGAL/Line_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Line_2_Iso_rectangle_2_intersection.h index d11d63ddeb3..d621a015343 100644 --- a/Intersections_2/include/CGAL/Line_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Line_2_Iso_rectangle_2_intersection.h @@ -216,6 +216,9 @@ intersection(const typename K::Iso_rectangle_2 &iso, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Line_2, Iso_rectangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Line_2, Iso_rectangle_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h index 978ffa6633c..9021e4e8bf2 100644 --- a/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h @@ -201,6 +201,10 @@ Line_2_Line_2_pair::intersection_line() const } // namespace internal +CGAL_INTERSECTION_FUNCTION_SELF(Line_2, 2) +CGAL_DO_INTERSECT_FUNCTION_SELF(Line_2, 2) + + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h index fb8b9b4bff5..22d5c7917b6 100644 --- a/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h @@ -193,6 +193,9 @@ intersection(const typename K::Triangle_2 &tr, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Line_2, Triangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Line_2, Triangle_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Point_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Point_2_Iso_rectangle_2_intersection.h index bf74b2205d6..eacdf273d93 100644 --- a/Intersections_2/include/CGAL/Point_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Iso_rectangle_2_intersection.h @@ -81,6 +81,9 @@ intersection(const typename K::Iso_rectangle_2 &iso, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Point_2, Iso_rectangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Point_2, Iso_rectangle_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h index 20d3391b939..56560121475 100644 --- a/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h @@ -76,6 +76,9 @@ intersection(const typename K::Line_2 &line, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Point_2, Line_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Point_2, Line_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h b/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h index 7c6b52b8eff..90b7a320592 100644 --- a/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h @@ -54,6 +54,10 @@ intersection(const typename K::Point_2 &pt1, }// namespace internal +CGAL_INTERSECTION_FUNCTION_SELF(Point_2, 2) +CGAL_DO_INTERSECT_FUNCTION_SELF(Point_2, 2) + + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h index c2387e320e5..f29af85c97f 100644 --- a/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h @@ -80,6 +80,10 @@ intersection(const typename K::Ray_2 &ray, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Point_2, Ray_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Point_2, Ray_2, 2) + + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h index 92d760f8e68..3d332cac432 100644 --- a/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h @@ -81,6 +81,9 @@ intersection( const typename K::Segment_2 &seg, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Point_2, Segment_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Point_2, Segment_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h index 551b8d15a04..3b14db3790c 100644 --- a/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h @@ -157,6 +157,9 @@ intersection(const typename K::Triangle_2 &tr, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Point_2, Triangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Point_2, Triangle_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Ray_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Ray_2_Iso_rectangle_2_intersection.h index 6cc3d4ca59e..9ef0dd3a4c7 100644 --- a/Intersections_2/include/CGAL/Ray_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Iso_rectangle_2_intersection.h @@ -203,6 +203,10 @@ Ray_2_Iso_rectangle_2_pair::intersection_point() const } // namespace internal +CGAL_INTERSECTION_FUNCTION(Ray_2, Iso_rectangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Ray_2, Iso_rectangle_2, 2) + + } //namespace CGAL #endif // CGAL_RAY_2_iSO_RECTANGLE_2_INTERSECTION_H diff --git a/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h index b725c949f76..ab41db9e1e3 100644 --- a/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h @@ -165,6 +165,9 @@ Ray_2_Line_2_pair::intersection_ray() const } // namespace internal +CGAL_INTERSECTION_FUNCTION(Ray_2, Line_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Ray_2, Line_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h index a1264ca1bec..5292bffbf0a 100644 --- a/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h @@ -256,6 +256,10 @@ intersection(const typename K::Ray_2 &ray1, } // namespace internal +CGAL_INTERSECTION_FUNCTION_SELF(Ray_2, 2) +CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_2, 2) + + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h index 72a9ed3994b..ba2e9deef60 100644 --- a/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h @@ -268,6 +268,9 @@ intersection(const typename K::Segment_2 &seg, } // namespace internal +CGAL_INTERSECTION_FUNCTION(Ray_2, Segment_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Ray_2, Segment_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h index ca2f976f06e..4c3a8470680 100644 --- a/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h @@ -199,6 +199,10 @@ inline bool do_intersect( } // namespace internal +CGAL_INTERSECTION_FUNCTION(Ray_2, Triangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Ray_2, Triangle_2, 2) + + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Segment_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Segment_2_Iso_rectangle_2_intersection.h index 5858983167c..cbba0cd3eb4 100644 --- a/Intersections_2/include/CGAL/Segment_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Iso_rectangle_2_intersection.h @@ -229,6 +229,9 @@ inline bool do_intersect( } // namespace internal +CGAL_INTERSECTION_FUNCTION(Segment_2, Iso_rectangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Segment_2, Iso_rectangle_2, 2) + } //namespace CGAL #endif // CGAL_SEGMENT_2_ISO_RECTANGLE_2_INTERSECTION_H diff --git a/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h index ad06e8223f6..b8ed430a6e4 100644 --- a/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h @@ -158,6 +158,10 @@ Segment_2_Line_2_pair::intersection_segment() const } // namespace internal +CGAL_INTERSECTION_FUNCTION(Segment_2, Line_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Segment_2, Line_2, 2) + + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h index 4d702d217a0..4785a3e1131 100644 --- a/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h @@ -455,6 +455,9 @@ intersection(const typename K::Segment_2 &seg1, } // namespace internal +CGAL_INTERSECTION_FUNCTION_SELF(Segment_2, 2) +CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h index e8fdb8795b2..af20613b492 100644 --- a/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h @@ -197,6 +197,9 @@ inline bool do_intersect( } // namespace internal +CGAL_INTERSECTION_FUNCTION(Segment_2, Triangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Segment_2, Triangle_2, 2) + } //namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h index 779e13c1bb8..bd226f04b63 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h @@ -281,6 +281,10 @@ namespace internal { return intersection_return(); }//end intersection }//end namespace internal + +CGAL_INTERSECTION_FUNCTION(Triangle_2, Iso_rectangle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Triangle_2, Iso_rectangle_2, 2) + }//end namespace #endif diff --git a/Intersections_2/include/CGAL/Triangle_2_Triangle_2_do_intersect.h b/Intersections_2/include/CGAL/Triangle_2_Triangle_2_do_intersect.h index b0ede9e0390..cece6192266 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Triangle_2_do_intersect.h +++ b/Intersections_2/include/CGAL/Triangle_2_Triangle_2_do_intersect.h @@ -170,16 +170,7 @@ bool do_intersect(const typename K::Triangle_2 &t1, } // namespace internal - - - -template -inline bool do_intersect(const Triangle_2 &t1, - const Triangle_2 &t2) -{ - typedef typename K::Do_intersect_2 Do_intersect; - return Do_intersect()(t1,t2); -} +CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_2, 2) } //namespace CGAL diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index 25618d226c4..8ffbc85735f 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -1,5 +1,6 @@ // 2D intersection tests. +#include #include #include #include diff --git a/Intersections_3/include/CGAL/Intersection_traits_3.h b/Intersections_3/include/CGAL/Intersection_traits_3.h index 7c7a7a4b080..a515eb99c2e 100644 --- a/Intersections_3/include/CGAL/Intersection_traits_3.h +++ b/Intersections_3/include/CGAL/Intersection_traits_3.h @@ -22,7 +22,26 @@ #define CGAL_INTERSECTION_TRAITS_3_H #include -#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) @@ -79,6 +98,7 @@ struct Intersection_traits { typedef typename boost::optional< variant_type > result_type; }; + // !!! undocumented !!! // Segment_3 Iso_cuboid_3 @@ -101,6 +121,7 @@ struct Intersection_traits result_type; }; + // Intersections with BBox returns the same for Ray_3, Line_3 and Segment_3 // Bbox_3 Line_3 template @@ -114,6 +135,20 @@ template struct Intersection_traits : public Intersection_traits {}; +template +inline +typename K::Intersect_3::template Result +intersection(const CGAL::Bbox_3& a, typename K::Line_3 const& b) { + return K().intersect_3_object()(a, b); +} + +template +inline +typename K::Intersect_3::template Result +intersection(typename K::Line_3 const& b, const CGAL::Bbox_3& a) { + return K().intersect_3_object()(b, a); +} + // Bbox_3 Segment_3 template struct Intersection_traits : @@ -123,6 +158,20 @@ template struct Intersection_traits : public Intersection_traits {}; +template +inline +typename K::Intersect_3::template Result +intersection(typename K::Segment_3 const& b, const CGAL::Bbox_3& a) { + return K().intersect_3_object()(b, a); +} + +template +inline +typename K::Intersect_3::template Result +intersection(typename CGAL::Bbox_3 const& b, typename K::Segment_3 const& a) { + return K().intersect_3_object()(b, a); +} + // Bbox_3 Ray_3 template struct Intersection_traits : @@ -132,6 +181,20 @@ template struct Intersection_traits : public Intersection_traits {}; +template +inline +typename K::Intersect_3::template Result +intersection(typename K::Ray_3 const& b, const CGAL::Bbox_3& a) { + return K().intersect_3_object()(b, a); +} + +template +inline +typename K::Intersect_3::template Result +intersection(const CGAL::Bbox_3& a, typename K::Ray_3 const& b) { + return K().intersect_3_object()(b, a); +} + // Intersection_traits for the circular kernel // Sphere_3 Line_3 diff --git a/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h b/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h index 8d0f5026eda..d89c8b35c7c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h +++ b/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h @@ -30,6 +30,128 @@ namespace CGAL { + +// the special plane_3 function +template +inline +#if CGAL_INTERSECTION_VERSION < 2 +CGAL::Object +#else +typename boost::optional< boost::variant< Point_3, Line_3, Plane_3 > > +#endif +intersection(const Plane_3 &plane1, const Plane_3 &plane2, + const Plane_3 &plane3) +{ + return K().intersect_3_object()(plane1, plane2, plane3); +} + +CGAL_INTERSECTION_FUNCTION(Plane_3, Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Plane_3, Line_3, 3) + +CGAL_INTERSECTION_FUNCTION_SELF(Plane_3, 3) + +CGAL_INTERSECTION_FUNCTION_SELF(Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Line_3, 3) + +CGAL_INTERSECTION_FUNCTION_SELF(Segment_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_3, 3) + +CGAL_INTERSECTION_FUNCTION(Line_3, Segment_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Line_3, Segment_3, 3) + +CGAL_INTERSECTION_FUNCTION(Line_3, Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Line_3, Ray_3, 3) + +CGAL_INTERSECTION_FUNCTION(Segment_3, Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Segment_3, Ray_3, 3) + +CGAL_INTERSECTION_FUNCTION_SELF(Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_3, 3) + +CGAL_INTERSECTION_FUNCTION(Plane_3, Sphere_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Plane_3, Sphere_3, 3) + +CGAL_INTERSECTION_FUNCTION_SELF(Sphere_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Sphere_3, 3) + +CGAL_INTERSECTION_FUNCTION(Plane_3, Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Plane_3, Ray_3, 3) + +CGAL_INTERSECTION_FUNCTION(Plane_3, Segment_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Plane_3, Segment_3, 3) + +CGAL_INTERSECTION_FUNCTION(Plane_3, Triangle_3, 3) + +template +inline +typename Intersection_traits::result_type +intersection(const Line_3 &a, + const Bbox_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline +typename Intersection_traits::result_type +intersection(const Bbox_3 &a, + const Line_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline +typename Intersection_traits::result_type +intersection(const Ray_3 &a, + const Bbox_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline +typename Intersection_traits::result_type +intersection(const Bbox_3 &a, + const Ray_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline +typename Intersection_traits::result_type +intersection(const Segment_3 &a, + const Bbox_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline +typename Intersection_traits::result_type +intersection(const Bbox_3 &a, + const Segment_3 &b) { + return K().intersect_3_object()(a, b); +} + +CGAL_INTERSECTION_FUNCTION(Line_3, Iso_cuboid_3, 3) + +CGAL_INTERSECTION_FUNCTION(Ray_3, Iso_cuboid_3, 3) + +CGAL_INTERSECTION_FUNCTION(Segment_3, Iso_cuboid_3, 3) + +CGAL_INTERSECTION_FUNCTION_SELF(Iso_cuboid_3, 3) + +CGAL_DO_INTERSECT_FUNCTION_SELF(Plane_3, 3) + +template +inline bool +do_intersect(const Plane_3 &plane1, const Plane_3 &plane2, + const Plane_3 &plane3) { + return R().do_intersect_3_object()(plane1, plane2, plane3); +} + +CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_cuboid_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Segment_3, 3) + namespace internal { template diff --git a/Intersections_3/include/CGAL/Triangle_3_Line_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Line_3_do_intersect.h index 123ced169d2..f8eb1efa09f 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Line_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Line_3_do_intersect.h @@ -105,9 +105,10 @@ bool do_intersect(const typename K::Line_3 &l, return do_intersect(t, l, k); } - } // namespace internal +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Line_3, 3) + } //namespace CGAL #endif //CGAL_TRIANGLE_3_LINE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Plane_3_do_intersect.h index 90cebb0bd6a..e144ee710ee 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Plane_3_do_intersect.h @@ -70,6 +70,9 @@ bool do_intersect(const typename K::Plane_3 &h, } // namespace internal + +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Plane_3, 3) + } //namespace CGAL #endif //CGAL_TRIANGLE_3_PLANE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Point_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Point_3_do_intersect.h index 9b89ca21269..ed2fea8c16b 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Point_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Point_3_do_intersect.h @@ -93,29 +93,7 @@ bool do_intersect(const typename K::Point_3 &p, } // namespace internal -template -inline bool do_intersect(const Point_3 &p, - const Triangle_3 &t) -{ - return typename K::Do_intersect_3()(t,p); -} - -template -inline bool do_intersect(const Triangle_3 &t, - const Point_3 &p) -{ - return typename K::Do_intersect_3()(t,p); -} - -/* -template -inline bool do_intersect(const Point_3 &p, - const Triangle_3 &t, - const K & k) -{ - return do_intersect(t,p,k); -} -*/ +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Point_3, 3) } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Triangle_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Ray_3_do_intersect.h index d244f159c2b..20347b1e77e 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Ray_3_do_intersect.h @@ -297,6 +297,9 @@ bool do_intersect_coplanar(const typename K::Triangle_3 &t, } // namespace internal + +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Ray_3, 3) + } //namespace CGAL #endif // CGAL_TRIANGLE_3_RAY_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Segment_3_do_intersect.h index 4f79bb29aa7..df90777abbd 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Segment_3_do_intersect.h @@ -318,6 +318,9 @@ bool do_intersect(const typename K::Segment_3 &s, } } // namespace internal + +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Segment_3, 3) + } //namespace CGAL #endif //CGAL_TRIANGLE_3_SEGMENT_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h index af51b2a4be2..1ffdfeb8ac5 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h @@ -69,21 +69,7 @@ do_intersect(const typename K::Tetrahedron_3 &tet, } // namespace internal - - -template -inline bool do_intersect(const Tetrahedron_3 &tet, - const Triangle_3 &tr) -{ - return typename K::Do_intersect_3()(tr,tet); -} - -template -inline bool do_intersect(const Triangle_3 &tr, - const Tetrahedron_3 &tet) -{ - return typename K::Do_intersect_3()(tr,tet); -} +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Tetrahedron_3, 3) } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h index 4f194d5d708..94e307b9202 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h @@ -443,6 +443,9 @@ do_intersect(const typename K::Triangle_3 &t1, } } // namespace internal + +CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_3, 3) + } //namespace CGAL #endif // CGAL_TRIANGLE_3_TRIANGLE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h index 3d96fc2eaa4..7e18d7bee1e 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h @@ -218,6 +218,8 @@ intersection( }//namespace internal +CGAL_INTERSECTION_FUNCTION_SELF(Triangle_3, 3) + } // namespace CGAL diff --git a/Intersections_3/include/CGAL/bbox_intersection_3.h b/Intersections_3/include/CGAL/bbox_intersection_3.h index b168c6174b5..d77aefc6b36 100644 --- a/Intersections_3/include/CGAL/bbox_intersection_3.h +++ b/Intersections_3/include/CGAL/bbox_intersection_3.h @@ -34,18 +34,27 @@ namespace CGAL { // But it must be a template function since the original kernel must be // taken into account. (Michael.Hemmer@sophia.inria.fr) template +#if CGAL_INTERSECTION_VERSION < 2 +CGAL::Object +#else typename boost::optional< boost::variant< typename K::Segment_3, typename K::Point_3 > > +#endif intersection_bl(const Bbox_3 &box, double lpx, double lpy, double lpz, double ldx, double ldy, double ldz, bool min_infinite, bool max_infinite) { - typedef typename + typedef +#if CGAL_INTERSECTION_VERSION < 2 + CGAL::Object +#else + typename boost::optional< boost::variant< typename K::Segment_3, typename K::Point_3 > > +#endif result_type; double seg_min = 0.0, seg_max = 1.0; @@ -159,10 +168,20 @@ intersection_bl(const Bbox_3 &box, Point_3 ref_point = Point_3( FT(lpx), FT(lpy), FT(lpz)); Vector_3 dir = Vector_3( FT(ldx), FT(ldy), FT(ldz)); - if (seg_max == seg_min) + if (seg_max == seg_min) { +#if CGAL_INTERSECTION_VERSION < 2 + return make_object(ref_point + dir * FT(seg_max)); +#else return result_type(ref_point + dir * FT(seg_max)); +#endif + } +#if CGAL_INTERSECTION_VERSION < 2 + return make_object( + Segment_3(ref_point + dir*FT(seg_min), ref_point + dir*FT(seg_max))); +#else return result_type( - Segment_3(ref_point + dir*FT(seg_min), ref_point + dir*FT(seg_max))); + Segment_3(ref_point + dir*FT(seg_min), ref_point + dir*FT(seg_max))); +#endif } diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h index fcdd2896e1c..c8908d2567f 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h @@ -154,6 +154,20 @@ namespace internal { } // namespace internal + +template +bool do_intersect(const CGAL::Bbox_3 a, + const Line_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Line_3& a, + const CGAL::Bbox_3& b) { + return K().do_intersect_3_object()(a, b); +} + + } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_LINE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h index 826e7ad20ff..b039ad6fcec 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h @@ -127,6 +127,20 @@ namespace internal { } // namespace internal + +template +bool do_intersect(const CGAL::Bbox_3 a, + const Plane_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Plane_3& a, + const CGAL::Bbox_3& b) { + return K().do_intersect_3_object()(a, b); +} + + } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_PLANE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h index 9762ce71e81..4f56977ef87 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h @@ -149,6 +149,19 @@ namespace internal { return do_intersect(ray, bbox, K()); } } // namespace internal + +template +bool do_intersect(const CGAL::Bbox_3 a, + const Ray_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Ray_3& a, + const CGAL::Bbox_3& b) { + return K().do_intersect_3_object()(a, b); +} + } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_RAY_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h index 33c2ff0f6df..48d0cf45f2b 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h @@ -152,6 +152,20 @@ namespace internal { } } // namespace internal + +template +bool do_intersect(const CGAL::Bbox_3 a, + const Segment_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Segment_3& a, + const CGAL::Bbox_3& b) { + return K().do_intersect_3_object()(a, b); +} + + } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_SEGMENT_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h index c9c1892838a..2301296daa1 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h @@ -104,6 +104,20 @@ namespace internal { } // namespace internal + +template +bool do_intersect(const CGAL::Bbox_3& a, + const Sphere_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Sphere_3& a, + const CGAL::Bbox_3& b) { + return K().do_intersect_3_object()(a, b); +} + + } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h index 8f7a88ca60b..436d4dc48f6 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h @@ -382,6 +382,20 @@ namespace internal { } } // namespace internal + +template +bool do_intersect(const CGAL::Bbox_3 a, + const Triangle_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Triangle_3& a, + const CGAL::Bbox_3& b) { + return K().do_intersect_3_object()(a, b); +} + + } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h index e42a18d8159..a6f659373b5 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h @@ -423,6 +423,9 @@ intersection(const typename K::Line_3 &l, } // end namespace internal +CGAL_INTERSECTION_FUNCTION(Triangle_3, Line_3, 3) + + } // end namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_TRIANGLE_3_LINE_3_INTERSECTION_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Ray_3_intersection.h b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Ray_3_intersection.h index a3280332910..e8645f0686e 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Ray_3_intersection.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Ray_3_intersection.h @@ -593,6 +593,8 @@ intersection(const typename K::Ray_3 &r, } // end namespace internal +CGAL_INTERSECTION_FUNCTION(Triangle_3, Ray_3, 3) + } // end namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_TRIANGLE_3_RAY_3_INTERSECTION_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h index e0e480f4341..1006eac8ad0 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h @@ -559,6 +559,8 @@ intersection(const typename K::Segment_3 &s, } // end namespace internal +CGAL_INTERSECTION_FUNCTION(Triangle_3, Segment_3, 3) + } // end namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_TRIANGLE_3_SEGMENT_3_INTERSECTION_H diff --git a/Intersections_3/include/CGAL/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index 352e6315841..2a398d5db49 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -25,7 +25,6 @@ #ifndef CGAL_INTERSECTION_3_H #define CGAL_INTERSECTION_3_H -#include #include #include diff --git a/Intersections_3/include/CGAL/intersection_3_0.h b/Intersections_3/include/CGAL/intersection_3_0.h deleted file mode 100644 index a2ef096e15e..00000000000 --- a/Intersections_3/include/CGAL/intersection_3_0.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). All rights reserved. -// All rights reserved. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Philipp Möller - -#ifndef CGAL_INTERSECTION_3_0_H -#define CGAL_INTERSECTION_3_0_H - -#include -#include - -namespace CGAL { - // Intersection_traits.h provides the defaults, we add overloads for all special cases - - // the special plane_3 function - template - inline - #if CGAL_INTERSECTION_VERSION < 2 - CGAL::Object - #else - typename boost::optional< boost::variant< Point_3, Line_3, Plane_3 > > - #endif - intersection(const Plane_3 &plane1, const Plane_3 &plane2, - const Plane_3 &plane3) - { - return K().intersect_3_object()(plane1, plane2, plane3); - } - - // intersections with Bbox_3 for which no kernel traits exist - template - inline - typename Intersection_traits< typename CGAL::Kernel_traits::Kernel, A, CGAL::Bbox_3 >::result_type - intersection(const A& a, const CGAL::Bbox_3& b) { - typedef typename CGAL::Kernel_traits::Kernel Kernel; - return Kernel().intersect_3_object()(a, b); - } - - template - inline - typename Intersection_traits< typename CGAL::Kernel_traits::Kernel, A, CGAL::Bbox_3 >::result_type - intersection(const CGAL::Bbox_3& b, const A& a) { - typedef typename CGAL::Kernel_traits::Kernel Kernel; - return Kernel().intersect_3_object()(a, b); - } - - template - inline bool - do_intersect(const A& a, const CGAL::Bbox_3& b) { - typedef typename CGAL::Kernel_traits::Kernel Kernel; - return Kernel().do_intersect_3_object()(a, b); - } - - template - inline bool - do_intersect(const CGAL::Bbox_3& b, const A& a) { - typedef typename CGAL::Kernel_traits::Kernel Kernel; - return Kernel().do_intersect_3_object()(a, b); - } -} // CGAL - - -#endif /* _INTERSECTION_3_0_H_ */