From 5d5f4d0a3d13f74fcf117b81b58be84bc719ec06 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 5 Feb 2018 12:10:44 +0000 Subject: [PATCH] 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