BWAPI
|
00001 // Copyright (c) 1997-2004 Utrecht University (The Netherlands), 00002 // ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), 00003 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg 00004 // (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), 00005 // and Tel-Aviv University (Israel). All rights reserved. 00006 // 00007 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License as 00009 // published by the Free Software Foundation; version 2.1 of the License. 00010 // See the file LICENSE.LGPL distributed with CGAL. 00011 // 00012 // Licensees holding a valid commercial license may use this file in 00013 // accordance with the commercial license agreement provided with the software. 00014 // 00015 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 // 00018 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Intersections_3/include/CGAL/intersection_3_1.h $ 00019 // $Id: intersection_3_1.h 45211 2008-08-29 14:33:12Z spion $ 00020 // 00021 // 00022 // Author(s) : Geert-Jan Giezeman <geert@cs.uu.nl> 00023 00024 #ifndef CGAL_INTERSECTION_3_1_H 00025 #define CGAL_INTERSECTION_3_1_H 00026 00027 #include <CGAL/Object.h> 00028 #include <CGAL/bbox_intersection_3.h> 00029 00030 CGAL_BEGIN_NAMESPACE 00031 00032 template <class R> 00033 Object 00034 intersection(const Plane_3<R> &plane1, const Plane_3<R>&plane2); 00035 00036 template <class R> 00037 inline bool 00038 do_intersect(const Plane_3<R> &plane1, const Plane_3<R>&plane2) 00039 { 00040 return ! intersection(plane1, plane2).is_empty(); 00041 } 00042 00043 00044 template <class R> 00045 Object 00046 intersection(const Plane_3<R> &plane1, const Plane_3<R>&plane2, 00047 const Plane_3<R>&plane3); 00048 00049 template <class R> 00050 inline bool 00051 do_intersect(const Plane_3<R> &plane1, const Plane_3<R>&plane2, 00052 const Plane_3<R>&plane3) 00053 { 00054 return ! intersection(plane1, plane2, plane3).is_empty(); 00055 } 00056 00057 00058 template <class R> 00059 Object 00060 intersection(const Plane_3<R> &plane, const Line_3<R>&line); 00061 00062 template <class R> 00063 inline 00064 Object 00065 intersection(const Line_3<R>&line, const Plane_3<R> &plane) 00066 { 00067 return intersection(plane,line); 00068 } 00069 00070 template <class R> 00071 bool 00072 do_intersect(const Plane_3<R> &p2, const Line_3<R> &p1); 00073 00074 00075 template <class R> 00076 inline bool 00077 do_intersect(const Line_3<R> &p1, const Plane_3<R> &p2) 00078 { 00079 return do_intersect(p2,p1); 00080 } 00081 00082 00083 00084 template <class R> 00085 Object 00086 intersection(const Plane_3<R> &plane, const Ray_3<R>&ray); 00087 00088 template <class R> 00089 inline 00090 Object 00091 intersection(const Ray_3<R>&ray, const Plane_3<R> &plane) 00092 { 00093 return intersection(plane,ray); 00094 } 00095 00096 template <class R> 00097 bool 00098 do_intersect(const Plane_3<R> &p1, const Ray_3<R> &p2); 00099 00100 00101 template <class R> 00102 inline bool 00103 do_intersect( 00104 const Ray_3<R> &p1, 00105 const Plane_3<R> &p2) 00106 { 00107 return do_intersect(p2,p1); 00108 } 00109 00110 00111 template <class R> 00112 Object 00113 intersection(const Plane_3<R> &plane, const Segment_3<R>&seg); 00114 00115 template <class R> 00116 inline 00117 Object 00118 intersection(const Segment_3<R>&seg, const Plane_3<R> &plane) 00119 { 00120 return intersection(plane,seg); 00121 } 00122 00123 template <class R> 00124 bool 00125 do_intersect(const Plane_3<R> &p1, const Segment_3<R> &p2); 00126 00127 00128 template <class R> 00129 inline bool 00130 do_intersect(const Segment_3<R> &p1, 00131 const Plane_3<R> &p2) 00132 { 00133 return do_intersect(p2,p1); 00134 } 00135 00136 00137 00138 template <class R> 00139 Object 00140 intersection(const Line_3<R> &line, 00141 const Bbox_3 &box) ; 00142 00143 template <class R> 00144 inline Object 00145 intersection(const Bbox_3 &box, 00146 const Line_3<R> &line) 00147 { 00148 return intersection(line, box); 00149 } 00150 00151 00152 00153 template <class R> 00154 Object 00155 intersection(const Ray_3<R> &ray, 00156 const Bbox_3 &box) ; 00157 00158 template <class R> 00159 inline Object 00160 intersection(const Bbox_3 &box, 00161 const Ray_3<R> &ray) 00162 { 00163 return intersection(ray, box); 00164 } 00165 00166 00167 00168 template <class R> 00169 Object 00170 intersection(const Segment_3<R> &seg, 00171 const Bbox_3 &box) ; 00172 00173 template <class R> 00174 inline Object 00175 intersection(const Bbox_3 &box, 00176 const Segment_3<R> &seg) 00177 { 00178 return intersection(seg, box); 00179 } 00180 00181 00182 template <class R> 00183 Object 00184 intersection(const Line_3<R> &line, 00185 const Iso_cuboid_3<R> &box) ; 00186 00187 template <class R> 00188 inline Object 00189 intersection(const Iso_cuboid_3<R> &box, 00190 const Line_3<R> &line) 00191 { 00192 return intersection(line, box); 00193 } 00194 00195 00196 00197 template <class R> 00198 Object 00199 intersection(const Ray_3<R> &ray, 00200 const Iso_cuboid_3<R> &box) ; 00201 00202 template <class R> 00203 inline Object 00204 intersection(const Iso_cuboid_3<R> &box, 00205 const Ray_3<R> &ray) 00206 { 00207 return intersection(ray, box); 00208 } 00209 00210 00211 00212 template <class R> 00213 Object 00214 intersection(const Segment_3<R> &seg, 00215 const Iso_cuboid_3<R> &box) ; 00216 00217 template <class R> 00218 inline Object 00219 intersection(const Iso_cuboid_3<R> &box, 00220 const Segment_3<R> &seg) 00221 { 00222 return intersection(seg, box); 00223 } 00224 00225 00226 00227 template <class R> 00228 Object 00229 intersection(const Iso_cuboid_3<R> &box1, 00230 const Iso_cuboid_3<R> &box2) ; 00231 00232 template <class R> 00233 Object 00234 intersection(const Line_3<R> &l1, 00235 const Line_3<R> &l2); 00236 00237 template <class R> 00238 Object 00239 intersection(const Sphere_3<R> &s1, 00240 const Sphere_3<R> &s2); 00241 00242 00243 template <class R> 00244 Object 00245 intersection(const Plane_3<R> &p, 00246 const Sphere_3<R> &s); 00247 00248 template <class R> 00249 inline Object 00250 intersection(const Sphere_3<R> &s, 00251 const Plane_3<R> &p) { 00252 return intersection(p, s); 00253 } 00254 00255 template <class R> 00256 bool 00257 do_intersect(const Line_3<R> &l1, 00258 const Line_3<R> &l2); 00259 00260 00261 template <class R> 00262 bool 00263 do_intersect(const Sphere_3<R> &s1, 00264 const Sphere_3<R> &s2); 00265 00266 template <class R> 00267 bool 00268 do_intersect(const Plane_3<R> &p, 00269 const Sphere_3<R> &s); 00270 00271 template <class R> 00272 inline bool 00273 do_intersect(const Sphere_3<R> &s, 00274 const Plane_3<R> &p) { 00275 return do_intersect(p, s); 00276 } 00277 00278 template <class R> 00279 inline bool 00280 do_intersect(const Iso_cuboid_3<R> &i, const Iso_cuboid_3<R> &j) 00281 { 00282 return ! CGAL::intersection(i, j).empty(); 00283 } 00284 00285 template <class R> 00286 inline bool 00287 do_intersect(const Line_3<R> &l, const Iso_cuboid_3<R> &j) 00288 { 00289 return ! CGAL::intersection(l, j).empty(); 00290 } 00291 00292 template <class R> 00293 inline bool 00294 do_intersect(const Iso_cuboid_3<R> &j, const Line_3<R> &l) 00295 { 00296 return ! CGAL::intersection(l, j).empty(); 00297 } 00298 00299 template <class R> 00300 inline bool 00301 do_intersect(const Ray_3<R> &r, const Iso_cuboid_3<R> &j) 00302 { 00303 return ! CGAL::intersection(r, j).empty(); 00304 } 00305 00306 template <class R> 00307 inline bool 00308 do_intersect(const Iso_cuboid_3<R> &j, const Ray_3<R> &r) 00309 { 00310 return ! CGAL::intersection(r, j).empty(); 00311 } 00312 00313 template <class R> 00314 inline bool 00315 do_intersect(const Segment_3<R> &s, const Iso_cuboid_3<R> &j) 00316 { 00317 return ! CGAL::intersection(s, j).empty(); 00318 } 00319 00320 template <class R> 00321 inline bool 00322 do_intersect(const Iso_cuboid_3<R> &j, const Segment_3<R> &s) 00323 { 00324 return ! CGAL::intersection(s, j).empty(); 00325 } 00326 00327 CGAL_END_NAMESPACE 00328 00329 #include <CGAL/Intersections_3/intersection_3_1_impl.h> 00330 00331 #endif // CGAL_INTERSECTION_3_1_H