diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h index 38f40dc4627..43eaca91403 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h @@ -30,7 +30,7 @@ #include #include -#include +#include // for CGAL::internal::do_intersect_bbox_segment_aux #include diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index 023be6ea504..83f42231aa9 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -68,6 +68,16 @@ #endif +#define CGAL_NO_INTERSECTION_FUNCTION_SELF(A, DIM) \ +template \ +inline void intersection(const A&, const A&) {} + +#define CGAL_NO_INTERSECTION_FUNCTION(A, B, DIM) \ +template \ +inline void intersection(const A&, const B&) {} \ +template \ +inline void intersection(const B&, const A&) {} + #define CGAL_INTERSECTION_FUNCTION(A, B, DIM) \ template \ inline \ diff --git a/Intersections_3/include/CGAL/Intersection_traits_3.h b/Intersections_3/include/CGAL/Intersection_traits_3.h index c17449a54e0..c74186bc6cc 100644 --- a/Intersections_3/include/CGAL/Intersection_traits_3.h +++ b/Intersections_3/include/CGAL/Intersection_traits_3.h @@ -142,7 +142,30 @@ struct Intersection_traits { boost::variant< typename K::Point_3 > variant_type; typedef typename boost::optional< variant_type > result_type; }; + +// Bbox_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + +// Iso_cuboid_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + // Point_3 Line_3, variant of one template struct Intersection_traits { @@ -151,6 +174,14 @@ struct Intersection_traits { typedef typename boost::optional< variant_type > result_type; }; +// Line_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + // Point_3 Ray_3, variant of one template struct Intersection_traits { @@ -159,6 +190,14 @@ struct Intersection_traits { typedef typename boost::optional< variant_type > result_type; }; +// Ray_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + // Point_3 Segment_3, variant of one template struct Intersection_traits { @@ -167,6 +206,14 @@ struct Intersection_traits { typedef typename boost::optional< variant_type > result_type; }; +// Segment_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + // Point_3 Point_3, variant of one template struct Intersection_traits { @@ -182,6 +229,59 @@ struct Intersection_traits { boost::variant< typename K::Point_3 > variant_type; typedef typename boost::optional< variant_type > result_type; }; + +// Plane_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + +// Point_3 Triangle_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; +// Triangle_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + +// Point_3 Tetrahedron_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; +// Tetrahedron_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + +// Point_3 Sphere_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; +// Sphere_3 Point_3, variant of one +template +struct Intersection_traits { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; } // namespace #endif // !(CGAL_INTERSECTION_VERSION < 2) diff --git a/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Point_3.h similarity index 93% rename from Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Point_3.h index 2255d0551a8..2d1ace333dd 100644 --- a/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Point_3.h @@ -19,8 +19,8 @@ // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H -#define CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_POINT_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_POINT_3_H #include #include @@ -81,4 +81,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Iso_cuboid_3, 3) } //namespace CGAL -#endif // CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H +#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_POINT_3_H diff --git a/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Point_3.h similarity index 94% rename from Intersections_3/include/CGAL/Point_3_Line_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/Line_3_Point_3.h index eb82c52c7a1..6f033fb37de 100644 --- a/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Point_3.h @@ -19,8 +19,8 @@ // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_3_LINE_3_INTERSECTION_H -#define CGAL_POINT_3_LINE_3_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_3_LINE_3_POINT_3_H +#define CGAL_INTERSECTIONS_3_LINE_3_POINT_3_H #include #include @@ -81,4 +81,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Line_3, 3) } //namespace CGAL -#endif // CGAL_POINT_3_LINE_3_INTERSECTION_H +#endif // CGAL_INTERSECTIONS_3_LINE_3_POINT_3_H diff --git a/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Point_3.h similarity index 92% rename from Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/Plane_3_Point_3.h index 6080ae98a8c..96421de67fe 100644 --- a/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Point_3.h @@ -19,8 +19,8 @@ // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_3_PLANE_3_INTERSECTION_H -#define CGAL_POINT_3_PLANE_3_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_3_PLANE_3_POINT_3_PLANE_3_H +#define CGAL_INTERSECTIONS_3_PLANE_3_POINT_3_PLANE_3_H #include #include @@ -80,4 +80,4 @@ CGAL_INTERSECTION_FUNCTION(Point_3, Plane_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Plane_3, 3) } //namespace CGAL -#endif // CGAL_POINT_3_PLANE_3_INTERSECTION_H +#endif // CGAL_INTERSECTIONS_3_PLANE_3_POINT_3_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Point_3.h similarity index 92% rename from Intersections_3/include/CGAL/Point_3_Point_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/Point_3_Point_3.h index 8ccfb5a29ee..68eac1cdcc5 100644 --- a/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Point_3.h @@ -19,8 +19,8 @@ // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_3_POINT_3_INTERSECTION_H -#define CGAL_POINT_3_POINT_3_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_3_POINT_3_POINT_3_H +#define CGAL_INTERSECTIONS_3_POINT_3_POINT_3_H #include #include @@ -60,4 +60,4 @@ CGAL_INTERSECTION_FUNCTION_SELF(Point_3, 3) CGAL_DO_INTERSECT_FUNCTION_SELF(Point_3, 3) }//nmaespace cgal -#endif // CGAL_POINT_3_POINT_3_INTERSECTION_H +#endif // CGAL_INTERSECTIONS_3_POINT_3_POINT_3_H diff --git a/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Ray_3.h similarity index 94% rename from Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/Point_3_Ray_3.h index 0ec8b0f2bd7..dbf1e0dfda6 100644 --- a/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Ray_3.h @@ -19,8 +19,8 @@ // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_3_RAY_3_INTERSECTION_H -#define CGAL_POINT_3_RAY_3_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H +#define CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H #include #include @@ -85,4 +85,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Ray_3, 3) } //namespace CGAL -#endif // CGAL_POINT_3_RAY_3_INTERSECTION_H +#endif // CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Segment_3.h similarity index 93% rename from Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/Point_3_Segment_3.h index 89f8de6ff4a..4d0425db3c3 100644 --- a/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Segment_3.h @@ -19,8 +19,8 @@ // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_3_SEGMENT_3_INTERSECTION_H -#define CGAL_POINT_3_SEGMENT_3_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_3_POINT_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_POINT_3_SEGMENT_3_H #include #include @@ -86,4 +86,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Segment_3, 3) } //namespace CGAL -#endif // CGAL_POINT_3_SEGMENT_3_INTERSECTION_H +#endif // CGAL_INTERSECTIONS_3_POINT_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Point_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Triangle_3.h similarity index 73% rename from Intersections_3/include/CGAL/Triangle_3_Point_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/Point_3_Triangle_3.h index ae3d38d9da6..e170ef3bf18 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Point_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Triangle_3.h @@ -19,8 +19,8 @@ // // Author(s) : Philippe Guigue -#ifndef CGAL_TRIANGLE_3_POINT_3_DO_INTERSECT_H -#define CGAL_TRIANGLE_3_POINT_3_DO_INTERSECT_H +#ifndef CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H #include #include @@ -103,12 +103,36 @@ bool do_intersect(const typename K::Point_3 &p, return do_intersect(t, p, k); } +template +inline +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Triangle_3 &tr, + const K& k) +{ + if (do_intersect(pt,tr, k)) { + return intersection_return(pt); + } + return intersection_return(); +} +template +inline +typename CGAL::Intersection_traits +::result_type +intersection( const typename K::Triangle_3 &tr, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, tr, k); +} } // namespace internal } // namespace Intersections CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Point_3, 3) +CGAL_INTERSECTION_FUNCTION(Triangle_3, Point_3, 3) } //namespace CGAL -#endif // CGAL_TRIANGLE_3_POINT_3_DO_INTERSECT_H +#endif // CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Bbox_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Bbox_3_do_intersect.h similarity index 94% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Bbox_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Bbox_3_do_intersect.h index 6d21409ce12..cc435e22b10 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Bbox_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Bbox_3_do_intersect.h @@ -39,6 +39,9 @@ namespace CGAL { { return CGAL::do_overlap(c, bbox); } + + void intersection(const CGAL::Bbox_3&, + const CGAL::Bbox_3&){} } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_BBOX_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h similarity index 84% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h index e9b9a042151..fe0710a84d4 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h @@ -48,21 +48,6 @@ namespace internal { } // namespace internal } // namespace Intersections - - -template -bool do_intersect(const CGAL::Bbox_3& a, - const Iso_cuboid_3& b) { - return K().do_intersect_3_object()(a, b); -} - -template -bool do_intersect(const Iso_cuboid_3& a, - const CGAL::Bbox_3& b) { - return K().do_intersect_3_object()(b, a); -} - - } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Line_3_do_intersect.h similarity index 93% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Line_3_do_intersect.h index 440a652a567..95448fd3c6f 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Line_3_do_intersect.h @@ -158,20 +158,6 @@ namespace internal { } // namespace internal } // namespace Intersections - -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/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h similarity index 90% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h index 620962bda90..0dbb95e2e02 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h @@ -153,31 +153,6 @@ namespace internal { } // namespace internal } // namespace Intersections - -template -bool do_intersect(const CGAL::Bbox_3 a, - const Plane_3& b) { - return K().do_intersect_3_object()(b, a); -} - -template -bool do_intersect(const Plane_3& a, - const CGAL::Bbox_3& b) { - return K().do_intersect_3_object()(a, b); -} - -template -bool do_intersect(const Iso_cuboid_3& a, - const Plane_3& b) { - return K().do_intersect_3_object()(b, a); -} - -template -bool do_intersect(const Plane_3& a, - const Iso_cuboid_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/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h similarity index 85% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h index 009962c1b26..e0fcd062625 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h @@ -26,7 +26,7 @@ #include #include -#include +#include // for CGAL::internal::do_intersect_bbox_segment_aux // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf @@ -69,19 +69,6 @@ namespace internal { } // namespace internal } // namespace Intersections - -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/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h similarity index 97% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h index 0b52c5d5ab2..8015f82c464 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h @@ -461,20 +461,6 @@ namespace internal { } // namespace internal } // namespace Intersections - -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 #include diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h similarity index 86% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h index efbfcf830d7..29953fe3009 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h @@ -115,23 +115,26 @@ namespace internal { { return do_intersect_sphere_box_3(sphere, bbox, K()); } + + template + bool do_intersect(const typename K::Iso_cuboid_3& bbox, + const typename K::Sphere_3& sphere, + const K&) + { + return do_intersect_sphere_box_3(sphere, bbox, K()); + } + + + template + bool do_intersect(const typename K::Sphere_3& sphere, + const typename K::Iso_cuboid_3& bbox, + const K&) + { + return do_intersect_sphere_box_3(sphere, bbox, K()); + } } // namespace internal } // namespace Intersections - -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/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h similarity index 97% rename from Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h index e8ea3ccb01a..58f030a5d5c 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h @@ -33,7 +33,7 @@ // a minimal cost (and we use C++ ;). #include -#include +#include namespace CGAL { @@ -399,20 +399,6 @@ namespace internal { } // namespace internal } // namespace Intersections - -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 #include diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h similarity index 86% rename from Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h index 470f6673801..4c4e81707a6 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h @@ -26,7 +26,7 @@ #include #include -#include +#include // for CGAL::internal::do_intersect_bbox_segment_aux // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf @@ -70,19 +70,6 @@ namespace internal { } // namespace internal } // namespace Intersections - -template -bool do_intersect(const Iso_cuboid_3 a, - const Ray_3& b) { - return K().do_intersect_3_object()(a, b); -} - -template -bool do_intersect(const Ray_3& a, - const Iso_cuboid_3& b) { - return K().do_intersect_3_object()(a, b); -} - } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h similarity index 86% rename from Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h index 23f42e89277..0581686a99e 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h @@ -26,7 +26,7 @@ #include #include -#include +#include // for CGAL::internal::do_intersect_bbox_segment_aux // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf @@ -70,19 +70,6 @@ namespace internal { } // namespace internal } // namespace Intersections - -template -bool do_intersect(const Iso_cuboid_3 a, - const Segment_3& b) { - return K().do_intersect_3_object()(a, b); -} - -template -bool do_intersect(const Segment_3& a, - const Iso_cuboid_3& b) { - return K().do_intersect_3_object()(a, b); -} - } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h similarity index 96% rename from Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h index a4907ec3ec6..15f500a9cef 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h @@ -25,7 +25,7 @@ #include #include -#include +#include namespace CGAL { diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h similarity index 84% rename from Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h index 430447124f0..2f3e216d802 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h @@ -31,7 +31,7 @@ // a minimal cost (and we use C++ ;). #include -#include +#include namespace CGAL { @@ -59,18 +59,6 @@ namespace internal { } // namespace Intersections -template -bool do_intersect(const Iso_cuboid_3& a, - const Triangle_3& b) { - return K().do_intersect_3_object()(a, b); -} - -template -bool do_intersect(const Triangle_3& a, - const Iso_cuboid_3& b) { - return K().do_intersect_3_object()(a, b); -} - } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h similarity index 82% rename from Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h index e7ad745a4a0..5debbb9cef3 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h @@ -23,12 +23,13 @@ // // Author(s) : Nico Kruithof -#ifndef CGAL_TRIANGLE_3_TETRAHEDRON_3_DO_INTERSECT_H -#define CGAL_TRIANGLE_3_TETRAHEDRON_3_DO_INTERSECT_H +#ifndef CGAL_TETRAHEDRON_3_BOUNDED_3_DO_INTERSECT_H +#define CGAL_TETRAHEDRON_3_BOUNDED_3_DO_INTERSECT_H -#include -#include -#include +#include +#include +#include +#include namespace CGAL { @@ -175,7 +176,7 @@ do_intersect(const typename K::Tetrahedron_3 &tet, template inline typename K::Boolean - do_intersect(const CGAL::Bbox_3 &bb, +do_intersect(const CGAL::Bbox_3 &bb, const typename K::Tetrahedron_3 &tet, const K & k) { @@ -184,27 +185,6 @@ typename K::Boolean } // namespace internal } // namespace Intersections - -CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Tetrahedron_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Segment_3, Tetrahedron_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Tetrahedron_3, 3) -CGAL_DO_INTERSECT_FUNCTION_SELF(Tetrahedron_3, 3) - - -template -bool do_intersect(const CGAL::Tetrahedron_3& a, - const CGAL::Bbox_3& b) { - return K().do_intersect_3_object()(a, b); -} - - -template -bool do_intersect(const CGAL::Bbox_3& b, - const CGAL::Tetrahedron_3& a) { - return K().do_intersect_3_object()(a, b); -} - } //namespace CGAL -#endif // CGAL_TRIANGLE_3_TETRAHEDRON_3_DO_INTERSECT_H +#endif // CGAL_TETRAHEDRON_3_BOUNDED_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h similarity index 71% rename from Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h index 5d6513cf8f7..18f9fa15374 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h @@ -26,7 +26,8 @@ #include #include #include -#include +#include +#include namespace CGAL { @@ -48,6 +49,13 @@ bool do_intersect_tetrahedron_unbounded(const typename K::Tetrahedron_3& tet, +template +bool do_intersect(const typename K::Plane_3& unb, + const typename K::Tetrahedron_3& tet, + const K& k) { + return do_intersect_tetrahedron_unbounded(tet, unb, k); +} + template bool do_intersect(const typename K::Tetrahedron_3& tet, const typename K::Plane_3& unb, @@ -56,6 +64,13 @@ bool do_intersect(const typename K::Tetrahedron_3& tet, } +template +bool do_intersect(const typename K::Line_3& unb, + const typename K::Tetrahedron_3& tet, + const K& k) { + return do_intersect_tetrahedron_unbounded(tet, unb, k); +} + template bool do_intersect(const typename K::Tetrahedron_3& tet, const typename K::Line_3& unb, @@ -64,6 +79,13 @@ bool do_intersect(const typename K::Tetrahedron_3& tet, } +template +bool do_intersect(const typename K::Ray_3& unb, + const typename K::Tetrahedron_3& tet, + const K& k) { + return do_intersect_tetrahedron_unbounded(tet, unb, k); +} + template bool do_intersect(const typename K::Tetrahedron_3& tet, const typename K::Ray_3& unb, @@ -73,48 +95,6 @@ bool do_intersect(const typename K::Tetrahedron_3& tet, } // namespace internal } // namespace Intersections - -template -bool do_intersect(const CGAL::Tetrahedron_3& a, - const CGAL::Plane_3& b) { - return K().do_intersect_3_object()(a, b); -} - - -template -bool do_intersect(const CGAL::Plane_3& b, - const CGAL::Tetrahedron_3& a) { - return K().do_intersect_3_object()(a, b); -} - - -template -bool do_intersect(const CGAL::Tetrahedron_3& a, - const CGAL::Line_3& b) { - return K().do_intersect_3_object()(a, b); -} - - -template -bool do_intersect(const CGAL::Line_3& b, - const CGAL::Tetrahedron_3& a) { - return K().do_intersect_3_object()(a, b); -} - - -template -bool do_intersect(const CGAL::Tetrahedron_3& a, - const CGAL::Ray_3& b) { - return K().do_intersect_3_object()(a, b); -} - - -template -bool do_intersect(const CGAL::Ray_3& b, - const CGAL::Tetrahedron_3& a) { - return K().do_intersect_3_object()(a, b); -} - } // namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Line_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Line_3_do_intersect.h similarity index 98% rename from Intersections_3/include/CGAL/Triangle_3_Line_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Line_3_do_intersect.h index d5a08becbae..d68297aebea 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Line_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Line_3_do_intersect.h @@ -121,9 +121,6 @@ bool do_intersect(const typename K::Line_3 &l, } // namespace internal } // namespace Intersections - -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/internal/Intersections_3/Triangle_3_Line_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Line_3_intersection.h similarity index 99% rename from Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Line_3_intersection.h index 5b64f0cf45d..fa32149ab80 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Line_3_intersection.h @@ -424,10 +424,6 @@ intersection(const typename K::Line_3 &l, } // end namespace internal } // namespace Intersections - -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/Triangle_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Plane_3_do_intersect.h similarity index 97% rename from Intersections_3/include/CGAL/Triangle_3_Plane_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Plane_3_do_intersect.h index b4386fa6b93..5d6c5a1e5e3 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Plane_3_do_intersect.h @@ -84,9 +84,6 @@ bool do_intersect(const typename K::Plane_3 &h, } // namespace internal } // namespace Intersections - -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_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Ray_3_do_intersect.h similarity index 99% rename from Intersections_3/include/CGAL/Triangle_3_Ray_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Ray_3_do_intersect.h index b00d872a9d8..3a181a43466 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Ray_3_do_intersect.h @@ -383,9 +383,6 @@ do_intersect_coplanar(const typename K::Triangle_3 &t, } // namespace internal } // namespace Intersections - -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/internal/Intersections_3/Triangle_3_Ray_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Ray_3_intersection.h similarity index 99% rename from Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Ray_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Ray_3_intersection.h index 716ceb1c090..da50c997f0a 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Ray_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Ray_3_intersection.h @@ -585,9 +585,6 @@ intersection(const typename K::Ray_3 &r, } // end namespace internal } // namespace Intersections - -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/Triangle_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Segment_3_do_intersect.h similarity index 99% rename from Intersections_3/include/CGAL/Triangle_3_Segment_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Segment_3_do_intersect.h index 1a76711bca4..95431085bff 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Segment_3_do_intersect.h @@ -332,9 +332,6 @@ bool do_intersect(const typename K::Segment_3 &s, } // namespace internal } // namespace Intersections - -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/internal/Intersections_3/Triangle_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Segment_3_intersection.h similarity index 99% rename from Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Segment_3_intersection.h index 9a3a4d988df..f0bf64c31f3 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Segment_3_intersection.h @@ -563,12 +563,8 @@ intersection(const typename K::Segment_3 &s, return internal::intersection(t,s,k); } - } // end namespace internal } // namespace Intersections - -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/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h similarity index 92% rename from Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h index ad0e36ad2b0..84e05f0ef66 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h @@ -49,7 +49,16 @@ do_intersect(const typename K::Sphere_3 &sp, { return squared_distance(sp.center(), tr) <= sp.squared_radius(); } - + +template +inline +typename K::Boolean +do_intersect(const typename K::Triangle_3 &tr, + const typename K::Sphere_3 &sp, + const K & k) +{ + return squared_distance(sp.center(), tr) <= sp.squared_radius(); +} template inline typename K::Boolean @@ -117,12 +126,6 @@ do_intersect(const typename K::Segment_3 &lin, } // namespace internal } // namespace Intersections - -CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Sphere_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Line_3, Sphere_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Ray_3, Sphere_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Segment_3, Sphere_3, 3) - } // namespace CGAL #endif // CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h similarity index 99% rename from Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h index 9a0ee416c1e..72b6893d6ee 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h @@ -453,9 +453,6 @@ do_intersect(const typename K::Triangle_3 &t1, } // namespace internal } // namespace Intersections - -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/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h similarity index 99% rename from Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h rename to Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h index 397aa9d57b2..8bcf0c3963d 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h @@ -24,6 +24,7 @@ #define CGAL_TRIANGLE_3_TRIANGLE_3_INTERSECTION_H #include +#include #include #include @@ -230,9 +231,6 @@ intersection( } //namespace internal } // namespace Intersections - -CGAL_INTERSECTION_FUNCTION_SELF(Triangle_3, 3) - } // namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h b/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h index 511fd048bfd..12cf65fcc16 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h @@ -24,12 +24,17 @@ // Author(s) : Geert-Jan Giezeman // Sebastien Loriot +#ifndef CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H +#define CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H #include #include #include #include +#include +#include +#include namespace CGAL { template @@ -70,100 +75,7 @@ intersection(const Plane_3 &plane1, const Plane_3 &plane2, 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 -cpp11::result_of::type -intersection(const Line_3 &a, - const Bbox_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const Bbox_3 &a, - const Line_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const Ray_3 &a, - const Bbox_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const Bbox_3 &a, - const Ray_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const Segment_3 &a, - const Bbox_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::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 @@ -172,8 +84,7 @@ do_intersect(const Plane_3 &plane1, const Plane_3 &plane2, 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) + namespace Intersections { @@ -1705,3 +1616,5 @@ do_intersect(const Iso_cuboid_3 &j, const Line_3 &l, const R&) } // namespace internal } // namespace Intersections } // namespace CGAL + +#endif CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H diff --git a/Intersections_3/include/CGAL/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index 3d74dbf38d4..c32e8a12a54 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -1,9 +1,9 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // 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 @@ -19,7 +19,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0+ -// +// // // Author(s) : Geert-Jan Giezeman @@ -29,43 +29,72 @@ #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include #include diff --git a/Intersections_3/test/Intersections_3/CMakeLists.txt b/Intersections_3/test/Intersections_3/CMakeLists.txt index a13cf22451a..36d2d70e1d3 100644 --- a/Intersections_3/test/Intersections_3/CMakeLists.txt +++ b/Intersections_3/test/Intersections_3/CMakeLists.txt @@ -22,6 +22,17 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "${cppfile}" ) endforeach() +foreach(VAL RANGE 1 55) + message(STATUS "NOTICE: Compiling one_${VAL}") + add_executable(one_${VAL} one.cpp) + target_compile_definitions(one_${VAL} PRIVATE -DSEL=${VAL}) + + target_link_libraries(one_${VAL} PRIVATE CGAL::CGAL) + if(CGAL_3RD_PARTY_LIBRARIES) + target_link_libraries(one_${VAL} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES}) + endif() + endforeach() + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Intersections_3/test/Intersections_3/test_intersections_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_3.cpp index 1390d6a407b..b3c63e243b1 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_3.cpp @@ -1,3 +1,18 @@ +#if 0 + +#include +#include + +typedef CGAL::Cartesian K; + +int main() +{ + K::Segment_3 s1, s2; + std::cout << do_intersect(s1,s2) << std::endl; + return 0; +} + +#else // 3D intersection tests. #include @@ -583,3 +598,4 @@ int main() Test< CGAL::Homogeneous >().run(); // TODO : test more kernels. } +#endif diff --git a/Intersections_3/test/Intersections_3/triangle_other.cpp b/Intersections_3/test/Intersections_3/triangle_other.cpp index d96a444b24b..e9ffa8b5861 100644 --- a/Intersections_3/test/Intersections_3/triangle_other.cpp +++ b/Intersections_3/test/Intersections_3/triangle_other.cpp @@ -1,13 +1,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include