diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h b/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h index ae9453be1c0..02cf1d24709 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h @@ -92,17 +92,17 @@ intersection(const Line_2 &c1, const Line_2 &c2, OutputIterator res) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circular_arc_2, Circular_arc_2) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Line_arc_2) -CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Circle_2) -CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circle_2, Line_arc_2) + CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circular_arc_2, Circle_2) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circle_2, Circular_arc_2) -CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Circular_arc_2) -CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circular_arc_2, Line_arc_2) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_2, Circular_arc_2) -CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_2, Line_arc_2) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circular_arc_2, Line_2) +CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circular_arc_2, Line_arc_2) +CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Circular_arc_2) +CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Circle_2) +CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circle_2, Line_arc_2) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Line_2) - +CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_2, Line_arc_2) } //namespace CGAL diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h index ed6ac62628f..f932d8b9aa0 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h @@ -156,6 +156,10 @@ template struct SK3_Intersection_traits : SK3_intersect_ternary {}; +template +struct SK3_Intersection_traits + : SK3_intersect_ternary {}; + template struct SK3_Intersection_traits : SK3_intersect_ternary {}; @@ -164,6 +168,10 @@ template struct SK3_Intersection_traits : SK3_intersect_ternary {}; +template +struct SK3_Intersection_traits + : SK3_intersect_ternary {}; + template struct SK3_Intersection_traits : SK3_intersect_ternary {}; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h index c2940aa42d7..8664f3abe5c 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h @@ -935,8 +935,10 @@ template < class SK > \ CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Sphere_3, Sphere_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Sphere_3, Sphere_3, Plane_3) + CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Sphere_3, Plane_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Plane_3, Sphere_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Plane_3, Plane_3, Sphere_3) + CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Plane_3, Sphere_3, Plane_3) CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Sphere_3, Plane_3, Plane_3) CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circle_3, Plane_3) CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Plane_3, Circle_3) @@ -1024,6 +1026,12 @@ template < class SK > \ const Plane_3 & p, OutputIterator res) const { return SphericalFunctors::intersect_3 (p,s1,s2,res); } + template < class OutputIterator > + OutputIterator + operator()(const Sphere_3 & s1, const Plane_3 & p, + const Sphere_3 & s2, OutputIterator res) const + { return SphericalFunctors::intersect_3 (p,s1,s2,res); } + template < class OutputIterator > OutputIterator operator()(const Plane_3 & p, const Sphere_3 & s1, @@ -1036,6 +1044,12 @@ template < class SK > \ const Sphere_3 & s, OutputIterator res) const { return SphericalFunctors::intersect_3 (p1,p2,s,res); } + template < class OutputIterator > + OutputIterator + operator()(const Plane_3 & p1, const Sphere_3 & s, + const Plane_3 & p2, OutputIterator res) const + { return SphericalFunctors::intersect_3 (p1,p2,s,res); } + template < class OutputIterator > OutputIterator operator()(const Sphere_3 & s, const Plane_3 & p1, diff --git a/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h b/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h index a587d87cea4..7d605d82897 100644 --- a/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h +++ b/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h @@ -71,8 +71,10 @@ CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_JUST_INTERSECTION_2_(Sphere_3, Line_ CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_JUST_INTERSECTION_2_(Line_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Sphere_3, Sphere_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Sphere_3, Sphere_3, Plane_3) +CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Sphere_3, Plane_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Plane_3, Sphere_3, Sphere_3) CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Plane_3, Plane_3, Sphere_3) +CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Plane_3, Sphere_3, Plane_3) CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Sphere_3, Plane_3, Plane_3) CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(Circle_3, Plane_3) CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(Plane_3, Circle_3) diff --git a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h index cac9217e371..670800fc5e2 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h +++ b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h @@ -928,7 +928,9 @@ void _test_intersection_construct(SK sk) { intersection(s1, s2, pl, std::back_inserter(intersection_1)); intersection(s1, s3, pl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { - assert(CGAL::do_intersect(s1, s2, pl)); + assert(CGAL::do_intersect(pl, s1, s2)); + assert(CGAL::do_intersect(s1, pl, s2)); + assert(CGAL::do_intersect(s1, s2, pl)); Circle_3 circle; std::pair cap; if(assign_variant(circle,intersection_1[0])) { @@ -1006,7 +1008,9 @@ void _test_intersection_construct(SK sk) { theIntersect_3(s1, p1, pl, std::back_inserter(intersection_1)); theIntersect_3(s1, p2, pl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { - assert(theDo_intersect_3(s1, p1, pl)); + assert(theDo_intersect_3(s1, p1, pl)); + assert(theDo_intersect_3(p1, s1, pl)); + assert(theDo_intersect_3(p1, pl, s1)); Circle_3 circle; std::pair cap; if(assign_variant(circle,intersection_1[0])) { diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h index 0b73db82b88..35013ea0e5e 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h @@ -20,6 +20,7 @@ #include #include +#include namespace CGAL { diff --git a/Intersections_2/include/CGAL/intersection_2.h b/Intersections_2/include/CGAL/intersection_2.h index 4b22e327369..d793cd8d133 100644 --- a/Intersections_2/include/CGAL/intersection_2.h +++ b/Intersections_2/include/CGAL/intersection_2.h @@ -19,10 +19,14 @@ #ifndef CGAL_INTERSECTION_2_H #define CGAL_INTERSECTION_2_H +#include #include +#include #include #include #include +#include +#include #include #include diff --git a/Kernel_23/doc/Kernel_23/CGAL/intersections.h b/Kernel_23/doc/Kernel_23/CGAL/intersections.h index 3670052bb6d..20d298e1cf1 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/intersections.h +++ b/Kernel_23/doc/Kernel_23/CGAL/intersections.h @@ -32,25 +32,22 @@ bounded region, this region is part of the object. The types `Type1` and `Type2` can be any of the following: -- `Point_2` +- `Bbox_2` +- `Circle_2` +- `Iso_rectangle_2` - `Line_2` +- `Point_2` - `Ray_2` - `Segment_2` - `Triangle_2` -- `Iso_rectangle_2` - -Also, `Type1` and `Type2` can be both of type - -- `Line_2` -- `Circle_2` In three-dimensional space, the types `Type1` and `Type2` can be any of the following: - `Bbox_3`. +- `Line_3` - `Point_3` - `Plane_3` -- `Line_3` - `Ray_3` - `Segment_3` - `Sphere_3` @@ -192,8 +189,8 @@ the template parameter pack. -Additional overloads are provided for the type `Point_2` combined with any other type with the result type being -`std::optional< std::variant< Point_2 > >`. +Additional overloads are provided for the type `Point_2` combined with any other type in the table above, +with the result type being `std::optional< std::variant< Point_2 > >`. Overloads are also provided for the type `Bbox_2`, for all intersections existing with the type `Iso_rectangle_2`. Note that the return type for `Bbox_2` - `Bbox_2` is `Bbox_2` and not `Iso_rectangle_2`. @@ -350,11 +347,11 @@ the template parameter pack. -Additional overloads are provided for the type `Point_3` combined with any other type with the result type being -`std::optional< std::variant< Point_3 > >`. Overloads are also provided for the type `Bbox_3`, for all +Additional overloads are provided for the type `Point_3` combined with any other type in the table above, +with the result type being `std::optional< std::variant< Point_3 > >`. +Overloads are also provided for the type `Bbox_3`, for all intersections existing with the type `Iso_cuboid_3`. Note that the return type for `Bbox_3` - `Bbox_3` - is `Bbox_3` and not `Iso_cuboid_3`. - +is `Bbox_3` and not `Iso_cuboid_3`. \cgalHeading{Examples}