From 318e7a7d12256cab48060d0d4f52ece4b5281b55 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 1 Feb 2018 15:41:59 +0100 Subject: [PATCH 01/48] Add missing overloads for Point_3 intersections --- .../include/CGAL/Intersection_traits_3.h | 47 +++++++ .../Intersections_3/intersection_3_1_impl.h | 51 ++++++++ .../CGAL/Point_3_Iso_cuboid_3_intersection.h | 81 ++++++++++++ .../CGAL/Point_3_Line_3_intersection.h | 79 ++++++++++++ .../CGAL/Point_3_Plane_3_intersection.h | 78 ++++++++++++ .../CGAL/Point_3_Point_3_intersection.h | 60 +++++++++ .../include/CGAL/Point_3_Ray_3_intersection.h | 83 +++++++++++++ .../CGAL/Point_3_Segment_3_intersection.h | 84 +++++++++++++ Intersections_3/include/CGAL/intersection_3.h | 7 ++ .../test_point_3_intersections.cpp | 115 ++++++++++++++++++ 10 files changed, 685 insertions(+) create mode 100644 Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h create mode 100644 Intersections_3/include/CGAL/Point_3_Line_3_intersection.h create mode 100644 Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h create mode 100644 Intersections_3/include/CGAL/Point_3_Point_3_intersection.h create mode 100644 Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h create mode 100644 Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h create mode 100644 Intersections_3/test/Intersections_3/test_point_3_intersections.cpp diff --git a/Intersections_3/include/CGAL/Intersection_traits_3.h b/Intersections_3/include/CGAL/Intersection_traits_3.h index 832790cdedc..c17449a54e0 100644 --- a/Intersections_3/include/CGAL/Intersection_traits_3.h +++ b/Intersections_3/include/CGAL/Intersection_traits_3.h @@ -135,6 +135,53 @@ template struct Intersection_traits : public Intersection_traits {}; +// Point_3 Iso_cuboid_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 { + 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 { + 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 { + 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 { + typedef typename + boost::variant< typename K::Point_3 > variant_type; + typedef typename boost::optional< variant_type > result_type; +}; + +// Point_3 Plane_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/Intersections_3/intersection_3_1_impl.h b/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h index 9f65b83e86e..2cb24979c67 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 @@ -53,6 +53,9 @@ namespace CGAL { template class Iso_cuboid_3; + template + class Point_3; + // the special plane_3 function template inline @@ -152,6 +155,54 @@ intersection(const Bbox_3 &a, return K().intersect_3_object()(a, b); } +template +inline typename +cpp11::result_of::type +intersection(const typename K::Point_3 &a, + const typename K::Iso_cuboid_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline typename +cpp11::result_of::type +intersection(const typename K::Point_3 &a, + const typename K::Line_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline typename +cpp11::result_of::type +intersection(const typename K::Point_3 &a, + const typename K::Ray_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline typename +cpp11::result_of::type +intersection(const typename K::Point_3 &a, + const typename K::Segment_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline typename +cpp11::result_of::type +intersection(const typename K::Point_3 &a, + const typename K::Point_3 &b) { + return K().intersect_3_object()(a, b); +} + +template +inline typename +cpp11::result_of::type +intersection(const typename K::Point_3 &a, + const typename K::Plane_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) diff --git a/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h new file mode 100644 index 00000000000..66983d3b12a --- /dev/null +++ b/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h @@ -0,0 +1,81 @@ +#ifndef CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H +#define CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno +#include +#include +#include + +namespace CGAL { + +namespace internal { + +template +inline +bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Iso_cuboid_3 &iso, + const K&) +{ + return !iso.has_on_unbounded_side(pt); +} + +template +inline +bool +do_intersect(const typename K::Iso_cuboid_3 &iso, + const typename K::Point_3 &pt, + const K&) +{ + return !iso.has_on_unbounded_side(pt); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Iso_cuboid_3 &iso, + const K& k) +{ + if (internal::do_intersect(pt,iso,k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Iso_cuboid_3 &iso, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, iso, k); +} + +} // namespace internal + +CGAL_INTERSECTION_FUNCTION(Point_3, Iso_cuboid_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Point_3, Iso_cuboid_3, 3) + +} //namespace CGAL + +#endif // CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H diff --git a/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h new file mode 100644 index 00000000000..bdf9dffc33d --- /dev/null +++ b/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h @@ -0,0 +1,79 @@ +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno +#ifndef CGAL_POINT_3_LINE_3_INTERSECTION_H +#define CGAL_POINT_3_LINE_3_INTERSECTION_H + +#include +#include +#include +namespace CGAL { + +namespace internal { + +template +inline bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Line_3 &line, + const K&) +{ + return line.has_on(pt); +} + +template +inline bool +do_intersect(const typename K::Line_3 &line, + const typename K::Point_3 &pt, + const K&) +{ + return line.has_on(pt); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Line_3 &line, + const K& k) +{ + if (do_intersect(pt,line,k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Line_3 &line, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, line, k); +} + +} // namespace internal + +CGAL_INTERSECTION_FUNCTION(Point_3, Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Point_3, Line_3, 3) + +} //namespace CGAL + +#endif // CGAL_POINT_3_LINE_3_INTERSECTION_H diff --git a/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h new file mode 100644 index 00000000000..73ecc7dfaf0 --- /dev/null +++ b/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h @@ -0,0 +1,78 @@ +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno +#ifndef CGAL_POINT_3_PLANE_3_INTERSECTION_H +#define CGAL_POINT_3_PLANE_3_INTERSECTION_H + +#include +#include +#include +namespace CGAL { + +namespace internal { + +template +inline bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Plane_3 &plane, + const K&) +{ + return plane.has_on(pt); +} + +template +inline bool +do_intersect(const typename K::Plane_3 &plane, + const typename K::Point_3 &pt, + const K&) +{ + return plane.has_on(pt); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Plane_3 &plane, + const K& k) +{ + if (do_intersect(pt,plane,k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Plane_3 &plane, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, plane,k); +} + +} // namespace internal + +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 diff --git a/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h new file mode 100644 index 00000000000..ae5321dc94e --- /dev/null +++ b/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h @@ -0,0 +1,60 @@ +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno + +#ifndef CGAL_POINT_3_POINT_3_INTERSECTION_H +#define CGAL_POINT_3_POINT_3_INTERSECTION_H + +#include +#include + +namespace CGAL { + +namespace internal { + +template +inline bool +do_intersect(const typename K::Point_3 &pt1, + const typename K::Point_3 &pt2, + const K&) +{ + return pt1 == pt2; +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt1, + const typename K::Point_3 &pt2, + const K&) +{ + if (pt1 == pt2) { + return intersection_return(pt1); + } + return intersection_return(); +} + +}// namespace internal + +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 diff --git a/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h new file mode 100644 index 00000000000..fd4c04ede83 --- /dev/null +++ b/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h @@ -0,0 +1,83 @@ +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno +#ifndef CGAL_POINT_3_RAY_3_INTERSECTION_H +#define CGAL_POINT_3_RAY_3_INTERSECTION_H +#include +#include +#include + +namespace CGAL { + +namespace internal { + +template +inline +bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Ray_3 &ray, + const K&) +{ + return ray.has_on(pt); +} + + +template +inline +bool +do_intersect(const typename K::Ray_3 &ray, + const typename K::Point_3 &pt, + const K&) +{ + return ray.has_on(pt); +} + + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Ray_3 &ray, + const K& k) +{ + if (do_intersect(pt,ray, k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Ray_3 &ray, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, ray, k); +} + +} // namespace internal + +CGAL_INTERSECTION_FUNCTION(Point_3, Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Point_3, Ray_3, 3) + + +} //namespace CGAL +#endif // CGAL_POINT_3_RAY_3_INTERSECTION_H diff --git a/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h new file mode 100644 index 00000000000..764d0a65f41 --- /dev/null +++ b/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h @@ -0,0 +1,84 @@ +#ifndef CGAL_POINT_3_SEGMENT_3_INTERSECTION_H +#define CGAL_POINT_3_SEGMENT_3_INTERSECTION_H +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno +#include +#include +#include + +namespace CGAL { + +namespace internal { + +template +inline +bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Segment_3 &seg, + const K&) +{ + return seg.has_on(pt); +} + +template +inline +bool +do_intersect(const typename K::Segment_3 &seg, + const typename K::Point_3 &pt, + const K&) +{ + return seg.has_on(pt); +} + + +template +inline +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Segment_3 &seg, + const K& k) +{ + if (do_intersect(pt,seg, k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +inline +typename CGAL::Intersection_traits +::result_type +intersection( const typename K::Segment_3 &seg, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, seg, k); +} + +} // namespace internal + +CGAL_INTERSECTION_FUNCTION(Point_3, Segment_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Point_3, Segment_3, 3) + +} //namespace CGAL + +#endif // CGAL_POINT_3_SEGMENT_3_INTERSECTION_H diff --git a/Intersections_3/include/CGAL/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index 2aa69cf954c..10aa9a840be 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -44,6 +44,13 @@ #include #include +#include +#include +#include +#include +#include +#include + #include #include #include diff --git a/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp b/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp new file mode 100644 index 00000000000..8dbfd3efe10 --- /dev/null +++ b/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp @@ -0,0 +1,115 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; + +template +void test_P_Cub() +{ + typedef CGAL::Point_3 P; + typedef CGAL::Iso_cuboid_3 Cub; + P p(0.0,1.0,0.5); + Cub cub(P(-1.0,-1.0,-1.0), P(1.0,1.0,1.0)); + assert(CGAL::do_intersect(p, cub)); + CGAL::Object o = CGAL::intersection(p,cub); + P res; + assert(assign(res, o)); + assert(res == p); +} +template +void test_P_L() +{ + typedef CGAL::Point_3 P; + typedef CGAL::Line_3 Line; + P p(0.99,0.99,0.99); + Line line(P(-1.0,-1.0,-1.0), P(1.0,1.0,1.0)); + assert(CGAL::do_intersect(p, line)); + CGAL::Object o = CGAL::intersection(p,line); + P res; + assert(assign(res, o)); + assert(res == p); +} +template +void test_P_R() +{ + typedef CGAL::Point_3 P; + typedef CGAL::Ray_3 Ray; + P p(0.99,0.99,0.99); + Ray ray(P(-1.0,-1.0,-1.0), P(1.0,1.0,1.0)); + assert(CGAL::do_intersect(p, ray)); + CGAL::Object o = CGAL::intersection(p,ray); + P res; + assert(assign(res, o)); + assert(res == p); +} +template +void test_P_S() +{ + typedef CGAL::Point_3 P; + typedef CGAL::Segment_3 S; + P p(0.99,0.99,0.99); + S s(P(-1.0,-1.0,-1.0), P(1.0,1.0,1.0)); + assert(CGAL::do_intersect(p, s)); + CGAL::Object o = CGAL::intersection(p,s); + P res; + assert(assign(res, o)); + assert(res == p); +} +template +void test_P_P() +{ + typedef CGAL::Point_3 P; + P p(0.99,0.99,0.99); + assert(CGAL::do_intersect(p, p)); + CGAL::Object o = CGAL::intersection(p,p); + P res; + assert(assign(res, o)); + assert(res == p); +} +template +void test_P_Pl() +{ + typedef CGAL::Point_3 P; + typedef CGAL::Plane_3 Pl; + P p(0.99,0.99,0.99); + Pl pl(P(-1.0,-1.0,-1.0), P(1.0,1.0,1.0), P(0.0,0.0,0.0)); + assert(CGAL::do_intersect(p, pl)); + CGAL::Object o = CGAL::intersection(p,pl); + P res; + assert(assign(res, o)); + assert(res == p); +} + +int main() +{ + test_P_Cub(); + test_P_Cub(); + + test_P_L(); + test_P_L(); + + test_P_R(); + test_P_R(); + + test_P_S(); + test_P_S(); + + test_P_P(); + test_P_P(); + + test_P_Pl(); + test_P_Pl(); +} +#include + + + From e78322855113d9dd3851777208a6780e733983c7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 2 Feb 2018 14:31:29 +0000 Subject: [PATCH 02/48] Share code between Iso_cuboid_3/BBox_3 for do_intersect with Ray_3 Nd Segment_3 to profit from static filter --- .../Intersections_3/intersection_3_1_impl.h | 31 +------ .../Bbox_3_Segment_3_do_intersect.h | 41 +++++++-- .../Iso_cuboid_3_Ray_3_do_intersect.h | 84 +++++++++++++++++++ .../Iso_cuboid_3_Segment_3_do_intersect.h | 84 +++++++++++++++++++ Intersections_3/include/CGAL/intersection_3.h | 3 + 5 files changed, 204 insertions(+), 39 deletions(-) create mode 100644 Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h create mode 100644 Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h 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 2cb24979c67..95a99e8e141 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 @@ -222,8 +222,7 @@ do_intersect(const Plane_3 &plane1, const Plane_3 &plane2, 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 { @@ -1750,34 +1749,6 @@ do_intersect(const Iso_cuboid_3 &j, const Line_3 &l, const R&) return bool(CGAL::intersection(l, j)); } -template -inline bool -do_intersect(const Ray_3 &r, const Iso_cuboid_3 &j, const R&) -{ - return bool(CGAL::intersection(r, j)); -} - -template -inline bool -do_intersect(const Iso_cuboid_3 &j, const Ray_3 &r, const R&) -{ - return bool(CGAL::intersection(r, j)); -} - -template -inline bool -do_intersect(const Segment_3 &s, const Iso_cuboid_3 &j, const R&) -{ - return bool(CGAL::intersection(s, j)); -} - -template -inline bool -do_intersect(const Iso_cuboid_3 &j, const Segment_3 &s, const R&) -{ - return bool(CGAL::intersection(s, j)); -} - } // namespace internal } //namespace CGAL 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 47b20df326c..ad2b94c6541 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 @@ -120,7 +120,10 @@ namespace internal { }; // end specialization Do_intersect_bbox_segment_aux_is_greater + + template @@ -134,16 +137,9 @@ namespace internal { do_intersect_bbox_segment_aux( const FT& px, const FT& py, const FT& pz, const FT& qx, const FT& qy, const FT& qz, - const Bbox_3& bbox) + const BFT& bxmin, const BFT& bymin, const BFT& bzmin, + const BFT& bxmax, const BFT& bymax, const BFT& bzmax) { - const double& bxmin = bbox.xmin(); - const double& bymin = bbox.ymin(); - const double& bzmin = bbox.zmin(); - const double& bxmax = bbox.xmax(); - const double& bymax = bbox.ymax(); - const double& bzmax = bbox.zmax(); - - if( ( (px >= bxmin) && (px <= bxmax) && (py >= bymin) && (py <= bymax) && (pz >= bzmin) && (pz <= bzmax) ) || @@ -409,6 +405,33 @@ namespace internal { return true; } + + template + inline + typename Do_intersect_bbox_segment_aux_is_greater + < + FT, + bounded_0, + use_static_filters + >::result_type + do_intersect_bbox_segment_aux( + const FT& px, const FT& py, const FT& pz, + const FT& qx, const FT& qy, const FT& qz, + const Bbox_3& bb) + + { + return do_intersect_bbox_segment_aux(px, py, pz, + qx, qy, qz, + bb.xmin(), bb.ymin(), bb.zmin(), + bb.xmax(), bb.ymax(), bb.zmax()); + } + + + + template bool do_intersect(const typename K::Segment_3& segment, const CGAL::Bbox_3& bbox, diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h new file mode 100644 index 00000000000..ac7d67c9f21 --- /dev/null +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h @@ -0,0 +1,84 @@ +// Copyright (c) 2008 ETH Zurich (Switzerland) +// Copyright (c) 2008-2009 INRIA Sophia-Antipolis (France) +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Camille Wormser, Jane Tournois, Pierre Alliez, Stephane Tayeb + +#ifndef CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_DO_INTERSECT_H +#define CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_DO_INTERSECT_H + +#include +#include + +#include +// for CGAL::internal::do_intersect_bbox_segment_aux + +// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf + +namespace CGAL { + +namespace internal { + + template + bool do_intersect(const typename K::Ray_3& ray, + const typename K::Iso_cuboid_3& ic, + const K&) + { + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; + + const Point_3& source = ray.source(); + const Point_3& point_on_ray = ray.second_point(); + + return do_intersect_bbox_segment_aux + // do not use static filters + ( + source.x(), source.y(), source.z(), + point_on_ray.x(), point_on_ray.y(), point_on_ray.z(), + (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), + (ic.max)().x(), (ic.max)().y(), (ic.max)().z() + ); + } + + template + bool do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Ray_3& ray, + const K&) { + return do_intersect(ray, ic, K()); + } +} // namespace internal + +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/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h new file mode 100644 index 00000000000..92772a57597 --- /dev/null +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h @@ -0,0 +1,84 @@ +// Copyright (c) 2008 ETH Zurich (Switzerland) +// Copyright (c) 2008-2009 INRIA Sophia-Antipolis (France) +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Camille Wormser, Jane Tournois, Pierre Alliez, Stephane Tayeb + +#ifndef CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_DO_INTERSECT_H +#define CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_DO_INTERSECT_H + +#include +#include + +#include +// for CGAL::internal::do_intersect_bbox_segment_aux + +// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf + +namespace CGAL { + +namespace internal { + + template + bool do_intersect(const typename K::Segment_3& seg, + const typename K::Iso_cuboid_3& ic, + const K&) + { + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; + + const Point_3& source = seg.source(); + const Point_3& target = seg.target(); + + return do_intersect_bbox_segment_aux + // do not use static filters + ( + source.x(), source.y(), source.z(), + target.x(), target.y(), target.z(), + (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), + (ic.max)().x(), (ic.max)().y(), (ic.max)().z() + ); + } + + template + bool do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Segment_3& seg, + const K&) { + return do_intersect(seg, ic, K()); + } +} // namespace internal + +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/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index 10aa9a840be..a075e8be94a 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -59,6 +59,9 @@ #include #include +#include +#include + #include #endif // CGAL_INTERSECTION_3_H From 42762b7efb48910f01e98fbf78f8cd95c3b046cb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 2 Feb 2018 15:59:31 +0000 Subject: [PATCH 03/48] Add do_intersect(Iso_cuboid_3, Plane_3/Triangle_3) --- .../Bbox_3_Plane_3_do_intersect.h | 26 +++-- .../Bbox_3_Triangle_3_do_intersect.h | 99 +++++++++++++------ .../bbox_other_do_intersect_test.cpp | 17 +++- Kernel_23/include/CGAL/Bbox_3.h | 3 + 4 files changed, 104 insertions(+), 41 deletions(-) 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 7c05ee63ad1..fe95b74879d 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 @@ -24,6 +24,7 @@ #define CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_PLANE_3_DO_INTERSECT_H #include +#include #include // Opcode like @@ -32,9 +33,9 @@ namespace CGAL { namespace internal { - template + template Uncertain get_min_max(const typename K::Vector_3& p, - const CGAL::Bbox_3& bbox, + Box3& bbox, typename K::Point_3& p_min, typename K::Point_3& p_max) { @@ -89,10 +90,10 @@ namespace internal { return Uncertain::indeterminate(); } - template + template bool do_intersect(const typename K::Plane_3& plane, - const CGAL::Bbox_3& bbox, - const K&) + const Box3& bbox, + const K&) { typedef typename K::Point_3 Point_3; Point_3 p_max, p_min; @@ -120,8 +121,8 @@ namespace internal { return false; } - template - bool do_intersect(const CGAL::Bbox_3& bbox, const typename K::Plane_3& plane, + template + bool do_intersect(const Box3& bbox, const typename K::Plane_3& plane, const K&) { return do_intersect(plane, bbox, K()); } @@ -141,6 +142,17 @@ bool do_intersect(const Plane_3& a, 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()(a, b); +} + +template +bool do_intersect(const Plane_3& a, + const Iso_cuboid_3& b) { + return K().do_intersect_3_object()(a, b); +} } //namespace CGAL 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 7584aac800b..d2c0130faa3 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 @@ -39,10 +39,10 @@ namespace CGAL { namespace internal { - template + template inline bool do_bbox_intersect(const typename K::Triangle_3& triangle, - const CGAL::Bbox_3& bbox) + const Box3& bbox) { const typename K::Point_3& p = triangle.vertex(0); const typename K::Point_3& q = triangle.vertex(1); @@ -51,32 +51,32 @@ namespace internal { for(int i = 0; i < 3; ++i) { if(p[i] <= q[i]) { if(q[i] <= r[i]) { // pqr - if(((bbox.max)(i) < p[i]) || ((bbox.min)(i) > r[i])) + if((bbox.max_coord(i) < p[i]) || (bbox.min_coord(i) > r[i])) return false; } else { if(p[i] <= r[i]) { // prq - if((bbox.max)(i) < p[i] || (bbox.min)(i) > q[i]) + if(bbox.max_coord(i) < p[i] || bbox.min_coord(i) > q[i]) return false; } else { // rpq - if((bbox.max)(i) < r[i] || (bbox.min)(i) > q[i]) + if(bbox.max_coord(i) < r[i] || bbox.min_coord(i) > q[i]) return false; } } } else { if(p[i] <= r[i]) { // qpr - if((bbox.max)(i) < q[i] || (bbox.min)(i) > r[i]) + if(bbox.max_coord(i) < q[i] || bbox.min_coord(i) > r[i]) return false; } else { if(q[i] <= r[i]) { // qrp - if((bbox.max)(i) < q[i] || (bbox.min)(i) > p[i]) + if(bbox.max_coord(i) < q[i] || bbox.min_coord(i) > p[i]) return false; } else { // rqp - if((bbox.max)(i) < r[i] || (bbox.min)(i) > p[i]) + if(bbox.max_coord(i) < r[i] || bbox.min_coord(i) > p[i]) return false; } } @@ -89,12 +89,12 @@ namespace internal { // if you do not know it, or if it does not exist, // use get_min_max without the AXE template parameter // available in _plane_is_cuboid_do_intersect.h - template + template inline void get_min_max(const typename K::FT& px, const typename K::FT& py, const typename K::FT& pz, - const CGAL::Bbox_3& c, + const Box3& c, typename K::Point_3& p_min, typename K::Point_3& p_max) { @@ -186,20 +186,20 @@ namespace internal { return -1; } - template + template inline Uncertain do_axis_intersect(const typename K::Triangle_3& triangle, const typename K::Vector_3* sides, - const CGAL::Bbox_3& bbox) + const Box3& bbox) { const typename K::Point_3* j = & triangle.vertex(SIDE); const typename K::Point_3* k = & triangle.vertex((SIDE+2)%3); typename K::Point_3 p_min, p_max; - get_min_max(AXE==0? 0: AXE==1? sides[SIDE].z(): -sides[SIDE].y(), - AXE==0? -sides[SIDE].z(): AXE==1? 0: sides[SIDE].x(), - AXE==0? sides[SIDE].y(): AXE==1? -sides[SIDE].x(): - typename K::FT(0), bbox, p_min, p_max); + get_min_max(AXE==0? 0: AXE==1? sides[SIDE].z(): -sides[SIDE].y(), + AXE==0? -sides[SIDE].z(): AXE==1? 0: sides[SIDE].x(), + AXE==0? sides[SIDE].y(): AXE==1? -sides[SIDE].x(): + typename K::FT(0), bbox, p_min, p_max); switch ( AXE ) { @@ -238,10 +238,10 @@ namespace internal { } } - template - bool do_intersect(const typename K::Triangle_3& a_triangle, - const CGAL::Bbox_3& a_bbox, - const K& k) + template + bool do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle, + const Box3& a_bbox, + const K& k) { if(certainly_not( do_bbox_intersect(a_triangle, a_bbox) )) @@ -286,11 +286,11 @@ namespace internal { typename K::Triangle_3 triangle(a_triangle[0]-v, a_triangle[1]-v, a_triangle[2]-v); - Bbox_3 bbox( (p-v).bbox() + (q-v).bbox()); + Box3 bbox( (p-v).bbox() + (q-v).bbox()); #else const typename K::Triangle_3& triangle = a_triangle; - const Bbox_3& bbox = a_bbox; + const Box3& bbox = a_bbox; #endif // Create a "certainly true" @@ -298,7 +298,7 @@ namespace internal { if (forbidden_axis!=0){ if (forbidden_size!=0){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -306,7 +306,7 @@ namespace internal { } } if (forbidden_size!=1){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -314,7 +314,7 @@ namespace internal { } } if (forbidden_size!=2){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -325,7 +325,7 @@ namespace internal { if (forbidden_axis!=1){ if (forbidden_size!=0){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -333,7 +333,7 @@ namespace internal { } } if (forbidden_size!=1){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -341,7 +341,7 @@ namespace internal { } } if (forbidden_size!=2){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -352,7 +352,7 @@ namespace internal { if (forbidden_axis!=2){ if (forbidden_size!=0){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -360,7 +360,7 @@ namespace internal { } } if (forbidden_size!=1){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -368,7 +368,7 @@ namespace internal { } } if (forbidden_size!=2){ - Uncertain b = do_axis_intersect(triangle, sides, bbox); + Uncertain b = do_axis_intersect(triangle, sides, bbox); if(is_indeterminate(b)){ ind_or_true = b; } else if(! b){ @@ -379,14 +379,37 @@ namespace internal { return ind_or_true; // throws exception in case it is indeterminate } + template + bool do_intersect(const typename K::Triangle_3& triangle, + const CGAL::Bbox_3& bbox, + const K& k) + { + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); + } + template bool do_intersect(const CGAL::Bbox_3& bbox, const typename K::Triangle_3& triangle, const K& k) { - return do_intersect(triangle, bbox, k); + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); } + template + bool do_intersect(const typename K::Triangle_3& triangle, + const typename K::Iso_cuboid_3& bbox, + const K& k) + { + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); + } + + template + bool do_intersect(const typename K::Iso_cuboid_3& bbox, + const typename K::Triangle_3& triangle, + const K& k) + { + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); + } } // namespace internal template @@ -401,6 +424,18 @@ bool do_intersect(const Triangle_3& a, return K().do_intersect_3_object()(a, b); } +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/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 8364de1f8fb..c850b4a041b 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -62,10 +62,10 @@ typename K::Point_3 random_point_in(const CGAL::Bbox_3& bbox) } -template +template bool test_aux(const T& t, const std::string& name, - const CGAL::Bbox_3& bbox, + const Box3& bbox, bool expected, bool /*exact_predicates*/ = false) { bool b = CGAL::do_intersect(t,bbox); @@ -550,6 +550,11 @@ bool test(bool exact_kernel = false) b &= test_aux(Pl3,"Pl3",bbox,true); b &= test_aux(Pl4,"Pl4",bbox,false); + b &= test_aux(Pl1,"Pl1",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(Pl2,"Pl2",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(Pl3,"Pl3",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(Pl4,"Pl4",CGAL::Iso_cuboid_3(bbox),false); + Triangle t123(p1,p2,p3); Triangle t124(p1,p2,p4); Triangle t126(p1,p2,p6); @@ -568,6 +573,14 @@ bool test(bool exact_kernel = false) b &= test_aux(t2,"t2",bbox,true); b &= test_aux(t3,"t3",bbox,false); + b &= test_aux(t123,"t123",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(t124,"t124",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(t126,"t126",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(t136,"t136",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(tABC,"tABC",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(t1,"t1",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(t2,"t2",CGAL::Iso_cuboid_3(bbox),true); + b &= test_aux(t3,"t3",CGAL::Iso_cuboid_3(bbox),false); // Test more bboxes CGAL::Bbox_3 bbox2(-0.248143,-0.49325,0.0747943,-0.107021,-0.406955,0.151042); diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index a0d2ee29ac5..ae13f08fb52 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -76,6 +76,9 @@ public: inline double min BOOST_PREVENT_MACRO_SUBSTITUTION (int i) const; inline double max BOOST_PREVENT_MACRO_SUBSTITUTION (int i) const; + inline double min_coord(int i) const { return (min)(i); } + inline double max_coord(int i) const { return (max)(i); } + Bbox_3 operator+(const Bbox_3& b) const; Bbox_3& operator+=(const Bbox_3& b); }; From 7dd25721f7c088d53688d959ade985879e05088a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 2 Feb 2018 16:56:49 +0000 Subject: [PATCH 04/48] Add do_intersect(Bbox_3, Iso_cuboid_3) --- .../Bbox_3_Iso_cuboid_3_do_intersect.h | 66 +++++++++++++++++++ .../Bbox_3_Triangle_3_do_intersect.h | 2 +- Intersections_3/include/CGAL/intersection_3.h | 1 + .../bbox_other_do_intersect_test.cpp | 28 ++++---- 4 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_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/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h new file mode 100644 index 00000000000..7a119c126cb --- /dev/null +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h @@ -0,0 +1,66 @@ +// Copyright (c) 2008 INRIA Sophia-Antipolis (France), ETH Zurich (Switzerland). +// Copyright (c) 2010, 2014 GeometryFactory Sarl (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Camille Wormser, Jane Tournois, Pierre Alliez + +#ifndef CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_DO_INTERSECT_H +#define CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_DO_INTERSECT_H + +#include +#include + +namespace CGAL { + +namespace internal { + + template + bool do_intersect(const CGAL::Bbox_3& bb, + const typename K::Iso_cuboid_3& ic, + const K& k) + { + if (bb.xmax() < ic.xmin() || ic.xmax() < bb.xmin()) + return false; + if (bb.ymax() < ic.ymin() || ic.ymax() < bb.ymin()) + return false; + if (bb.zmax() < ic.zmin() || ic.zmax() < bb.zmin()) + return false; + return true; + } + +} // namespace internal + + + +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_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h index d2c0130faa3..eefd4a32f50 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 @@ -413,7 +413,7 @@ namespace internal { } // namespace internal template -bool do_intersect(const CGAL::Bbox_3 a, +bool do_intersect(const CGAL::Bbox_3& a, const Triangle_3& b) { return K().do_intersect_3_object()(a, b); } diff --git a/Intersections_3/include/CGAL/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index a075e8be94a..4b8ed482863 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -58,6 +58,7 @@ #include #include #include +#include #include #include diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index c850b4a041b..26903e95161 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -386,6 +386,7 @@ bool test(bool exact_kernel = false) typedef typename K::Sphere_3 Sphere; typedef typename K::Plane_3 Plane; typedef typename K::Triangle_3 Triangle; + typedef typename K::Iso_cuboid_3 Iso_cuboid_3; CGAL::Bbox_3 bbox(1.0,1.0,1.0,10.0,50.0,100.0); @@ -550,10 +551,10 @@ bool test(bool exact_kernel = false) b &= test_aux(Pl3,"Pl3",bbox,true); b &= test_aux(Pl4,"Pl4",bbox,false); - b &= test_aux(Pl1,"Pl1",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(Pl2,"Pl2",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(Pl3,"Pl3",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(Pl4,"Pl4",CGAL::Iso_cuboid_3(bbox),false); + b &= test_aux(Pl1,"Pl1",Iso_cuboid_3(bbox),true); + b &= test_aux(Pl2,"Pl2",Iso_cuboid_3(bbox),true); + b &= test_aux(Pl3,"Pl3",Iso_cuboid_3(bbox),true); + b &= test_aux(Pl4,"Pl4",Iso_cuboid_3(bbox),false); Triangle t123(p1,p2,p3); Triangle t124(p1,p2,p4); @@ -573,14 +574,14 @@ bool test(bool exact_kernel = false) b &= test_aux(t2,"t2",bbox,true); b &= test_aux(t3,"t3",bbox,false); - b &= test_aux(t123,"t123",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(t124,"t124",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(t126,"t126",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(t136,"t136",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(tABC,"tABC",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(t1,"t1",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(t2,"t2",CGAL::Iso_cuboid_3(bbox),true); - b &= test_aux(t3,"t3",CGAL::Iso_cuboid_3(bbox),false); + b &= test_aux(t123,"t123",Iso_cuboid_3(bbox),true); + b &= test_aux(t124,"t124",Iso_cuboid_3(bbox),true); + b &= test_aux(t126,"t126",Iso_cuboid_3(bbox),true); + b &= test_aux(t136,"t136",Iso_cuboid_3(bbox),true); + b &= test_aux(tABC,"tABC",Iso_cuboid_3(bbox),true); + b &= test_aux(t1,"t1",Iso_cuboid_3(bbox),true); + b &= test_aux(t2,"t2",Iso_cuboid_3(bbox),true); + b &= test_aux(t3,"t3",Iso_cuboid_3(bbox),false); // Test more bboxes CGAL::Bbox_3 bbox2(-0.248143,-0.49325,0.0747943,-0.107021,-0.406955,0.151042); @@ -614,6 +615,9 @@ bool test(bool exact_kernel = false) b &= test_aux(line2, "line2", bbox2, false); b &= test_aux(line3, "line3", bbox3, true); b &= test_aux(line4, "line4", bbox4, false); + + Iso_cuboid_3 ic(bbox); + b &= test_aux(ic, "ic", bbox, true); // Use do_intersect(bbox,bbox) CGAL::do_intersect(bbox2,bbox4); From 702eafafdcfec7208e19e77b2bedc3eefd9d21c4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 5 Feb 2018 11:32:13 +0000 Subject: [PATCH 05/48] Add Iso_cuboid / Sphere --- .../Bbox_3_Sphere_3_do_intersect.h | 20 ++++-- .../Iso_cuboid_3_Sphere_3_do_intersect.h | 68 +++++++++++++++++++ Intersections_3/include/CGAL/intersection_3.h | 1 + .../bbox_other_do_intersect_test.cpp | 6 ++ 4 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_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 1ee8e0dd3b0..c23e07c05df 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 @@ -33,10 +33,10 @@ namespace CGAL { namespace internal { - template - bool do_intersect(const typename K::Sphere_3& sphere, - const CGAL::Bbox_3& bbox, - const K&) + template + bool do_intersect_sphere_box_3(const typename K::Sphere_3& sphere, + const Box3& bbox, + const K&) { typedef typename K::FT FT; typedef typename K::Point_3 Point; @@ -101,8 +101,18 @@ namespace internal { bool do_intersect(const CGAL::Bbox_3& bbox, const typename K::Sphere_3& sphere, const K&) - { return do_intersect(sphere, bbox, K()); } + { + return do_intersect_sphere_box_3(sphere, bbox, K()); + } + + template + bool do_intersect(const typename K::Sphere_3& sphere, + const CGAL::Bbox_3& bbox, + const K&) + { + return do_intersect_sphere_box_3(sphere, bbox, K()); + } } // namespace internal diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h new file mode 100644 index 00000000000..ad8ae9b82c9 --- /dev/null +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h @@ -0,0 +1,68 @@ +// Copyright (c) 2008 INRIA Sophia-Antipolis (France), ETH Zurich (Switzerland). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Camille Wormser, Jane Tournois, Pierre Alliez + + +#ifndef CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_DO_INTERSECT_H +#define CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_DO_INTERSECT_H + +#include +#include +#include + +namespace CGAL { + +namespace internal { + + template + bool do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Sphere_3& sphere, + const K&) + { + return do_intersect_sphere_box_3(sphere, ic, K()); + } + + template + bool do_intersect(const typename K::Sphere_3& sphere, + const typename K::Iso_cuboid_3& ic, + const K&) + { + return do_intersect_sphere_box_3(sphere, ic, K()); + } + + +} // namespace internal + +template +bool do_intersect(const Iso_cuboid_3& a, + const Sphere_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Sphere_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_SPHERE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index 4b8ed482863..0c02cfc4ea4 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -62,6 +62,7 @@ #include #include +#include #include diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 26903e95161..7de5c37e020 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -541,6 +541,12 @@ bool test(bool exact_kernel = false) b &= test_aux(sphE_1,"sphE_1",bbox,true); b &= test_aux(sph1_3,"sph1_3",bbox,true); + b &= test_aux(sphA_1,"sphA_1",Iso_cuboid_3(bbox),false); + b &= test_aux(sphB_1,"sphB_1",Iso_cuboid_3(bbox),true); + b &= test_aux(sphC_1,"sphC_1",Iso_cuboid_3(bbox),false); + b &= test_aux(sphE_1,"sphE_1",Iso_cuboid_3(bbox),true); + b &= test_aux(sph1_3,"sph1_3",Iso_cuboid_3(bbox),true); + Plane Pl1(Point(1,1,1),Vector(0,0,1)); Plane Pl2(Point(1,1,1),Vector(1,1,1)); Plane Pl3(Point(5,5,5),Vector(1,2,-5)); From 5d5f4d0a3d13f74fcf117b81b58be84bc719ec06 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 5 Feb 2018 12:10:44 +0000 Subject: [PATCH 06/48] split header files --- .../Bbox_3_Triangle_3_do_intersect.h | 27 ------- .../Iso_cuboid_3_Triangle_3_do_intersect.h | 73 +++++++++++++++++++ Intersections_3/include/CGAL/intersection_3.h | 1 + 3 files changed, 74 insertions(+), 27 deletions(-) create mode 100644 Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_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 eefd4a32f50..6434be6a00e 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 @@ -395,21 +395,6 @@ namespace internal { return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); } - template - bool do_intersect(const typename K::Triangle_3& triangle, - const typename K::Iso_cuboid_3& bbox, - const K& k) - { - return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); - } - - template - bool do_intersect(const typename K::Iso_cuboid_3& bbox, - const typename K::Triangle_3& triangle, - const K& k) - { - return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); - } } // namespace internal template @@ -424,18 +409,6 @@ bool do_intersect(const Triangle_3& a, return K().do_intersect_3_object()(a, b); } -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/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h new file mode 100644 index 00000000000..b535f05cf2e --- /dev/null +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h @@ -0,0 +1,73 @@ +// Copyright (c) 2008 INRIA Sophia-Antipolis (France), ETH Zurich (Switzerland). +// Copyright (c) 2010, 2014 GeometryFactory Sarl (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Camille Wormser, Jane Tournois, Pierre Alliez + +#ifndef CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_DO_INTERSECT_H +#define CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_DO_INTERSECT_H + +#include +#include + +// Fast Triangle-Cuboid intersection test, following Tomas Akenine-Moeller description. +// The code looks slightly different from his code because we avoid the translation at +// a minimal cost (and we use C++ ;). + +#include +#include + +namespace CGAL { + +namespace internal { + + template + bool do_intersect(const typename K::Triangle_3& triangle, + const typename K::Iso_cuboid_3& bbox, + const K& k) + { + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); + } + + template + bool do_intersect(const typename K::Iso_cuboid_3& bbox, + const typename K::Triangle_3& triangle, + const K& k) + { + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); + } +} // namespace internal + + +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 + +#endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index 0c02cfc4ea4..f2cefb8f31c 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -63,6 +63,7 @@ #include #include #include +#include #include From 12a5cd9f824f499d0eb933d8af0bc633e10e316e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 5 Feb 2018 15:46:23 +0000 Subject: [PATCH 07/48] Add the remaining missing functions --- .../Triangle_3_Tetrahedron_3_do_intersect.h | 141 ++++++++++++++++-- .../Tetrahedron_3_do_intersect.h | 116 ++++++++++++++ .../Triangle_3_Sphere_3_do_intersect.h | 125 ++++++++++++++++ Intersections_3/include/CGAL/intersection_3.h | 2 + .../test/Intersections_3/tetrahedron.cpp | 56 +++++++ .../test/Intersections_3/triangle_other.cpp | 2 - 6 files changed, 429 insertions(+), 13 deletions(-) create mode 100644 Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h create mode 100644 Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h create mode 100644 Intersections_3/test/Intersections_3/tetrahedron.cpp 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 a0987b3529f..f5ee6802f7a 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 @@ -27,6 +27,7 @@ #define CGAL_TRIANGLE_3_TETRAHEDRON_3_DO_INTERSECT_H #include +#include namespace CGAL { @@ -36,11 +37,12 @@ namespace CGAL { namespace internal { // This code is not optimized: -template + template typename K::Boolean -do_intersect(const typename K::Triangle_3 &tr, - const typename K::Tetrahedron_3 &tet, - const K & k) +do_intersect_tetrahedron_bounded(const typename Bounded &tr, + const typename K::Tetrahedron_3 &tet, + const typename K::Point_3 p, + const K & k) { typedef typename K::Triangle_3 Triangle; @@ -52,12 +54,7 @@ do_intersect(const typename K::Triangle_3 &tr, if (do_intersect(tr, Triangle(tet[0], tet[2], tet[3]), k)) return true; if (do_intersect(tr, Triangle(tet[1], tet[2], tet[3]), k)) return true; - CGAL_kernel_assertion(k.bounded_side_3_object()(tet, tr[0]) == - k.bounded_side_3_object()(tet, tr[1])); - CGAL_kernel_assertion(k.bounded_side_3_object()(tet, tr[0]) == - k.bounded_side_3_object()(tet, tr[2])); - - return k.has_on_bounded_side_3_object()(tet, tr[0]); + return k.has_on_bounded_side_3_object()(tet, p); } @@ -68,12 +65,134 @@ do_intersect(const typename K::Tetrahedron_3 &tet, const typename K::Triangle_3 &tr, const K & k) { - return do_intersect(tr, tet, k); + return do_intersect_tetrahedron_bounded(tr, tet, tr[0], k); } +template +inline +typename K::Boolean +do_intersect(const typename K::Triangle_3 &tr, + const typename K::Tetrahedron_3 &tet, + const K & k) +{ + return do_intersect_tetrahedron_bounded(tr, tet, tr[0], k); +} + + +template +inline +typename K::Boolean +do_intersect(const typename K::Tetrahedron_3 &tet, + const typename K::Segment_3 &seg, + const K & k) +{ + return do_intersect_tetrahedron_bounded(seg, tet, seg.source(), k); +} + +template +inline +typename K::Boolean +do_intersect(const typename K::Segment_3 &seg, + const typename K::Tetrahedron_3 &tet, + const K & k) +{ + return do_intersect_tetrahedron_bounded(seg, tet, seg.source(), k); +} + + +template +inline +typename K::Boolean +do_intersect(const typename K::Tetrahedron_3 &tet, + const typename K::Iso_cuboid_3 &ic, + const K & k) +{ + return do_intersect_tetrahedron_bounded(ic, tet, ic[0], k); +} + +template +inline +typename K::Boolean +do_intersect(const typename K::Iso_cuboid_3 &ic, + const typename K::Tetrahedron_3 &tet, + const K & k) +{ + return do_intersect_tetrahedron_bounded(ic, tet, ic[0], k); +} + + +template +inline +typename K::Boolean +do_intersect(const typename K::Tetrahedron_3 &tet, + const typename K::Sphere_3 &sp, + const K & k) +{ + return do_intersect_tetrahedron_bounded(sp, tet, sp.center(), k); +} + +template +inline +typename K::Boolean +do_intersect(const typename K::Sphere_3 &sp, + const typename K::Tetrahedron_3 &tet, + const K & k) +{ + return do_intersect_tetrahedron_bounded(sp, tet, sp.center(), k); +} + + +template +inline +typename K::Boolean +do_intersect(const typename K::Tetrahedron_3 &tet, + const typename K::Tetrahedron_3 &sp, + const K & k) +{ + return do_intersect_tetrahedron_bounded(sp, tet, tet[0], k); +} + +template +inline +typename K::Boolean +do_intersect(const typename K::Tetrahedron_3 &tet, + const typename Bbox_3 &bb, + const K & k) +{ + return do_intersect_tetrahedron_bounded(bb, tet, typename K::Point_3(bb.xmin(), bb.ymin(), bb.zmin()), k); +} + + template +inline +typename K::Boolean +do_intersect(const typename Bbox_3 &bb, + const typename K::Tetrahedron_3 &tet, + const K & k) +{ + return do_intersect_tetrahedron_bounded(bb, tet, typename K::Point_3(bb.xmin(), bb.ymin(), bb.zmin()), k); +} + } // namespace internal 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 diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h new file mode 100644 index 00000000000..b735b3d2346 --- /dev/null +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h @@ -0,0 +1,116 @@ +// Copyright (c) 2018 GeometryFactory Sarl (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H +#define CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H + +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + +template +bool do_intersect_tetrahedron_unbounded(const typename K::Tetrahedron_3& tet, + const Unbounded& unb, + const K& k) { + if (do_intersect(unb, Triangle(tet[0], tet[1], tet[2]), k)) return true; + if (do_intersect(unb, Triangle(tet[0], tet[1], tet[3]), k)) return true; + if (do_intersect(unb, Triangle(tet[0], tet[2], tet[3]), k)) return true; + if (do_intersect(unb, Triangle(tet[1], tet[2], tet[3]), k)) return true; + return false; +} + + + +template +bool do_intersect(const typename K::Tetrahedron_3& tet, + const typename K::Plane_3& unb, + 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, + 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, + const K& k) { + return do_intersect_tetrahedron_unbounded(tet, unb, k); +} + +} // namespace internal + + +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/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h new file mode 100644 index 00000000000..8c129fa07a4 --- /dev/null +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h @@ -0,0 +1,125 @@ +// Copyright (c) 2018 GeometryFactory Sarl +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H +#define CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H + +#include +#include + +namespace CGAL { + + template + class Triangle_3; + + template + class Sphere_3; + + template + class Line_3; + +namespace internal { + +template +inline +typename K::Boolean +do_intersect(const typename K::Sphere_3 &sp, + const typename K::Triangle_3 &tr, + const K & k) +{ + return squared_distance(sp.center(), tr) <= sp.squared_radius(); +} + +template +inline +typename K::Boolean +do_intersect(const typename K::Sphere_3 &sp, + const typename K::Line_3 &lin, + const K & k) +{ + return squared_distance(sp.center(), lin) <= sp.squared_radius(); +} + + +template +inline +typename K::Boolean +do_intersect(const typename K::Line_3 &lin, + const typename K::Sphere_3 &sp, + const K & k) +{ + return squared_distance(sp.center(), lin) <= sp.squared_radius(); +} + + + +template +inline +typename K::Boolean +do_intersect(const typename K::Sphere_3 &sp, + const typename K::Ray_3 &lin, + const K & k) +{ + return squared_distance(sp.center(), lin) <= sp.squared_radius(); +} + + +template +inline +typename K::Boolean +do_intersect(const typename K::Ray_3 &lin, + const typename K::Sphere_3 &sp, + const K & k) +{ + return squared_distance(sp.center(), lin) <= sp.squared_radius(); +} + +template +inline +typename K::Boolean +do_intersect(const typename K::Sphere_3 &sp, + const typename K::Segment_3 &lin, + const K & k) +{ + return squared_distance(sp.center(), lin) <= sp.squared_radius(); +} + + +template +inline +typename K::Boolean +do_intersect(const typename K::Segment_3 &lin, + const typename K::Sphere_3 &sp, + const K & k) +{ + return squared_distance(sp.center(), lin) <= sp.squared_radius(); +} +} // namespace internal + +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/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index f2cefb8f31c..3d74dbf38d4 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -64,6 +64,8 @@ #include #include #include +#include +#include #include diff --git a/Intersections_3/test/Intersections_3/tetrahedron.cpp b/Intersections_3/test/Intersections_3/tetrahedron.cpp new file mode 100644 index 00000000000..6c05a321df6 --- /dev/null +++ b/Intersections_3/test/Intersections_3/tetrahedron.cpp @@ -0,0 +1,56 @@ +#include + +#include +#include + +typedef CGAL::Cartesian K; + +typedef K::Tetrahedron_3 Tetrahedron; + +typedef K::Segment_3 Segment; +typedef K::Triangle_3 Triangle; +typedef K::Iso_cuboid_3 Iso_cuboid; +typedef K::Sphere_3 Sphere; + +typedef K::Plane_3 Plane; +typedef K::Line_3 Line; +typedef K::Ray_3 Ray; + +typedef CGAL::Bbox_3 Bbox; + +int main() +{ + Tetrahedron tet; + Sphere sp; + + CGAL::do_intersect(tet,Triangle()); + CGAL::do_intersect(tet,Segment()); + CGAL::do_intersect(tet,Iso_cuboid()); + CGAL::do_intersect(tet,Sphere()); + CGAL::do_intersect(tet,Plane()); + CGAL::do_intersect(tet,Line()); + CGAL::do_intersect(tet,Ray()); + CGAL::do_intersect(tet,tet); + CGAL::do_intersect(tet,Bbox()); + CGAL::do_intersect(sp, Line()); + CGAL::do_intersect(sp, Ray()); + CGAL::do_intersect(sp, Segment()); + + + CGAL::do_intersect(Triangle(), tet); + CGAL::do_intersect(Segment(), tet); + CGAL::do_intersect(Iso_cuboid(), tet); + CGAL::do_intersect(Sphere(), tet); + CGAL::do_intersect(Plane(), tet); + CGAL::do_intersect(Line(), tet); + CGAL::do_intersect(Ray(), tet); + CGAL::do_intersect(Bbox(), tet); + + CGAL::do_intersect(Line(), sp); + CGAL::do_intersect(Ray(), sp); + CGAL::do_intersect(Segment(), sp); + + + return 0; + +} diff --git a/Intersections_3/test/Intersections_3/triangle_other.cpp b/Intersections_3/test/Intersections_3/triangle_other.cpp index fdfccc372fe..d96a444b24b 100644 --- a/Intersections_3/test/Intersections_3/triangle_other.cpp +++ b/Intersections_3/test/Intersections_3/triangle_other.cpp @@ -1,7 +1,5 @@ #include - -#include #include #include #include From c5367399ab503f55f56fb1791d849ba3378c6062 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 5 Feb 2018 17:00:43 +0000 Subject: [PATCH 08/48] Remove unneeded includes --- Intersections_3/test/Intersections_3/call_test.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Intersections_3/test/Intersections_3/call_test.cpp b/Intersections_3/test/Intersections_3/call_test.cpp index 303078d0076..6b708780d3e 100644 --- a/Intersections_3/test/Intersections_3/call_test.cpp +++ b/Intersections_3/test/Intersections_3/call_test.cpp @@ -1,8 +1,6 @@ -#include #include #include #include -#include #include #include From 72cdc05152ddac0c7b018d8d7fdf6221d9bc3d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 5 Feb 2018 18:45:18 +0100 Subject: [PATCH 09/48] fix headers --- .../include/CGAL/Point_3_Iso_cuboid_3_intersection.h | 8 +++++--- .../include/CGAL/Point_3_Line_3_intersection.h | 4 +++- .../include/CGAL/Point_3_Plane_3_intersection.h | 4 +++- .../include/CGAL/Point_3_Point_3_intersection.h | 2 +- Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h | 4 +++- .../include/CGAL/Point_3_Segment_3_intersection.h | 8 +++++--- .../Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h | 2 +- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h index 66983d3b12a..a58491fb494 100644 --- a/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h @@ -1,6 +1,4 @@ -#ifndef CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H -#define CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H -// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -20,6 +18,10 @@ // // // Author(s) : Maxime Gimeno + +#ifndef CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H +#define CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H + #include #include #include diff --git a/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h index bdf9dffc33d..b2906fa59d2 100644 --- a/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h @@ -1,4 +1,4 @@ -// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -18,12 +18,14 @@ // // // Author(s) : Maxime Gimeno + #ifndef CGAL_POINT_3_LINE_3_INTERSECTION_H #define CGAL_POINT_3_LINE_3_INTERSECTION_H #include #include #include + namespace CGAL { namespace internal { diff --git a/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h index 73ecc7dfaf0..f3d09b82ab2 100644 --- a/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h @@ -1,4 +1,4 @@ -// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -18,12 +18,14 @@ // // // Author(s) : Maxime Gimeno + #ifndef CGAL_POINT_3_PLANE_3_INTERSECTION_H #define CGAL_POINT_3_PLANE_3_INTERSECTION_H #include #include #include + namespace CGAL { namespace internal { diff --git a/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h index ae5321dc94e..dfd3744f195 100644 --- a/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h @@ -1,4 +1,4 @@ -// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or diff --git a/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h index fd4c04ede83..91c4f557989 100644 --- a/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h @@ -1,4 +1,4 @@ -// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -18,8 +18,10 @@ // // // Author(s) : Maxime Gimeno + #ifndef CGAL_POINT_3_RAY_3_INTERSECTION_H #define CGAL_POINT_3_RAY_3_INTERSECTION_H + #include #include #include diff --git a/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h index 764d0a65f41..0873b0d76b1 100644 --- a/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h @@ -1,6 +1,4 @@ -#ifndef CGAL_POINT_3_SEGMENT_3_INTERSECTION_H -#define CGAL_POINT_3_SEGMENT_3_INTERSECTION_H -// Copyright (c) 2003 INRIA Sophia-Antipolis (France). +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -20,6 +18,10 @@ // // // Author(s) : Maxime Gimeno + +#ifndef CGAL_POINT_3_SEGMENT_3_INTERSECTION_H +#define CGAL_POINT_3_SEGMENT_3_INTERSECTION_H + #include #include #include diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h index 7a119c126cb..cb931b1524f 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h @@ -1,5 +1,5 @@ // Copyright (c) 2008 INRIA Sophia-Antipolis (France), ETH Zurich (Switzerland). -// Copyright (c) 2010, 2014 GeometryFactory Sarl (France). +// Copyright (c) 2010, 2014 GeometryFactory Sarl (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or From 77f5a4e556df27f4b1bb50e7d6226124d3fc10ac Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 12 Feb 2018 11:57:08 +0000 Subject: [PATCH 10/48] Remove typename; Comment after #endif --- .../include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h | 2 +- .../CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h | 2 +- .../internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 f5ee6802f7a..0984a2fac87 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 @@ -39,7 +39,7 @@ namespace internal { // This code is not optimized: template typename K::Boolean -do_intersect_tetrahedron_bounded(const typename Bounded &tr, +do_intersect_tetrahedron_bounded(const Bounded &tr, const typename K::Tetrahedron_3 &tet, const typename K::Point_3 p, const K & k) diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h index b735b3d2346..8197777a842 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h @@ -113,4 +113,4 @@ bool do_intersect(const CGAL::Ray_3& b, } // namespace CGAL -#endif CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H +#endif // CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h index 8c129fa07a4..4ae4cf82c9c 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h @@ -121,5 +121,5 @@ CGAL_DO_INTERSECT_FUNCTION(Segment_3, Sphere_3, 3) } // namespace CGAL -#endif CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H +#endif // CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H From 78b90d26147ced09b39bfc71356f173efe2541fc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 13 Feb 2018 10:25:45 +0000 Subject: [PATCH 11/48] Fix bugs revealed with g++ --- .../Triangle_3_Tetrahedron_3_do_intersect.h | 12 +++++- .../Bbox_3_Plane_3_do_intersect.h | 37 +++++++++++++++---- .../Tetrahedron_3_do_intersect.h | 12 +++--- 3 files changed, 46 insertions(+), 15 deletions(-) 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 0984a2fac87..708170b7370 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 @@ -28,6 +28,7 @@ #include #include +#include namespace CGAL { @@ -36,6 +37,12 @@ namespace CGAL { namespace internal { +template +typename K::Boolean +do_intersect(const typename K::Tetrahedron_3 &tet, + const typename K::Triangle_3 &tr, + const K & k); + // This code is not optimized: template typename K::Boolean @@ -49,6 +56,7 @@ do_intersect_tetrahedron_bounded(const Bounded &tr, CGAL_kernel_precondition( ! k.is_degenerate_3_object() (tr) ); CGAL_kernel_precondition( ! k.is_degenerate_3_object() (tet) ); + typedef typename K::Triangle_3 Triangle; if (do_intersect(tr, Triangle(tet[0], tet[1], tet[2]), k)) return true; if (do_intersect(tr, Triangle(tet[0], tet[1], tet[3]), k)) return true; if (do_intersect(tr, Triangle(tet[0], tet[2], tet[3]), k)) return true; @@ -156,7 +164,7 @@ template inline typename K::Boolean do_intersect(const typename K::Tetrahedron_3 &tet, - const typename Bbox_3 &bb, + const CGAL::Bbox_3 &bb, const K & k) { return do_intersect_tetrahedron_bounded(bb, tet, typename K::Point_3(bb.xmin(), bb.ymin(), bb.zmin()), k); @@ -165,7 +173,7 @@ do_intersect(const typename K::Tetrahedron_3 &tet, template inline typename K::Boolean -do_intersect(const typename Bbox_3 &bb, + do_intersect(const CGAL::Bbox_3 &bb, const typename K::Tetrahedron_3 &tet, const K & k) { 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 fe95b74879d..d6b6d5dc317 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 @@ -91,9 +91,9 @@ namespace internal { } template - bool do_intersect(const typename K::Plane_3& plane, - const Box3& bbox, - const K&) + bool do_intersect_plane_box(const typename K::Plane_3& plane, + const Box3& bbox, + const K&) { typedef typename K::Point_3 Point_3; Point_3 p_max, p_min; @@ -121,19 +121,40 @@ namespace internal { return false; } - template - bool do_intersect(const Box3& bbox, const typename K::Plane_3& plane, + template + bool do_intersect(const typename K::Plane_3& plane, + const Bbox_3& bbox, const K&) { - return do_intersect(plane, bbox, K()); + return do_intersect_plane_box(plane, bbox, K()); } + template + bool do_intersect(const typename K::Plane_3& plane, + const typename K::Iso_cuboid_3& bbox, + const K&) { + return do_intersect_plane_box(plane, bbox, K()); + } + + template + bool do_intersect(const Bbox_3& bbox, + const typename K::Plane_3& plane, + const K&) { + return do_intersect_plane_box(plane, bbox, K()); + } + + template + bool do_intersect(const typename K::Iso_cuboid_3& bbox, + const typename K::Plane_3& plane, + const K&) { + return do_intersect_plane_box(plane, bbox, K()); + } } // namespace internal template bool do_intersect(const CGAL::Bbox_3 a, const Plane_3& b) { - return K().do_intersect_3_object()(a, b); + return K().do_intersect_3_object()(b, a); } template @@ -145,7 +166,7 @@ bool do_intersect(const Plane_3& a, template bool do_intersect(const Iso_cuboid_3& a, const Plane_3& b) { - return K().do_intersect_3_object()(a, b); + return K().do_intersect_3_object()(b, a); } template diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h index 8197777a842..b9b899c1b43 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h @@ -26,6 +26,7 @@ #include #include #include +#include namespace CGAL { @@ -35,11 +36,12 @@ template bool do_intersect_tetrahedron_unbounded(const typename K::Tetrahedron_3& tet, const Unbounded& unb, const K& k) { - if (do_intersect(unb, Triangle(tet[0], tet[1], tet[2]), k)) return true; - if (do_intersect(unb, Triangle(tet[0], tet[1], tet[3]), k)) return true; - if (do_intersect(unb, Triangle(tet[0], tet[2], tet[3]), k)) return true; - if (do_intersect(unb, Triangle(tet[1], tet[2], tet[3]), k)) return true; - return false; + typedef typename K::Triangle_3 Triangle; + if (do_intersect(unb,Triangle(tet[0], tet[1], tet[2]), k)) return true; + if (do_intersect(unb, Triangle(tet[0], tet[1], tet[3]), k)) return true; + if (do_intersect(unb, Triangle(tet[0], tet[2], tet[3]), k)) return true; + if (do_intersect(unb, Triangle(tet[1], tet[2], tet[3]), k)) return true; + return false; } From f9dcc6f1a4cd1910cbe27f6606e20224a4e9125f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 13 Feb 2018 14:52:47 +0000 Subject: [PATCH 12/48] No need for do_intersect(Sphere/Line) in the Spherical_kernel_3 as it is already provided by the Linear_kernel --- .../include/CGAL/Spherical_kernel_intersections.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h b/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h index 2adfd88f51e..1f2af032485 100644 --- a/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h +++ b/Circular_kernel_3/include/CGAL/Spherical_kernel_intersections.h @@ -38,6 +38,14 @@ namespace CGAL { +#define CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_JUST_INTERSECTION_2_(A,B) \ +template < class OutputIterator, class K > \ +OutputIterator \ +intersection(const A &c1, const B &c2, OutputIterator res) \ +{ \ + return typename K::Intersect_3()(c1, c2, res); \ +} + #define CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(A,B) \ template < class OutputIterator, class K > \ OutputIterator \ @@ -68,8 +76,8 @@ do_intersect(const A &c1, const B &c2, const C &c3) \ return typename K::Do_intersect_3()(c1, c2, c3); \ } -CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(Sphere_3, Line_3) -CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(Line_3, Sphere_3) +CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_JUST_INTERSECTION_2_(Sphere_3, Line_3) +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_(Plane_3, Sphere_3, Sphere_3) From 0d3ac755189b1f0035e0c71db3127ee2b89e37d9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 17 Feb 2018 12:37:15 +0000 Subject: [PATCH 13/48] Introduce namespace Intersections --- .../CGAL/Circular_kernel_2/Circular_arc_2.h | 4 +- .../CGAL/Circular_kernel_2/Line_arc_2.h | 12 ++--- .../function_objects_polynomial_circular.h | 2 +- .../internal_functions_on_circle_2.h | 4 +- .../internal_functions_on_line_arc_2.h | 4 +- .../CGAL/Circular_kernel_intersections.h | 4 +- .../internal_functions_on_circle_3.h | 4 +- .../internal_functions_on_circular_arc_3.h | 52 +++++++++---------- .../internal_functions_on_line_arc_3.h | 22 ++++---- .../internal_functions_on_sphere_3.h | 4 +- .../internal/Static_filters/Do_intersect_2.h | 6 +-- .../internal/Static_filters/Do_intersect_3.h | 8 +-- .../CGAL/Circle_2_Circle_2_intersection.h | 3 ++ .../include/CGAL/Intersection_traits.h | 7 ++- .../Triangle_2_Triangle_2_intersection_impl.h | 3 ++ ...rectangle_2_Iso_rectangle_2_intersection.h | 3 ++ .../Line_2_Iso_rectangle_2_intersection.h | 3 ++ .../include/CGAL/Line_2_Line_2_intersection.h | 3 ++ .../CGAL/Line_2_Triangle_2_intersection.h | 3 ++ .../Point_2_Iso_rectangle_2_intersection.h | 3 ++ .../CGAL/Point_2_Line_2_intersection.h | 4 ++ .../CGAL/Point_2_Point_2_intersection.h | 3 ++ .../include/CGAL/Point_2_Ray_2_intersection.h | 3 ++ .../CGAL/Point_2_Segment_2_intersection.h | 4 ++ .../CGAL/Point_2_Triangle_2_intersection.h | 3 ++ .../CGAL/Ray_2_Iso_rectangle_2_intersection.h | 3 ++ .../include/CGAL/Ray_2_Line_2_intersection.h | 3 ++ .../include/CGAL/Ray_2_Ray_2_intersection.h | 3 ++ .../CGAL/Ray_2_Segment_2_intersection.h | 3 ++ .../CGAL/Ray_2_Triangle_2_intersection.h | 3 ++ .../Segment_2_Iso_rectangle_2_intersection.h | 4 ++ .../CGAL/Segment_2_Line_2_intersection.h | 3 ++ .../CGAL/Segment_2_Segment_2_intersection.h | 3 ++ .../CGAL/Segment_2_Triangle_2_intersection.h | 3 ++ Intersections_2/include/CGAL/Straight_2.h | 7 ++- .../Triangle_2_Iso_rectangle_2_intersection.h | 7 ++- .../CGAL/Triangle_2_Triangle_2_do_intersect.h | 5 +- .../Intersections_3/intersection_3_1_impl.h | 5 +- .../CGAL/Point_3_Iso_cuboid_3_intersection.h | 5 +- .../CGAL/Point_3_Line_3_intersection.h | 5 +- .../CGAL/Point_3_Plane_3_intersection.h | 3 ++ .../CGAL/Point_3_Point_3_intersection.h | 5 +- .../include/CGAL/Point_3_Ray_3_intersection.h | 5 +- .../CGAL/Point_3_Segment_3_intersection.h | 5 +- .../CGAL/Triangle_3_Line_3_do_intersect.h | 6 ++- .../CGAL/Triangle_3_Plane_3_do_intersect.h | 5 +- .../CGAL/Triangle_3_Point_3_do_intersect.h | 4 +- .../CGAL/Triangle_3_Ray_3_do_intersect.h | 5 +- .../CGAL/Triangle_3_Segment_3_do_intersect.h | 5 +- .../Triangle_3_Tetrahedron_3_do_intersect.h | 5 +- .../CGAL/Triangle_3_Triangle_3_do_intersect.h | 5 +- .../CGAL/Triangle_3_Triangle_3_intersection.h | 7 ++- .../include/CGAL/bbox_intersection_3.h | 5 ++ .../Bbox_3_Iso_cuboid_3_do_intersect.h | 4 +- .../Bbox_3_Line_3_do_intersect.h | 5 +- .../Bbox_3_Plane_3_do_intersect.h | 5 +- .../Bbox_3_Ray_3_do_intersect.h | 6 ++- .../Bbox_3_Segment_3_do_intersect.h | 5 +- .../Bbox_3_Sphere_3_do_intersect.h | 5 +- .../Bbox_3_Triangle_3_do_intersect.h | 5 +- .../Iso_cuboid_3_Ray_3_do_intersect.h | 4 ++ .../Iso_cuboid_3_Segment_3_do_intersect.h | 6 ++- .../Iso_cuboid_3_Sphere_3_do_intersect.h | 8 +-- .../Iso_cuboid_3_Triangle_3_do_intersect.h | 4 ++ .../Tetrahedron_3_do_intersect.h | 4 +- .../Triangle_3_Line_3_intersection.h | 6 ++- .../Triangle_3_Ray_3_intersection.h | 8 ++- .../Triangle_3_Segment_3_intersection.h | 4 ++ .../Triangle_3_Sphere_3_do_intersect.h | 6 ++- .../include/CGAL/Kernel/function_objects.h | 12 ++--- 70 files changed, 287 insertions(+), 108 deletions(-) diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h index 514cadaeb17..a1ee4abbb5c 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h @@ -191,7 +191,7 @@ namespace internal { // the circles intersect const std::pair* - result = CGAL::internal::intersect_get< std::pair >(*it); + result = CGAL::Intersections::internal::intersect_get< std::pair >(*it); if ( result->second == 2 ){ // double solution _begin = result->first; _end = result->first; @@ -202,7 +202,7 @@ namespace internal { _end = result->first; if (!(b_1 && b_2)) { ++it; - result = CGAL::internal::intersect_get< std::pair >(*it); + result = CGAL::Intersections::internal::intersect_get< std::pair >(*it); if (!b_1) _begin = result->first; if (!b_2) diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h index 4013c139755..1ee97d42289 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h @@ -92,13 +92,13 @@ public: // the circles intersect const std::pair* - result = CGAL::internal::intersect_get >(*it); + result = CGAL::Intersections::internal::intersect_get >(*it); // get must have succeeded if ( result->second == 2 ) // double solution return result->first; if (b) return result->first; ++it; - result = CGAL::internal::intersect_get >(*it); + result = CGAL::Intersections::internal::intersect_get >(*it); return result->first; } @@ -136,14 +136,14 @@ public: CGAL_kernel_precondition(do_intersect(support, l2)); //typedef typename Root_of_2::RT RT_2; typename Intersection_traits::result_type - v = CGAL::internal::intersection(support, l1, CK()); + v = CGAL::Intersections::internal::intersection(support, l1, CK()); CGAL_assertion(bool(v)); - const Point_2 *pt = CGAL::internal::intersect_get(v); + const Point_2 *pt = CGAL::Intersections::internal::intersect_get(v); CGAL_assertion(pt != NULL); _begin = Circular_arc_point_2(*pt); - v = CGAL::internal::intersection(support, l2, CK()); - const Point_2 *pt2 = CGAL::internal::intersect_get(v); + v = CGAL::Intersections::internal::intersection(support, l2, CK()); + const Point_2 *pt2 = CGAL::Intersections::internal::intersect_get(v); CGAL_assertion(pt2 != NULL); _end = Circular_arc_point_2(*pt2); reset_flags(); diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h index 40758b51b4a..551fb6fd963 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h @@ -508,7 +508,7 @@ namespace CircularFunctors { template result_type operator()(const T1& t1, const T2& t2) const - { return internal::do_intersect(t1, t2, CK()); } + { return Intersections::internal::do_intersect(t1, t2, CK()); } }; template < class CK > diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h index bd39cf5b175..f2293257eb6 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h @@ -54,7 +54,7 @@ circle_intersect( const typename CK::Circle_2 & c1, // the circles intersect const std::pair* - result = internal::intersect_get > (*it); + result = Intersections::internal::intersect_get > (*it); if ( result->second == 2 ) // double solution return result->first; @@ -63,7 +63,7 @@ circle_intersect( const typename CK::Circle_2 & c1, return result->first; ++it; - result = internal::intersect_get > (*it); + result = Intersections::internal::intersect_get > (*it); return result->first; } diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h index d0ca21dba38..ad82a932929 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h @@ -488,10 +488,10 @@ namespace CircularFunctors { } typename Intersection_traits::result_type - v = CGAL::internal::intersection(a1.supporting_line(), a2.supporting_line(), CK()); + v = CGAL::Intersections::internal::intersection(a1.supporting_line(), a2.supporting_line(), CK()); if(!v) return res; - const Point_2 *pt = CGAL::internal::intersect_get(v); + const Point_2 *pt = CGAL::Intersections::internal::intersect_get(v); if(pt == NULL) return res; Circular_arc_point_2 intersect_point = Circular_arc_point_2(*pt); // (Root_for_circles_2_2(Root_of_2(pt->x()),Root_of_2(pt->y()))); diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h b/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h index 37ba0d3e874..fcc0a32b932 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h @@ -48,7 +48,8 @@ intersection(const A &c1, const B &c2, OutputIterator res) \ { \ return typename K::Intersect_2()(c1, c2, res); \ } \ -namespace internal { \ +namespace Intersections { \ + namespace internal { \ template \ inline \ bool \ @@ -59,6 +60,7 @@ namespace internal { \ return !res.empty(); \ } \ } \ + } \ template \ inline \ bool \ diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h index 9e5fec4b652..295877da4e6 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h @@ -130,8 +130,8 @@ namespace CGAL { intersect_3(circle,plane,std::back_inserter(inters)); CGAL_kernel_precondition(inters.size()==2); const std::pair* pt[2]={NULL,NULL}; - pt[0]=CGAL::internal::intersect_get >(inters[0]); - pt[1]=CGAL::internal::intersect_get >(inters[1]); + pt[0]=CGAL::Intersections::internal::intersect_get >(inters[0]); + pt[1]=CGAL::Intersections::internal::intersect_get >(inters[1]); CGAL_kernel_precondition(pt[0]!=NULL); CGAL_kernel_precondition(pt[1]!=NULL); diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h index 717f9116c83..5ec837de728 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h @@ -103,12 +103,12 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution& sol=*CGAL::internal::intersect_get(solutions[0]); + const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(ca,sol.first,true)) *res++ = solutions[0]; } else { - const Solution& sol1=*CGAL::internal::intersect_get(solutions[0]); - const Solution& sol2=*CGAL::internal::intersect_get(solutions[1]); + const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(ca,sol1.first,true)) *res++ = solutions[0]; if(SK().has_on_3_object()(ca,sol2.first,true)) @@ -140,12 +140,12 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution& sol=*CGAL::internal::intersect_get(solutions[0]); + const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(ca,sol.first,true)) *res++ = solutions[0]; } else { - const Solution& sol1=*CGAL::internal::intersect_get(solutions[0]); - const Solution& sol2=*CGAL::internal::intersect_get(solutions[1]); + const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(ca,sol1.first,true)) *res++ = solutions[0]; if(SK().has_on_3_object()(ca,sol2.first,true)) @@ -178,12 +178,12 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution& sol=*CGAL::internal::intersect_get(solutions[0]); + const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(c,sol.first,true)) *res++ = solutions[0]; } else { - const Solution& sol1=*CGAL::internal::intersect_get(solutions[0]); - const Solution& sol2=*CGAL::internal::intersect_get(solutions[1]); + const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(c,sol1.first,true)) *res++ = solutions[0]; if(SK().has_on_3_object()(c,sol2.first,true)) @@ -215,12 +215,12 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution& sol=*CGAL::internal::intersect_get(solutions[0]); + const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(ca,sol.first,true)) *res++ = CGAL::internal::sk3_intersection_return(sol); } else { - const Solution& sol1=*CGAL::internal::intersect_get(solutions[0]); - const Solution& sol2=*CGAL::internal::intersect_get(solutions[1]); + const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(ca,sol1.first,true)) *res++ = CGAL::internal::sk3_intersection_return(sol1); if(SK().has_on_3_object()(ca,sol2.first,true)) @@ -247,13 +247,13 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution& sol=*CGAL::internal::intersect_get(solutions[0]); + const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(ca,sol.first,true) && SK().has_on_3_object()(la,sol.first,true)) *res++ = solutions[0]; } else { - const Solution& sol1=*CGAL::internal::intersect_get(solutions[0]); - const Solution& sol2=*CGAL::internal::intersect_get(solutions[1]); + const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(ca,sol1.first,true) && SK().has_on_3_object()(la,sol1.first,true)) *res++ = solutions[0]; @@ -359,13 +359,13 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution& sol=*CGAL::internal::intersect_get(solutions[0]); + const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(a1,sol.first,true) && SK().has_on_3_object()(a2,sol.first,true)) *res++ = solutions[0]; } else { - const Solution& sol1=*CGAL::internal::intersect_get(solutions[0]); - const Solution& sol2=*CGAL::internal::intersect_get(solutions[1]); + const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(a1,sol1.first,true) && SK().has_on_3_object()(a2,sol1.first,true)) *res++ = solutions[0]; @@ -481,8 +481,8 @@ namespace CGAL { //one endpoint is extremal: just split the arc if (nb_extrem==1){ const std::pair* pt[2]={NULL,NULL}; - pt[0]=CGAL::internal::intersect_get >(inters[0]); - pt[1]=CGAL::internal::intersect_get >(inters[1]); + pt[0]=CGAL::Intersections::internal::intersect_get >(inters[0]); + pt[1]=CGAL::Intersections::internal::intersect_get >(inters[1]); CGAL_kernel_precondition(pt[0]!=NULL); CGAL_kernel_precondition(pt[1]!=NULL); const typename SK::Circular_arc_point_3& midpt=(arc.source()==pt[0]->first || arc.target()==pt[0]->first)?pt[1]->first:pt[0]->first; @@ -496,7 +496,7 @@ namespace CGAL { //only one intersection points if (inters.size()==1){ const std::pair* midpt=NULL; - midpt=CGAL::internal::intersect_get >(inters[0]); + midpt=CGAL::Intersections::internal::intersect_get >(inters[0]); CGAL_kernel_precondition(midpt!=NULL); *out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),arc.source(),midpt->first); *out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),midpt->first,arc.target()); @@ -505,8 +505,8 @@ namespace CGAL { //three arcs are defined by two intersection points const std::pair* pt[2]={NULL,NULL}; - pt[0]=CGAL::internal::intersect_get >(inters[0]); - pt[1]=CGAL::internal::intersect_get >(inters[1]); + pt[0]=CGAL::Intersections::internal::intersect_get >(inters[0]); + pt[1]=CGAL::Intersections::internal::intersect_get >(inters[1]); CGAL_kernel_precondition(pt[0]!=NULL); CGAL_kernel_precondition(pt[1]!=NULL); @@ -590,16 +590,16 @@ namespace CGAL { CGAL_kernel_precondition(!inters.empty()); if (inters.size()==1){ const typename SK::Circular_arc_point_3& pt= - CGAL::internal::intersect_get >(inters[0])->first; + CGAL::Intersections::internal::intersect_get >(inters[0])->first; return pt; } CGAL_kernel_precondition(classify_circle_3(arc.supporting_circle(),sphere)!=NORMAL); const typename SK::Circular_arc_point_3& pts1 = - CGAL::internal::intersect_get >(inters[0])->first; + CGAL::Intersections::internal::intersect_get >(inters[0])->first; const typename SK::Circular_arc_point_3& pts2 = - CGAL::internal::intersect_get >(inters[1])->first; + CGAL::Intersections::internal::intersect_get >(inters[1])->first; //either a polar (1 pole + 1 pt) or a threaded circle (2 pts with theta-coord = +/- pi) diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h index 9a8858dc0fa..2c2e7b8c803 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h @@ -101,12 +101,12 @@ namespace CGAL { if(!o) return res; - if(const Point_3* inters_p = CGAL::internal::intersect_get(o)) { + if(const Point_3* inters_p = CGAL::Intersections::internal::intersect_get(o)) { Circular_arc_point_3 p = *inters_p; if(!SK().has_on_3_object()(l1,p,true)) return res; if(!SK().has_on_3_object()(l2,p,true)) return res; *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(p,1u)); - } else if( CGAL::internal::intersect_get(o) ) { + } else if( CGAL::Intersections::internal::intersect_get(o) ) { if(SK().compare_xyz_3_object()(l1.lower_xyz_extremity(), l2.lower_xyz_extremity()) < 0) { int comparison = @@ -167,9 +167,9 @@ namespace CGAL { if(!o) return res; - if(const Line_3* inters_l = CGAL::internal::intersect_get(o)) { + if(const Line_3* inters_l = CGAL::Intersections::internal::intersect_get(o)) { *res++ = CGAL::internal::sk3_intersection_return(la); - } else if(const Point_3* inters_p = CGAL::internal::intersect_get(o)) { + } else if(const Point_3* inters_p = CGAL::Intersections::internal::intersect_get(o)) { Circular_arc_point_3 p = *inters_p; if(!SK().has_on_3_object()(la,p,true)) return res; *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(p,1u)); @@ -195,12 +195,12 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution* sol = CGAL::internal::intersect_get(solutions[0]); + const Solution* sol = CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(l,(*sol).first,true)) *res++ = solutions[0]; } else { - const Solution* sol1 = CGAL::internal::intersect_get(solutions[0]); - const Solution* sol2 = CGAL::internal::intersect_get(solutions[1]); + const Solution* sol1 = CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution* sol2 = CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(l,(*sol1).first,true)) *res++ = solutions[0]; @@ -226,12 +226,12 @@ namespace CGAL { std::back_inserter(solutions) ); if(solutions.size() == 0) return res; if(solutions.size() == 1) { - const Solution* sol = CGAL::internal::intersect_get(solutions[0]); + const Solution* sol = CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(l,(*sol).first,true)) *res++ = solutions[0]; } else { - const Solution* sol1 = CGAL::internal::intersect_get(solutions[0]); - const Solution* sol2 = CGAL::internal::intersect_get(solutions[1]); + const Solution* sol1 = CGAL::Intersections::internal::intersect_get(solutions[0]); + const Solution* sol2 = CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(l,(*sol1).first,true)) *res++ = solutions[0]; if(SK().has_on_3_object()(l,(*sol2).first,true)) @@ -257,7 +257,7 @@ namespace CGAL { if(!o) return res; - if((sol = CGAL::internal::intersect_get(o))) { + if((sol = CGAL::Intersections::internal::intersect_get(o))) { if(!SK().has_on_3_object()(l,*sol)) return res; Circular_arc_point_3 point = sol; *res++ = result_type(std::make_pair(point,1u)); diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h index 4c0936086ee..81c43824786 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h @@ -336,7 +336,7 @@ namespace CGAL { typename Intersection_traits::result_type v = SK().intersect_3_object()(s1, s2); if(!v) return res; - if(const Point_3* p = CGAL::internal::intersect_get(v)) { + if(const Point_3* p = CGAL::Intersections::internal::intersect_get(v)) { if(SK().has_on_3_object()(s3, *p)) { #if CGAL_INTERSECTION_VERSION < 2 *res++ = make_object(std::make_pair(Circular_arc_point_3(*p),2u)); @@ -346,7 +346,7 @@ namespace CGAL { } return res; } - if(const Circle_3* c = CGAL::internal::intersect_get(v)) { + if(const Circle_3* c = CGAL::Intersections::internal::intersect_get(v)) { if(SK().has_on_3_object()(s3, *c)) { #if CGAL_INTERSECTION_VERSION < 2 *res++ = make_object(*c); diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_2.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_2.h index 2deb02212e4..86345327149 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_2.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_2.h @@ -69,19 +69,19 @@ public: result_type operator()(const Segment_2 &s, const Segment_2& t) const { - return internal::do_intersect(s,t, SFK()); + return Intersections::internal::do_intersect(s,t, SFK()); } result_type operator()(const Point_2 &p, const Segment_2& t) const { - return internal::do_intersect(p,t, SFK()); + return Intersections::internal::do_intersect(p,t, SFK()); } result_type operator()(const Segment_2& t, const Point_2 &p) const { - return internal::do_intersect(p,t, SFK()); + return Intersections::internal::do_intersect(p,t, SFK()); } }; 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 5f51183e530..38f40dc4627 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 @@ -89,13 +89,13 @@ public: result_type operator()(const Segment_3 &s, const Triangle_3& t) const { - return internal::do_intersect(t,s, SFK()); + return Intersections::internal::do_intersect(t,s, SFK()); } result_type operator()(const Triangle_3& t, const Segment_3 &s) const { - return internal::do_intersect(t,s, SFK()); + return Intersections::internal::do_intersect(t,s, SFK()); } result_type @@ -124,7 +124,7 @@ public: CGAL_BRANCH_PROFILER_BRANCH_1(tmp); const Uncertain ub = - do_intersect_bbox_segment_aux + Intersections::internal::do_intersect_bbox_segment_aux ub = - do_intersect_bbox_segment_aux + Intersections::internal::do_intersect_bbox_segment_aux namespace CGAL { + +namespace Intersections { namespace internal { @@ -49,6 +51,7 @@ do_intersect(const typename K::Circle_2 & circ1, } } // namespace internal +} // namespace Intersections template inline diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index aaf0c51d280..023be6ea504 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -143,6 +143,8 @@ template class IT : public Intersection_traits< typename Kernel_traits::Kernel, CGAL::Bbox_3, B > { }; + +namespace Intersections { namespace internal { // this function is used to call either make_object or a @@ -246,8 +248,9 @@ do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) { return Kernel().do_intersect_d_object()(a, b); } -} // internal - +} // namespace internal +} // namespace Intersections + // See overloads in the respective header files // template 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 3592deca591..69b5fe48c17 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 @@ -34,6 +34,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -349,6 +351,7 @@ intersection(const typename K::Triangle_2 &tr1, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Triangle_2, 2) 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 6677e951f39..5d09843c210 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 @@ -31,6 +31,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -89,6 +91,7 @@ do_intersect(const typename K::Iso_rectangle_2 &irect1, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Iso_rectangle_2, 2) 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 70cc67ce43d..89962f3cc78 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 @@ -38,6 +38,8 @@ namespace CGAL { + +namespace Intersections { namespace internal { @@ -219,6 +221,7 @@ intersection(const typename K::Iso_rectangle_2 &iso, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Line_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Line_2, Iso_rectangle_2, 2) 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 8748f689415..74eb65e427a 100644 --- a/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h @@ -35,6 +35,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -202,6 +204,7 @@ Line_2_Line_2_pair::intersection_line() const } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Line_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Line_2, 2) 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 1818e1e7c91..23572783234 100644 --- a/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h @@ -37,6 +37,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -194,6 +196,7 @@ intersection(const typename K::Triangle_2 &tr, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Line_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Line_2, Triangle_2, 2) 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 bbe234b9eed..956ebf55044 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 @@ -32,6 +32,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -79,6 +81,7 @@ intersection(const typename K::Iso_rectangle_2 &iso, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Point_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Iso_rectangle_2, 2) 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 b57a8bfcb78..b954a0d018b 100644 --- a/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h @@ -32,6 +32,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -77,6 +79,8 @@ intersection(const typename K::Line_2 &line, } } // namespace internal +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Point_2, Line_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Line_2, 2) 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 70d8e9e4d13..83605ab047f 100644 --- a/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h @@ -31,6 +31,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -55,6 +57,7 @@ intersection(const typename K::Point_2 &pt1, } }// namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Point_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Point_2, 2) 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 3a6e6ec1b1d..a2bad20e465 100644 --- a/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h @@ -32,6 +32,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -81,6 +83,7 @@ intersection(const typename K::Ray_2 &ray, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Point_2, Ray_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Ray_2, 2) 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 47563eb2003..247a5fd631d 100644 --- a/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h @@ -32,6 +32,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -82,6 +84,8 @@ intersection( const typename K::Segment_2 &seg, } } // namespace internal +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Point_2, Segment_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Segment_2, 2) 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 6e4b25e9d32..6596fd8f807 100644 --- a/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h @@ -36,6 +36,8 @@ namespace CGAL { +namespace Intersections { + namespace internal { template @@ -158,6 +160,7 @@ intersection(const typename K::Triangle_2 &tr, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Point_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Triangle_2, 2) 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 8a862b153dd..9077a9876e8 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 @@ -38,6 +38,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -206,6 +208,7 @@ Ray_2_Iso_rectangle_2_pair::intersection_point() const } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Ray_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Ray_2, Iso_rectangle_2, 2) 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 ca9ca2308fb..0d7b75a7b74 100644 --- a/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h @@ -36,6 +36,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -166,6 +168,7 @@ Ray_2_Line_2_pair::intersection_ray() const } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Ray_2, Line_2, 2) CGAL_DO_INTERSECT_FUNCTION(Ray_2, Line_2, 2) 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 2ef90d97dc9..36c6bc87c85 100644 --- a/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h @@ -38,6 +38,8 @@ namespace CGAL { + +namespace Intersections { namespace internal { @@ -257,6 +259,7 @@ intersection(const typename K::Ray_2 &ray1, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Ray_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_2, 2) 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 07630d0ae79..bb0c62f124d 100644 --- a/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h @@ -38,6 +38,8 @@ namespace CGAL { + +namespace Intersections { namespace internal { @@ -269,6 +271,7 @@ intersection(const typename K::Segment_2 &seg, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Ray_2, Segment_2, 2) CGAL_DO_INTERSECT_FUNCTION(Ray_2, Segment_2, 2) 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 740f9c42d77..464ac4e8873 100644 --- a/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h @@ -38,6 +38,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -200,6 +202,7 @@ inline bool do_intersect( } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Ray_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Ray_2, Triangle_2, 2) 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 7b85db690b2..22e7a5c77e2 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 @@ -38,6 +38,9 @@ namespace CGAL { + +namespace Intersections { + namespace internal { template @@ -232,6 +235,7 @@ inline bool do_intersect( } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Segment_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Segment_2, Iso_rectangle_2, 2) 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 6eb9459dd65..0d89cbab814 100644 --- a/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h @@ -36,6 +36,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -159,6 +161,7 @@ Segment_2_Line_2_pair::intersection_segment() const } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Segment_2, Line_2, 2) CGAL_DO_INTERSECT_FUNCTION(Segment_2, Line_2, 2) 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 216ebdaff4c..36c92a5d851 100644 --- a/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h @@ -38,6 +38,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -453,6 +455,7 @@ intersection(const typename K::Segment_2 &seg1, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Segment_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_2, 2) 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 1de8852547d..3a503280859 100644 --- a/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h @@ -37,6 +37,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -198,6 +200,7 @@ inline bool do_intersect( } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Segment_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Segment_2, Triangle_2, 2) diff --git a/Intersections_2/include/CGAL/Straight_2.h b/Intersections_2/include/CGAL/Straight_2.h index 5c9553ddf5d..fda94e29c3a 100644 --- a/Intersections_2/include/CGAL/Straight_2.h +++ b/Intersections_2/include/CGAL/Straight_2.h @@ -32,6 +32,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -267,8 +269,8 @@ sign_of_cross(typename K::Direction_2 const &dir1, typename K::Direction_2 const &dir2, const K&) { - return static_cast(internal::orientation(dir1.to_vector(), - dir2.to_vector(), K())); + return static_cast(CGAL::internal::orientation(dir1.to_vector(), + dir2.to_vector(), K())); } template @@ -351,6 +353,7 @@ collinear_order(typename K::Point_2 const &pt1, typename K::Point_2 const & pt2) } } // namespace internal +} // namespace Intersections } //namespace CGAL 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 1e6a4c4e269..7efb9394e8d 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 @@ -34,7 +34,11 @@ #include -namespace CGAL{ namespace internal { +namespace CGAL{ + +namespace Intersections { + +namespace internal { template typename Intersection_traits::result_type @@ -331,6 +335,7 @@ namespace CGAL{ namespace internal { } } //namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Triangle_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Triangle_2, Iso_rectangle_2, 2) 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 23c752a5897..44436433e6f 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 @@ -26,8 +26,8 @@ #include namespace CGAL { - - + +namespace Intersections { namespace internal { @@ -172,6 +172,7 @@ bool do_intersect(const typename K::Triangle_2 &t1, } } // namespace internal +} // namespace Intersections CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_2, 2) 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 95a99e8e141..face86587cd 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 @@ -224,6 +224,7 @@ CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_cuboid_3, 3) CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Line_3, 3) +namespace Intersections { namespace internal { template @@ -1750,5 +1751,5 @@ do_intersect(const Iso_cuboid_3 &j, const Line_3 &l, const R&) } } // namespace internal - -} //namespace CGAL +} // namespace Intersections +} // namespace CGAL diff --git a/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h index a58491fb494..2255d0551a8 100644 --- a/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Iso_cuboid_3_intersection.h @@ -27,7 +27,7 @@ #include namespace CGAL { - +namespace Intersections { namespace internal { template @@ -74,7 +74,8 @@ intersection(const typename K::Iso_cuboid_3 &iso, } } // namespace internal - +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Point_3, Iso_cuboid_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Iso_cuboid_3, 3) diff --git a/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h index b2906fa59d2..eb82c52c7a1 100644 --- a/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Line_3_intersection.h @@ -27,6 +27,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -72,7 +74,8 @@ intersection(const typename K::Line_3 &line, } } // namespace internal - +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Point_3, Line_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Line_3, 3) diff --git a/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h index f3d09b82ab2..6080ae98a8c 100644 --- a/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Plane_3_intersection.h @@ -27,6 +27,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -72,6 +74,7 @@ intersection(const typename K::Plane_3 &plane, } } // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Point_3, Plane_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Plane_3, 3) diff --git a/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h index dfd3744f195..8ccfb5a29ee 100644 --- a/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Point_3_intersection.h @@ -26,6 +26,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -51,7 +53,8 @@ intersection(const typename K::Point_3 &pt1, return intersection_return(); } -}// namespace internal +} // namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Point_3, 3) CGAL_DO_INTERSECT_FUNCTION_SELF(Point_3, 3) diff --git a/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h index 91c4f557989..0ec8b0f2bd7 100644 --- a/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Ray_3_intersection.h @@ -27,6 +27,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -76,7 +78,8 @@ intersection(const typename K::Ray_3 &ray, } } // namespace internal - +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Point_3, Ray_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Ray_3, 3) diff --git a/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h index 0873b0d76b1..89f8de6ff4a 100644 --- a/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/Point_3_Segment_3_intersection.h @@ -27,6 +27,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -77,7 +79,8 @@ intersection( const typename K::Segment_3 &seg, } } // namespace internal - +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Point_3, Segment_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Segment_3, 3) 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 c73b2d12486..d5a08becbae 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 @@ -34,6 +34,9 @@ namespace CGAL { template class Line_3; + +namespace Intersections { + namespace internal { template @@ -117,7 +120,8 @@ bool do_intersect(const typename K::Line_3 &l, } } // namespace internal - +} // namespace Intersections + CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Line_3, 3) } //namespace CGAL 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 ac785f0ce97..b4386fa6b93 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 @@ -34,6 +34,8 @@ namespace CGAL { template class Plane_3; +namespace Intersections { + namespace internal { template @@ -81,7 +83,8 @@ bool do_intersect(const typename K::Plane_3 &h, } // namespace internal - +} // namespace Intersections + CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Plane_3, 3) } //namespace CGAL 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 4ec47ab0b7c..ae3d38d9da6 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 @@ -35,6 +35,8 @@ namespace CGAL { template class Point_3; +namespace Intersections { + namespace internal { template @@ -103,7 +105,7 @@ bool do_intersect(const typename K::Point_3 &p, } // namespace internal - +} // namespace Intersections CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Point_3, 3) 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 93864cfdf60..b00d872a9d8 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 @@ -34,6 +34,8 @@ namespace CGAL { template class Ray_3; + +namespace Intersections { namespace internal { namespace R3T3_intersection{ @@ -380,7 +382,8 @@ do_intersect_coplanar(const typename K::Triangle_3 &t, } // namespace internal - +} // namespace Intersections + CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Ray_3, 3) } //namespace CGAL 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 3cac5f89d7a..1a76711bca4 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 @@ -34,6 +34,8 @@ namespace CGAL { template class Segment_3; +namespace Intersections { + namespace internal { template @@ -329,7 +331,8 @@ bool do_intersect(const typename K::Segment_3 &s, } } // namespace internal - +} // namespace Intersections + CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Segment_3, 3) } //namespace CGAL 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 708170b7370..e7ad745a4a0 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 @@ -35,6 +35,8 @@ namespace CGAL { template class Tetrahedron_3; +namespace Intersections { + namespace internal { template @@ -181,7 +183,8 @@ 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) 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 12dbbe6b92a..9a0ee416c1e 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 @@ -31,6 +31,8 @@ namespace CGAL { template class Triangle_3; + +namespace Intersections { namespace internal { @@ -450,7 +452,8 @@ do_intersect(const typename K::Triangle_3 &t1, } } // namespace internal - +} // namespace Intersections + CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_3, 3) } //namespace CGAL 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 1035e367c2b..397aa9d57b2 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h @@ -34,6 +34,8 @@ namespace CGAL { template class Triangle_3; + +namespace Intersections { namespace internal{ @@ -226,8 +228,9 @@ intersection( return intersection_return(); } -}//namespace internal - +} //namespace internal +} // namespace Intersections + 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 1351e9650f8..f5a197d144d 100644 --- a/Intersections_3/include/CGAL/bbox_intersection_3.h +++ b/Intersections_3/include/CGAL/bbox_intersection_3.h @@ -32,6 +32,9 @@ namespace CGAL { +namespace Intersections { + + namespace internal { // This function intersects a bbox with a ray, line or segment // Its essentially a copy of the function that was in Bbox_3_intersections.cpp // But it must be a template function since the original kernel must be @@ -187,6 +190,8 @@ intersection_bl(const Bbox_3 &box, #endif } +} // namespace internal +} // namespace Intersections } //namespace CGAL diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h index cb931b1524f..e9b9a042151 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h @@ -27,6 +27,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -45,7 +47,7 @@ namespace internal { } } // namespace internal - +} // namespace Intersections template 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 fc57c9d0ad6..440a652a567 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 @@ -30,6 +30,8 @@ // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf namespace CGAL { + +namespace Intersections { namespace internal { @@ -155,7 +157,8 @@ namespace internal { } // namespace internal - +} // namespace Intersections + template bool do_intersect(const CGAL::Bbox_3 a, const Line_3& b) { 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 d6b6d5dc317..620962bda90 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 @@ -30,6 +30,8 @@ // Opcode like namespace CGAL { + +namespace Intersections { namespace internal { @@ -150,7 +152,8 @@ namespace internal { } } // namespace internal - +} // namespace Intersections + template bool do_intersect(const CGAL::Bbox_3 a, const Plane_3& b) { 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 55a9b05c45f..009962c1b26 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 @@ -32,6 +32,8 @@ // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf namespace CGAL { + +namespace Intersections { namespace internal { @@ -64,8 +66,10 @@ namespace internal { const K&) { return do_intersect(ray, bbox, K()); } + } // namespace internal - +} // namespace Intersections + template bool do_intersect(const CGAL::Bbox_3 a, const Ray_3& b) { 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 ad2b94c6541..0b52c5d5ab2 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 @@ -44,6 +44,8 @@ // [t1, t2] intersects [0, 1]. namespace CGAL { + +namespace Intersections { namespace internal { @@ -458,7 +460,8 @@ namespace internal { } } // namespace internal - +} // namespace Intersections + template bool do_intersect(const CGAL::Bbox_3 a, const Segment_3& b) { 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 c23e07c05df..efbfcf830d7 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 @@ -30,6 +30,8 @@ namespace CGAL { + +namespace Intersections { namespace internal { @@ -115,7 +117,8 @@ namespace internal { } } // namespace internal - +} // namespace Intersections + template bool do_intersect(const CGAL::Bbox_3& a, const Sphere_3& b) { 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 6434be6a00e..e8ea3ccb01a 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 @@ -36,6 +36,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -396,7 +398,8 @@ namespace internal { } } // namespace internal - +} // namespace Intersections + template bool do_intersect(const CGAL::Bbox_3& a, const Triangle_3& b) { diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h index ac7d67c9f21..470f6673801 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h @@ -32,6 +32,8 @@ // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf namespace CGAL { + +namespace Intersections { namespace internal { @@ -65,7 +67,9 @@ namespace internal { const K&) { return do_intersect(ray, ic, K()); } + } // namespace internal +} // namespace Intersections template bool do_intersect(const Iso_cuboid_3 a, diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h index 92772a57597..23f42e89277 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h @@ -32,6 +32,8 @@ // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf namespace CGAL { + +namespace Intersections { namespace internal { @@ -65,8 +67,10 @@ namespace internal { const K&) { return do_intersect(seg, ic, K()); } + } // namespace internal - +} // namespace Intersections + template bool do_intersect(const Iso_cuboid_3 a, const Segment_3& b) { diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h index ad8ae9b82c9..a4907ec3ec6 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h @@ -28,6 +28,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -46,10 +48,10 @@ namespace internal { { return do_intersect_sphere_box_3(sphere, ic, K()); } - - + } // namespace internal - +} // namespace Intersections + template bool do_intersect(const Iso_cuboid_3& a, const Sphere_3& b) { diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h index b535f05cf2e..430447124f0 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h @@ -34,6 +34,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -52,7 +54,9 @@ namespace internal { { return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); } + } // namespace internal +} // namespace Intersections template diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h index b9b899c1b43..5d6513cf8f7 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h @@ -29,6 +29,8 @@ #include namespace CGAL { + +namespace Intersections { namespace internal { @@ -70,7 +72,7 @@ bool do_intersect(const typename K::Tetrahedron_3& tet, } } // namespace internal - +} // namespace Intersections template bool do_intersect(const CGAL::Tetrahedron_3& a, 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 a290b1b77d8..5b64f0cf45d 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 @@ -28,6 +28,9 @@ #include namespace CGAL { + +namespace Intersections { + namespace internal { template @@ -420,7 +423,8 @@ intersection(const typename K::Line_3 &l, } // end namespace internal - +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Triangle_3, Line_3, 3) 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 bdf8830f627..716ceb1c090 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 @@ -28,6 +28,9 @@ #include namespace CGAL { + +namespace Intersections { + namespace internal { template @@ -577,11 +580,12 @@ typename Intersection_traits::resu intersection(const typename K::Ray_3 &r, const typename K::Triangle_3 &t, const K& k) { - return CGAL::internal::intersection(t, r, k); + return Intersections::internal::intersection(t, r, k); } } // end namespace internal - +} // namespace Intersections + CGAL_INTERSECTION_FUNCTION(Triangle_3, Ray_3, 3) } // end namespace CGAL 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 31f9fcf7dcf..9a3a4d988df 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 @@ -28,6 +28,9 @@ #include namespace CGAL { + +namespace Intersections { + namespace internal { template @@ -562,6 +565,7 @@ intersection(const typename K::Segment_3 &s, } // end namespace internal +} // namespace Intersections CGAL_INTERSECTION_FUNCTION(Triangle_3, Segment_3, 3) diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h index 4ae4cf82c9c..ad0e36ad2b0 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h @@ -36,6 +36,8 @@ namespace CGAL { template class Line_3; +namespace Intersections { + namespace internal { template @@ -112,8 +114,10 @@ do_intersect(const typename K::Segment_3 &lin, { return squared_distance(sp.center(), lin) <= sp.squared_radius(); } + } // 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) diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 0ff0de5764b..faec518f1cc 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -2933,7 +2933,7 @@ namespace CommonKernelFunctors { template result_type operator()(const T1& t1, const T2& t2) const - { return internal::do_intersect(t1, t2, K()); } + { return Intersections::internal::do_intersect(t1, t2, K()); } }; template @@ -2946,11 +2946,11 @@ namespace CommonKernelFunctors { template result_type operator()(const T1& t1, const T2& t2) const - { return internal::do_intersect(t1, t2, K()); } + { return Intersections::internal::do_intersect(t1, t2, K()); } result_type operator()(const typename K::Plane_3& pl1, const typename K::Plane_3& pl2, const typename K::Plane_3& pl3) const - { return internal::do_intersect(pl1, pl2, pl3, K() ); } + { return Intersections::internal::do_intersect(pl1, pl2, pl3, K() ); } }; @@ -3478,7 +3478,7 @@ namespace CommonKernelFunctors { template typename Intersection_traits::result_type operator()(const T1& t1, const T2& t2) const - { return internal::intersection(t1, t2, K()); } + { return Intersections::internal::intersection(t1, t2, K()); } }; template @@ -3511,7 +3511,7 @@ namespace CommonKernelFunctors { template typename cpp11::result_of< Intersect_3(T1, T2) >::type operator()(const T1& t1, const T2& t2) const - { return internal::intersection(t1, t2, K() ); } + { return Intersections::internal::intersection(t1, t2, K() ); } #if CGAL_INTERSECTION_VERSION < 2 CGAL::Object @@ -3519,7 +3519,7 @@ namespace CommonKernelFunctors { typename boost::optional< boost::variant< typename K::Point_3, typename K::Line_3, typename K::Plane_3 > > #endif operator()(const Plane_3& pl1, const Plane_3& pl2, const Plane_3& pl3)const - { return internal::intersection(pl1, pl2, pl3, K() ); } + { return Intersections::internal::intersection(pl1, pl2, pl3, K() ); } }; template From 0aa314d03a4be730afcf2e6321a7d95ba656105a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 17 Feb 2018 12:51:49 +0000 Subject: [PATCH 14/48] Don't include an internal file --- Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp b/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp index 07e3ae302bd..7264fb8f89b 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp +++ b/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include From bf55dcd69c50b14024a8121a58a0834109c738e2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 17 Feb 2018 13:45:23 +0000 Subject: [PATCH 15/48] Cleanup in Intersections_2 --- .../include/CGAL/Bbox_2_intersection.h | 33 ------------------- .../CGAL/{ => Intersections_2}/Straight_2.h | 0 .../CGAL/Line_2_Triangle_2_intersection.h | 2 +- .../CGAL/Point_2_Triangle_2_intersection.h | 2 +- .../CGAL/Ray_2_Triangle_2_intersection.h | 2 +- .../CGAL/Segment_2_Triangle_2_intersection.h | 2 +- 6 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 Intersections_2/include/CGAL/Bbox_2_intersection.h rename Intersections_2/include/CGAL/{ => Intersections_2}/Straight_2.h (100%) diff --git a/Intersections_2/include/CGAL/Bbox_2_intersection.h b/Intersections_2/include/CGAL/Bbox_2_intersection.h deleted file mode 100644 index 1b345b4b981..00000000000 --- a/Intersections_2/include/CGAL/Bbox_2_intersection.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - - - -#ifndef CGAL_BBOX_2_INTERSECTIONS_H -#define CGAL_BBOX_2_INTERSECTIONS_H - -#include -#include -#endif // CGAL_BBOX_2_INTERSECTIONS_H diff --git a/Intersections_2/include/CGAL/Straight_2.h b/Intersections_2/include/CGAL/Intersections_2/Straight_2.h similarity index 100% rename from Intersections_2/include/CGAL/Straight_2.h rename to Intersections_2/include/CGAL/Intersections_2/Straight_2.h 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 23572783234..5a92f8b127b 100644 --- a/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include 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 6596fd8f807..987d26a2959 100644 --- a/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include namespace CGAL { 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 464ac4e8873..db8e1c2e0ae 100644 --- a/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include namespace CGAL { 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 3a503280859..06a824d8c33 100644 --- a/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include namespace CGAL { From ffb13b07d697a4ff9f38c5c7a337dff591d419d2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 17 Feb 2018 15:53:45 +0000 Subject: [PATCH 16/48] Remove some functions added by Maxime --- .../Intersections_3/intersection_3_1_impl.h | 48 ------------------- 1 file changed, 48 deletions(-) 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 face86587cd..511fd048bfd 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 @@ -155,54 +155,6 @@ intersection(const Bbox_3 &a, return K().intersect_3_object()(a, b); } -template -inline typename -cpp11::result_of::type -intersection(const typename K::Point_3 &a, - const typename K::Iso_cuboid_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const typename K::Point_3 &a, - const typename K::Line_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const typename K::Point_3 &a, - const typename K::Ray_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const typename K::Point_3 &a, - const typename K::Segment_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const typename K::Point_3 &a, - const typename K::Point_3 &b) { - return K().intersect_3_object()(a, b); -} - -template -inline typename -cpp11::result_of::type -intersection(const typename K::Point_3 &a, - const typename K::Plane_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) From 09c7fe11037019b41719260efdafbe6cc99aeac7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 17 Feb 2018 16:14:51 +0000 Subject: [PATCH 17/48] move purely internal files --- .../CGAL/{ => Intersections_3/internal}/bbox_intersection_3.h | 0 .../Intersections_3/{ => internal}/intersection_3_1_impl.h | 0 Intersections_3/include/CGAL/intersection_3_1.h | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename Intersections_3/include/CGAL/{ => Intersections_3/internal}/bbox_intersection_3.h (100%) rename Intersections_3/include/CGAL/Intersections_3/{ => internal}/intersection_3_1_impl.h (100%) diff --git a/Intersections_3/include/CGAL/bbox_intersection_3.h b/Intersections_3/include/CGAL/Intersections_3/internal/bbox_intersection_3.h similarity index 100% rename from Intersections_3/include/CGAL/bbox_intersection_3.h rename to Intersections_3/include/CGAL/Intersections_3/internal/bbox_intersection_3.h diff --git a/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h b/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h similarity index 100% rename from Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h rename to Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h diff --git a/Intersections_3/include/CGAL/intersection_3_1.h b/Intersections_3/include/CGAL/intersection_3_1.h index 3d6a6338ade..b8b607d3500 100644 --- a/Intersections_3/include/CGAL/intersection_3_1.h +++ b/Intersections_3/include/CGAL/intersection_3_1.h @@ -28,7 +28,7 @@ #ifndef CGAL_INTERSECTION_3_1_H #define CGAL_INTERSECTION_3_1_H -#include -#include +#include +#include #endif // CGAL_INTERSECTION_3_1_H From 4111e3e20ca2d1d7f690019a3cf9b0a2caa1c142 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 20 Feb 2018 16:48:11 +0000 Subject: [PATCH 18/48] Reorganize header files --- .../internal/Static_filters/Do_intersect_3.h | 2 +- .../include/CGAL/Intersection_traits.h | 10 ++ .../include/CGAL/Intersection_traits_3.h | 100 +++++++++++++++++ .../Iso_cuboid_3_Point_3.h} | 6 +- .../Line_3_Point_3.h} | 6 +- .../Plane_3_Point_3.h} | 6 +- .../Point_3_Point_3.h} | 6 +- .../Point_3_Ray_3.h} | 6 +- .../Point_3_Segment_3.h} | 6 +- .../Point_3_Triangle_3.h} | 30 ++++- .../internal}/Bbox_3_Bbox_3_do_intersect.h | 3 + .../Bbox_3_Iso_cuboid_3_do_intersect.h | 15 --- .../internal}/Bbox_3_Line_3_do_intersect.h | 14 --- .../internal}/Bbox_3_Plane_3_do_intersect.h | 25 ----- .../internal}/Bbox_3_Ray_3_do_intersect.h | 15 +-- .../internal}/Bbox_3_Segment_3_do_intersect.h | 14 --- .../internal}/Bbox_3_Sphere_3_do_intersect.h | 31 +++--- .../Bbox_3_Triangle_3_do_intersect.h | 16 +-- .../Iso_cuboid_3_Ray_3_do_intersect.h | 15 +-- .../Iso_cuboid_3_Segment_3_do_intersect.h | 15 +-- .../Iso_cuboid_3_Sphere_3_do_intersect.h | 2 +- .../Iso_cuboid_3_Triangle_3_do_intersect.h | 14 +-- .../Tetrahedron_3_Bounded_3_do_intersect.h} | 36 ++---- .../Tetrahedron_3_Unbounded_3_do_intersect.h} | 66 ++++------- .../Triangle_3_Line_3_do_intersect.h | 3 - .../Triangle_3_Line_3_intersection.h | 4 - .../Triangle_3_Plane_3_do_intersect.h | 3 - .../internal}/Triangle_3_Ray_3_do_intersect.h | 3 - .../internal}/Triangle_3_Ray_3_intersection.h | 3 - .../Triangle_3_Segment_3_do_intersect.h | 3 - .../Triangle_3_Segment_3_intersection.h | 4 - .../Triangle_3_Sphere_3_do_intersect.h | 17 +-- .../Triangle_3_Triangle_3_do_intersect.h | 3 - .../Triangle_3_Triangle_3_intersection.h | 4 +- .../internal/intersection_3_1_impl.h | 103 ++---------------- Intersections_3/include/CGAL/intersection_3.h | 99 +++++++++++------ .../test/Intersections_3/CMakeLists.txt | 11 ++ .../Intersections_3/test_intersections_3.cpp | 16 +++ .../test/Intersections_3/triangle_other.cpp | 15 +-- 39 files changed, 331 insertions(+), 419 deletions(-) rename Intersections_3/include/CGAL/{Point_3_Iso_cuboid_3_intersection.h => Intersections_3/Iso_cuboid_3_Point_3.h} (93%) rename Intersections_3/include/CGAL/{Point_3_Line_3_intersection.h => Intersections_3/Line_3_Point_3.h} (94%) rename Intersections_3/include/CGAL/{Point_3_Plane_3_intersection.h => Intersections_3/Plane_3_Point_3.h} (92%) rename Intersections_3/include/CGAL/{Point_3_Point_3_intersection.h => Intersections_3/Point_3_Point_3.h} (92%) rename Intersections_3/include/CGAL/{Point_3_Ray_3_intersection.h => Intersections_3/Point_3_Ray_3.h} (94%) rename Intersections_3/include/CGAL/{Point_3_Segment_3_intersection.h => Intersections_3/Point_3_Segment_3.h} (93%) rename Intersections_3/include/CGAL/{Triangle_3_Point_3_do_intersect.h => Intersections_3/Point_3_Triangle_3.h} (73%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Bbox_3_do_intersect.h (94%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Iso_cuboid_3_do_intersect.h (84%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Line_3_do_intersect.h (93%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Plane_3_do_intersect.h (90%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Ray_3_do_intersect.h (85%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Segment_3_do_intersect.h (97%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Sphere_3_do_intersect.h (86%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Bbox_3_Triangle_3_do_intersect.h (97%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Iso_cuboid_3_Ray_3_do_intersect.h (86%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Iso_cuboid_3_Segment_3_do_intersect.h (86%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Iso_cuboid_3_Sphere_3_do_intersect.h (96%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Iso_cuboid_3_Triangle_3_do_intersect.h (84%) rename Intersections_3/include/CGAL/{Triangle_3_Tetrahedron_3_do_intersect.h => Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h} (82%) rename Intersections_3/include/CGAL/{internal/Intersections_3/Tetrahedron_3_do_intersect.h => Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h} (71%) rename Intersections_3/include/CGAL/{ => Intersections_3/internal}/Triangle_3_Line_3_do_intersect.h (98%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Triangle_3_Line_3_intersection.h (99%) rename Intersections_3/include/CGAL/{ => Intersections_3/internal}/Triangle_3_Plane_3_do_intersect.h (97%) rename Intersections_3/include/CGAL/{ => Intersections_3/internal}/Triangle_3_Ray_3_do_intersect.h (99%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Triangle_3_Ray_3_intersection.h (99%) rename Intersections_3/include/CGAL/{ => Intersections_3/internal}/Triangle_3_Segment_3_do_intersect.h (99%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Triangle_3_Segment_3_intersection.h (99%) rename Intersections_3/include/CGAL/{internal/Intersections_3 => Intersections_3/internal}/Triangle_3_Sphere_3_do_intersect.h (92%) rename Intersections_3/include/CGAL/{ => Intersections_3/internal}/Triangle_3_Triangle_3_do_intersect.h (99%) rename Intersections_3/include/CGAL/{ => Intersections_3/internal}/Triangle_3_Triangle_3_intersection.h (99%) 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 From 92dcb7ca48186001d361b46feb4ec84790665f47 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 20 Feb 2018 16:49:31 +0000 Subject: [PATCH 19/48] Reorganize header files --- .../CGAL/Intersections_3/Bbox_3_Bbox_3.h | 44 +++ .../Intersections_3/Bbox_3_Iso_cuboid_3.h | 52 ++++ .../CGAL/Intersections_3/Bbox_3_Line_3.h | 58 ++++ .../CGAL/Intersections_3/Bbox_3_Plane_3.h | 53 ++++ .../CGAL/Intersections_3/Bbox_3_Point_3.h | 73 +++++ .../CGAL/Intersections_3/Bbox_3_Ray_3.h | 58 ++++ .../CGAL/Intersections_3/Bbox_3_Segment_3.h | 60 +++++ .../CGAL/Intersections_3/Bbox_3_Sphere_3.h | 53 ++++ .../Intersections_3/Bbox_3_Tetrahedron_3.h | 51 ++++ .../CGAL/Intersections_3/Bbox_3_Triangle_3.h | 52 ++++ .../Iso_cuboid_3_Iso_cuboid_3.h | 33 +++ .../Intersections_3/Iso_cuboid_3_Line_3.h | 33 +++ .../Intersections_3/Iso_cuboid_3_Plane_3.h | 34 +++ .../CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h | 34 +++ .../Intersections_3/Iso_cuboid_3_Segment_3.h | 34 +++ .../Intersections_3/Iso_cuboid_3_Sphere_3.h | 38 +++ .../Iso_cuboid_3_Tetrahedron_3.h | 34 +++ .../Intersections_3/Iso_cuboid_3_Triangle_3.h | 33 +++ .../CGAL/Intersections_3/Line_3_Line_3.h | 33 +++ .../CGAL/Intersections_3/Line_3_Plane_3.h | 33 +++ .../CGAL/Intersections_3/Line_3_Ray_3.h | 33 +++ .../CGAL/Intersections_3/Line_3_Segment_3.h | 33 +++ .../CGAL/Intersections_3/Line_3_Sphere_3.h | 33 +++ .../Intersections_3/Line_3_Tetrahedron_3.h | 33 +++ .../CGAL/Intersections_3/Line_3_Triangle_3.h | 34 +++ .../CGAL/Intersections_3/Plane_3_Plane_3.h | 33 +++ .../CGAL/Intersections_3/Plane_3_Ray_3.h | 33 +++ .../CGAL/Intersections_3/Plane_3_Segment_3.h | 33 +++ .../CGAL/Intersections_3/Plane_3_Sphere_3.h | 33 +++ .../Intersections_3/Plane_3_Tetrahedron_3.h | 33 +++ .../CGAL/Intersections_3/Plane_3_Triangle_3.h | 34 +++ .../CGAL/Intersections_3/Point_3_Line_3.h | 88 ++++++ .../CGAL/Intersections_3/Point_3_Sphere_3.h | 88 ++++++ .../Intersections_3/Point_3_Tetrahedron_3.h | 88 ++++++ .../CGAL/Intersections_3/Ray_3_Ray_3.h | 33 +++ .../CGAL/Intersections_3/Ray_3_Segment_3.h | 33 +++ .../CGAL/Intersections_3/Ray_3_Sphere_3.h | 33 +++ .../Intersections_3/Ray_3_Tetrahedron_3.h | 33 +++ .../CGAL/Intersections_3/Ray_3_Triangle_3.h | 34 +++ .../Intersections_3/Segment_3_Segment_3.h | 33 +++ .../CGAL/Intersections_3/Segment_3_Sphere_3.h | 33 +++ .../Intersections_3/Segment_3_Tetrahedron_3.h | 34 +++ .../Intersections_3/Segment_3_Triangle_3.h | 34 +++ .../CGAL/Intersections_3/Sphere_3_Sphere_3.h | 33 +++ .../Intersections_3/Sphere_3_Tetrahedron_3.h | 34 +++ .../Intersections_3/Sphere_3_Triangle_3.h | 34 +++ .../Tetrahedron_3_Tetrahedron_3.h | 34 +++ .../Tetrahedron_3_Triangle_3.h | 33 +++ .../Intersections_3/Triangle_3_Triangle_3.h | 34 +++ Intersections_3/test/Intersections_3/one.cpp | 251 ++++++++++++++++++ 50 files changed, 2275 insertions(+) create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h create mode 100644 Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h create mode 100644 Intersections_3/test/Intersections_3/one.cpp diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h new file mode 100644 index 00000000000..46393c3e123 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h @@ -0,0 +1,44 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_BBOX_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_BBOX_3_H + + +#include + +namespace CGAL { + bool + inline + do_intersect(const CGAL::Bbox_3& c, + const CGAL::Bbox_3& bbox) + { + return CGAL::do_overlap(c, bbox); + } + + void intersection(const CGAL::Bbox_3& c, + const CGAL::Bbox_3& bbox) + {} +} //namespace CGAL + + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_BBOX_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h new file mode 100644 index 00000000000..38c3993a227 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h @@ -0,0 +1,52 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_H + +#include + +namespace CGAL { + +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); +} + + +template +void intersection(const CGAL::Bbox_3&, + const Iso_cuboid_3&) {} + +template +void intersection(const Iso_cuboid_3& a, + const CGAL::Bbox_3& b) {} +} // namespace CGAL + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h new file mode 100644 index 00000000000..0990e21651f --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h @@ -0,0 +1,58 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_LINE_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_LINE_3_H + +#include +#include + +namespace CGAL { + +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); +} + +template +typename Intersection_traits::result_type +intersection(const CGAL::Bbox_3& a, + const Line_3& b) { + return K().intersect_3_object()(a, b); +} + +template +typename Intersection_traits::result_type +intersection(const Line_3& a, + const CGAL::Bbox_3& b) { + return K().intersect_3_object()(a, b); +} +} + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_LINE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h new file mode 100644 index 00000000000..637097ba122 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h @@ -0,0 +1,53 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_PLANE_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_PLANE_3_H + +#include + + +namespace CGAL { + +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); +} + +template +void intersection(const CGAL::Bbox_3&, + const Plane_3&) {} + +template +void intersection(const Plane_3&, + const CGAL::Bbox_3&) {} + +} + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h new file mode 100644 index 00000000000..4bc8cf0ef3b --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h @@ -0,0 +1,73 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_POINT_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_POINT_3_H + +#include +#include +#include + +namespace CGAL { + +template +bool do_intersect(const CGAL::Bbox_3& a, + const Point_3& b) { + Point_3 bl(a.xmin(), a.ymin(),a.zmin()), tr(a.xmax(), a.ymax(),a.zmax()); + + Iso_cuboid_3 ic(bl,tr); + return K().do_intersect_3_object()(ic, b); +} + + +template +bool do_intersect(const Point_3& a, + const CGAL::Bbox_3& b) { + return do_intersect(b,a); +} + + +template +typename Intersection_traits::result_type +intersection(const Point_3& a, + const CGAL::Bbox_3& b + ) { + if (do_intersect(a,b)) { + return Intersections::internal::intersection_return(a); + } + return Intersections::internal::intersection_return(); +} + + +template +typename Intersection_traits::result_type +intersection(const CGAL::Bbox_3& b, + const Point_3& a) { + if (do_intersect(a,b)) { + return Intersections::internal::intersection_return(a); + } + return Intersections::internal::intersection_return(); +} + +} // namespace CGAL + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_POINT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h new file mode 100644 index 00000000000..bdd352ea375 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h @@ -0,0 +1,58 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_RAY_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_RAY_3_H + +#include +#include + +namespace CGAL { + +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); +} + +template +typename Intersection_traits::result_type +intersection(const CGAL::Bbox_3& a, + const Ray_3& b) { + return K().intersect_3_object()(a, b); +} + +template +typename Intersection_traits::result_type +intersection(const Ray_3& a, + const CGAL::Bbox_3& b) { + return K().intersect_3_object()(a, b); +} + +} +#endif // CGAL_INTERSECTIONS_3_BBOX_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h new file mode 100644 index 00000000000..1d93dbebf00 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h @@ -0,0 +1,60 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_SEGMENT_3_H + +#include +#include +#include + +namespace CGAL { + +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); +} + +template +typename Intersection_traits::result_type +intersection(const CGAL::Bbox_3& a, + const Segment_3& b) { + return K().intersect_3_object()(a, b); +} + +template +typename Intersection_traits::result_type +intersection(const Segment_3& a, + const CGAL::Bbox_3& b) { + return K().intersect_3_object()(a, b); +} + +} // namespace CGAL + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h new file mode 100644 index 00000000000..8f21b30cc91 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h @@ -0,0 +1,53 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_H + +#include + +namespace CGAL { + +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); +} + +template +void intersection(const CGAL::Bbox_3&, + const Sphere_3&) {} + +template +void intersection(const Sphere_3&, + const CGAL::Bbox_3&) {} + + +} + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h new file mode 100644 index 00000000000..0db6d0fc310 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h @@ -0,0 +1,51 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + +template +bool do_intersect(const CGAL::Bbox_3& a, + const Tetrahedron_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +bool do_intersect(const Tetrahedron_3& a, + const CGAL::Bbox_3& b) { + return K().do_intersect_3_object()(a, b); +} + +template +void intersection(const CGAL::Bbox_3&, + const Tetrahedron_3&) {} + +template +void intersection(const Tetrahedron_3&, + const CGAL::Bbox_3&) {} +} // namespace CGAL + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h new file mode 100644 index 00000000000..7d6259d2f7e --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h @@ -0,0 +1,52 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H + +#include + +namespace CGAL { + +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); +} + +template +void intersection(const CGAL::Bbox_3&, + const Triangle_3&) {} + +template +void intersection(const Triangle_3&, + const CGAL::Bbox_3&) {} + +} // mnamespace CGAL + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h new file mode 100644 index 00000000000..3513dab8911 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_ISO_CUBOID_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_ISO_CUBOID_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION_SELF(Iso_cuboid_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_cuboid_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_ISO_CUBOID_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h new file mode 100644 index 00000000000..3ded415455e --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_LINE_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_LINE_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3,Line_3, 3) + CGAL_INTERSECTION_FUNCTION(Line_3, Iso_cuboid_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_LINE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h new file mode 100644 index 00000000000..575e77dda5b --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_PLANE_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_PLANE_3_H + +#include + + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Plane_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3, Plane_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h new file mode 100644 index 00000000000..abd69b65333 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_H + +#include +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3,Ray_3, 3) + CGAL_INTERSECTION_FUNCTION(Ray_3, Iso_cuboid_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_ISSO_CUBOID_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h new file mode 100644 index 00000000000..f2a19844edc --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_H + +#include +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3,Segment_3, 3) + CGAL_INTERSECTION_FUNCTION(Segment_3, Iso_cuboid_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h new file mode 100644 index 00000000000..36684276e57 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h @@ -0,0 +1,38 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_H + +#include +#include +#include + + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Sphere_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3, Sphere_3, 3) +} + + + +#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h new file mode 100644 index 00000000000..d586718cc36 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3) + + CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h new file mode 100644 index 00000000000..0e75bb7ddc0 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3,Triangle_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3,Triangle_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h new file mode 100644 index 00000000000..dc462195957 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_LINE_3_LINE_3_H +#define CGAL_INTERSECTIONS_3_LINE_3_LINE_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION_SELF(Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Line_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_LINE_3_LINE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h new file mode 100644 index 00000000000..9e98da6da7d --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_LINE_PLANE_3_H +#define CGAL_INTERSECTIONS_3_LINE_PLANE_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Plane_3, Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Plane_3, Line_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_LINE_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h new file mode 100644 index 00000000000..6d44de7076f --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_LINE_3_RAY_3_H +#define CGAL_INTERSECTIONS_3_LINE_3_RAY_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Ray_3, Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Ray_3, Line_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_LINE_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h new file mode 100644 index 00000000000..fe4e91eb97a --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_LINE_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_LINE_3_SEGMENT_3_H + +#include + +namespace CGAL { + CGAL_INTERSECTION_FUNCTION(Line_3, Segment_3, 3) + CGAL_DO_INTERSECT_FUNCTION(Line_3, Segment_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_LINE_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h new file mode 100644 index 00000000000..445a82a5430 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_LINE_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_LINE_3_SPHERE_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Line_3, Sphere_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Line_3, Sphere_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_LINE_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h new file mode 100644 index 00000000000..d296988445e --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_LINE_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_LINE_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Line_3, Tetrahedron_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Line_3, Tetrahedron_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_LINE_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h new file mode 100644 index 00000000000..e388e974161 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_LINE_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_LINE_3_TRIANGLE_3_H + +#include +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Triangle_3, Line_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Line_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_LINE_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h new file mode 100644 index 00000000000..8d315a680df --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_PLANE_3_PLANE_3_H +#define CGAL_INTERSECTIONS_3_PLANE_3_PLANE_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION_SELF(Plane_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Plane_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_PLANE_3_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h new file mode 100644 index 00000000000..e1f598b3b9c --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_PLANE_3_RAY_3_H +#define CGAL_INTERSECTIONS_3_PLANE_3_RAY_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Ray_3, Plane_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Ray_3, Plane_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_PLANE_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h new file mode 100644 index 00000000000..78ad38cb7f6 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_PLANE_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_PLANE_3_SEGMENT_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Segment_3, Plane_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Segment_3, Plane_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_PLANE_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h new file mode 100644 index 00000000000..4dd19f9ae6b --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_PLANE_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_PLANE_3_SPHERE_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Sphere_3, Plane_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Plane_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_PLANE_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h new file mode 100644 index 00000000000..0d58c942196 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_PLANE_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_PLANE_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Tetrahedron_3, Plane_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Tetrahedron_3, Plane_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_PLANE_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h new file mode 100644 index 00000000000..2833be0534d --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_PLANE_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_PLANE_3_TRIANGLE_3_H + +#include +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Triangle_3, Plane_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Plane_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_PLANE_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h new file mode 100644 index 00000000000..dbf1e0dfda6 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h @@ -0,0 +1,88 @@ +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno + +#ifndef CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H +#define CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H + +#include +#include +#include + +namespace CGAL { + +namespace Intersections { + +namespace internal { + +template +inline +bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Ray_3 &ray, + const K&) +{ + return ray.has_on(pt); +} + + +template +inline +bool +do_intersect(const typename K::Ray_3 &ray, + const typename K::Point_3 &pt, + const K&) +{ + return ray.has_on(pt); +} + + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Ray_3 &ray, + const K& k) +{ + if (do_intersect(pt,ray, k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Ray_3 &ray, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, ray, k); +} + +} // namespace internal +} // namespace Intersections + +CGAL_INTERSECTION_FUNCTION(Point_3, Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Point_3, Ray_3, 3) + + +} //namespace CGAL +#endif // CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h new file mode 100644 index 00000000000..bf7b1bae922 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h @@ -0,0 +1,88 @@ +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno + +#ifndef CGAL_INTERSECTIONS_3_POINT_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_POINT_3_SPHERE_3_H + +#include +#include +#include + +namespace CGAL { + +namespace Intersections { + +namespace internal { + +template +inline +bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Sphere_3 &sphere, + const K&) +{ + return ! sphere.has_on_unbounded_side(pt); +} + + +template +inline +bool +do_intersect(const typename K::Sphere_3 &sphere, + const typename K::Point_3 &pt, + const K&) +{ + return sphere.has_on_unbounded_side(pt); +} + + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Sphere_3 &sphere, + const K& k) +{ + if (do_intersect(pt,sphere, k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Sphere_3 &sphere, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, sphere, k); +} + +} // namespace internal +} // namespace Intersections + +CGAL_INTERSECTION_FUNCTION(Point_3, Sphere_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Point_3, Sphere_3, 3) + + +} //namespace CGAL +#endif // CGAL_INTERSECTIONS_3_POINT_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h new file mode 100644 index 00000000000..886bd9dbaff --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h @@ -0,0 +1,88 @@ +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno + +#ifndef CGAL_INTERSECTIONS_3_POINT_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_POINT_3_TETRAHEDRON_3_H + +#include +#include +#include + +namespace CGAL { + +namespace Intersections { + +namespace internal { + +template +inline +bool +do_intersect(const typename K::Point_3 &pt, + const typename K::Tetrahedron_3 &tetrahedron, + const K&) +{ + return ! tetrahedron.has_on_unbounded_side(pt); +} + + +template +inline +bool +do_intersect(const typename K::Tetrahedron_3 &tetrahedron, + const typename K::Point_3 &pt, + const K&) +{ + return tetrahedron.has_on_unbounded_side(pt); +} + + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_3 &pt, + const typename K::Tetrahedron_3 &tetrahedron, + const K& k) +{ + if (do_intersect(pt,tetrahedron, k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Tetrahedron_3 &tetrahedron, + const typename K::Point_3 &pt, + const K& k) +{ + return internal::intersection(pt, tetrahedron, k); +} + +} // namespace internal +} // namespace Intersections + +CGAL_INTERSECTION_FUNCTION(Point_3, Tetrahedron_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Point_3, Tetrahedron_3, 3) + + +} //namespace CGAL +#endif // CGAL_INTERSECTIONS_3_POINT_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h new file mode 100644 index 00000000000..9297f765d8e --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_RAY_3_RAY_3_H +#define CGAL_INTERSECTIONS_3_RAY_3_RAY_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION_SELF(Ray_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_RAY_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h new file mode 100644 index 00000000000..ed2b43d56d0 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_RAY_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_RAY_3_SEGMENT_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Ray_3, Segment_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Ray_3, Segment_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_RAY_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h new file mode 100644 index 00000000000..c3220e86be3 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_RAY_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_RAY_3_SPHERE_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Ray_3, Sphere_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Ray_3, Sphere_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_RAY_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h new file mode 100644 index 00000000000..c5c8a70f170 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_RAY_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_RAY_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Ray_3, Tetrahedron_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Ray_3, Tetrahedron_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_RAY_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h new file mode 100644 index 00000000000..2de69307a0b --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_RAY_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_RAY_3_TRIANGLE_3_H + +#include +#include + +namespace CGAL { + CGAL_INTERSECTION_FUNCTION(Triangle_3, Ray_3, 3) + CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Ray_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_TRIANGLE_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h new file mode 100644 index 00000000000..300e39a458b --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_SEGMENT_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_SEGMENT_3_SEGMENT_3_H + +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION_SELF(Segment_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_SEGMENT_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h new file mode 100644 index 00000000000..4d612eb6654 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_SEGMENT_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_SEGMENT_3_SPHERE_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Segment_3, Sphere_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Segment_3, Sphere_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_SEGMENT_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h new file mode 100644 index 00000000000..3b2143ff82a --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Segment_3, Tetrahedron_3, 3) + + CGAL_NO_INTERSECTION_FUNCTION(Segment_3, Tetrahedron_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h new file mode 100644 index 00000000000..e1d931b27dd --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_TRIANGLE_3_SEGMENT_3_H +#define CGAL_INTERSECTIONS_3_TRIANGLE_3_SEGMENT_3_H + +#include +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION(Triangle_3, Segment_3, 3) +CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Segment_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_TRIANGLE_3_SEGMENT_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h new file mode 100644 index 00000000000..b2e02b94a1d --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_SPHERE_3_SPHERE_3_H +#define CGAL_INTERSECTIONS_3_SPHERE_3_SPHERE_3_H + +#include + +namespace CGAL { +CGAL_DO_INTERSECT_FUNCTION_SELF(Sphere_3, 3) +CGAL_INTERSECTION_FUNCTION_SELF(Sphere_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_SPHERE_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h new file mode 100644 index 00000000000..9e619335d21 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Tetrahedron_3, 3) + + CGAL_NO_INTERSECTION_FUNCTION(Sphere_3, Tetrahedron_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h new file mode 100644 index 00000000000..70a9e8c426e --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Triangle_3, 3) + + CGAL_NO_INTERSECTION_FUNCTION(Sphere_3, Triangle_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h new file mode 100644 index 00000000000..7404b2be723 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TETRAHEDRON_3_H +#define CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TETRAHEDRON_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION_SELF(Tetrahedron_3, 3) + + CGAL_NO_INTERSECTION_FUNCTION_SELF(Tetrahedron_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h new file mode 100644 index 00000000000..4ffd9b62777 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_H + +#include + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Tetrahedron_3, Triangle_3, 3) + CGAL_NO_INTERSECTION_FUNCTION(Tetrahedron_3, Triangle_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h new file mode 100644 index 00000000000..f18ed298aa3 --- /dev/null +++ b/Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h @@ -0,0 +1,34 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_3_TRIANGLE_3_TRIANGLE_3_H +#define CGAL_INTERSECTIONS_3_TRIANGLE_3_TRIANGLE_3_H + +#include +#include + +namespace CGAL { +CGAL_INTERSECTION_FUNCTION_SELF(Triangle_3, 3) +CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_3, 3) +} + +#endif // CGAL_INTERSECTIONS_3_TRIANGLE_3_TRIANGLE_3_H diff --git a/Intersections_3/test/Intersections_3/one.cpp b/Intersections_3/test/Intersections_3/one.cpp new file mode 100644 index 00000000000..c495150498d --- /dev/null +++ b/Intersections_3/test/Intersections_3/one.cpp @@ -0,0 +1,251 @@ + +#include +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +//#include +//typedef CGAL::Cartesian K; + + +#if (SEL == 1) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Bbox_3 T2; +#elif (SEL == 2) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Iso_cuboid_3 T2; +#elif (SEL == 3) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Line_3 T2; +#elif (SEL == 4) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Plane_3 T2; +#elif (SEL == 5) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Ray_3 T2; +#elif (SEL == 6) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Segment_3 T2; +#elif (SEL == 7) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 8) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 9) +#include +typedef CGAL::Bbox_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 10) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Iso_cuboid_3 T2; +#elif (SEL == 11) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Line_3 T2; +#elif (SEL == 12) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Plane_3 T2; +#elif (SEL == 13) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Point_3 T2; +#elif (SEL == 14) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Ray_3 T2; +#elif (SEL == 15) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Segment_3 T2; +#elif (SEL == 16) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 17) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 18) +#include +typedef CGAL::Iso_cuboid_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 19) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Line_3 T2; +#elif (SEL == 20) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Plane_3 T2; +#elif (SEL == 21) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Point_3 T2; +#elif (SEL == 22) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Ray_3 T2; +#elif (SEL == 23) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Segment_3 T2; +#elif (SEL == 24) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 25) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 26) +#include +typedef CGAL::Line_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 27) +#include +typedef CGAL::Plane_3 T1; +typedef CGAL::Plane_3 T2; +#elif (SEL == 28) +#include +typedef CGAL::Plane_3 T1; +typedef CGAL::Point_3 T2; +#elif (SEL == 29) +#include +typedef CGAL::Plane_3 T1; +typedef CGAL::Ray_3 T2; +#elif (SEL == 30) +#include +typedef CGAL::Plane_3 T1; +typedef CGAL::Segment_3 T2; +#elif (SEL == 31) +#include +typedef CGAL::Plane_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 32) +#include +typedef CGAL::Plane_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 33) +#include +typedef CGAL::Plane_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 34) +#include +typedef CGAL::Point_3 T1; +typedef CGAL::Line_3 T2; +#elif (SEL == 35) +#include +typedef CGAL::Point_3 T1; +typedef CGAL::Point_3 T2; +#elif (SEL == 36) +#include +typedef CGAL::Point_3 T1; +typedef CGAL::Ray_3 T2; +#elif (SEL == 37) +#include +typedef CGAL::Point_3 T1; +typedef CGAL::Segment_3 T2; +#elif (SEL == 38) +#include +typedef CGAL::Point_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 39) +#include +typedef CGAL::Point_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 40) +#include +typedef CGAL::Point_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 41) +#include +typedef CGAL::Ray_3 T1; +typedef CGAL::Ray_3 T2; +#elif (SEL == 42) +#include +typedef CGAL::Ray_3 T1; +typedef CGAL::Segment_3 T2; +#elif (SEL == 43) +#include +typedef CGAL::Ray_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 44) +#include +typedef CGAL::Ray_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 45) +#include +typedef CGAL::Ray_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 46) +#include +typedef CGAL::Segment_3 T1; +typedef CGAL::Segment_3 T2; +#elif (SEL == 47) +#include +typedef CGAL::Segment_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 48) +#include +typedef CGAL::Segment_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 49) +#include +typedef CGAL::Segment_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 50) +#include +typedef CGAL::Sphere_3 T1; +typedef CGAL::Sphere_3 T2; +#elif (SEL == 51) +#include +typedef CGAL::Sphere_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 52) +#include +typedef CGAL::Sphere_3 T1; +typedef CGAL::Triangle_3 T2; + +#elif (SEL == 53) +#include +typedef CGAL::Tetrahedron_3 T1; +typedef CGAL::Tetrahedron_3 T2; +#elif (SEL == 54) +#include +typedef CGAL::Tetrahedron_3 T1; +typedef CGAL::Triangle_3 T2; + +#else +#include +typedef CGAL::Triangle_3 T1; +typedef CGAL::Triangle_3 T2; +#endif + +int main() +{ + T1 t1; + T2 t2; + try { + do_intersect(t1,t2); + do_intersect(t2,t1); + intersection(t1,t2); + intersection(t2,t1); + } catch(...){} + return 0; +} + From 2d5c726ac74a7f408bee4dcdf9b389a051fa4c94 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 20 Feb 2018 17:34:25 +0000 Subject: [PATCH 20/48] Fix PMP --- .../corefinement/intersection_triangle_segment_3.h | 4 ++-- .../Corefinement/intersect_triangle_and_segment_3.h | 4 ++-- .../internal/Polygon_mesh_slicer/Traversal_traits.h | 2 +- .../Ray_3_Triangle_3_traversal_traits.h | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h index 1a892a9fab0..749671e9c89 100644 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h +++ b/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h @@ -27,7 +27,7 @@ //TODO rename this file when doing proper integration #include -#include +#include namespace CGAL{ namespace internal_IOP{ @@ -153,7 +153,7 @@ do_intersect(typename Polyhedron_types::Halfedge_handle hh, // the segment is coplanar with the triangle's supporting plane // we test whether the segment intersects the triangle in the common // supporting plane - if ( ::CGAL::internal::do_intersect_coplanar(a,b,c,p,q,Kernel()) ) + if ( ::CGAL::Intersections::internal::do_intersect_coplanar(a,b,c,p,q,Kernel()) ) return Intersection_result(COPLNR,Intersection_info(),true,true); return Intersection_result(EMPTY,Intersection_info(),true,true); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h index 9aba776fc47..17bd0a6bc74 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include @@ -164,7 +164,7 @@ intersection_type( // the segment is coplanar with the triangle's supporting plane // we test whether the segment intersects the triangle in the common // supporting plane - if ( ::CGAL::internal::do_intersect_coplanar(a,b,c,p,q,Kernel()) ) + if ( ::CGAL::Intersections::internal::do_intersect_coplanar(a,b,c,p,q,Kernel()) ) return result_type(COPLANAR_TRIANGLES,GT::null_halfedge(),true,true); return result_type(EMPTY,GT::null_halfedge(),true,true); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Traversal_traits.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Traversal_traits.h index ee65e27aa3a..53c846cd686 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Traversal_traits.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Traversal_traits.h @@ -27,7 +27,7 @@ #include -#include +#include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h index 9df35906309..13b0baaf077 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -58,18 +58,18 @@ public: template void intersection(const Query& query, const Primitive& primitive) { - internal::r3t3_do_intersect_endpoint_position_visitor visitor; - std::pair res= - internal::do_intersect( + Intersections::internal::r3t3_do_intersect_endpoint_position_visitor visitor; + std::pair res= + Intersections::internal::do_intersect( (internal::Primitive_helper::get_datum(primitive, m_aabb_traits)), query,Kernel(),visitor); if (res.first){ switch (res.second){ - case internal::R3T3_intersection::CROSS_FACET: + case Intersections::internal::R3T3_intersection::CROSS_FACET: ++m_status.second; break; - case internal::R3T3_intersection::ENDPOINT_IN_TRIANGLE: + case Intersections::internal::R3T3_intersection::ENDPOINT_IN_TRIANGLE: m_status.first=false; m_stop=true; break; From 8abfad66abc342e58ddfe2a63b1358317eb6b6e8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 21 Feb 2018 09:02:07 +0000 Subject: [PATCH 21/48] inline --- Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h index 46393c3e123..069dabf2bdc 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h @@ -35,8 +35,8 @@ namespace CGAL { return CGAL::do_overlap(c, bbox); } - void intersection(const CGAL::Bbox_3& c, - const CGAL::Bbox_3& bbox) + void inline intersection(const CGAL::Bbox_3& c, + const CGAL::Bbox_3& bbox) {} } //namespace CGAL From e65eba03017d066c005c68693f29e396b1dbdf12 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 21 Feb 2018 10:02:56 +0000 Subject: [PATCH 22/48] Add #includes --- .../internal/Tetrahedron_3_Bounded_3_do_intersect.h | 4 ++-- .../internal/Tetrahedron_3_Unbounded_3_do_intersect.h | 5 +---- .../CGAL/Intersections_3/internal/intersection_3_1_impl.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h index 5debbb9cef3..770c0bf9c91 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h @@ -28,8 +28,8 @@ #include #include -#include -#include +#include +#include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h index 18f9fa15374..b883187d24f 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h @@ -22,10 +22,7 @@ #ifndef CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H #define CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H -#include -#include -#include -#include +#include #include #include 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 12cf65fcc16..26e25aad2da 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 @@ -1617,4 +1617,4 @@ do_intersect(const Iso_cuboid_3 &j, const Line_3 &l, const R&) } // namespace Intersections } // namespace CGAL -#endif CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H +#endif // CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H From 06c42de0e4d17e2de782f45109f0e49f79df942d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 21 Feb 2018 11:07:59 +0000 Subject: [PATCH 23/48] Add subnamespace Intersections in Kernel_d --- Kernel_d/include/CGAL/Kernel_d/function_objects.h | 4 ++-- Kernel_d/include/CGAL/intersections_d.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objects.h b/Kernel_d/include/CGAL/Kernel_d/function_objects.h index 591f4bd313c..4c1bd3b7829 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objects.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objects.h @@ -222,7 +222,7 @@ public: template typename result::type operator()(const T1& t1, const T2& t2) const - { return internal::intersection(t1, t2, R()); } + { return Intersections::internal::intersection(t1, t2, R()); } #endif }; @@ -235,7 +235,7 @@ class Do_intersect template bool operator()(const T1& t1, const T2& t2) const - { return CGAL::internal::do_intersect(t1, t2, R()); } + { return CGAL::Intersections::internal::do_intersect(t1, t2, R()); } }; } // end namespace internal diff --git a/Kernel_d/include/CGAL/intersections_d.h b/Kernel_d/include/CGAL/intersections_d.h index 6ad4e019ba2..b37feb2356c 100644 --- a/Kernel_d/include/CGAL/intersections_d.h +++ b/Kernel_d/include/CGAL/intersections_d.h @@ -30,6 +30,7 @@ #include namespace CGAL { +namespace Intersections { namespace internal { template @@ -358,6 +359,7 @@ inline bool do_intersect(const typename R::Hyperplane_d& h, const typename R::Se { return do_intersect(s,h,r); } } //namespace internal +} // namespace Intersections template class Hyperplane_d; From 827e9fee8e7dffb600f46b8510d10822c36924e8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 4 Mar 2018 12:56:55 +0000 Subject: [PATCH 24/48] fix Segmentation --- .../CGAL/internal/Surface_mesh_segmentation/AABB_traits.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/AABB_traits.h b/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/AABB_traits.h index 5a01a8b5375..674af767ad4 100644 --- a/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/AABB_traits.h +++ b/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/AABB_traits.h @@ -61,7 +61,7 @@ public: const Point_3& p = segment.source(); const Point_3& q = segment.target(); - return internal::do_intersect_bbox_segment_aux + return Intersections::internal::do_intersect_bbox_segment_aux Date: Sun, 4 Mar 2018 16:05:04 +0000 Subject: [PATCH 25/48] fix namespace --- Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h index a7fbe843c1e..a77f48ddd5b 100644 --- a/Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h @@ -32,7 +32,7 @@ #include namespace CGAL { - +namespace Intersections { namespace internal { template @@ -54,7 +54,8 @@ do_intersect(const typename K::Line_2& l, } } // namespace internal - +} // namespace Intersections + template inline bool From 43f849092067f16355c9a64ba79be25337f021b8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 4 Mar 2018 17:27:28 +0000 Subject: [PATCH 26/48] Reorganize Intersections_2 header files --- .../include/CGAL/Bbox_2_Ray_2_intersection.h | 27 ------------------- .../Bbox_2_Line_2.h} | 8 +++--- .../Bbox_2_Ray_2.h} | 6 ++--- .../Circle_2_Circle_2.h} | 4 +-- .../Circle_2_Line_2.h} | 4 +-- .../Iso_rectangle_2_Iso_rectangle_2.h} | 4 +-- .../Iso_rectangle_2_Line_2.h} | 5 ++-- .../Iso_rectangle_2_Point_2.h} | 4 +-- .../Iso_rectangle_2_Ray_2.h} | 6 ++--- .../Iso_rectangle_2_Segment_2.h} | 5 ++-- .../Iso_rectangle_2_Triangle_2.h} | 10 +++---- .../Line_2_Line_2.h} | 5 ++-- .../Line_2_Point_2.h} | 4 +-- .../Line_2_Ray_2.h} | 6 ++--- .../Line_2_Segment_2.h} | 7 +++-- .../Line_2_Triangle_2.h} | 6 ++--- .../Point_2_Point_2.h} | 4 +-- .../Point_2_Ray_2.h} | 4 +-- .../Point_2_Segment_2.h} | 4 +-- .../Point_2_Triangle_2.h} | 27 +++---------------- .../Ray_2_Ray_2.h} | 7 +++-- .../Ray_2_Segment_2.h} | 8 +++--- .../Ray_2_Triangle_2.h} | 9 +++---- .../Segment_2_Segment_2.h} | 6 ++--- .../Segment_2_Triangle_2.h} | 8 +++--- .../Triangle_2_Triangle_2.h} | 13 ++++++--- .../Bbox_2_Line_2_intersection_impl.h | 0 .../Ray_2_Bbox_2_intersection_impl.h | 0 .../{ => internal}/Straight_2.h | 12 +++------ ...Triangle_2_Triangle_2_do_intersect_impl.h} | 3 --- .../Triangle_2_Triangle_2_intersection_impl.h | 7 +---- .../Iso_rectangle_2_Line_2_intersection.h | 26 ------------------ .../Iso_rectangle_2_Point_2_intersection.h | 26 ------------------ .../CGAL/Iso_rectangle_2_Ray_2_intersection.h | 26 ------------------ .../Iso_rectangle_2_Segment_2_intersection.h | 26 ------------------ .../include/CGAL/Line_2_Bbox_2_intersection.h | 26 ------------------ .../CGAL/Line_2_Point_2_intersection.h | 26 ------------------ .../include/CGAL/Line_2_Ray_2_intersection.h | 26 ------------------ .../CGAL/Line_2_Segment_2_intersection.h | 26 ------------------ .../include/CGAL/Ray_2_Point_2_intersection.h | 26 ------------------ .../CGAL/Segment_2_Point_2_intersection.h | 26 ------------------ .../CGAL/Segment_2_Ray_2_intersection.h | 26 ------------------ .../CGAL/Triangle_2_Line_2_intersection.h | 26 ------------------ .../CGAL/Triangle_2_Point_2_intersection.h | 26 ------------------ .../CGAL/Triangle_2_Ray_2_intersection.h | 26 ------------------ .../CGAL/Triangle_2_Segment_2_intersection.h | 26 ------------------ .../include/CGAL/intersection_2_1.h | 22 +++++++-------- .../include/CGAL/intersection_2_2.h | 20 +++++++------- .../include/CGAL/intersection_2_3.h | 4 +-- .../Intersections_2/test_intersections_2.cpp | 12 ++++----- 50 files changed, 104 insertions(+), 567 deletions(-) delete mode 100644 Intersections_2/include/CGAL/Bbox_2_Ray_2_intersection.h rename Intersections_2/include/CGAL/{Bbox_2_Line_2_intersection.h => Intersections_2/Bbox_2_Line_2.h} (93%) rename Intersections_2/include/CGAL/{Ray_2_Bbox_2_intersection.h => Intersections_2/Bbox_2_Ray_2.h} (93%) rename Intersections_2/include/CGAL/{Circle_2_Circle_2_intersection.h => Intersections_2/Circle_2_Circle_2.h} (94%) rename Intersections_2/include/CGAL/{Circle_2_Line_2_intersection.h => Intersections_2/Circle_2_Line_2.h} (95%) rename Intersections_2/include/CGAL/{Iso_rectangle_2_Iso_rectangle_2_intersection.h => Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h} (96%) rename Intersections_2/include/CGAL/{Line_2_Iso_rectangle_2_intersection.h => Intersections_2/Iso_rectangle_2_Line_2.h} (98%) rename Intersections_2/include/CGAL/{Point_2_Iso_rectangle_2_intersection.h => Intersections_2/Iso_rectangle_2_Point_2.h} (95%) rename Intersections_2/include/CGAL/{Ray_2_Iso_rectangle_2_intersection.h => Intersections_2/Iso_rectangle_2_Ray_2.h} (97%) rename Intersections_2/include/CGAL/{Segment_2_Iso_rectangle_2_intersection.h => Intersections_2/Iso_rectangle_2_Segment_2.h} (98%) rename Intersections_2/include/CGAL/{Triangle_2_Iso_rectangle_2_intersection.h => Intersections_2/Iso_rectangle_2_Triangle_2.h} (97%) rename Intersections_2/include/CGAL/{Line_2_Line_2_intersection.h => Intersections_2/Line_2_Line_2.h} (98%) rename Intersections_2/include/CGAL/{Point_2_Line_2_intersection.h => Intersections_2/Line_2_Point_2.h} (96%) rename Intersections_2/include/CGAL/{Ray_2_Line_2_intersection.h => Intersections_2/Line_2_Ray_2.h} (97%) rename Intersections_2/include/CGAL/{Segment_2_Line_2_intersection.h => Intersections_2/Line_2_Segment_2.h} (96%) rename Intersections_2/include/CGAL/{Line_2_Triangle_2_intersection.h => Intersections_2/Line_2_Triangle_2.h} (97%) rename Intersections_2/include/CGAL/{Point_2_Point_2_intersection.h => Intersections_2/Point_2_Point_2.h} (95%) rename Intersections_2/include/CGAL/{Point_2_Ray_2_intersection.h => Intersections_2/Point_2_Ray_2.h} (96%) rename Intersections_2/include/CGAL/{Point_2_Segment_2_intersection.h => Intersections_2/Point_2_Segment_2.h} (96%) rename Intersections_2/include/CGAL/{Point_2_Triangle_2_intersection.h => Intersections_2/Point_2_Triangle_2.h} (82%) rename Intersections_2/include/CGAL/{Ray_2_Ray_2_intersection.h => Intersections_2/Ray_2_Ray_2.h} (98%) rename Intersections_2/include/CGAL/{Ray_2_Segment_2_intersection.h => Intersections_2/Ray_2_Segment_2.h} (98%) rename Intersections_2/include/CGAL/{Ray_2_Triangle_2_intersection.h => Intersections_2/Ray_2_Triangle_2.h} (96%) rename Intersections_2/include/CGAL/{Segment_2_Segment_2_intersection.h => Intersections_2/Segment_2_Segment_2.h} (99%) rename Intersections_2/include/CGAL/{Segment_2_Triangle_2_intersection.h => Intersections_2/Segment_2_Triangle_2.h} (96%) rename Intersections_2/include/CGAL/{Triangle_2_Triangle_2_intersection.h => Intersections_2/Triangle_2_Triangle_2.h} (69%) rename Intersections_2/include/CGAL/{ => Intersections_2/internal}/Bbox_2_Line_2_intersection_impl.h (100%) rename Intersections_2/include/CGAL/{ => Intersections_2/internal}/Ray_2_Bbox_2_intersection_impl.h (100%) rename Intersections_2/include/CGAL/Intersections_2/{ => internal}/Straight_2.h (98%) rename Intersections_2/include/CGAL/{Triangle_2_Triangle_2_do_intersect.h => Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h} (99%) rename Intersections_2/include/CGAL/Intersections_2/{ => internal}/Triangle_2_Triangle_2_intersection_impl.h (98%) delete mode 100644 Intersections_2/include/CGAL/Iso_rectangle_2_Line_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Iso_rectangle_2_Point_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Iso_rectangle_2_Ray_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Iso_rectangle_2_Segment_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Line_2_Bbox_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Line_2_Point_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Line_2_Ray_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Line_2_Segment_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Ray_2_Point_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Segment_2_Point_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Segment_2_Ray_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Triangle_2_Line_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Triangle_2_Point_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Triangle_2_Ray_2_intersection.h delete mode 100644 Intersections_2/include/CGAL/Triangle_2_Segment_2_intersection.h diff --git a/Intersections_2/include/CGAL/Bbox_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Bbox_2_Ray_2_intersection.h deleted file mode 100644 index 155895580c1..00000000000 --- a/Intersections_2/include/CGAL/Bbox_2_Ray_2_intersection.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - - -#include diff --git a/Intersections_2/include/CGAL/Bbox_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Line_2.h similarity index 93% rename from Intersections_2/include/CGAL/Bbox_2_Line_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Bbox_2_Line_2.h index 515bd311f05..c5804de228c 100644 --- a/Intersections_2/include/CGAL/Bbox_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Line_2.h @@ -24,13 +24,11 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_BBOX_2_LINE_2_INTERSECTION_H -#define CGAL_BBOX_2_LINE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_BBOX_2_LINE_2_H +#define CGAL_INTERSECTIONS_2_BBOX_2_LINE_2_H #include #include -//#include -//#include #include #include @@ -98,7 +96,7 @@ inline bool do_intersect( } //namespace CGAL #ifdef CGAL_HEADER_ONLY -#include +#include #endif // CGAL_HEADER_ONLY #endif diff --git a/Intersections_2/include/CGAL/Ray_2_Bbox_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Ray_2.h similarity index 93% rename from Intersections_2/include/CGAL/Ray_2_Bbox_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Bbox_2_Ray_2.h index cf902aae04a..512f4779b2f 100644 --- a/Intersections_2/include/CGAL/Ray_2_Bbox_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Ray_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_RAY_2_BBOX_2_INTERSECTION_H -#define CGAL_RAY_2_BBOX_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_BBOX_2_RAY_2_H +#define CGAL_INTERSECTIONS_BBOX_2_RAY_2_H #include #include @@ -77,7 +77,7 @@ inline bool do_intersect_ray_2( } //namespace CGAL #ifdef CGAL_HEADER_ONLY -#include +#include #endif // CGAL_HEADER_ONLY #endif diff --git a/Intersections_2/include/CGAL/Circle_2_Circle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Circle_2.h similarity index 94% rename from Intersections_2/include/CGAL/Circle_2_Circle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Circle_2_Circle_2.h index 80ecaff7fd6..230d2e6791a 100644 --- a/Intersections_2/include/CGAL/Circle_2_Circle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Circle_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_CIRCLE_2_CIRCLE_2_INTERSECTION_H -#define CGAL_CIRCLE_2_CIRCLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H +#define CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H #include #include diff --git a/Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Line_2.h similarity index 95% rename from Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Circle_2_Line_2.h index a77f48ddd5b..c678fa3b426 100644 --- a/Intersections_2/include/CGAL/Circle_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Line_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_CIRCLE_2_LINE_2_INTERSECTION_H -#define CGAL_CIRCLE_2_LINE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_CIRCLE_2_LINE_2_H +#define CGAL_INTERSECTIONS_2_CIRCLE_2_LINE_2_H #include #include diff --git a/Intersections_2/include/CGAL/Iso_rectangle_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h similarity index 96% rename from Intersections_2/include/CGAL/Iso_rectangle_2_Iso_rectangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h index 5d09843c210..2f50e2e6e28 100644 --- a/Intersections_2/include/CGAL/Iso_rectangle_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_ISO_RECTANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H -#define CGAL_ISO_RECTANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_ISO_RECTANGLE_2_H +#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_ISO_RECTANGLE_2_H #include #include diff --git a/Intersections_2/include/CGAL/Line_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h similarity index 98% rename from Intersections_2/include/CGAL/Line_2_Iso_rectangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h index 89962f3cc78..9d085b4a2aa 100644 --- a/Intersections_2/include/CGAL/Line_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h @@ -24,14 +24,13 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_LINE_2_ISO_RECTANGLE_2_INTERSECTION_H -#define CGAL_LINE_2_ISO_RECTANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_LINE_2_H +#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_LINE_2_H #include #include #include -#include #include #include #include diff --git a/Intersections_2/include/CGAL/Point_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Point_2.h similarity index 95% rename from Intersections_2/include/CGAL/Point_2_Iso_rectangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Point_2.h index 956ebf55044..5a52d5dd142 100644 --- a/Intersections_2/include/CGAL/Point_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Point_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_POINT_2_ISO_RECTANGLE_2_INTERSECTION_H -#define CGAL_POINT_2_ISO_RECTANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_POINT_2_ISO_RECTANGLE_2_H +#define CGAL_INTERSECTIONS_2_POINT_2_ISO_RECTANGLE_2_H #include #include diff --git a/Intersections_2/include/CGAL/Ray_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h similarity index 97% rename from Intersections_2/include/CGAL/Ray_2_Iso_rectangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h index 9077a9876e8..1b925bf7003 100644 --- a/Intersections_2/include/CGAL/Ray_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h @@ -24,15 +24,13 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_RAY_2_ISO_RECTANGLE_2_INTERSECTION_H -#define CGAL_RAY_2_ISO_RECTANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_RAY_2_H +#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_RAY_2_H #include #include #include -#include -#include #include #include #include diff --git a/Intersections_2/include/CGAL/Segment_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h similarity index 98% rename from Intersections_2/include/CGAL/Segment_2_Iso_rectangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h index 22e7a5c77e2..423b7d40a61 100644 --- a/Intersections_2/include/CGAL/Segment_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h @@ -24,14 +24,13 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_SEGMENT_2_ISO_RECTANGLE_2_INTERSECTION_H -#define CGAL_SEGMENT_2_ISO_RECTANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_SEGMENT_2_H +#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_SEGMENT_2_H #include #include #include -#include #include #include #include diff --git a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Triangle_2.h similarity index 97% rename from Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Triangle_2.h index 7efb9394e8d..58991d7dfde 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Triangle_2.h @@ -19,16 +19,14 @@ // // Author(s) : Radu Ursu -#ifndef CGAL_TRIANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H -#define CGAL_TRIANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_TRIANGLE_2_H +#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_TRIANGLE_2_H -#include -#include #include #include -#include +#include #include -#include +#include #include #include diff --git a/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h similarity index 98% rename from Intersections_2/include/CGAL/Line_2_Line_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h index 74eb65e427a..29e951a2412 100644 --- a/Intersections_2/include/CGAL/Line_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h @@ -24,12 +24,11 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_LINE_2_LINE_2_INTERSECTION_H -#define CGAL_LINE_2_LINE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_LINE_2_LINE_2_H +#define CGAL_INTERSECTIONS_2_LINE_2_LINE_2_H #include #include -#include #include #include #include diff --git a/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Point_2.h similarity index 96% rename from Intersections_2/include/CGAL/Point_2_Line_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Line_2_Point_2.h index b954a0d018b..9838ea93468 100644 --- a/Intersections_2/include/CGAL/Point_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Point_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_POINT_2_LINE_2_INTERSECTION_H -#define CGAL_POINT_2_LINE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_POINT_2_LINE_2_H +#define CGAL_INTERSECTIONS_2_POINT_2_LINE_2_H #include #include diff --git a/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h similarity index 97% rename from Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h index 0d7b75a7b74..bc8bb35cdd9 100644 --- a/Intersections_2/include/CGAL/Ray_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h @@ -24,15 +24,15 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_RAY_2_LINE_2_INTERSECTION_H -#define CGAL_RAY_2_LINE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_LINE_2_RAY_2_H +#define CGAL_INTERSECTIONS_2_LINE_2_RAY_2_H #include #include #include #include #include -#include +#include #include namespace CGAL { diff --git a/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h similarity index 96% rename from Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h index 0d89cbab814..e26ebae6b47 100644 --- a/Intersections_2/include/CGAL/Segment_2_Line_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h @@ -24,15 +24,14 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_SEGMENT_2_LINE_2_INTERSECTION_H -#define CGAL_SEGMENT_2_LINE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_SEGMENT_2_LINE_2_H +#define CGAL_INTERSECTIONS_2_SEGMENT_2_LINE_2_H #include #include -#include #include #include -#include +#include #include namespace CGAL { diff --git a/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h similarity index 97% rename from Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h index 5a92f8b127b..5f1c817b792 100644 --- a/Intersections_2/include/CGAL/Line_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h @@ -24,14 +24,14 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_LINE_2_TRIANGLE_2_INTERSECTION_H -#define CGAL_LINE_2_TRIANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_LINE_2_TRIANGLE_2_H +#define CGAL_INTERSECTIONS_2_LINE_2_TRIANGLE_2_H #include #include #include #include -#include +#include #include #include #include diff --git a/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Point_2.h similarity index 95% rename from Intersections_2/include/CGAL/Point_2_Point_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Point_2_Point_2.h index 83605ab047f..0baa0f0a6a8 100644 --- a/Intersections_2/include/CGAL/Point_2_Point_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Point_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_POINT_2_POINT_2_INTERSECTION_H -#define CGAL_POINT_2_POINT_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_POINT_2_POINT_2_H +#define CGAL_INTERSECTIONS_2_POINT_2_POINT_2_H #include #include diff --git a/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Ray_2.h similarity index 96% rename from Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Point_2_Ray_2.h index a2bad20e465..c7efa2cc868 100644 --- a/Intersections_2/include/CGAL/Point_2_Ray_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Ray_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_POINT_2_RAY_2_INTERSECTION_H -#define CGAL_POINT_2_RAY_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_POINT_2_RAY_2_H +#define CGAL_INTERSECTIONS_2_POINT_2_RAY_2_H #include #include diff --git a/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Segment_2.h similarity index 96% rename from Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Point_2_Segment_2.h index 247a5fd631d..94edc1ad098 100644 --- a/Intersections_2/include/CGAL/Point_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Segment_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_POINT_2_SEGMENT_2_INTERSECTION_H -#define CGAL_POINT_2_SEGMENT_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_POINT_2_SEGMENT_2_H +#define CGAL_INTERSECTIONS_2_POINT_2_SEGMENT_2_H #include #include diff --git a/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h similarity index 82% rename from Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h index 987d26a2959..c758d55a66b 100644 --- a/Intersections_2/include/CGAL/Point_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h @@ -24,15 +24,14 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_POINT_2_TRIANGLE_2_INTERSECTION_H -#define CGAL_POINT_2_TRIANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_POINT_2_TRIANGLE_2_H +#define CGAL_INTERSECTIONS_2_POINT_2_TRIANGLE_2_H #include #include -#include #include #include -#include +#include namespace CGAL { @@ -93,26 +92,6 @@ Point_2_Triangle_2_pair::intersection_type() const _result = POINT; } return _result; -/* - typedef typename K::Line_2 line_t; - line_t l(_trian->vertex(0), _trian->vertex(1)); - if (l.has_on_positive_side(_trian->vertex(2))) { - for (int i=0; i<3; i++) { - if (line_t(_trian->vertex(i), _trian->vertex(i+1)). - has_on_negative_side(*_pt)) { - _result = NO_INTERSECTION; - return _result; - } - } - } else { - for (int i=0; i<3; i++) - if(line_t(_trian->vertex(i), _trian->vertex(i-1)). - has_on_negative_side(*_pt)){ - _result = NO_INTERSECTION; - return _result; - } - } -*/ } diff --git a/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h similarity index 98% rename from Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h index 36c6bc87c85..5413d498b2e 100644 --- a/Intersections_2/include/CGAL/Ray_2_Ray_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h @@ -24,16 +24,15 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_RAY_2_RAY_2_INTERSECTION_H -#define CGAL_RAY_2_RAY_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_RAY_2_RAY_2_H +#define CGAL_INTERSECTIONS_2_RAY_2_RAY_2_H #include #include #include #include #include -#include -#include +#include #include diff --git a/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h similarity index 98% rename from Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h index bb0c62f124d..323f285aef2 100644 --- a/Intersections_2/include/CGAL/Ray_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h @@ -24,16 +24,16 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_RAY_2_SEGMENT_2_INTERSECTION_H -#define CGAL_RAY_2_SEGMENT_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_RAY_2_SEGMENT_2_H +#define CGAL_INTERSECTIONS_2_RAY_2_SEGMENT_2_H #include #include #include +#include #include #include -#include -#include +#include #include diff --git a/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h similarity index 96% rename from Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h index db8e1c2e0ae..650eb3ad0ab 100644 --- a/Intersections_2/include/CGAL/Ray_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h @@ -24,17 +24,14 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_RAY_2_TRIANGLE_2_INTERSECTION_H -#define CGAL_RAY_2_TRIANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_RAY_2_TRIANGLE_2_H +#define CGAL_INTERSECTIONS_2_RAY_2_TRIANGLE_2_H -#include #include #include -#include -#include #include #include -#include +#include #include namespace CGAL { diff --git a/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h similarity index 99% rename from Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h index 36c92a5d851..da7cebe3db8 100644 --- a/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h @@ -24,8 +24,8 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_SEGMENT_2_SEGMENT_2_INTERSECTION_H -#define CGAL_SEGMENT_2_SEGMENT_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_SEGMENT_2_SEGMENT_2_H +#define CGAL_INTERSECTIONS_2_SEGMENT_2_SEGMENT_2_H #include #include @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h similarity index 96% rename from Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h index 06a824d8c33..4f8cc825748 100644 --- a/Intersections_2/include/CGAL/Segment_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h @@ -24,16 +24,14 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_SEGMENT_2_TRIANGLE_2_INTERSECTION_H -#define CGAL_SEGMENT_2_TRIANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_SEGMENT_2_TRIANGLE_2_H +#define CGAL_INTERSECTIONS_2_SEGMENT_2_TRIANGLE_2_H #include #include -#include -#include #include #include -#include +#include #include namespace CGAL { diff --git a/Intersections_2/include/CGAL/Triangle_2_Triangle_2_intersection.h b/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2.h similarity index 69% rename from Intersections_2/include/CGAL/Triangle_2_Triangle_2_intersection.h rename to Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2.h index f68dd0b61d6..09bdea7198d 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Triangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2.h @@ -24,10 +24,15 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_TRIANGLE_2_TRIANGLE_2_INTERSECTION_H -#define CGAL_TRIANGLE_2_TRIANGLE_2_INTERSECTION_H +#ifndef CGAL_INTERSECTIONS_2_TRIANGLE_2_TRIANGLE_2_H +#define CGAL_INTERSECTIONS_2_TRIANGLE_2_TRIANGLE_2_H -#include -#include +#include +#include + +namespace CGAL { +CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_2, 2) +CGAL_INTERSECTION_FUNCTION_SELF(Triangle_2, 2) +} // namespace CGAL #endif diff --git a/Intersections_2/include/CGAL/Bbox_2_Line_2_intersection_impl.h b/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Line_2_intersection_impl.h similarity index 100% rename from Intersections_2/include/CGAL/Bbox_2_Line_2_intersection_impl.h rename to Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Line_2_intersection_impl.h diff --git a/Intersections_2/include/CGAL/Ray_2_Bbox_2_intersection_impl.h b/Intersections_2/include/CGAL/Intersections_2/internal/Ray_2_Bbox_2_intersection_impl.h similarity index 100% rename from Intersections_2/include/CGAL/Ray_2_Bbox_2_intersection_impl.h rename to Intersections_2/include/CGAL/Intersections_2/internal/Ray_2_Bbox_2_intersection_impl.h diff --git a/Intersections_2/include/CGAL/Intersections_2/Straight_2.h b/Intersections_2/include/CGAL/Intersections_2/internal/Straight_2.h similarity index 98% rename from Intersections_2/include/CGAL/Intersections_2/Straight_2.h rename to Intersections_2/include/CGAL/Intersections_2/internal/Straight_2.h index fda94e29c3a..490fddf2698 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Straight_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Straight_2.h @@ -24,10 +24,10 @@ // Author(s) : Geert-Jan Giezeman -#ifndef CGAL_STRAIGHT_2_H -#define CGAL_STRAIGHT_2_H +#ifndef CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H +#define CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H -#include +#include #include #include @@ -354,12 +354,6 @@ collinear_order(typename K::Point_2 const &pt1, typename K::Point_2 const & pt2) } // namespace internal } // namespace Intersections - } //namespace CGAL - - - - - #endif diff --git a/Intersections_2/include/CGAL/Triangle_2_Triangle_2_do_intersect.h b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h similarity index 99% rename from Intersections_2/include/CGAL/Triangle_2_Triangle_2_do_intersect.h rename to Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h index 44436433e6f..7bdc6542428 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Triangle_2_do_intersect.h +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h @@ -173,9 +173,6 @@ bool do_intersect(const typename K::Triangle_2 &t1, } // namespace internal } // namespace Intersections - -CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_2, 2) - } //namespace CGAL #endif //CGAL_TRIANGLE_2_TRIANGLE_2_DO_INTERSECT_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2_intersection_impl.h b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h similarity index 98% rename from Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2_intersection_impl.h rename to Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h index 69b5fe48c17..ab5d9386874 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2_intersection_impl.h +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h @@ -23,14 +23,12 @@ // // Author(s) : Geert-Jan Giezeman -#include #include -#include #include #include #include -#include +#include #include namespace CGAL { @@ -352,7 +350,4 @@ intersection(const typename K::Triangle_2 &tr1, } // namespace internal } // namespace Intersections - -CGAL_INTERSECTION_FUNCTION_SELF(Triangle_2, 2) - } //namespace CGAL diff --git a/Intersections_2/include/CGAL/Iso_rectangle_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Iso_rectangle_2_Line_2_intersection.h deleted file mode 100644 index 1ea17f837e0..00000000000 --- a/Intersections_2/include/CGAL/Iso_rectangle_2_Line_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Iso_rectangle_2_Point_2_intersection.h b/Intersections_2/include/CGAL/Iso_rectangle_2_Point_2_intersection.h deleted file mode 100644 index 9d498dcb798..00000000000 --- a/Intersections_2/include/CGAL/Iso_rectangle_2_Point_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Iso_rectangle_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Iso_rectangle_2_Ray_2_intersection.h deleted file mode 100644 index 99501b578e0..00000000000 --- a/Intersections_2/include/CGAL/Iso_rectangle_2_Ray_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Iso_rectangle_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Iso_rectangle_2_Segment_2_intersection.h deleted file mode 100644 index cadfdfbbce7..00000000000 --- a/Intersections_2/include/CGAL/Iso_rectangle_2_Segment_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Line_2_Bbox_2_intersection.h b/Intersections_2/include/CGAL/Line_2_Bbox_2_intersection.h deleted file mode 100644 index 59b6a2c982c..00000000000 --- a/Intersections_2/include/CGAL/Line_2_Bbox_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Line_2_Point_2_intersection.h b/Intersections_2/include/CGAL/Line_2_Point_2_intersection.h deleted file mode 100644 index d957a00b1eb..00000000000 --- a/Intersections_2/include/CGAL/Line_2_Point_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Line_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Line_2_Ray_2_intersection.h deleted file mode 100644 index ba965eae711..00000000000 --- a/Intersections_2/include/CGAL/Line_2_Ray_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Line_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Line_2_Segment_2_intersection.h deleted file mode 100644 index 36e4429f9b3..00000000000 --- a/Intersections_2/include/CGAL/Line_2_Segment_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Ray_2_Point_2_intersection.h b/Intersections_2/include/CGAL/Ray_2_Point_2_intersection.h deleted file mode 100644 index 44bb85184cb..00000000000 --- a/Intersections_2/include/CGAL/Ray_2_Point_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Segment_2_Point_2_intersection.h b/Intersections_2/include/CGAL/Segment_2_Point_2_intersection.h deleted file mode 100644 index d8da2c4a887..00000000000 --- a/Intersections_2/include/CGAL/Segment_2_Point_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Segment_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Segment_2_Ray_2_intersection.h deleted file mode 100644 index e723553a143..00000000000 --- a/Intersections_2/include/CGAL/Segment_2_Ray_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Triangle_2_Line_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Line_2_intersection.h deleted file mode 100644 index bf7e131465a..00000000000 --- a/Intersections_2/include/CGAL/Triangle_2_Line_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Triangle_2_Point_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Point_2_intersection.h deleted file mode 100644 index 2185ccd20c2..00000000000 --- a/Intersections_2/include/CGAL/Triangle_2_Point_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Triangle_2_Ray_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Ray_2_intersection.h deleted file mode 100644 index 9ebf9300661..00000000000 --- a/Intersections_2/include/CGAL/Triangle_2_Ray_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/Triangle_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Segment_2_intersection.h deleted file mode 100644 index 8025b5fc3ca..00000000000 --- a/Intersections_2/include/CGAL/Triangle_2_Segment_2_intersection.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - -#include diff --git a/Intersections_2/include/CGAL/intersection_2_1.h b/Intersections_2/include/CGAL/intersection_2_1.h index 14046e5da92..32c66d1b44b 100644 --- a/Intersections_2/include/CGAL/intersection_2_1.h +++ b/Intersections_2/include/CGAL/intersection_2_1.h @@ -28,16 +28,16 @@ #ifndef CGAL_INTERSECTION_2_1_H #define CGAL_INTERSECTION_2_1_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/Intersections_2/include/CGAL/intersection_2_2.h b/Intersections_2/include/CGAL/intersection_2_2.h index 9059ecf1412..0840a53045a 100644 --- a/Intersections_2/include/CGAL/intersection_2_2.h +++ b/Intersections_2/include/CGAL/intersection_2_2.h @@ -28,15 +28,15 @@ #ifndef CGAL_INTERSECTION_2_2_H #define CGAL_INTERSECTION_2_2_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/Intersections_2/include/CGAL/intersection_2_3.h b/Intersections_2/include/CGAL/intersection_2_3.h index 55f8d7b0c3c..4774bc778bf 100644 --- a/Intersections_2/include/CGAL/intersection_2_3.h +++ b/Intersections_2/include/CGAL/intersection_2_3.h @@ -28,7 +28,7 @@ #ifndef CGAL_INTERSECTION_2_3_H #define CGAL_INTERSECTION_2_3_H -#include -#include +#include +#include #endif diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index 512236d8933..2d356464f3c 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -8,12 +8,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include From 97b5c37b6e8806bc83486ca11440cbc93b7150f8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 4 Mar 2018 17:33:50 +0000 Subject: [PATCH 27/48] Fix includes --- Convex_hull_2/include/CGAL/segment_intersection_points_2.h | 2 +- Nef_2/include/CGAL/Bounded_kernel.h | 2 +- Nef_2/include/CGAL/Extended_cartesian.h | 2 +- Nef_2/include/CGAL/Extended_homogeneous.h | 2 +- .../include/CGAL/Partition_2/Vertex_visibility_graph_2.h | 2 +- Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h | 2 +- Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Convex_hull_2/include/CGAL/segment_intersection_points_2.h b/Convex_hull_2/include/CGAL/segment_intersection_points_2.h index b40dc0c2cbe..5346059e350 100644 --- a/Convex_hull_2/include/CGAL/segment_intersection_points_2.h +++ b/Convex_hull_2/include/CGAL/segment_intersection_points_2.h @@ -32,7 +32,7 @@ namespace CGAL { /* -#include +#include template OutputIterator si_brute_force(ForwardIterator first, ForwardIterator last, diff --git a/Nef_2/include/CGAL/Bounded_kernel.h b/Nef_2/include/CGAL/Bounded_kernel.h index 736788715f4..09868640f72 100644 --- a/Nef_2/include/CGAL/Bounded_kernel.h +++ b/Nef_2/include/CGAL/Bounded_kernel.h @@ -27,7 +27,7 @@ #include #include -#include +#include #undef CGAL_NEF_DEBUG diff --git a/Nef_2/include/CGAL/Extended_cartesian.h b/Nef_2/include/CGAL/Extended_cartesian.h index 9f6b4603dbb..c0f650302d6 100644 --- a/Nef_2/include/CGAL/Extended_cartesian.h +++ b/Nef_2/include/CGAL/Extended_cartesian.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #undef CGAL_NEF_DEBUG diff --git a/Nef_2/include/CGAL/Extended_homogeneous.h b/Nef_2/include/CGAL/Extended_homogeneous.h index ffa4a532689..dcbe2e843fb 100644 --- a/Nef_2/include/CGAL/Extended_homogeneous.h +++ b/Nef_2/include/CGAL/Extended_homogeneous.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h index bc931dce3c0..30e086cf868 100644 --- a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h +++ b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h index 41d488b23f4..90154ee69fb 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h index 9507fe94c04..70e81bd11f0 100644 --- a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h @@ -38,7 +38,7 @@ #include #include -#include +#include namespace CGAL { From 2a78b7861b9013bfea9a7128801f89a3d6b428c8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 5 Mar 2018 14:54:58 +0000 Subject: [PATCH 28/48] fix src --- .../include/CGAL/Intersections_2/Line_2_Line_2.h | 3 +++ Intersections_2/src/CGAL/Bbox_2_intersections.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h index 29e951a2412..b1dca54be02 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h @@ -34,6 +34,9 @@ #include namespace CGAL { + +class Cartesian_tag; +class Homogeneous_tag; namespace Intersections { diff --git a/Intersections_2/src/CGAL/Bbox_2_intersections.cpp b/Intersections_2/src/CGAL/Bbox_2_intersections.cpp index 63d0ddd12bb..3e0edcecc58 100644 --- a/Intersections_2/src/CGAL/Bbox_2_intersections.cpp +++ b/Intersections_2/src/CGAL/Bbox_2_intersections.cpp @@ -25,10 +25,10 @@ #ifndef CGAL_HEADER_ONLY -#include -#include +#include +#include -#include -#include +#include +#include #endif // CGAL_HEADER_ONLY From 955b6a89e6ace6e537c866bb274b9b5a50439589 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 5 Mar 2018 15:04:32 +0000 Subject: [PATCH 29/48] fix includes --- .../include/CGAL/Partition_2/Vertex_visibility_graph_2.h | 2 +- Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h index 30e086cf868..f38034fff5e 100644 --- a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h +++ b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h index 90154ee69fb..1b36ff04416 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include From e1eacead955fda71aadc665d9c85a6a518729d4c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 9 May 2018 12:20:11 +0100 Subject: [PATCH 30/48] Add #includes of kernel object types --- .../Intersections_3/Bbox_3_Iso_cuboid_3.h | 5 +- .../CGAL/Intersections_3/Bbox_3_Line_3.h | 3 + .../CGAL/Intersections_3/Bbox_3_Plane_3.h | 3 + .../CGAL/Intersections_3/Bbox_3_Point_3.h | 2 + .../CGAL/Intersections_3/Bbox_3_Ray_3.h | 3 + .../CGAL/Intersections_3/Bbox_3_Segment_3.h | 1 + .../CGAL/Intersections_3/Bbox_3_Sphere_3.h | 3 + .../Intersections_3/Bbox_3_Tetrahedron_3.h | 3 + .../CGAL/Intersections_3/Bbox_3_Triangle_3.h | 3 + .../Iso_cuboid_3_Iso_cuboid_3.h | 2 + .../Intersections_3/Iso_cuboid_3_Line_3.h | 2 + .../Intersections_3/Iso_cuboid_3_Plane_3.h | 2 + .../CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h | 3 + .../Intersections_3/Iso_cuboid_3_Segment_3.h | 3 + .../Intersections_3/Iso_cuboid_3_Sphere_3.h | 1 + .../Iso_cuboid_3_Tetrahedron_3.h | 3 + .../Intersections_3/Iso_cuboid_3_Triangle_3.h | 3 + .../CGAL/Intersections_3/Line_3_Line_3.h | 2 + .../CGAL/Intersections_3/Line_3_Plane_3.h | 3 + .../CGAL/Intersections_3/Line_3_Ray_3.h | 3 + .../CGAL/Intersections_3/Line_3_Segment_3.h | 3 + .../CGAL/Intersections_3/Line_3_Sphere_3.h | 3 + .../Intersections_3/Line_3_Tetrahedron_3.h | 3 + .../CGAL/Intersections_3/Line_3_Triangle_3.h | 3 + .../CGAL/Intersections_3/Plane_3_Plane_3.h | 2 + .../CGAL/Intersections_3/Plane_3_Ray_3.h | 3 + .../CGAL/Intersections_3/Plane_3_Segment_3.h | 3 + .../CGAL/Intersections_3/Plane_3_Sphere_3.h | 3 + .../Intersections_3/Plane_3_Tetrahedron_3.h | 3 + .../CGAL/Intersections_3/Plane_3_Triangle_3.h | 3 + .../CGAL/Intersections_3/Point_3_Line_3.h | 88 ------------------- .../CGAL/Intersections_3/Point_3_Triangle_3.h | 10 +-- .../CGAL/Intersections_3/Ray_3_Ray_3.h | 2 + .../CGAL/Intersections_3/Ray_3_Segment_3.h | 3 + .../CGAL/Intersections_3/Ray_3_Sphere_3.h | 3 + .../Intersections_3/Ray_3_Tetrahedron_3.h | 3 + .../CGAL/Intersections_3/Ray_3_Triangle_3.h | 3 + .../Intersections_3/Segment_3_Segment_3.h | 2 + .../CGAL/Intersections_3/Segment_3_Sphere_3.h | 3 + .../Intersections_3/Segment_3_Tetrahedron_3.h | 3 + .../Intersections_3/Segment_3_Triangle_3.h | 3 + .../CGAL/Intersections_3/Sphere_3_Sphere_3.h | 2 + .../Intersections_3/Sphere_3_Tetrahedron_3.h | 3 + .../Intersections_3/Sphere_3_Triangle_3.h | 3 + .../Tetrahedron_3_Tetrahedron_3.h | 2 + .../Tetrahedron_3_Triangle_3.h | 3 + .../Intersections_3/Triangle_3_Triangle_3.h | 2 + Intersections_3/include/CGAL/intersection_3.h | 1 - Intersections_3/test/Intersections_3/one.cpp | 4 +- 49 files changed, 125 insertions(+), 100 deletions(-) delete mode 100644 Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h index 38c3993a227..ddfffb75dcd 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_H #define CGAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_H +#include +#include + #include namespace CGAL { @@ -39,7 +42,6 @@ bool do_intersect(const Iso_cuboid_3& a, return K().do_intersect_3_object()(b, a); } - template void intersection(const CGAL::Bbox_3&, const Iso_cuboid_3&) {} @@ -47,6 +49,7 @@ void intersection(const CGAL::Bbox_3&, template void intersection(const Iso_cuboid_3& a, const CGAL::Bbox_3& b) {} + } // namespace CGAL #endif // CGAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h index 0990e21651f..b14111c620c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_BBOX_3_LINE_3_H #define CGAL_INTERSECTIONS_3_BBOX_3_LINE_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h index 637097ba122..85bdf4735a1 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_BBOX_3_PLANE_3_H #define CGAL_INTERSECTIONS_3_BBOX_3_PLANE_3_H +#include +#include + #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h index 4bc8cf0ef3b..156a008a46c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h @@ -24,6 +24,8 @@ #define CGAL_INTERSECTIONS_3_BBOX_3_POINT_3_H #include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h index bdd352ea375..da4d99448ad 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_BBOX_3_RAY_3_H #define CGAL_INTERSECTIONS_3_BBOX_3_RAY_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h index 1d93dbebf00..597e6d60469 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h @@ -24,6 +24,7 @@ #define CGAL_INTERSECTIONS_3_BBOX_3_SEGMENT_3_H #include +#include #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h index 8f21b30cc91..f6181c1179a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_H #define CGAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h index 0db6d0fc310..ef801caedb9 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_BBOX_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_BBOX_3_TETRAHEDRON_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h index 7d6259d2f7e..d8555ac2385 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h index 3513dab8911..db74ad6152b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_ISO_CUBOID_3_H #define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_ISO_CUBOID_3_H +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h index 3ded415455e..59305d45aca 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Line_3.h @@ -24,6 +24,8 @@ #define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_LINE_3_H #include +#include +#include namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3,Line_3, 3) diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h index 575e77dda5b..3ee868524ac 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_PLANE_3_H #define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_PLANE_3_H +#include +#include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h index abd69b65333..8798b295b5a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_H #define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h index f2a19844edc..8bd316d77f3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_H #define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h index 36684276e57..e1b2e3b90c0 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h @@ -25,6 +25,7 @@ #include #include + #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h index d586718cc36..998b2ed8122 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h index 0e75bb7ddc0..35cbb36c5fc 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h index dc462195957..ec964297439 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Line_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_LINE_3_LINE_3_H #define CGAL_INTERSECTIONS_3_LINE_3_LINE_3_H +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h index 9e98da6da7d..36f2b8f4eef 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_LINE_PLANE_3_H #define CGAL_INTERSECTIONS_3_LINE_PLANE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h index 6d44de7076f..3846288730d 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Ray_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_LINE_3_RAY_3_H #define CGAL_INTERSECTIONS_3_LINE_3_RAY_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h index fe4e91eb97a..0421e7ce342 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Segment_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_LINE_3_SEGMENT_3_H #define CGAL_INTERSECTIONS_3_LINE_3_SEGMENT_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h index 445a82a5430..403c980a376 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_LINE_3_SPHERE_3_H #define CGAL_INTERSECTIONS_3_LINE_3_SPHERE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h index d296988445e..4fcb49dbde3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_LINE_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_LINE_3_TETRAHEDRON_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h index e388e974161..9be4e73a8d2 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_LINE_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_LINE_3_TRIANGLE_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h index 8d315a680df..501afd4bf20 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_PLANE_3_PLANE_3_H #define CGAL_INTERSECTIONS_3_PLANE_3_PLANE_3_H +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h index e1f598b3b9c..1572729b694 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Ray_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_PLANE_3_RAY_3_H #define CGAL_INTERSECTIONS_3_PLANE_3_RAY_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h index 78ad38cb7f6..c2739743d2e 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Segment_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_PLANE_3_SEGMENT_3_H #define CGAL_INTERSECTIONS_3_PLANE_3_SEGMENT_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h index 4dd19f9ae6b..2669afd39af 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Sphere_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_PLANE_3_SPHERE_3_H #define CGAL_INTERSECTIONS_3_PLANE_3_SPHERE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h index 0d58c942196..bbf232a5982 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_PLANE_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_PLANE_3_TETRAHEDRON_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h index 2833be0534d..fe92f4873b4 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_PLANE_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_PLANE_3_TRIANGLE_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h deleted file mode 100644 index dbf1e0dfda6..00000000000 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Line_3.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2018 INRIA Sophia-Antipolis (France). -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Maxime Gimeno - -#ifndef CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H -#define CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H - -#include -#include -#include - -namespace CGAL { - -namespace Intersections { - -namespace internal { - -template -inline -bool -do_intersect(const typename K::Point_3 &pt, - const typename K::Ray_3 &ray, - const K&) -{ - return ray.has_on(pt); -} - - -template -inline -bool -do_intersect(const typename K::Ray_3 &ray, - const typename K::Point_3 &pt, - const K&) -{ - return ray.has_on(pt); -} - - -template -typename CGAL::Intersection_traits -::result_type -intersection(const typename K::Point_3 &pt, - const typename K::Ray_3 &ray, - const K& k) -{ - if (do_intersect(pt,ray, k)) { - return intersection_return(pt); - } - return intersection_return(); -} - -template -typename CGAL::Intersection_traits -::result_type -intersection(const typename K::Ray_3 &ray, - const typename K::Point_3 &pt, - const K& k) -{ - return internal::intersection(pt, ray, k); -} - -} // namespace internal -} // namespace Intersections - -CGAL_INTERSECTION_FUNCTION(Point_3, Ray_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Point_3, Ray_3, 3) - - -} //namespace CGAL -#endif // CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Triangle_3.h index e170ef3bf18..1a887b0a52e 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Triangle_3.h @@ -22,19 +22,15 @@ #ifndef CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H +#include +#include + #include #include #include namespace CGAL { - - template - class Triangle_3; - - template - class Point_3; - namespace Intersections { namespace internal { diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h index 9297f765d8e..c9eb6a95de7 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Ray_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_RAY_3_RAY_3_H #define CGAL_INTERSECTIONS_3_RAY_3_RAY_3_H +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h index ed2b43d56d0..25702ff619a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Segment_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_RAY_3_SEGMENT_3_H #define CGAL_INTERSECTIONS_3_RAY_3_SEGMENT_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h index c3220e86be3..07aac51d885 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_RAY_3_SPHERE_3_H #define CGAL_INTERSECTIONS_3_RAY_3_SPHERE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h index c5c8a70f170..3f60c304a56 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_RAY_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_RAY_3_TETRAHEDRON_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h index 2de69307a0b..2a4557988dc 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_RAY_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_RAY_3_TRIANGLE_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h index 300e39a458b..ba99ca0b5a1 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Segment_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_SEGMENT_3_SEGMENT_3_H #define CGAL_INTERSECTIONS_3_SEGMENT_3_SEGMENT_3_H +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h index 4d612eb6654..cc12c1d9ba9 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_SEGMENT_3_SPHERE_3_H #define CGAL_INTERSECTIONS_3_SEGMENT_3_SPHERE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h index 3b2143ff82a..2348bb216dd 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h index e1d931b27dd..ad40a07a663 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_TRIANGLE_3_SEGMENT_3_H #define CGAL_INTERSECTIONS_3_TRIANGLE_3_SEGMENT_3_H +#include +#include + #include #include diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h index b2e02b94a1d..e9fd61803df 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Sphere_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_SPHERE_3_SPHERE_3_H #define CGAL_INTERSECTIONS_3_SPHERE_3_SPHERE_3_H +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h index 9e619335d21..14be9e0ae96 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h index 70a9e8c426e..f95193206bd 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h index 7404b2be723..ec440f0b403 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TETRAHEDRON_3_H #define CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TETRAHEDRON_3_H +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h index 4ffd9b62777..9db65c326ec 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h @@ -23,6 +23,9 @@ #ifndef CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_H +#include +#include + #include namespace CGAL { diff --git a/Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h index f18ed298aa3..0654ef9d989 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Triangle_3_Triangle_3.h @@ -23,6 +23,8 @@ #ifndef CGAL_INTERSECTIONS_3_TRIANGLE_3_TRIANGLE_3_H #define CGAL_INTERSECTIONS_3_TRIANGLE_3_TRIANGLE_3_H +#include + #include #include diff --git a/Intersections_3/include/CGAL/intersection_3.h b/Intersections_3/include/CGAL/intersection_3.h index c32e8a12a54..cc50d65cf87 100644 --- a/Intersections_3/include/CGAL/intersection_3.h +++ b/Intersections_3/include/CGAL/intersection_3.h @@ -68,7 +68,6 @@ #include #include -#include #include #include #include diff --git a/Intersections_3/test/Intersections_3/one.cpp b/Intersections_3/test/Intersections_3/one.cpp index c495150498d..c1f47980933 100644 --- a/Intersections_3/test/Intersections_3/one.cpp +++ b/Intersections_3/test/Intersections_3/one.cpp @@ -142,9 +142,7 @@ typedef CGAL::Plane_3 T1; typedef CGAL::Triangle_3 T2; #elif (SEL == 34) -#include -typedef CGAL::Point_3 T1; -typedef CGAL::Line_3 T2; +// duplicate #elif (SEL == 35) #include typedef CGAL::Point_3 T1; From 162241066b33aab2378be000b1e137165f0d8b22 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 17 May 2018 11:52:58 +0100 Subject: [PATCH 31/48] Remove CGAL_NO_INTERSECTION_FUNCTION and functions doing nothing --- .../include/CGAL/Intersection_traits.h | 8 - .../CGAL/Intersections_3/Bbox_3_Bbox_3.h | 5 +- .../Intersections_3/Bbox_3_Iso_cuboid_3.h | 8 - .../CGAL/Intersections_3/Bbox_3_Plane_3.h | 8 - .../CGAL/Intersections_3/Bbox_3_Sphere_3.h | 9 - .../Intersections_3/Bbox_3_Tetrahedron_3.h | 7 - .../CGAL/Intersections_3/Bbox_3_Triangle_3.h | 9 +- .../Intersections_3/Iso_cuboid_3_Plane_3.h | 1 - .../Intersections_3/Iso_cuboid_3_Sphere_3.h | 1 - .../Iso_cuboid_3_Tetrahedron_3.h | 1 - .../Intersections_3/Iso_cuboid_3_Triangle_3.h | 1 - .../CGAL/Intersections_3/Line_3_Sphere_3.h | 1 - .../Intersections_3/Line_3_Tetrahedron_3.h | 1 - .../Intersections_3/Plane_3_Tetrahedron_3.h | 1 - .../CGAL/Intersections_3/Point_3_Sphere_3.h | 1 - .../CGAL/Intersections_3/Ray_3_Sphere_3.h | 1 - .../Intersections_3/Ray_3_Tetrahedron_3.h | 1 - .../CGAL/Intersections_3/Segment_3_Sphere_3.h | 1 - .../Intersections_3/Segment_3_Tetrahedron_3.h | 1 - .../Intersections_3/Sphere_3_Tetrahedron_3.h | 1 - .../Intersections_3/Sphere_3_Triangle_3.h | 1 - .../Tetrahedron_3_Triangle_3.h | 1 - .../test/Intersections_3/CMakeLists.txt | 11 - Intersections_3/test/Intersections_3/one.cpp | 249 ------------------ 24 files changed, 2 insertions(+), 327 deletions(-) delete mode 100644 Intersections_3/test/Intersections_3/one.cpp diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index 83f42231aa9..3b751bc5c73 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -68,15 +68,7 @@ #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 \ diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h index 069dabf2bdc..59a02a3ed4f 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h @@ -34,10 +34,7 @@ namespace CGAL { { return CGAL::do_overlap(c, bbox); } - - void inline intersection(const CGAL::Bbox_3& c, - const CGAL::Bbox_3& bbox) - {} + } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h index ddfffb75dcd..37f439444b5 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h @@ -42,14 +42,6 @@ bool do_intersect(const Iso_cuboid_3& a, return K().do_intersect_3_object()(b, a); } -template -void intersection(const CGAL::Bbox_3&, - const Iso_cuboid_3&) {} - -template -void intersection(const Iso_cuboid_3& a, - const CGAL::Bbox_3& b) {} - } // namespace CGAL #endif // CGAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h index 85bdf4735a1..a9750eee8cd 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h @@ -43,14 +43,6 @@ bool do_intersect(const Plane_3& a, return K().do_intersect_3_object()(a, b); } -template -void intersection(const CGAL::Bbox_3&, - const Plane_3&) {} - -template -void intersection(const Plane_3&, - const CGAL::Bbox_3&) {} - } #endif // CGAL_INTERSECTIONS_3_BBOX_3_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h index f6181c1179a..5d83281ad2f 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h @@ -42,15 +42,6 @@ bool do_intersect(const Sphere_3& a, return K().do_intersect_3_object()(a, b); } -template -void intersection(const CGAL::Bbox_3&, - const Sphere_3&) {} - -template -void intersection(const Sphere_3&, - const CGAL::Bbox_3&) {} - - } #endif // CGAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h index ef801caedb9..b62050eefed 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h @@ -41,14 +41,7 @@ bool do_intersect(const Tetrahedron_3& a, const CGAL::Bbox_3& b) { return K().do_intersect_3_object()(a, b); } - -template -void intersection(const CGAL::Bbox_3&, - const Tetrahedron_3&) {} -template -void intersection(const Tetrahedron_3&, - const CGAL::Bbox_3&) {} } // namespace CGAL #endif // CGAL_INTERSECTIONS_3_BBOX_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h index d8555ac2385..c7d5a122a9e 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h @@ -41,15 +41,8 @@ bool do_intersect(const Triangle_3& a, const CGAL::Bbox_3& b) { return K().do_intersect_3_object()(a, b); } - -template -void intersection(const CGAL::Bbox_3&, - const Triangle_3&) {} -template -void intersection(const Triangle_3&, - const CGAL::Bbox_3&) {} -} // mnamespace CGAL +} // namespace CGAL #endif // CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h index 3ee868524ac..11c5eff3120 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Plane_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3, Plane_3, 3) } #endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h index e1b2e3b90c0..5562ba55e02 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h @@ -31,7 +31,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Sphere_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3, Sphere_3, 3) } diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h index 998b2ed8122..866a93fc5ea 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h @@ -31,7 +31,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3) } #endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h index 35cbb36c5fc..9c0e6ac71e2 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3,Triangle_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Iso_cuboid_3,Triangle_3, 3) } #endif // CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h index 403c980a376..7419504d724 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Sphere_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Line_3, Sphere_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Line_3, Sphere_3, 3) } #endif // CGAL_INTERSECTIONS_3_LINE_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h index 4fcb49dbde3..0566ccb561b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Tetrahedron_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Line_3, Tetrahedron_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Line_3, Tetrahedron_3, 3) } #endif // CGAL_INTERSECTIONS_3_LINE_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h index bbf232a5982..ef92801ef67 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Tetrahedron_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Tetrahedron_3, Plane_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Tetrahedron_3, Plane_3, 3) } #endif // CGAL_INTERSECTIONS_3_PLANE_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h index bf7b1bae922..c782a88be01 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h @@ -81,7 +81,6 @@ intersection(const typename K::Sphere_3 &sphere, } // namespace Intersections CGAL_INTERSECTION_FUNCTION(Point_3, Sphere_3, 3) -CGAL_DO_INTERSECT_FUNCTION(Point_3, Sphere_3, 3) } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h index 07aac51d885..d706e7b82be 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Sphere_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Ray_3, Sphere_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Ray_3, Sphere_3, 3) } #endif // CGAL_INTERSECTIONS_3_RAY_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h index 3f60c304a56..b9b4b10c93b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Ray_3_Tetrahedron_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Ray_3, Tetrahedron_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Ray_3, Tetrahedron_3, 3) } #endif // CGAL_INTERSECTIONS_3_RAY_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h index cc12c1d9ba9..1ed0338d690 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Sphere_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Segment_3, Sphere_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Segment_3, Sphere_3, 3) } #endif // CGAL_INTERSECTIONS_3_SEGMENT_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h index 2348bb216dd..c89e2b7fa21 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h @@ -31,7 +31,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Segment_3, Tetrahedron_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Segment_3, Tetrahedron_3, 3) } #endif // CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h index 14be9e0ae96..410bd6f2dcf 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h @@ -31,7 +31,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Tetrahedron_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Sphere_3, Tetrahedron_3, 3) } #endif // CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h index f95193206bd..a65a5f48e31 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h @@ -31,7 +31,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Triangle_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Sphere_3, Triangle_3, 3) } #endif // CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h index 9db65c326ec..da0193e3291 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Tetrahedron_3, Triangle_3, 3) - CGAL_NO_INTERSECTION_FUNCTION(Tetrahedron_3, Triangle_3, 3) } #endif // CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_H diff --git a/Intersections_3/test/Intersections_3/CMakeLists.txt b/Intersections_3/test/Intersections_3/CMakeLists.txt index 36d2d70e1d3..06c728fffe6 100644 --- a/Intersections_3/test/Intersections_3/CMakeLists.txt +++ b/Intersections_3/test/Intersections_3/CMakeLists.txt @@ -21,17 +21,6 @@ if ( CGAL_FOUND ) foreach(cppfile ${cppfiles}) 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() diff --git a/Intersections_3/test/Intersections_3/one.cpp b/Intersections_3/test/Intersections_3/one.cpp deleted file mode 100644 index c1f47980933..00000000000 --- a/Intersections_3/test/Intersections_3/one.cpp +++ /dev/null @@ -1,249 +0,0 @@ - -#include -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -//#include -//typedef CGAL::Cartesian K; - - -#if (SEL == 1) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Bbox_3 T2; -#elif (SEL == 2) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Iso_cuboid_3 T2; -#elif (SEL == 3) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Line_3 T2; -#elif (SEL == 4) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Plane_3 T2; -#elif (SEL == 5) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Ray_3 T2; -#elif (SEL == 6) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Segment_3 T2; -#elif (SEL == 7) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 8) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 9) -#include -typedef CGAL::Bbox_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 10) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Iso_cuboid_3 T2; -#elif (SEL == 11) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Line_3 T2; -#elif (SEL == 12) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Plane_3 T2; -#elif (SEL == 13) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Point_3 T2; -#elif (SEL == 14) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Ray_3 T2; -#elif (SEL == 15) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Segment_3 T2; -#elif (SEL == 16) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 17) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 18) -#include -typedef CGAL::Iso_cuboid_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 19) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Line_3 T2; -#elif (SEL == 20) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Plane_3 T2; -#elif (SEL == 21) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Point_3 T2; -#elif (SEL == 22) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Ray_3 T2; -#elif (SEL == 23) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Segment_3 T2; -#elif (SEL == 24) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 25) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 26) -#include -typedef CGAL::Line_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 27) -#include -typedef CGAL::Plane_3 T1; -typedef CGAL::Plane_3 T2; -#elif (SEL == 28) -#include -typedef CGAL::Plane_3 T1; -typedef CGAL::Point_3 T2; -#elif (SEL == 29) -#include -typedef CGAL::Plane_3 T1; -typedef CGAL::Ray_3 T2; -#elif (SEL == 30) -#include -typedef CGAL::Plane_3 T1; -typedef CGAL::Segment_3 T2; -#elif (SEL == 31) -#include -typedef CGAL::Plane_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 32) -#include -typedef CGAL::Plane_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 33) -#include -typedef CGAL::Plane_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 34) -// duplicate -#elif (SEL == 35) -#include -typedef CGAL::Point_3 T1; -typedef CGAL::Point_3 T2; -#elif (SEL == 36) -#include -typedef CGAL::Point_3 T1; -typedef CGAL::Ray_3 T2; -#elif (SEL == 37) -#include -typedef CGAL::Point_3 T1; -typedef CGAL::Segment_3 T2; -#elif (SEL == 38) -#include -typedef CGAL::Point_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 39) -#include -typedef CGAL::Point_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 40) -#include -typedef CGAL::Point_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 41) -#include -typedef CGAL::Ray_3 T1; -typedef CGAL::Ray_3 T2; -#elif (SEL == 42) -#include -typedef CGAL::Ray_3 T1; -typedef CGAL::Segment_3 T2; -#elif (SEL == 43) -#include -typedef CGAL::Ray_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 44) -#include -typedef CGAL::Ray_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 45) -#include -typedef CGAL::Ray_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 46) -#include -typedef CGAL::Segment_3 T1; -typedef CGAL::Segment_3 T2; -#elif (SEL == 47) -#include -typedef CGAL::Segment_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 48) -#include -typedef CGAL::Segment_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 49) -#include -typedef CGAL::Segment_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 50) -#include -typedef CGAL::Sphere_3 T1; -typedef CGAL::Sphere_3 T2; -#elif (SEL == 51) -#include -typedef CGAL::Sphere_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 52) -#include -typedef CGAL::Sphere_3 T1; -typedef CGAL::Triangle_3 T2; - -#elif (SEL == 53) -#include -typedef CGAL::Tetrahedron_3 T1; -typedef CGAL::Tetrahedron_3 T2; -#elif (SEL == 54) -#include -typedef CGAL::Tetrahedron_3 T1; -typedef CGAL::Triangle_3 T2; - -#else -#include -typedef CGAL::Triangle_3 T1; -typedef CGAL::Triangle_3 T2; -#endif - -int main() -{ - T1 t1; - T2 t2; - try { - do_intersect(t1,t2); - do_intersect(t2,t1); - intersection(t1,t2); - intersection(t2,t1); - } catch(...){} - return 0; -} - From 9bfbd567d5aa4c5ecaf668bb0a55abd2ce269199 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 17 May 2018 14:30:30 +0100 Subject: [PATCH 32/48] Remove CGAL_NO_INTERSECTION_FUNCTION and functions doing nothing --- .../include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h index ec440f0b403..d98d450609b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h @@ -29,8 +29,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION_SELF(Tetrahedron_3, 3) - - CGAL_NO_INTERSECTION_FUNCTION_SELF(Tetrahedron_3, 3) } #endif // CGAL_INTERSECTIONS_3_TETRAHEDRON_3_TETRAHEDRON_3_H From 1d12605ef4629fb0b7eaae0039d3458c30660a5f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 17 May 2018 14:53:07 +0100 Subject: [PATCH 33/48] Merge headers --- Intersections_2/include/CGAL/intersection_2.h | 28 ++++++++++-- .../include/CGAL/intersection_2_1.h | 43 ------------------- .../include/CGAL/intersection_2_2.h | 42 ------------------ .../include/CGAL/intersection_2_3.h | 34 --------------- 4 files changed, 25 insertions(+), 122 deletions(-) delete mode 100644 Intersections_2/include/CGAL/intersection_2_1.h delete mode 100644 Intersections_2/include/CGAL/intersection_2_2.h delete mode 100644 Intersections_2/include/CGAL/intersection_2_3.h diff --git a/Intersections_2/include/CGAL/intersection_2.h b/Intersections_2/include/CGAL/intersection_2.h index cce2e59e778..f08be121399 100644 --- a/Intersections_2/include/CGAL/intersection_2.h +++ b/Intersections_2/include/CGAL/intersection_2.h @@ -28,8 +28,30 @@ #ifndef CGAL_INTERSECTION_2_H #define CGAL_INTERSECTION_2_H -#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 #endif // CGAL_INTERSECTION_2_H diff --git a/Intersections_2/include/CGAL/intersection_2_1.h b/Intersections_2/include/CGAL/intersection_2_1.h deleted file mode 100644 index 32c66d1b44b..00000000000 --- a/Intersections_2/include/CGAL/intersection_2_1.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - - - -#ifndef CGAL_INTERSECTION_2_1_H -#define CGAL_INTERSECTION_2_1_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/Intersections_2/include/CGAL/intersection_2_2.h b/Intersections_2/include/CGAL/intersection_2_2.h deleted file mode 100644 index 0840a53045a..00000000000 --- a/Intersections_2/include/CGAL/intersection_2_2.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - - - -#ifndef CGAL_INTERSECTION_2_2_H -#define CGAL_INTERSECTION_2_2_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/Intersections_2/include/CGAL/intersection_2_3.h b/Intersections_2/include/CGAL/intersection_2_3.h deleted file mode 100644 index 4774bc778bf..00000000000 --- a/Intersections_2/include/CGAL/intersection_2_3.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2000 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// 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 -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// 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$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// -// Author(s) : Geert-Jan Giezeman - - - -#ifndef CGAL_INTERSECTION_2_3_H -#define CGAL_INTERSECTION_2_3_H - -#include -#include - -#endif From 05437e0c54abe015d124e15265a79cc8417cb6ac Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 17 May 2018 15:23:04 +0100 Subject: [PATCH 34/48] Add several 2D tests and functions --- .../CGAL/Intersections_2/Bbox_2_Circle_2.h | 46 +++++++ .../CGAL/Intersections_2/Bbox_2_Point_2.h | 95 +++++++++++++++ .../Circle_2_Iso_rectangle_2.h | 38 ++++++ .../CGAL/Intersections_2/Circle_2_Point_2.h | 87 ++++++++++++++ .../internal/Bbox_2_Circle_2_do_intersect.h | 112 ++++++++++++++++++ Intersections_2/include/CGAL/intersection_2.h | 6 + .../Intersections_2/test_intersections_2.cpp | 18 +++ 7 files changed, 402 insertions(+) create mode 100644 Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h create mode 100644 Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h create mode 100644 Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h create mode 100644 Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h create mode 100644 Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h new file mode 100644 index 00000000000..642c9a27211 --- /dev/null +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h @@ -0,0 +1,46 @@ +// Copyright (c) 2018 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Andreas Fabri +// + +#ifndef CGAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_H +#define CGAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_H + +#include +#include + +#include + +namespace CGAL { + +template +bool do_intersect(const CGAL::Bbox_2& a, + const Circle_2& b) { + return K().do_intersect_2_object()(a, b); +} + +template +bool do_intersect(const Circle_2& a, + const CGAL::Bbox_2& b) { + return K().do_intersect_2_object()(a, b); +} + +} +#endif // CGAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h new file mode 100644 index 00000000000..680df50550b --- /dev/null +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h @@ -0,0 +1,95 @@ +// Copyright (c) 2010 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Sebastien Loriot +// + +#ifndef CGAL_INTERSECTIONS_2_BBOX_2_POINT_2_H +#define CGAL_INTERSECTIONS_2_BBOX_2_POINT_2_H + +#include +#include + +#include + +namespace CGAL { + +template +bool do_intersect(const CGAL::Bbox_2& a, + const Point_2& b) { + Point_2 bl(a.xmin(), a.ymin()), tr(a.xmax(), a.ymax()); + + Iso_rectangle_2 ic(bl,tr); + return K().do_intersect_2_object()(ic, b); +} + + +template +bool do_intersect(const Point_2& a, + const CGAL::Bbox_2& b) { + return do_intersect(b,a); +} + +namespace Intersections { + +namespace internal { + +template +typename CGAL::Intersection_traits::result_type +intersection(const Point_2& a, + const CGAL::Bbox_2& b + ) { + if (do_intersect(a,b)) { + return Intersections::internal::intersection_return(a); + } + return Intersections::internal::intersection_return(); +} + + +template +typename CGAL::Intersection_traits::result_type +intersection(const CGAL::Bbox_2& b, + const typename K::Point_2 & a, + const K& k ) { + if (do_intersect(a,b)) { + return Intersections::internal::intersection_return(a); + } + return Intersections::internal::intersection_return(); +} + +} // namespace internal +} // namespace Intersections + +template +typename CGAL::Intersection_traits >::result_type +intersection(const CGAL::Bbox_2& b, + const typename Point_2 & a) +{ + return Intersections::internal::intersection(b,a,K()); +} + template +typename CGAL::Intersection_traits >::result_type + intersection(const typename Point_2 & a, + const CGAL::Bbox_2& b) +{ + return Intersections::internal::intersection(b,a,K()); +} +} // namespace CGAL + +#endif // CGAL_INTERSECTIONS_2_BBOX_2_POINT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h new file mode 100644 index 00000000000..38a870f2d07 --- /dev/null +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h @@ -0,0 +1,38 @@ +// Copyright (c) 2018 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Andreas Fabri +// + +#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H +#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H + +#include +#include + +#include + + +namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION(Iso_rectangle_2, Circle_2, 2) +} + + + +#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h new file mode 100644 index 00000000000..9ebdc4c4972 --- /dev/null +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h @@ -0,0 +1,87 @@ +// Copyright (c) 2018 INRIA Sophia-Antipolis (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Maxime Gimeno + +#ifndef CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H +#define CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H + +#include +#include +#include + +namespace CGAL { + +namespace Intersections { + +namespace internal { + +template +inline +bool +do_intersect(const typename K::Point_2 &pt, + const typename K::Circle_2 &circle, + const K&) +{ + return ! circle.has_on_unbounded_side(pt); +} + + +template +inline +bool +do_intersect(const typename K::Circle_2 &circle, + const typename K::Point_2 &pt, + const K&) +{ + return circle.has_on_unbounded_side(pt); +} + + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Point_2 &pt, + const typename K::Circle_2 &circle, + const K& k) +{ + if (do_intersect(pt,circle, k)) { + return intersection_return(pt); + } + return intersection_return(); +} + +template +typename CGAL::Intersection_traits +::result_type +intersection(const typename K::Circle_2 &circle, + const typename K::Point_2 &pt, + const K& k) +{ + return internal::intersection(pt, circle, k); +} + +} // namespace internal +} // namespace Intersections + +CGAL_INTERSECTION_FUNCTION(Point_2, Circle_2, 2) +CGAL_DO_INTERSECT_FUNCTION(Circle_2, Point_2, 2) + +} //namespace CGAL +#endif // CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h b/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h new file mode 100644 index 00000000000..1f78e9ea892 --- /dev/null +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h @@ -0,0 +1,112 @@ +// Copyright (c) 2018 GeometryFactory (France). +// 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 +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Andreas Fabri + + +#ifndef CGAL_INTERNAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_DO_INTERSECT_H +#define CGAL_INTERNAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_DO_INTERSECT_H + +#include +#include + +#include + + +namespace CGAL { + +namespace Intersections { + +namespace internal { + + template + bool do_intersect_circle_box_2(const typename K::Circle_2& circle, + const Box3& bbox, + const K&) + { + typedef typename K::FT FT; + typedef typename K::Point_2 Point; + FT d = FT(0); + FT distance = FT(0); + Point center = circle.center(); + + if(center.x() < (FT)bbox.xmin()) + { + d = (FT)bbox.xmin() - center.x(); + distance += d * d; + } + else if(center.x() > (FT)bbox.xmax()) + { + d = center.x() - (FT)bbox.xmax(); + distance += d * d; + } + + if(center.y() < (FT)bbox.ymin()) + { + d = (FT)bbox.ymin() - center.y(); + distance += d * d; + } + else if(center.y() > (FT)bbox.ymax()) + { + d = center.y() - (FT)bbox.ymax(); + distance += d * d; + } + + return distance <= circle.squared_radius(); + } + + template + bool do_intersect(const CGAL::Bbox_2& bbox, + const typename K::Circle_2& circle, + const K&) + { + return do_intersect_circle_box_2(circle, bbox, K()); + } + + + template + bool do_intersect(const typename K::Circle_2& circle, + const CGAL::Bbox_2& bbox, + const K&) + { + return do_intersect_circle_box_2(circle, bbox, K()); + } + + template + bool do_intersect(const typename K::Iso_rectangle_2& bbox, + const typename K::Circle_2& circle, + const K&) + { + return do_intersect_circle_box_2(circle, bbox, K()); + } + + + template + bool do_intersect(const typename K::Circle_2& circle, + const typename K::Iso_rectangle_2& bbox, + const K&) + { + return do_intersect_circle_box_2(circle, bbox, K()); + } + +} // namespace internal +} // namespace Intersections +} //namespace CGAL + +#endif // CGAL_INTERNAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_DO_INTERSECT_H diff --git a/Intersections_2/include/CGAL/intersection_2.h b/Intersections_2/include/CGAL/intersection_2.h index f08be121399..b5fe5594c7a 100644 --- a/Intersections_2/include/CGAL/intersection_2.h +++ b/Intersections_2/include/CGAL/intersection_2.h @@ -54,4 +54,10 @@ #include #include +#include +#include +#include +#include + + #endif // CGAL_INTERSECTION_2_H diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index 2d356464f3c..5a1e0c8e2f6 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -15,6 +15,11 @@ #include #include +#include +#include +#include +#include + #include #include @@ -65,6 +70,7 @@ struct Test { typedef CGAL::Ray_2< K > R; typedef CGAL::Triangle_2< K > T; typedef CGAL::Iso_rectangle_2< K > Rec; + typedef CGAL::Circle_2< K > C; typedef std::vector

Pol; @@ -152,6 +158,17 @@ struct Test { return P(to_nt(x*w), to_nt(y*w), to_nt(w)); } + void B_P() + { + CGAL::Bbox_2 bb(0,0,10,10); + P p(1,1), bl(0,0), tr(10,10); + C c(p,1); + Rec r(bl,tr); + check_intersection(bb,p,p,true); + check_intersection(c,p,p,true); + assert(do_intersect(r,c)); + } + void L_L() { std::cout << "Line - Line\n"; @@ -330,6 +347,7 @@ check_no_intersection (L(p(0, 0), p(10,10)), L(p(8,7), p(1, 0))); void run() { std::cout << "2D Intersection tests\n"; + B_P(); L_L(); S_S(); R_R(); From 31b5d5d3aa600a49efec90e9165295bfdbcdc64c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 17 May 2018 15:27:58 +0100 Subject: [PATCH 35/48] Reorder inclusions --- Intersections_2/include/CGAL/intersection_2.h | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/Intersections_2/include/CGAL/intersection_2.h b/Intersections_2/include/CGAL/intersection_2.h index b5fe5594c7a..d1672662b5b 100644 --- a/Intersections_2/include/CGAL/intersection_2.h +++ b/Intersections_2/include/CGAL/intersection_2.h @@ -28,36 +28,40 @@ #ifndef CGAL_INTERSECTION_2_H #define CGAL_INTERSECTION_2_H +#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 #endif // CGAL_INTERSECTION_2_H From c908ed5fa23ad752e367b6f5822defced25a60a3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 18 May 2018 15:46:34 +0100 Subject: [PATCH 36/48] No typename; no need for CGAL:: --- .../include/CGAL/Intersections_2/Bbox_2_Point_2.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h index 680df50550b..69176f42f1a 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h @@ -77,16 +77,16 @@ intersection(const CGAL::Bbox_2& b, } // namespace Intersections template -typename CGAL::Intersection_traits >::result_type -intersection(const CGAL::Bbox_2& b, - const typename Point_2 & a) +typename CGAL::Intersection_traits >::result_type +intersection(const Bbox_2& b, + const Point_2 & a) { return Intersections::internal::intersection(b,a,K()); } template -typename CGAL::Intersection_traits >::result_type - intersection(const typename Point_2 & a, - const CGAL::Bbox_2& b) +typename CGAL::Intersection_traits >::result_type + intersection(const Point_2 & a, + const Bbox_2& b) { return Intersections::internal::intersection(b,a,K()); } From 2f8515067c41c565b8c4e10c9f3eb7b07a07049f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 22 May 2018 10:51:39 +0100 Subject: [PATCH 37/48] Add #include for CGAL::abs() --- .../Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h index 8015f82c464..99f1e2ee078 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h @@ -25,6 +25,7 @@ #include +#include #include #include #include From a82b920b978a852c79e87f6c8f83e2f60e62a04e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 May 2018 09:47:42 +0100 Subject: [PATCH 38/48] Include --- .../Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h index 99f1e2ee078..2f2b27113f3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h @@ -25,6 +25,7 @@ #include +#include #include #include #include From 71c3c13664cf84ba5f4f7e98dde2765ce760aacd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 May 2018 14:49:50 +0100 Subject: [PATCH 39/48] fix dependencies --- Intersections_3/package_info/Intersections_3/dependencies | 1 + 1 file changed, 1 insertion(+) diff --git a/Intersections_3/package_info/Intersections_3/dependencies b/Intersections_3/package_info/Intersections_3/dependencies index 9404dbf7f32..a53fa50a264 100644 --- a/Intersections_3/package_info/Intersections_3/dependencies +++ b/Intersections_3/package_info/Intersections_3/dependencies @@ -1,5 +1,6 @@ Algebraic_foundations Distance_2 +Distance_3 Installation Intersections_2 Intersections_3 From 93d19591da5f8b2922a298b9ad975d5d0d171397 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 30 May 2018 15:24:50 +0100 Subject: [PATCH 40/48] To intersect a Circle_2 means to intersect the boundary --- .../include/CGAL/Intersections_2/Circle_2_Point_2.h | 4 ++-- Intersections_2/test/Intersections_2/test_intersections_2.cpp | 4 ++-- .../include/CGAL/Intersections_3/Point_3_Sphere_3.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h index 9ebdc4c4972..ab0f20d7d15 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h @@ -39,7 +39,7 @@ do_intersect(const typename K::Point_2 &pt, const typename K::Circle_2 &circle, const K&) { - return ! circle.has_on_unbounded_side(pt); + return circle.has_on_boundary(pt); } @@ -50,7 +50,7 @@ do_intersect(const typename K::Circle_2 &circle, const typename K::Point_2 &pt, const K&) { - return circle.has_on_unbounded_side(pt); + return circle.has_on_boundary(pt); } diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index 5a1e0c8e2f6..b43d81c9643 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -161,8 +161,8 @@ struct Test { void B_P() { CGAL::Bbox_2 bb(0,0,10,10); - P p(1,1), bl(0,0), tr(10,10); - C c(p,1); + P p(1,0), bl(0,0), tr(10,10); + C c(bl,1); Rec r(bl,tr); check_intersection(bb,p,p,true); check_intersection(c,p,p,true); diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h index c782a88be01..6b418d521c4 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h @@ -39,7 +39,7 @@ do_intersect(const typename K::Point_3 &pt, const typename K::Sphere_3 &sphere, const K&) { - return ! sphere.has_on_unbounded_side(pt); + return sphere.has_on(pt); } @@ -50,7 +50,7 @@ do_intersect(const typename K::Sphere_3 &sphere, const typename K::Point_3 &pt, const K&) { - return sphere.has_on_unbounded_side(pt); + return sphere.has_on(pt); } From d868969a07a2e4c521372fc3ce3b494d3b39ee97 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 30 May 2018 15:58:04 +0100 Subject: [PATCH 41/48] Add tests --- .../CGAL/Intersections_3/Point_3_Sphere_3.h | 6 +++--- .../test/Intersections_3/test_intersections_3.cpp | 14 ++++++++++++++ .../Kernel_23/Concepts/FunctionObjectConcepts.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h index 6b418d521c4..fdb5af0f8bc 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h @@ -39,7 +39,7 @@ do_intersect(const typename K::Point_3 &pt, const typename K::Sphere_3 &sphere, const K&) { - return sphere.has_on(pt); + return sphere.has_on_boundary(pt); } @@ -50,7 +50,7 @@ do_intersect(const typename K::Sphere_3 &sphere, const typename K::Point_3 &pt, const K&) { - return sphere.has_on(pt); + return sphere.has_on_boundary(pt); } @@ -81,7 +81,7 @@ intersection(const typename K::Sphere_3 &sphere, } // namespace Intersections CGAL_INTERSECTION_FUNCTION(Point_3, Sphere_3, 3) - +CGAL_DO_INTERSECT_FUNCTION(Point_3, Sphere_3, 3) } //namespace CGAL #endif // CGAL_INTERSECTIONS_3_POINT_3_SPHERE_3_H diff --git a/Intersections_3/test/Intersections_3/test_intersections_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_3.cpp index b3c63e243b1..2a2468ca6fd 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_3.cpp @@ -77,6 +77,7 @@ struct Test { typedef CGAL::Triangle_3< K > Tr; typedef CGAL::Ray_3< K > R; typedef CGAL::Iso_cuboid_3< K > Cub; + typedef CGAL::Sphere_3< K > Sph; typedef CGAL::Bbox_3 Bbox; @@ -170,6 +171,18 @@ struct Test { return Pl(to_nt(a*w), to_nt(b*w), to_nt(c*w), to_nt(d*w)); } + void P_do_intersect() + { + P p(0,0,0), q(1,0,0), r(2,0,0), s(10,10,10); + Sph sph(p,1); + Cub cub(p,r); + assert(do_intersect(q,sph)); + assert(do_intersect(sph,q)); + assert(! do_intersect(s,cub)); + assert(! do_intersect(cub,s)); + } + + void Cub_Cub() { std::cout << "Iso_cuboid - Iso_cuboid\n"; @@ -571,6 +584,7 @@ struct Test { void run() { std::cout << "3D Intersection tests\n"; + P_do_intersect(); Cub_Cub(); L_Cub(); Pl_L(); diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 2cb3db219c7..a89c59ba0d9 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -7389,6 +7389,7 @@ public: the types `Type1` and `Type2` can be any of the following: + - `Kernel::Point_2` - `Kernel::Plane_3` - `Kernel::Line_3` - `Kernel::Ray_3` From aee51d4b421a1bbfe3b3f277f655decf42bddb5a Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 24 May 2018 17:13:39 +0200 Subject: [PATCH 42/48] Add Dependency to Distance_3 --- AABB_tree/package_info/AABB_tree/dependencies | 1 + Convex_hull_d/package_info/Convex_hull_d/dependencies | 1 + Nef_S2/package_info/Nef_S2/dependencies | 1 + .../Optimal_transportation_reconstruction_2/dependencies | 1 + Polyhedron/package_info/Polyhedron/dependencies | 1 + .../package_info/Surface_mesh_parameterization/dependencies | 1 + .../package_info/Surface_mesh_segmentation/dependencies | 1 + .../package_info/Surface_mesh_shortest_path/dependencies | 1 + Visibility_2/package_info/Visibility_2/dependencies | 1 + 9 files changed, 9 insertions(+) diff --git a/AABB_tree/package_info/AABB_tree/dependencies b/AABB_tree/package_info/AABB_tree/dependencies index 68b30352078..c72f4088b6a 100644 --- a/AABB_tree/package_info/AABB_tree/dependencies +++ b/AABB_tree/package_info/AABB_tree/dependencies @@ -16,3 +16,4 @@ Property_map STL_Extension Spatial_searching Stream_support +Distance_3 diff --git a/Convex_hull_d/package_info/Convex_hull_d/dependencies b/Convex_hull_d/package_info/Convex_hull_d/dependencies index acd33093f76..81659211144 100644 --- a/Convex_hull_d/package_info/Convex_hull_d/dependencies +++ b/Convex_hull_d/package_info/Convex_hull_d/dependencies @@ -14,3 +14,4 @@ Number_types Profiling_tools STL_Extension Stream_support +Distance_3 diff --git a/Nef_S2/package_info/Nef_S2/dependencies b/Nef_S2/package_info/Nef_S2/dependencies index 37eb1b85d72..75135011028 100644 --- a/Nef_S2/package_info/Nef_S2/dependencies +++ b/Nef_S2/package_info/Nef_S2/dependencies @@ -16,3 +16,4 @@ Profiling_tools STL_Extension Stream_support Union_find +Distance_3 diff --git a/Optimal_transportation_reconstruction_2/package_info/Optimal_transportation_reconstruction_2/dependencies b/Optimal_transportation_reconstruction_2/package_info/Optimal_transportation_reconstruction_2/dependencies index 625a107675c..9b809650984 100644 --- a/Optimal_transportation_reconstruction_2/package_info/Optimal_transportation_reconstruction_2/dependencies +++ b/Optimal_transportation_reconstruction_2/package_info/Optimal_transportation_reconstruction_2/dependencies @@ -20,3 +20,4 @@ Spatial_sorting Stream_support TDS_2 Triangulation_2 +Distance_3 diff --git a/Polyhedron/package_info/Polyhedron/dependencies b/Polyhedron/package_info/Polyhedron/dependencies index 70c007e409d..b810ef1e411 100644 --- a/Polyhedron/package_info/Polyhedron/dependencies +++ b/Polyhedron/package_info/Polyhedron/dependencies @@ -19,3 +19,4 @@ Profiling_tools Property_map STL_Extension Stream_support +Distance_3 diff --git a/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies b/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies index 3ea7153c7fe..9dbfd435104 100644 --- a/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies +++ b/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies @@ -24,3 +24,4 @@ Stream_support Surface_mesh_parameterization TDS_2 Triangulation_2 +Distance_3 diff --git a/Surface_mesh_segmentation/package_info/Surface_mesh_segmentation/dependencies b/Surface_mesh_segmentation/package_info/Surface_mesh_segmentation/dependencies index b7ba1c38b01..233d2d2991f 100644 --- a/Surface_mesh_segmentation/package_info/Surface_mesh_segmentation/dependencies +++ b/Surface_mesh_segmentation/package_info/Surface_mesh_segmentation/dependencies @@ -19,3 +19,4 @@ STL_Extension Spatial_searching Stream_support Surface_mesh_segmentation +Distance_3 diff --git a/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies b/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies index 84f2a31f587..1124ba800da 100644 --- a/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies +++ b/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies @@ -17,3 +17,4 @@ STL_Extension Spatial_searching Stream_support Surface_mesh_shortest_path +Distance_3 diff --git a/Visibility_2/package_info/Visibility_2/dependencies b/Visibility_2/package_info/Visibility_2/dependencies index c4a79a1d03c..df17db35a32 100644 --- a/Visibility_2/package_info/Visibility_2/dependencies +++ b/Visibility_2/package_info/Visibility_2/dependencies @@ -23,3 +23,4 @@ Surface_sweep_2 TDS_2 Triangulation_2 Visibility_2 +Distance_3 From 057f4eafe7e399d40abde69f4c3031f1214c6232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 2 Nov 2018 14:17:16 +0100 Subject: [PATCH 43/48] fix warning + cosmetic changes --- .../CGAL/Intersections_2/Bbox_2_Circle_2.h | 2 +- .../CGAL/Intersections_2/Bbox_2_Point_2.h | 42 +++--- .../Circle_2_Iso_rectangle_2.h | 3 - .../CGAL/Intersections_2/Circle_2_Point_2.h | 7 +- .../internal/Bbox_2_Circle_2_do_intersect.h | 132 +++++++++--------- .../CGAL/Intersections_3/Bbox_3_Bbox_3.h | 16 +-- .../CGAL/Intersections_3/Bbox_3_Line_3.h | 2 +- .../CGAL/Intersections_3/Bbox_3_Plane_3.h | 2 +- .../CGAL/Intersections_3/Bbox_3_Point_3.h | 29 ++-- .../CGAL/Intersections_3/Bbox_3_Ray_3.h | 2 +- .../CGAL/Intersections_3/Bbox_3_Segment_3.h | 4 +- .../CGAL/Intersections_3/Bbox_3_Sphere_3.h | 2 +- .../Intersections_3/Iso_cuboid_3_Point_3.h | 9 +- .../Intersections_3/Iso_cuboid_3_Sphere_3.h | 3 - .../Iso_cuboid_3_Tetrahedron_3.h | 1 - .../CGAL/Intersections_3/Line_3_Point_3.h | 15 +- .../CGAL/Intersections_3/Plane_3_Point_3.h | 13 +- .../CGAL/Intersections_3/Point_3_Point_3.h | 5 +- .../CGAL/Intersections_3/Point_3_Ray_3.h | 4 +- .../CGAL/Intersections_3/Point_3_Segment_3.h | 7 +- .../CGAL/Intersections_3/Point_3_Sphere_3.h | 7 +- .../Intersections_3/Point_3_Tetrahedron_3.h | 7 +- .../Intersections_3/Segment_3_Tetrahedron_3.h | 1 - .../Intersections_3/Sphere_3_Tetrahedron_3.h | 1 - .../Intersections_3/Sphere_3_Triangle_3.h | 1 - .../Bbox_3_Iso_cuboid_3_do_intersect.h | 28 ++-- .../Iso_cuboid_3_Ray_3_do_intersect.h | 56 ++++---- .../Iso_cuboid_3_Segment_3_do_intersect.h | 58 ++++---- .../Iso_cuboid_3_Sphere_3_do_intersect.h | 35 +++-- .../Iso_cuboid_3_Triangle_3_do_intersect.h | 30 ++-- .../Tetrahedron_3_Bounded_3_do_intersect.h | 23 ++- .../Tetrahedron_3_Unbounded_3_do_intersect.h | 10 +- .../Triangle_3_Sphere_3_do_intersect.h | 55 ++++---- .../test/Intersections_3/tetrahedron.cpp | 12 +- 34 files changed, 300 insertions(+), 324 deletions(-) diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h index 642c9a27211..aaa9f323f1c 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h @@ -41,6 +41,6 @@ bool do_intersect(const Circle_2& a, const CGAL::Bbox_2& b) { return K().do_intersect_2_object()(a, b); } - + } #endif // CGAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h index 69176f42f1a..5df79996e48 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h @@ -29,20 +29,22 @@ #include namespace CGAL { - + template bool do_intersect(const CGAL::Bbox_2& a, - const Point_2& b) { + const Point_2& b) +{ Point_2 bl(a.xmin(), a.ymin()), tr(a.xmax(), a.ymax()); - + Iso_rectangle_2 ic(bl,tr); return K().do_intersect_2_object()(ic, b); } - + template bool do_intersect(const Point_2& a, - const CGAL::Bbox_2& b) { + const CGAL::Bbox_2& b) +{ return do_intersect(b,a); } @@ -53,24 +55,23 @@ namespace internal { template typename CGAL::Intersection_traits::result_type intersection(const Point_2& a, - const CGAL::Bbox_2& b - ) { - if (do_intersect(a,b)) { - return Intersections::internal::intersection_return(a); - } - return Intersections::internal::intersection_return(); + const CGAL::Bbox_2& b) +{ + if (do_intersect(a,b)) + return Intersections::internal::intersection_return(a); + return Intersections::internal::intersection_return(); } - + template typename CGAL::Intersection_traits::result_type -intersection(const CGAL::Bbox_2& b, +intersection(const CGAL::Bbox_2& b, const typename K::Point_2 & a, - const K& k ) { - if (do_intersect(a,b)) { - return Intersections::internal::intersection_return(a); - } - return Intersections::internal::intersection_return(); + const K& /*k*/ ) +{ + if (do_intersect(a,b)) + return Intersections::internal::intersection_return(a); + return Intersections::internal::intersection_return(); } } // namespace internal @@ -78,12 +79,13 @@ intersection(const CGAL::Bbox_2& b, template typename CGAL::Intersection_traits >::result_type -intersection(const Bbox_2& b, +intersection(const Bbox_2& b, const Point_2 & a) { return Intersections::internal::intersection(b,a,K()); } - template + +template typename CGAL::Intersection_traits >::result_type intersection(const Point_2 & a, const Bbox_2& b) diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h index 38a870f2d07..8aae18ec2d2 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h @@ -28,11 +28,8 @@ #include - namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_rectangle_2, Circle_2, 2) } - - #endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h index ab0f20d7d15..17483d4ec86 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -61,9 +61,8 @@ intersection(const typename K::Point_2 &pt, const typename K::Circle_2 &circle, const K& k) { - if (do_intersect(pt,circle, k)) { + if (do_intersect(pt,circle, k)) return intersection_return(pt); - } return intersection_return(); } @@ -79,7 +78,7 @@ intersection(const typename K::Circle_2 &circle, } // namespace internal } // namespace Intersections - + CGAL_INTERSECTION_FUNCTION(Point_2, Circle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Circle_2, Point_2, 2) diff --git a/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h b/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h index 1f78e9ea892..071dbd012a0 100644 --- a/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h @@ -15,7 +15,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0+ -// +// // // Author(s) : Andreas Fabri @@ -30,80 +30,80 @@ namespace CGAL { - + namespace Intersections { namespace internal { - template - bool do_intersect_circle_box_2(const typename K::Circle_2& circle, - const Box3& bbox, - const K&) - { - typedef typename K::FT FT; - typedef typename K::Point_2 Point; - FT d = FT(0); - FT distance = FT(0); - Point center = circle.center(); - - if(center.x() < (FT)bbox.xmin()) - { - d = (FT)bbox.xmin() - center.x(); - distance += d * d; - } - else if(center.x() > (FT)bbox.xmax()) - { - d = center.x() - (FT)bbox.xmax(); - distance += d * d; - } - - if(center.y() < (FT)bbox.ymin()) - { - d = (FT)bbox.ymin() - center.y(); - distance += d * d; - } - else if(center.y() > (FT)bbox.ymax()) - { - d = center.y() - (FT)bbox.ymax(); - distance += d * d; - } +template +bool do_intersect_circle_box_2(const typename K::Circle_2& circle, + const Box3& bbox, + const K&) +{ + typedef typename K::FT FT; + typedef typename K::Point_2 Point; + FT d = FT(0); + FT distance = FT(0); + Point center = circle.center(); - return distance <= circle.squared_radius(); + if(center.x() < (FT)bbox.xmin()) + { + d = (FT)bbox.xmin() - center.x(); + distance += d * d; + } + else if(center.x() > (FT)bbox.xmax()) + { + d = center.x() - (FT)bbox.xmax(); + distance += d * d; } - template - bool do_intersect(const CGAL::Bbox_2& bbox, - const typename K::Circle_2& circle, - const K&) - { - return do_intersect_circle_box_2(circle, bbox, K()); - } + if(center.y() < (FT)bbox.ymin()) + { + d = (FT)bbox.ymin() - center.y(); + distance += d * d; + } + else if(center.y() > (FT)bbox.ymax()) + { + d = center.y() - (FT)bbox.ymax(); + distance += d * d; + } - - template - bool do_intersect(const typename K::Circle_2& circle, - const CGAL::Bbox_2& bbox, - const K&) - { - return do_intersect_circle_box_2(circle, bbox, K()); - } - - template - bool do_intersect(const typename K::Iso_rectangle_2& bbox, - const typename K::Circle_2& circle, - const K&) - { - return do_intersect_circle_box_2(circle, bbox, K()); - } + return distance <= circle.squared_radius(); +} - - template - bool do_intersect(const typename K::Circle_2& circle, - const typename K::Iso_rectangle_2& bbox, - const K&) - { - return do_intersect_circle_box_2(circle, bbox, K()); - } +template +bool do_intersect(const CGAL::Bbox_2& bbox, + const typename K::Circle_2& circle, + const K&) +{ + return do_intersect_circle_box_2(circle, bbox, K()); +} + + +template +bool do_intersect(const typename K::Circle_2& circle, + const CGAL::Bbox_2& bbox, + const K&) +{ + return do_intersect_circle_box_2(circle, bbox, K()); +} + +template +bool do_intersect(const typename K::Iso_rectangle_2& bbox, + const typename K::Circle_2& circle, + const K&) +{ + return do_intersect_circle_box_2(circle, bbox, K()); +} + + +template +bool do_intersect(const typename K::Circle_2& circle, + const typename K::Iso_rectangle_2& bbox, + const K&) +{ + return do_intersect_circle_box_2(circle, bbox, K()); +} } // namespace internal } // namespace Intersections diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h index 59a02a3ed4f..d742cb8ff43 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h @@ -27,14 +27,14 @@ #include namespace CGAL { - bool - inline - do_intersect(const CGAL::Bbox_3& c, - const CGAL::Bbox_3& bbox) - { - return CGAL::do_overlap(c, bbox); - } - +bool +inline +do_intersect(const CGAL::Bbox_3& c, + const CGAL::Bbox_3& bbox) +{ + return CGAL::do_overlap(c, bbox); +} + } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h index b14111c620c..16afa74a743 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h @@ -42,7 +42,7 @@ bool do_intersect(const Line_3& a, const CGAL::Bbox_3& b) { return K().do_intersect_3_object()(a, b); } - + template typename Intersection_traits::result_type intersection(const CGAL::Bbox_3& a, diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h index a9750eee8cd..639a7986aee 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h @@ -42,7 +42,7 @@ bool do_intersect(const Plane_3& a, const CGAL::Bbox_3& b) { return K().do_intersect_3_object()(a, b); } - + } #endif // CGAL_INTERSECTIONS_3_BBOX_3_PLANE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h index 156a008a46c..e923357c38c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h @@ -30,17 +30,17 @@ #include namespace CGAL { - + template bool do_intersect(const CGAL::Bbox_3& a, const Point_3& b) { Point_3 bl(a.xmin(), a.ymin(),a.zmin()), tr(a.xmax(), a.ymax(),a.zmax()); - + Iso_cuboid_3 ic(bl,tr); return K().do_intersect_3_object()(ic, b); } - + template bool do_intersect(const Point_3& a, const CGAL::Bbox_3& b) { @@ -51,23 +51,22 @@ bool do_intersect(const Point_3& a, template typename Intersection_traits::result_type intersection(const Point_3& a, - const CGAL::Bbox_3& b - ) { - if (do_intersect(a,b)) { - return Intersections::internal::intersection_return(a); - } - return Intersections::internal::intersection_return(); + const CGAL::Bbox_3& b) +{ + if (do_intersect(a,b)) + return Intersections::internal::intersection_return(a); + return Intersections::internal::intersection_return(); } - + template typename Intersection_traits::result_type intersection(const CGAL::Bbox_3& b, - const Point_3& a) { - if (do_intersect(a,b)) { - return Intersections::internal::intersection_return(a); - } - return Intersections::internal::intersection_return(); + const Point_3& a) +{ + if (do_intersect(a,b)) + return Intersections::internal::intersection_return(a); + return Intersections::internal::intersection_return(); } } // namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h index da4d99448ad..72441388ff0 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h @@ -42,7 +42,7 @@ bool do_intersect(const Ray_3& a, const CGAL::Bbox_3& b) { return K().do_intersect_3_object()(a, b); } - + template typename Intersection_traits::result_type intersection(const CGAL::Bbox_3& a, diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h index 597e6d60469..243e37d5374 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h @@ -29,7 +29,7 @@ #include namespace CGAL { - + template bool do_intersect(const CGAL::Bbox_3& a, const Segment_3& b) { @@ -41,7 +41,7 @@ bool do_intersect(const Segment_3& a, const CGAL::Bbox_3& b) { return K().do_intersect_3_object()(a, b); } - + template typename Intersection_traits::result_type intersection(const CGAL::Bbox_3& a, diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h index 5d83281ad2f..62445c404e5 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h @@ -41,7 +41,7 @@ bool do_intersect(const Sphere_3& a, const CGAL::Bbox_3& b) { return K().do_intersect_3_object()(a, b); } - + } #endif // CGAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Point_3.h index 2d1ace333dd..c03335611ea 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Point_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Point_3.h @@ -37,7 +37,7 @@ do_intersect(const typename K::Point_3 &pt, const typename K::Iso_cuboid_3 &iso, const K&) { - return !iso.has_on_unbounded_side(pt); + return !iso.has_on_unbounded_side(pt); } template @@ -47,7 +47,7 @@ do_intersect(const typename K::Iso_cuboid_3 &iso, const typename K::Point_3 &pt, const K&) { - return !iso.has_on_unbounded_side(pt); + return !iso.has_on_unbounded_side(pt); } template @@ -57,9 +57,8 @@ intersection(const typename K::Point_3 &pt, const typename K::Iso_cuboid_3 &iso, const K& k) { - if (internal::do_intersect(pt,iso,k)) { + if (internal::do_intersect(pt,iso,k)) return intersection_return(pt); - } return intersection_return(); } @@ -75,7 +74,7 @@ intersection(const typename K::Iso_cuboid_3 &iso, } // namespace internal } // namespace Intersections - + CGAL_INTERSECTION_FUNCTION(Point_3, Iso_cuboid_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Iso_cuboid_3, 3) diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h index 5562ba55e02..b63ea70bc62 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h @@ -28,11 +28,8 @@ #include - namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Sphere_3, 3) } - - #endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h index 866a93fc5ea..e211d8f19a5 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3) - } #endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Point_3.h index 6f033fb37de..e05e8ac2ed2 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Point_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Point_3.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -38,7 +38,7 @@ do_intersect(const typename K::Point_3 &pt, const typename K::Line_3 &line, const K&) { - return line.has_on(pt); + return line.has_on(pt); } template @@ -47,7 +47,7 @@ do_intersect(const typename K::Line_3 &line, const typename K::Point_3 &pt, const K&) { - return line.has_on(pt); + return line.has_on(pt); } template @@ -57,10 +57,9 @@ intersection(const typename K::Point_3 &pt, const typename K::Line_3 &line, const K& k) { - if (do_intersect(pt,line,k)) { - return intersection_return(pt); - } - return intersection_return(); + if (do_intersect(pt,line,k)) + return intersection_return(pt); + return intersection_return(); } template @@ -75,7 +74,7 @@ intersection(const typename K::Line_3 &line, } // namespace internal } // namespace Intersections - + CGAL_INTERSECTION_FUNCTION(Point_3, Line_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Line_3, 3) diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Point_3.h index 96421de67fe..090ba9c0ae5 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Point_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Point_3.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -38,7 +38,7 @@ do_intersect(const typename K::Point_3 &pt, const typename K::Plane_3 &plane, const K&) { - return plane.has_on(pt); + return plane.has_on(pt); } template @@ -47,7 +47,7 @@ do_intersect(const typename K::Plane_3 &plane, const typename K::Point_3 &pt, const K&) { - return plane.has_on(pt); + return plane.has_on(pt); } template @@ -57,10 +57,9 @@ intersection(const typename K::Point_3 &pt, const typename K::Plane_3 &plane, const K& k) { - if (do_intersect(pt,plane,k)) { - return intersection_return(pt); - } - return intersection_return(); + if (do_intersect(pt,plane,k)) + return intersection_return(pt); + return intersection_return(); } template diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Point_3.h index 68eac1cdcc5..f7e815fd1c0 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Point_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Point_3.h @@ -26,7 +26,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -47,9 +47,8 @@ intersection(const typename K::Point_3 &pt1, const typename K::Point_3 &pt2, const K&) { - if (pt1 == pt2) { + if (pt1 == pt2) return intersection_return(pt1); - } return intersection_return(); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Ray_3.h index dbf1e0dfda6..9951c634c72 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Ray_3.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -79,7 +79,7 @@ intersection(const typename K::Ray_3 &ray, } // namespace internal } // namespace Intersections - + CGAL_INTERSECTION_FUNCTION(Point_3, Ray_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Ray_3, 3) diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Segment_3.h index 4d0425db3c3..93d441674a5 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Segment_3.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -61,9 +61,8 @@ intersection(const typename K::Point_3 &pt, const typename K::Segment_3 &seg, const K& k) { - if (do_intersect(pt,seg, k)) { + if (do_intersect(pt,seg, k)) return intersection_return(pt); - } return intersection_return(); } @@ -80,7 +79,7 @@ intersection( const typename K::Segment_3 &seg, } // namespace internal } // namespace Intersections - + CGAL_INTERSECTION_FUNCTION(Point_3, Segment_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Segment_3, 3) diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h index fdb5af0f8bc..0470340ef77 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Sphere_3.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -61,9 +61,8 @@ intersection(const typename K::Point_3 &pt, const typename K::Sphere_3 &sphere, const K& k) { - if (do_intersect(pt,sphere, k)) { + if (do_intersect(pt,sphere, k)) return intersection_return(pt); - } return intersection_return(); } @@ -79,7 +78,7 @@ intersection(const typename K::Sphere_3 &sphere, } // namespace internal } // namespace Intersections - + CGAL_INTERSECTION_FUNCTION(Point_3, Sphere_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Sphere_3, 3) diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h index 886bd9dbaff..0e5cc9f9053 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -61,9 +61,8 @@ intersection(const typename K::Point_3 &pt, const typename K::Tetrahedron_3 &tetrahedron, const K& k) { - if (do_intersect(pt,tetrahedron, k)) { + if (do_intersect(pt,tetrahedron, k)) return intersection_return(pt); - } return intersection_return(); } @@ -79,7 +78,7 @@ intersection(const typename K::Tetrahedron_3 &tetrahedron, } // namespace internal } // namespace Intersections - + CGAL_INTERSECTION_FUNCTION(Point_3, Tetrahedron_3, 3) CGAL_DO_INTERSECT_FUNCTION(Point_3, Tetrahedron_3, 3) diff --git a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h index c89e2b7fa21..3f5dc525a4c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Segment_3_Tetrahedron_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Segment_3, Tetrahedron_3, 3) - } #endif // CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h index 410bd6f2dcf..2ccdfe0b4f4 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Tetrahedron_3, 3) - } #endif // CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h index a65a5f48e31..fbb765f7b57 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Sphere_3_Triangle_3.h @@ -30,7 +30,6 @@ namespace CGAL { CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Triangle_3, 3) - } #endif // CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h index fe0710a84d4..8aff1c21721 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h @@ -27,24 +27,24 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { - template - bool do_intersect(const CGAL::Bbox_3& bb, - const typename K::Iso_cuboid_3& ic, - const K& k) - { - if (bb.xmax() < ic.xmin() || ic.xmax() < bb.xmin()) - return false; - if (bb.ymax() < ic.ymin() || ic.ymax() < bb.ymin()) - return false; - if (bb.zmax() < ic.zmin() || ic.zmax() < bb.zmin()) - return false; - return true; - } +template +bool do_intersect(const CGAL::Bbox_3& bb, + const typename K::Iso_cuboid_3& ic, + const K& /* k */) +{ + if (bb.xmax() < ic.xmin() || ic.xmax() < bb.xmin()) + return false; + if (bb.ymax() < ic.ymin() || ic.ymax() < bb.ymin()) + return false; + if (bb.zmax() < ic.zmin() || ic.zmax() < bb.zmin()) + return false; + return true; +} } // namespace internal } // namespace Intersections diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h index 4c4e81707a6..16baac9bf82 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h @@ -32,41 +32,41 @@ // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf namespace CGAL { - + namespace Intersections { namespace internal { - template - bool do_intersect(const typename K::Ray_3& ray, - const typename K::Iso_cuboid_3& ic, - const K&) - { - typedef typename K::FT FT; - typedef typename K::Point_3 Point_3; +template +bool do_intersect(const typename K::Ray_3& ray, + const typename K::Iso_cuboid_3& ic, + const K&) +{ + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; - const Point_3& source = ray.source(); - const Point_3& point_on_ray = ray.second_point(); + const Point_3& source = ray.source(); + const Point_3& point_on_ray = ray.second_point(); - return do_intersect_bbox_segment_aux - // do not use static filters - ( - source.x(), source.y(), source.z(), - point_on_ray.x(), point_on_ray.y(), point_on_ray.z(), - (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), - (ic.max)().x(), (ic.max)().y(), (ic.max)().z() - ); - } + return do_intersect_bbox_segment_aux + // do not use static filters + ( + source.x(), source.y(), source.z(), + point_on_ray.x(), point_on_ray.y(), point_on_ray.z(), + (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), + (ic.max)().x(), (ic.max)().y(), (ic.max)().z() + ); +} - template - bool do_intersect(const typename K::Iso_cuboid_3& ic, - const typename K::Ray_3& ray, - const K&) { - return do_intersect(ray, ic, K()); - } +template +bool do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Ray_3& ray, + const K&) { + return do_intersect(ray, ic, K()); +} } // namespace internal } // namespace Intersections diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h index 0581686a99e..87d1ef922d3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h @@ -32,42 +32,42 @@ // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf namespace CGAL { - + namespace Intersections { namespace internal { - template - bool do_intersect(const typename K::Segment_3& seg, - const typename K::Iso_cuboid_3& ic, - const K&) - { - typedef typename K::FT FT; - typedef typename K::Point_3 Point_3; +template +bool do_intersect(const typename K::Segment_3& seg, + const typename K::Iso_cuboid_3& ic, + const K&) +{ + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; - const Point_3& source = seg.source(); - const Point_3& target = seg.target(); + const Point_3& source = seg.source(); + const Point_3& target = seg.target(); - return do_intersect_bbox_segment_aux - // do not use static filters - ( - source.x(), source.y(), source.z(), - target.x(), target.y(), target.z(), - (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), - (ic.max)().x(), (ic.max)().y(), (ic.max)().z() - ); - } + return do_intersect_bbox_segment_aux + // do not use static filters + ( + source.x(), source.y(), source.z(), + target.x(), target.y(), target.z(), + (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), + (ic.max)().x(), (ic.max)().y(), (ic.max)().z() + ); +} + +template +bool do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Segment_3& seg, + const K&) { + return do_intersect(seg, ic, K()); +} - template - bool do_intersect(const typename K::Iso_cuboid_3& ic, - const typename K::Segment_3& seg, - const K&) { - return do_intersect(seg, ic, K()); - } - } // namespace internal } // namespace Intersections } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h index 15f500a9cef..1e70cfef505 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h @@ -28,30 +28,30 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { - template - bool do_intersect(const typename K::Iso_cuboid_3& ic, - const typename K::Sphere_3& sphere, - const K&) - { - return do_intersect_sphere_box_3(sphere, ic, K()); - } +template +bool do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Sphere_3& sphere, + const K&) +{ + return do_intersect_sphere_box_3(sphere, ic, K()); +} + +template +bool do_intersect(const typename K::Sphere_3& sphere, + const typename K::Iso_cuboid_3& ic, + const K&) +{ + return do_intersect_sphere_box_3(sphere, ic, K()); +} - template - bool do_intersect(const typename K::Sphere_3& sphere, - const typename K::Iso_cuboid_3& ic, - const K&) - { - return do_intersect_sphere_box_3(sphere, ic, K()); - } - } // namespace internal } // namespace Intersections - + template bool do_intersect(const Iso_cuboid_3& a, const Sphere_3& b) { @@ -64,7 +64,6 @@ bool do_intersect(const Sphere_3& a, return K().do_intersect_3_object()(a, b); } - } //namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h index 2f3e216d802..5af2050b235 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h @@ -34,26 +34,26 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { - template - bool do_intersect(const typename K::Triangle_3& triangle, - const typename K::Iso_cuboid_3& bbox, - const K& k) - { - return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); - } +template +bool do_intersect(const typename K::Triangle_3& triangle, + const typename K::Iso_cuboid_3& bbox, + const K& k) +{ + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); +} - template - bool do_intersect(const typename K::Iso_cuboid_3& bbox, - const typename K::Triangle_3& triangle, - const K& k) - { - return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); - } +template +bool do_intersect(const typename K::Iso_cuboid_3& bbox, + const typename K::Triangle_3& triangle, + const K& k) +{ + return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); +} } // namespace internal } // namespace Intersections diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h index 770c0bf9c91..c5057cda77d 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h @@ -1,9 +1,9 @@ -// Copyright (c) 2005 +// Copyright (c) 2005 // 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) : Nico Kruithof @@ -33,11 +33,11 @@ namespace CGAL { - template - class Tetrahedron_3; +template +class Tetrahedron_3; namespace Intersections { - + namespace internal { template @@ -45,7 +45,7 @@ typename K::Boolean do_intersect(const typename K::Tetrahedron_3 &tet, const typename K::Triangle_3 &tr, const K & k); - + // This code is not optimized: template typename K::Boolean @@ -89,7 +89,7 @@ do_intersect(const typename K::Triangle_3 &tr, return do_intersect_tetrahedron_bounded(tr, tet, tr[0], k); } - + template inline typename K::Boolean @@ -99,7 +99,7 @@ do_intersect(const typename K::Tetrahedron_3 &tet, { return do_intersect_tetrahedron_bounded(seg, tet, seg.source(), k); } - + template inline typename K::Boolean @@ -109,7 +109,6 @@ do_intersect(const typename K::Segment_3 &seg, { return do_intersect_tetrahedron_bounded(seg, tet, seg.source(), k); } - template inline @@ -131,7 +130,6 @@ do_intersect(const typename K::Iso_cuboid_3 &ic, return do_intersect_tetrahedron_bounded(ic, tet, ic[0], k); } - template inline typename K::Boolean @@ -152,7 +150,6 @@ do_intersect(const typename K::Sphere_3 &sp, return do_intersect_tetrahedron_bounded(sp, tet, sp.center(), k); } - template inline typename K::Boolean @@ -182,7 +179,7 @@ do_intersect(const CGAL::Bbox_3 &bb, { return do_intersect_tetrahedron_bounded(bb, tet, typename K::Point_3(bb.xmin(), bb.ymin(), bb.zmin()), k); } - + } // namespace internal } // namespace Intersections } //namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h index b883187d24f..65c9d38c3be 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Unbounded_3_do_intersect.h @@ -27,7 +27,7 @@ #include namespace CGAL { - + namespace Intersections { namespace internal { @@ -52,7 +52,7 @@ bool do_intersect(const typename K::Plane_3& unb, 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, @@ -67,7 +67,7 @@ bool do_intersect(const typename K::Line_3& unb, 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, @@ -82,14 +82,14 @@ bool do_intersect(const typename K::Ray_3& unb, 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, const K& k) { return do_intersect_tetrahedron_unbounded(tet, unb, k); } - + } // namespace internal } // namespace Intersections } // namespace CGAL diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h index 84e05f0ef66..4cfb6c4b737 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h @@ -1,5 +1,5 @@ -// Copyright (c) 2018 GeometryFactory Sarl -// All rights reserved. +// Copyright (c) 2018 GeometryFactory Sarl +// 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 @@ -15,7 +15,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0+ -// +// // // Author(s) : Andreas Fabri @@ -27,55 +27,55 @@ namespace CGAL { - template - class Triangle_3; - - template - class Sphere_3; +template +class Triangle_3; + +template +class Sphere_3; + +template +class Line_3; - template - class Line_3; - namespace Intersections { - + namespace internal { - + template inline typename K::Boolean do_intersect(const typename K::Sphere_3 &sp, const typename K::Triangle_3 &tr, - const K & k) + const K & /* k */) { 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) + const K & /* k */) { return squared_distance(sp.center(), tr) <= sp.squared_radius(); -} +} template inline typename K::Boolean do_intersect(const typename K::Sphere_3 &sp, const typename K::Line_3 &lin, - const K & k) + const K & /* k */) { return squared_distance(sp.center(), lin) <= sp.squared_radius(); } - + template inline typename K::Boolean do_intersect(const typename K::Line_3 &lin, const typename K::Sphere_3 &sp, - const K & k) + const K & /* k */) { return squared_distance(sp.center(), lin) <= sp.squared_radius(); } @@ -87,18 +87,18 @@ inline typename K::Boolean do_intersect(const typename K::Sphere_3 &sp, const typename K::Ray_3 &lin, - const K & k) + const K & /* k */) { return squared_distance(sp.center(), lin) <= sp.squared_radius(); } - + template inline typename K::Boolean do_intersect(const typename K::Ray_3 &lin, const typename K::Sphere_3 &sp, - const K & k) + const K & /* k */) { return squared_distance(sp.center(), lin) <= sp.squared_radius(); } @@ -108,25 +108,24 @@ inline typename K::Boolean do_intersect(const typename K::Sphere_3 &sp, const typename K::Segment_3 &lin, - const K & k) + const K & /* k */) { return squared_distance(sp.center(), lin) <= sp.squared_radius(); } - + template inline typename K::Boolean do_intersect(const typename K::Segment_3 &lin, const typename K::Sphere_3 &sp, - const K & k) + const K & /* k */) { return squared_distance(sp.center(), lin) <= sp.squared_radius(); } - + } // namespace internal } // namespace Intersections } // namespace CGAL #endif // CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H - diff --git a/Intersections_3/test/Intersections_3/tetrahedron.cpp b/Intersections_3/test/Intersections_3/tetrahedron.cpp index 6c05a321df6..c094c2a434b 100644 --- a/Intersections_3/test/Intersections_3/tetrahedron.cpp +++ b/Intersections_3/test/Intersections_3/tetrahedron.cpp @@ -22,35 +22,33 @@ int main() { Tetrahedron tet; Sphere sp; - + CGAL::do_intersect(tet,Triangle()); CGAL::do_intersect(tet,Segment()); CGAL::do_intersect(tet,Iso_cuboid()); CGAL::do_intersect(tet,Sphere()); CGAL::do_intersect(tet,Plane()); CGAL::do_intersect(tet,Line()); - CGAL::do_intersect(tet,Ray()); + CGAL::do_intersect(tet,Ray()); CGAL::do_intersect(tet,tet); CGAL::do_intersect(tet,Bbox()); CGAL::do_intersect(sp, Line()); CGAL::do_intersect(sp, Ray()); CGAL::do_intersect(sp, Segment()); - - + CGAL::do_intersect(Triangle(), tet); CGAL::do_intersect(Segment(), tet); CGAL::do_intersect(Iso_cuboid(), tet); CGAL::do_intersect(Sphere(), tet); CGAL::do_intersect(Plane(), tet); CGAL::do_intersect(Line(), tet); - CGAL::do_intersect(Ray(), tet); + CGAL::do_intersect(Ray(), tet); CGAL::do_intersect(Bbox(), tet); - + CGAL::do_intersect(Line(), sp); CGAL::do_intersect(Ray(), sp); CGAL::do_intersect(Segment(), sp); return 0; - } From a76623e7e8ed7b33ba73ab512e5473051fac2eba Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 4 Nov 2018 11:21:27 +0100 Subject: [PATCH 44/48] Fix test --- .../test/Intersections_3/tetrahedron.cpp | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/Intersections_3/test/Intersections_3/tetrahedron.cpp b/Intersections_3/test/Intersections_3/tetrahedron.cpp index c094c2a434b..c51fe3506da 100644 --- a/Intersections_3/test/Intersections_3/tetrahedron.cpp +++ b/Intersections_3/test/Intersections_3/tetrahedron.cpp @@ -5,6 +5,7 @@ typedef CGAL::Cartesian K; +typedef K::Point_3 Point; typedef K::Tetrahedron_3 Tetrahedron; typedef K::Segment_3 Segment; @@ -20,35 +21,37 @@ typedef CGAL::Bbox_3 Bbox; int main() { - Tetrahedron tet; - Sphere sp; - - CGAL::do_intersect(tet,Triangle()); - CGAL::do_intersect(tet,Segment()); - CGAL::do_intersect(tet,Iso_cuboid()); - CGAL::do_intersect(tet,Sphere()); - CGAL::do_intersect(tet,Plane()); - CGAL::do_intersect(tet,Line()); - CGAL::do_intersect(tet,Ray()); + Point p(0,0,0), q(10,0,0), r(10,10,0), s(0, 10,10); + Point p2(1,1,1), q2(20,20,20), r2(0,0,20); + Tetrahedron tet(p,q,r,s); + Sphere sp(p2,1.0); + + CGAL::do_intersect(tet,Triangle(p2,q2,r2)); + CGAL::do_intersect(tet,Segment(p2,q2)); + CGAL::do_intersect(tet,Iso_cuboid(p2,q2)); + CGAL::do_intersect(tet,sp); + CGAL::do_intersect(tet,Plane(p2,q2,r2)); + CGAL::do_intersect(tet,Line(p2,q2)); + CGAL::do_intersect(tet,Ray(p2,q2)); CGAL::do_intersect(tet,tet); - CGAL::do_intersect(tet,Bbox()); - CGAL::do_intersect(sp, Line()); - CGAL::do_intersect(sp, Ray()); - CGAL::do_intersect(sp, Segment()); - - CGAL::do_intersect(Triangle(), tet); - CGAL::do_intersect(Segment(), tet); - CGAL::do_intersect(Iso_cuboid(), tet); - CGAL::do_intersect(Sphere(), tet); - CGAL::do_intersect(Plane(), tet); - CGAL::do_intersect(Line(), tet); - CGAL::do_intersect(Ray(), tet); - CGAL::do_intersect(Bbox(), tet); - - CGAL::do_intersect(Line(), sp); - CGAL::do_intersect(Ray(), sp); - CGAL::do_intersect(Segment(), sp); - + CGAL::do_intersect(tet,sp.bbox()); + CGAL::do_intersect(sp, Line(p2,q2)); + CGAL::do_intersect(sp, Ray(p2,q2)); + CGAL::do_intersect(sp, Segment(p2,q2)); + + + CGAL::do_intersect(Triangle(p2,q2,r2), tet); + CGAL::do_intersect(Segment(p2,q2), tet); + CGAL::do_intersect(Iso_cuboid(p2,q2), tet); + CGAL::do_intersect(sp, tet); + CGAL::do_intersect(Plane(p2,q2,r2), tet); + CGAL::do_intersect(Line(p2,q2), tet); + CGAL::do_intersect(Ray(p2,q2), tet); + CGAL::do_intersect(sp.bbox(), tet); + + CGAL::do_intersect(Line(p2,q2), sp); + CGAL::do_intersect(Ray(p2,q2), sp); + CGAL::do_intersect(Segment(p2,q2), sp); return 0; } From aac8ac4e6bd4b21198bd83bb2b53d19087008ab1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 29 Nov 2018 15:58:34 +0100 Subject: [PATCH 45/48] Some changes after Sebastien's review --- .../internal/Bbox_2_Circle_2_do_intersect.h | 16 ++++++------- .../Intersections_3/Point_3_Tetrahedron_3.h | 2 +- .../Tetrahedron_3_Bounded_3_do_intersect.h | 2 +- .../test/Intersections_3/CMakeLists.txt | 1 - .../test_point_3_intersections.cpp | 23 ++++++++++++++++++- 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h b/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h index 071dbd012a0..6306d383ef3 100644 --- a/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h @@ -46,25 +46,25 @@ bool do_intersect_circle_box_2(const typename K::Circle_2& circle, FT distance = FT(0); Point center = circle.center(); - if(center.x() < (FT)bbox.xmin()) + if(center.x() < FT(bbox.xmin())) { - d = (FT)bbox.xmin() - center.x(); + d = FT(bbox.xmin()) - center.x(); distance += d * d; } - else if(center.x() > (FT)bbox.xmax()) + else if(center.x() > FT(bbox.xmax())) { - d = center.x() - (FT)bbox.xmax(); + d = center.x() - FT(bbox.xmax()); distance += d * d; } - if(center.y() < (FT)bbox.ymin()) + if(center.y() < FT(bbox.ymin())) { - d = (FT)bbox.ymin() - center.y(); + d = FT(bbox.ymin()) - center.y(); distance += d * d; } - else if(center.y() > (FT)bbox.ymax()) + else if(center.y() > FT(bbox.ymax())) { - d = center.y() - (FT)bbox.ymax(); + d = center.y() - FT(bbox.ymax()); distance += d * d; } diff --git a/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h index 0e5cc9f9053..bb057a3eb7a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Point_3_Tetrahedron_3.h @@ -50,7 +50,7 @@ do_intersect(const typename K::Tetrahedron_3 &tetrahedron, const typename K::Point_3 &pt, const K&) { - return tetrahedron.has_on_unbounded_side(pt); + return ! tetrahedron.has_on_unbounded_side(pt); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h index c5057cda77d..8470ccd03c6 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Bounded_3_do_intersect.h @@ -51,7 +51,7 @@ do_intersect(const typename K::Tetrahedron_3 &tet, typename K::Boolean do_intersect_tetrahedron_bounded(const Bounded &tr, const typename K::Tetrahedron_3 &tet, - const typename K::Point_3 p, + const typename K::Point_3 &p, const K & k) { typedef typename K::Triangle_3 Triangle; diff --git a/Intersections_3/test/Intersections_3/CMakeLists.txt b/Intersections_3/test/Intersections_3/CMakeLists.txt index 06c728fffe6..4ed3ff0c953 100644 --- a/Intersections_3/test/Intersections_3/CMakeLists.txt +++ b/Intersections_3/test/Intersections_3/CMakeLists.txt @@ -21,7 +21,6 @@ if ( CGAL_FOUND ) foreach(cppfile ${cppfiles}) create_single_source_cgal_program( "${cppfile}" ) endforeach() - else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp b/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp index 8dbfd3efe10..447d5c0907d 100644 --- a/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp +++ b/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp @@ -89,6 +89,25 @@ void test_P_Pl() assert(res == p); } +template +void test_P_Tet() +{ + typedef CGAL::Point_3 P; + typedef CGAL::Tetrahedron_3 T; + P p(0,0,0), q(1,0,0), r(1,1,0), s(0,0,1); + T t(p,q,r,s); + P q0(0.1, 0.1, 0.1), q1(10,10,10); + + assert(CGAL::do_intersect(p,t)); + assert(CGAL::do_intersect(t,p)); + + assert(CGAL::do_intersect(q0,t)); + assert(CGAL::do_intersect(t,q0)); + + assert(! CGAL::do_intersect(q1,t)); + assert(! CGAL::do_intersect(t,q1)); +} + int main() { test_P_Cub(); @@ -99,7 +118,6 @@ int main() test_P_R(); test_P_R(); - test_P_S(); test_P_S(); @@ -108,6 +126,9 @@ int main() test_P_Pl(); test_P_Pl(); + + test_P_Tet(); + test_P_Tet(); } #include From e58de4baa17d7ce212fab4ff5025c6aa256b9f4f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 3 Dec 2018 12:52:06 +0100 Subject: [PATCH 46/48] cleanup --- .../internal/Bbox_3_Bbox_3_do_intersect.h | 2 -- .../Intersections_3/test_intersections_3.cpp | 17 +---------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Bbox_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Bbox_3_do_intersect.h index cc435e22b10..94ba0853ffa 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Bbox_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Bbox_3_do_intersect.h @@ -40,8 +40,6 @@ 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/test/Intersections_3/test_intersections_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_3.cpp index 9244239016f..fd14042279b 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_3.cpp @@ -1,18 +1,3 @@ -#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 @@ -612,4 +597,4 @@ int main() Test< CGAL::Homogeneous >().run(); // TODO : test more kernels. } -#endif + From df08a8b8fa41bc3d5f059248017a728b71eb761c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 3 Dec 2018 15:26:39 +0100 Subject: [PATCH 47/48] Do not include extra files in the testsuite --- .../test/Intersections_3/bbox_other_do_intersect_test.cpp | 1 - Intersections_3/test/Intersections_3/call_test.cpp | 1 - .../test/Intersections_3/test_point_3_intersections.cpp | 2 +- Intersections_3/test/Intersections_3/tetrahedron.cpp | 1 - .../test/Intersections_3/triangle_other_intersection_test.cpp | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 7de5c37e020..9880a7bc056 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -31,7 +31,6 @@ // leda_rational, or Gmpq, or Quotient typedef CGAL::Exact_rational Rational; -#include #include #include #include diff --git a/Intersections_3/test/Intersections_3/call_test.cpp b/Intersections_3/test/Intersections_3/call_test.cpp index 6b708780d3e..768c7d4ac6e 100644 --- a/Intersections_3/test/Intersections_3/call_test.cpp +++ b/Intersections_3/test/Intersections_3/call_test.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include diff --git a/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp b/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp index 447d5c0907d..999c23f2278 100644 --- a/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp +++ b/Intersections_3/test/Intersections_3/test_point_3_intersections.cpp @@ -7,7 +7,7 @@ #include #include #include -#include + typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; diff --git a/Intersections_3/test/Intersections_3/tetrahedron.cpp b/Intersections_3/test/Intersections_3/tetrahedron.cpp index c51fe3506da..2e39619ef3b 100644 --- a/Intersections_3/test/Intersections_3/tetrahedron.cpp +++ b/Intersections_3/test/Intersections_3/tetrahedron.cpp @@ -1,7 +1,6 @@ #include #include -#include typedef CGAL::Cartesian K; diff --git a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp index 312b2edbd15..c954ea13b0c 100644 --- a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp +++ b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp @@ -21,7 +21,6 @@ #include -#include #include #include #include From 9abeddf7cd5aef3d6fbc85de4d6bab05d713acc9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 3 Dec 2018 15:45:42 +0100 Subject: [PATCH 48/48] Add documentation for intersection with Point_2 and Point_3 --- Kernel_23/doc/Kernel_23/CGAL/intersections.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Kernel_23/doc/Kernel_23/CGAL/intersections.h b/Kernel_23/doc/Kernel_23/CGAL/intersections.h index 29179cfc0bf..0678d09d11c 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/intersections.h +++ b/Kernel_23/doc/Kernel_23/CGAL/intersections.h @@ -63,6 +63,7 @@ Also, `Type1` and `Type2` can be both of type In three-dimensional space, the types `Type1` and `Type2` can be any of the following: +- `Point_3` - `Plane_3` - `Line_3` - `Ray_3` @@ -220,6 +221,9 @@ It is equivalent to `boost::optional< boost::variant< T... > >`, the last column +Additional overloads are provided for the type `Point_2` combined with any other type with the result type being +`boost::optional< boost::variant< Point_2 > >`. + \cgalHeading{3D Intersections} The return type can be obtained through `CGAL::cpp11::result_of::%type`. @@ -319,6 +323,10 @@ p Point_3, or Segment_3 +Additional overloads are provided for the type `Point_3` combined with any other type with the result type being +`boost::optional< boost::variant< Point_3 > >`. + + \cgalHeading{Examples} The following examples demonstrate the most common use of