From 10456676abdace16338b03dbab12bd73beebb2f3 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 24 Sep 2020 16:30:20 +0200 Subject: [PATCH 1/3] fix compilation of do_intersect(plane, plane, plane) for msvc --- .../include/CGAL/internal/Static_filters/Do_intersect_3.h | 7 +++++++ .../CGAL/Intersections_3/internal/intersection_3_1_impl.h | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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 ffc661b636d..552761ed440 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 @@ -60,6 +60,13 @@ public: { return Base()(t1,t2); } + + template + result_type + operator()(const T1 & t1, const T2 & t2, const T3 & t3) const + { + return Base()(t1, t2, t3); + } #endif // CGAL_CFG_MATCHING_BUG_6 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 35636c76f9e..0fefd13458c 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 @@ -1541,9 +1541,9 @@ do_intersect(const Plane_3& plane1, const Plane_3& plane2, const R&) template inline bool do_intersect(const Plane_3 &plane1, const Plane_3 &plane2, - const Plane_3 &plane3, const R&) + const Plane_3 &plane3, const R& r) { - return bool(intersection(plane1, plane2, plane3)); + return bool(intersection(plane1, plane2, plane3, r)); } From ec690d563ec0f94d89185535379f63eca52be383 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 24 Sep 2020 17:13:40 +0200 Subject: [PATCH 2/3] add test for do_intersect(plane, plane, plane) --- .../test/Intersections_3/test_intersections_3.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Intersections_3/test/Intersections_3/test_intersections_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_3.cpp index 0ab31a7d145..c78a665430f 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_3.cpp @@ -227,6 +227,7 @@ struct Test { Pl pl3(0,0,1,0); // Generic intersection. + assert(CGAL::do_intersect(pl1, pl2, pl3)); CGAL::Object o = CGAL::intersection(pl1, pl2, pl3); P p; assert(assign(p, o)); @@ -235,9 +236,11 @@ struct Test { // Empty intersection. Pl pl4(1,0,0,1); // pl4 is // to pl1. + assert(!CGAL::do_intersect(pl1, pl2, pl4)); CGAL::Object o2 = CGAL::intersection(pl1, pl2, pl4); assert(o2.is_empty()); + assert(!CGAL::do_intersect(pl1, pl4, pl2)); CGAL::Object o3 = CGAL::intersection(pl1, pl4, pl2); assert(o3.is_empty()); @@ -245,12 +248,14 @@ struct Test { Pl pl5(1,1,0,0); // pl1, pl2, pl5 intersect in the line l. L l; + assert(CGAL::do_intersect(pl1, pl2, pl5)); CGAL::Object o4 = CGAL::intersection(pl1, pl2, pl5); assert(assign(l, o4)); assert(l == L(P(0,0,0), P(0,0,1))); // Intersection in a plane. + assert(CGAL::do_intersect(pl1, pl1, pl1)); CGAL::Object o5 = CGAL::intersection(pl1, pl1, pl1); Pl pl; assert(assign(pl, o5)); From 9b50f58433e09ab7572a866d317208ed0d26fc69 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 24 Sep 2020 17:40:40 +0200 Subject: [PATCH 3/3] add do_intersect(plane, plane, plane) to the doc of linear kernel --- Kernel_23/doc/Kernel_23/CGAL/intersections.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Kernel_23/doc/Kernel_23/CGAL/intersections.h b/Kernel_23/doc/Kernel_23/CGAL/intersections.h index fdd2b7c5ab9..30b7768dceb 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/intersections.h +++ b/Kernel_23/doc/Kernel_23/CGAL/intersections.h @@ -66,6 +66,12 @@ Also, `Type1` and `Type2` can be respectively of types - `Iso_cuboid_3` and `Iso_cuboid_3`. */ bool do_intersect(Type1 obj1, Type2 obj2); + +/*! +checks whether `obj1`, `obj2` and `obj3` intersect. +*/ +bool do_intersect(Plane_3 obj1, Plane_3 obj2, Plane_3 obj3); + /// @}