BWAPI
|
00001 // Copyright (c) 2003-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/Kernel_23/include/CGAL/Kernel/global_functions_3.h $ 00019 // $Id: global_functions_3.h 50420 2009-07-07 10:33:38Z afabri $ 00020 // 00021 // 00022 // Author(s) : Sylvain Pion 00023 00024 #ifndef CGAL_KERNEL_GLOBAL_FUNCTIONS_3_H 00025 #define CGAL_KERNEL_GLOBAL_FUNCTIONS_3_H 00026 00027 #include <CGAL/user_classes.h> 00028 #include <CGAL/Kernel/global_functions_internal_3.h> 00029 #include <CGAL/Kernel/mpl.h> 00030 00031 // Generic functions calling the kernel functor. 00032 // See comments in CGAL/Kernel/global_functions_2.h. 00033 00034 CGAL_BEGIN_NAMESPACE 00035 00036 template <typename K> 00037 inline 00038 Angle 00039 angle(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 00040 { 00041 return CGALi::angle(p, q, r, K()); 00042 } 00043 00044 template < typename K > 00045 inline 00046 typename K::Boolean 00047 are_negative_oriented(const Point_3<K>& p, const Point_3<K>& q, 00048 const Point_3<K>& r, const Point_3<K>& s) 00049 { 00050 return CGALi::are_negative_oriented(p, q, r, s, K()); 00051 } 00052 00053 template < class K > 00054 inline 00055 typename K::Boolean 00056 are_ordered_along_line(const Point_3<K> &p, 00057 const Point_3<K> &q, 00058 const Point_3<K> &r) 00059 { 00060 return CGALi::are_ordered_along_line(p, q, r, K()); 00061 } 00062 00063 template < typename K > 00064 inline 00065 typename K::Boolean 00066 are_positive_oriented(const Point_3<K>& p, const Point_3<K>& q, 00067 const Point_3<K>& r, const Point_3<K>& s) 00068 { 00069 return CGALi::are_positive_oriented(p, q, r, s, K()); 00070 } 00071 00072 template < class K > 00073 inline 00074 typename K::Boolean 00075 are_strictly_ordered_along_line(const Point_3<K> &p, 00076 const Point_3<K> &q, 00077 const Point_3<K> &r) 00078 { 00079 return CGALi::are_strictly_ordered_along_line(p, q, r, K()); 00080 } 00081 00082 template < class K > 00083 inline 00084 typename K::Point_3 00085 barycenter(const Point_3<K> &p1, const typename K::FT& w1, 00086 const Point_3<K> &p2) 00087 { 00088 return CGALi::barycenter(p1, w1, p2, K()); 00089 } 00090 00091 template < class K > 00092 inline 00093 typename K::Point_3 00094 barycenter(const Point_3<K> &p1, const typename K::FT& w1, 00095 const Point_3<K> &p2, const typename K::FT& w2) 00096 { 00097 return CGALi::barycenter(p1, w1, p2, w2, K()); 00098 } 00099 00100 template < class K > 00101 inline 00102 typename K::Point_3 00103 barycenter(const Point_3<K> &p1, const typename K::FT& w1, 00104 const Point_3<K> &p2, const typename K::FT& w2, 00105 const Point_3<K> &p3) 00106 { 00107 return CGALi::barycenter(p1, w1, p2, w2, p3, K()); 00108 } 00109 00110 template < class K > 00111 inline 00112 typename K::Point_3 00113 barycenter(const Point_3<K> &p1, const typename K::FT& w1, 00114 const Point_3<K> &p2, const typename K::FT& w2, 00115 const Point_3<K> &p3, const typename K::FT& w3) 00116 { 00117 return CGALi::barycenter(p1, w1, p2, w2, p3, w3, K()); 00118 } 00119 00120 template < class K > 00121 inline 00122 typename K::Point_3 00123 barycenter(const Point_3<K> &p1, const typename K::FT& w1, 00124 const Point_3<K> &p2, const typename K::FT& w2, 00125 const Point_3<K> &p3, const typename K::FT& w3, 00126 const Point_3<K> &p4) 00127 { 00128 return CGALi::barycenter(p1, w1, p2, w2, p3, w3, p4, K()); 00129 } 00130 00131 template < class K > 00132 inline 00133 typename K::Point_3 00134 barycenter(const Point_3<K> &p1, const typename K::FT& w1, 00135 const Point_3<K> &p2, const typename K::FT& w2, 00136 const Point_3<K> &p3, const typename K::FT& w3, 00137 const Point_3<K> &p4, const typename K::FT& w4) 00138 { 00139 return CGALi::barycenter(p1, w1, p2, w2, p3, w3, p4, w4, K()); 00140 } 00141 00142 template <typename K> 00143 inline 00144 typename K::Plane_3 00145 bisector(const Point_3<K> &p, const Point_3<K> &q) 00146 { 00147 return CGALi::bisector(p, q, K()); 00148 } 00149 00150 template <typename K> 00151 inline 00152 typename K::Plane_3 00153 bisector(const Plane_3<K> &h1, const Plane_3<K> &h2) 00154 { 00155 return CGALi::bisector(h1, h2, K()); 00156 } 00157 00158 template < class K > 00159 inline 00160 Point_3<K> 00161 centroid(const Point_3<K> &p, const Point_3<K> &q, 00162 const Point_3<K> &r, const Point_3<K> &s) 00163 { 00164 return CGALi::centroid(p, q, r, s, K()); 00165 } 00166 00167 template < class K > 00168 inline 00169 Point_3<K> 00170 centroid(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 00171 { 00172 return CGALi::centroid(p, q, r, K()); 00173 } 00174 00175 template < class K > 00176 inline 00177 Point_3<K> 00178 centroid(const Tetrahedron_3<K> &t) 00179 { 00180 return CGALi::centroid(t, K()); 00181 } 00182 00183 template < class K > 00184 inline 00185 Point_3<K> 00186 centroid(const Triangle_3<K> &t) 00187 { 00188 return CGALi::centroid(t, K()); 00189 } 00190 00191 template < class K > 00192 inline 00193 typename K::Point_3 00194 circumcenter(const Point_3<K> &p, 00195 const Point_3<K> &q) 00196 { 00197 return CGALi::circumcenter(p, q, K()); 00198 } 00199 00200 template < class K > 00201 inline 00202 typename K::Point_3 00203 circumcenter(const Point_3<K> &p, 00204 const Point_3<K> &q, 00205 const Point_3<K> &r) 00206 { 00207 return CGALi::circumcenter(p, q, r, K()); 00208 } 00209 00210 template < class K > 00211 inline 00212 typename K::Point_3 00213 circumcenter(const Point_3<K> &p, const Point_3<K> &q, 00214 const Point_3<K> &r, const Point_3<K> &s) 00215 { 00216 return CGALi::circumcenter(p, q, r, s, K()); 00217 } 00218 00219 template < class K > 00220 inline 00221 typename K::Point_3 00222 circumcenter(const Tetrahedron_3<K> &t) 00223 { 00224 return CGALi::circumcenter(t, K()); 00225 } 00226 00227 template < class K > 00228 inline 00229 typename K::Point_3 00230 circumcenter(const Triangle_3<K> &t) 00231 { 00232 return CGALi::circumcenter(t, K()); 00233 } 00234 00235 template < class K > 00236 inline 00237 typename K::Boolean 00238 collinear(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 00239 { 00240 return CGALi::collinear(p, q, r, K()); 00241 } 00242 00243 template < class K > 00244 inline 00245 typename K::Boolean 00246 collinear_are_ordered_along_line(const Point_3<K> &p, 00247 const Point_3<K> &q, 00248 const Point_3<K> &r) 00249 { 00250 return CGALi::collinear_are_ordered_along_line(p, q, r, K()); 00251 } 00252 00253 template < class K > 00254 inline 00255 typename K::Boolean 00256 collinear_are_strictly_ordered_along_line(const Point_3<K> &p, 00257 const Point_3<K> &q, 00258 const Point_3<K> &r) 00259 { 00260 return CGALi::collinear_are_strictly_ordered_along_line(p, q, r, K()); 00261 } 00262 00263 template < class K > 00264 inline 00265 typename K::Comparison_result 00266 compare_distance_to_point(const Point_3<K> &p, 00267 const Point_3<K> &q, 00268 const Point_3<K> &r) 00269 { 00270 return CGALi::compare_distance_to_point(p, q, r, K()); 00271 } 00272 00273 template < class K > 00274 inline 00275 typename K::Comparison_result 00276 compare_squared_distance(const Point_3<K> &p, 00277 const Point_3<K> &q, 00278 const typename K::FT &d2) 00279 { 00280 return CGALi::compare_squared_distance(p, q, d2, K()); 00281 } 00282 00283 template < class K > 00284 inline 00285 typename K::Comparison_result 00286 compare_squared_radius(const Point_3<K> &p, 00287 const Point_3<K> &q, 00288 const typename K::FT &sr) 00289 { 00290 return CGALi::compare_squared_radius(p, q, sr, K()); 00291 } 00292 00293 template < class K > 00294 inline 00295 typename K::Comparison_result 00296 compare_squared_radius(const Point_3<K> &p, 00297 const Point_3<K> &q, 00298 const Point_3<K> &r, 00299 const typename K::FT &sr) 00300 { 00301 return CGALi::compare_squared_radius(p, q, r, sr, K()); 00302 } 00303 00304 template < class K > 00305 inline 00306 typename K::Comparison_result 00307 compare_squared_radius(const Point_3<K> &p, 00308 const Point_3<K> &q, 00309 const Point_3<K> &r, 00310 const Point_3<K> &s, 00311 const typename K::FT &sr) 00312 { 00313 return CGALi::compare_squared_radius(p, q, r, s, sr, K()); 00314 } 00315 00316 template < class K > 00317 inline 00318 typename K::Comparison_result 00319 compare_lexicographically_xyz(const Point_3<K> &p, 00320 const Point_3<K> &q) 00321 { 00322 return CGALi::compare_lexicographically_xyz(p, q, K()); 00323 } 00324 00325 template < class K > 00326 inline 00327 typename K::Comparison_result 00328 compare_signed_distance_to_plane(const Plane_3<K> &h, 00329 const Point_3<K> &p, 00330 const Point_3<K> &q) 00331 { 00332 return CGALi::compare_signed_distance_to_plane(h, p, q, K()); 00333 } 00334 00335 template < class K > 00336 inline 00337 typename K::Comparison_result 00338 compare_signed_distance_to_plane(const Point_3<K> &hp, 00339 const Point_3<K> &hq, 00340 const Point_3<K> &hr, 00341 const Point_3<K> &p, 00342 const Point_3<K> &q) 00343 { 00344 return CGALi::compare_signed_distance_to_plane(hp, hq, hr, p, q, K()); 00345 } 00346 00347 template < class K > 00348 inline 00349 typename K::Comparison_result 00350 compare_x(const Point_3<K> &p, const Point_3<K> &q) 00351 { 00352 return CGALi::compare_x(p, q, K()); 00353 } 00354 00355 template < class K > 00356 inline 00357 typename K::Comparison_result 00358 compare_y(const Point_3<K> &p, const Point_3<K> &q) 00359 { 00360 return CGALi::compare_y(p, q, K()); 00361 } 00362 00363 template < class K > 00364 inline 00365 typename K::Comparison_result 00366 compare_z(const Point_3<K> &p, const Point_3<K> &q) 00367 { 00368 return CGALi::compare_z(p, q, K()); 00369 } 00370 00371 template < class K > 00372 inline 00373 typename K::Comparison_result 00374 compare_xyz(const Point_3<K> &p, const Point_3<K> &q) 00375 { 00376 return CGALi::compare_xyz(p, q, K()); 00377 } 00378 00379 template < class K > 00380 inline 00381 typename K::Boolean 00382 coplanar(const Point_3<K> &p, const Point_3<K> &q, 00383 const Point_3<K> &r, const Point_3<K> &s) 00384 { 00385 return CGALi::coplanar(p, q, r, s, K()); 00386 } 00387 00388 00389 template < class K > 00390 inline 00391 typename K::Orientation 00392 coplanar_orientation(const Point_3<K> &p, 00393 const Point_3<K> &q, 00394 const Point_3<K> &r, 00395 const Point_3<K> &s) 00396 { 00397 return CGALi::coplanar_orientation(p, q, r, s, K()); 00398 } 00399 00400 template < class K > 00401 inline 00402 typename K::Orientation 00403 coplanar_orientation(const Point_3<K> &p, 00404 const Point_3<K> &q, 00405 const Point_3<K> &r) 00406 { 00407 return CGALi::coplanar_orientation(p, q, r, K()); 00408 } 00409 00410 template < class K > 00411 inline 00412 typename K::Bounded_side 00413 coplanar_side_of_bounded_circle(const Point_3<K> &p, 00414 const Point_3<K> &q, 00415 const Point_3<K> &r, 00416 const Point_3<K> &t) 00417 { 00418 return CGALi::coplanar_side_of_bounded_circle(p, q, r, t, K()); 00419 } 00420 00421 template < class K > 00422 inline 00423 typename K::Vector_3 00424 cross_product(const Vector_3<K> &v, const Vector_3<K> &w) 00425 { 00426 return CGALi::cross_product(v, w, K()); 00427 } 00428 00429 template < class K > 00430 inline 00431 typename K::FT 00432 determinant(const Vector_3<K> &v0, const Vector_3<K> &v1, 00433 const Vector_3<K> &v2) 00434 { 00435 return CGALi::determinant(v0, v1, v2, K()); 00436 } 00437 00438 template < class K > 00439 inline 00440 typename K::Line_3 00441 equidistant_line(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 00442 { 00443 return CGALi::equidistant_line(p, q, r, K()); 00444 } 00445 00446 template < class K > 00447 inline 00448 typename K::Boolean 00449 has_larger_distance_to_point(const Point_3<K> &p, 00450 const Point_3<K> &q, 00451 const Point_3<K> &r) 00452 { 00453 return CGALi::has_larger_distance_to_point(p, q, r, K()); 00454 } 00455 00456 template < class K > 00457 inline 00458 typename K::Boolean 00459 has_larger_signed_distance_to_plane(const Point_3<K> &hp, 00460 const Point_3<K> &hq, 00461 const Point_3<K> &hr, 00462 const Point_3<K> &p, 00463 const Point_3<K> &q) 00464 { 00465 return CGALi::has_larger_signed_distance_to_plane(hp, hq, hr, p, q, K()); 00466 } 00467 00468 template < class K > 00469 inline 00470 typename K::Boolean 00471 has_larger_signed_distance_to_plane(const Plane_3<K> &h, 00472 const Point_3<K> &p, 00473 const Point_3<K> &q) 00474 { 00475 return CGALi::has_larger_signed_distance_to_plane(h, p, q, K()); 00476 } 00477 00478 template < class K > 00479 inline 00480 typename K::Boolean 00481 has_smaller_distance_to_point(const Point_3<K> &p, 00482 const Point_3<K> &q, 00483 const Point_3<K> &r) 00484 { 00485 return CGALi::has_smaller_distance_to_point(p, q, r, K()); 00486 } 00487 00488 template < class K > 00489 inline 00490 typename K::Boolean 00491 has_smaller_signed_distance_to_plane(const Point_3<K> &hp, 00492 const Point_3<K> &hq, 00493 const Point_3<K> &hr, 00494 const Point_3<K> &p, 00495 const Point_3<K> &q) 00496 { 00497 return CGALi::has_smaller_signed_distance_to_plane(hp, hq, hr, p, q, K()); 00498 } 00499 00500 template < class K > 00501 inline 00502 typename K::Boolean 00503 has_smaller_signed_distance_to_plane(const Plane_3<K> &h, 00504 const Point_3<K> &p, 00505 const Point_3<K> &q) 00506 { 00507 return CGALi::has_smaller_signed_distance_to_plane(h, p, q, K()); 00508 } 00509 00510 template < class K > 00511 inline 00512 typename K::Boolean 00513 less_x(const Point_3<K> &p, const Point_3<K> &q) 00514 { 00515 return CGALi::less_x(p, q, K()); 00516 } 00517 00518 template < class K > 00519 inline 00520 typename K::Boolean 00521 less_y(const Point_3<K> &p, const Point_3<K> &q) 00522 { 00523 return CGALi::less_y(p, q, K()); 00524 } 00525 00526 template < class K > 00527 inline 00528 typename K::Boolean 00529 less_z(const Point_3<K> &p, const Point_3<K> &q) 00530 { 00531 return CGALi::less_z(p, q, K()); 00532 } 00533 00534 template < class K > 00535 inline 00536 typename K::Boolean 00537 lexicographically_xyz_smaller(const Point_3<K> &p, const Point_3<K> &q) 00538 { 00539 return CGALi::lexicographically_xyz_smaller(p, q, K()); 00540 } 00541 00542 template < class K > 00543 inline 00544 typename K::Boolean 00545 lexicographically_xyz_smaller_or_equal(const Point_3<K> &p, 00546 const Point_3<K> &q) 00547 { 00548 return CGALi::lexicographically_xyz_smaller_or_equal(p, q, K()); 00549 } 00550 00551 template < class K > 00552 inline 00553 typename K::Point_3 00554 midpoint(const Point_3<K> &p, const Point_3<K> &q) 00555 { 00556 return CGALi::midpoint(p, q, K()); 00557 } 00558 00559 template < class K > 00560 inline 00561 typename K::Point_3 00562 max_vertex(const Iso_cuboid_3<K> &ic) 00563 { 00564 return CGALi::max_vertex(ic, K()); 00565 } 00566 00567 template < class K > 00568 inline 00569 typename K::Point_3 00570 min_vertex(const Iso_cuboid_3<K> &ic) 00571 { 00572 return CGALi::min_vertex(ic, K()); 00573 } 00574 00575 template < class K > 00576 inline 00577 typename K::Vector_3 00578 normal(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 00579 { 00580 return CGALi::normal(p, q, r, K()); 00581 } 00582 00583 // FIXME TODO : what to do with the operators ? 00584 template < class K > 00585 inline 00586 typename K::Boolean 00587 operator==(const Point_3<K>& p, const Point_3<K>& q) 00588 { return K().equal_3_object()(p, q); } 00589 00590 template < class K > 00591 inline 00592 typename K::Boolean 00593 operator!=(const Point_3<K>& p, const Point_3<K>& q) 00594 { return ! (p == q); } 00595 00596 template < class K > 00597 inline 00598 typename K::Boolean 00599 operator==(const Point_3<K>& p, const Origin& o) 00600 { return K().equal_3_object()(p, Point_3<K>(o)); } 00601 00602 template < class K > 00603 inline 00604 typename K::Boolean 00605 operator!=(const Point_3<K>& p, const Origin& o) 00606 { return ! (p == o); } 00607 00608 template < class K > 00609 inline 00610 typename K::Boolean 00611 operator==(const Iso_cuboid_3<K>& p, const Iso_cuboid_3<K>& q) 00612 { return K().equal_3_object()(p, q); } 00613 00614 template < class K > 00615 inline 00616 typename K::Boolean 00617 operator!=(const Iso_cuboid_3<K>& p, const Iso_cuboid_3<K>& q) 00618 { return ! (p == q); } 00619 00620 template < class K > 00621 inline 00622 typename K::Boolean 00623 operator==(const Plane_3<K>& p, const Plane_3<K>& q) 00624 { return K().equal_3_object()(p, q); } 00625 00626 template < class K > 00627 inline 00628 typename K::Boolean 00629 operator!=(const Plane_3<K>& p, const Plane_3<K>& q) 00630 { return ! (p == q); } 00631 00632 template < class K > 00633 inline 00634 typename K::Boolean 00635 operator==(const Segment_3<K>& p, const Segment_3<K>& q) 00636 { return K().equal_3_object()(p, q); } 00637 00638 template < class K > 00639 inline 00640 typename K::Boolean 00641 operator!=(const Segment_3<K>& p, const Segment_3<K>& q) 00642 { return ! (p == q); } 00643 00644 template < class K > 00645 inline 00646 typename K::Boolean 00647 operator==(const Line_3<K>& p, const Line_3<K>& q) 00648 { return K().equal_3_object()(p, q); } 00649 00650 template < class K > 00651 inline 00652 typename K::Boolean 00653 operator!=(const Line_3<K>& p, const Line_3<K>& q) 00654 { return ! (p == q); } 00655 00656 template < class K > 00657 inline 00658 typename K::Boolean 00659 operator==(const Ray_3<K>& p, const Ray_3<K>& q) 00660 { return K().equal_3_object()(p, q); } 00661 00662 template < class K > 00663 inline 00664 typename K::Boolean 00665 operator!=(const Ray_3<K>& p, const Ray_3<K>& q) 00666 { return ! (p == q); } 00667 00668 template < class K > 00669 inline 00670 typename K::Boolean 00671 operator==(const Triangle_3<K>& p, const Triangle_3<K>& q) 00672 { return K().equal_3_object()(p, q); } 00673 00674 template < class K > 00675 inline 00676 typename K::Boolean 00677 operator!=(const Triangle_3<K>& p, const Triangle_3<K>& q) 00678 { return ! (p == q); } 00679 00680 template < class K > 00681 inline 00682 typename K::Boolean 00683 operator==(const Tetrahedron_3<K>& p, const Tetrahedron_3<K>& q) 00684 { return K().equal_3_object()(p, q); } 00685 00686 template < class K > 00687 inline 00688 typename K::Boolean 00689 operator!=(const Tetrahedron_3<K>& p, const Tetrahedron_3<K>& q) 00690 { return ! (p == q); } 00691 00692 template < class K > 00693 inline 00694 typename K::Boolean 00695 operator==(const Direction_3<K>& p, const Direction_3<K>& q) 00696 { return K().equal_3_object()(p, q); } 00697 00698 template < class K > 00699 inline 00700 typename K::Boolean 00701 operator!=(const Direction_3<K>& p, const Direction_3<K>& q) 00702 { return ! (p == q); } 00703 00704 template < class K > 00705 inline 00706 typename K::Boolean 00707 operator==(const Sphere_3<K>& p, const Sphere_3<K>& q) 00708 { return K().equal_3_object()(p, q); } 00709 00710 template < class K > 00711 inline 00712 typename K::Boolean 00713 operator!=(const Sphere_3<K>& p, const Sphere_3<K>& q) 00714 { return ! (p == q); } 00715 00716 template < class K > 00717 inline 00718 typename K::Boolean 00719 operator==(const Vector_3<K>& p, const Vector_3<K>& q) 00720 { return K().equal_3_object()(p, q); } 00721 00722 template < class K > 00723 inline 00724 typename K::Boolean 00725 operator!=(const Vector_3<K>& p, const Vector_3<K>& q) 00726 { return ! (p == q); } 00727 00728 template < class K > 00729 inline 00730 typename K::Boolean 00731 operator==(const Vector_3<K>& p, const Null_vector& o) 00732 { return K().equal_3_object()(p, Vector_3<K>(o)); } 00733 00734 template < class K > 00735 inline 00736 typename K::Boolean 00737 operator!=(const Vector_3<K>& p, const Null_vector& o) 00738 { return ! (p == o); } 00739 00740 00741 template < class K > 00742 inline 00743 typename K::Boolean 00744 operator<(const Point_3<K>& p, const Point_3<K>& q) 00745 { return K().less_xyz_3_object()(p, q); } 00746 00747 template < class K > 00748 inline 00749 typename K::Boolean 00750 operator>(const Point_3<K>& p, const Point_3<K>& q) 00751 { return K().less_xyz_3_object()(q, p); } 00752 00753 template < class K > 00754 inline 00755 typename K::Boolean 00756 operator<=(const Point_3<K>& p, const Point_3<K>& q) 00757 { return ! K().less_xyz_3_object()(q, p); } 00758 00759 template < class K > 00760 inline 00761 typename K::Boolean 00762 operator>=(const Point_3<K>& p, const Point_3<K>& q) 00763 { return ! K().less_xyz_3_object()(p, q); } 00764 00765 template < class K > 00766 inline 00767 typename K::Vector_3 00768 operator*(const typename K::FT &c, const Vector_3<K> &w) 00769 { 00770 return K().construct_scaled_vector_3_object()(w, c); 00771 } 00772 00773 template < class K > 00774 inline 00775 typename K::Vector_3 00776 operator*(const Vector_3<K> &w, const typename K::FT &c) 00777 { 00778 return K().construct_scaled_vector_3_object()(w, c); 00779 } 00780 00781 template < class K > 00782 inline 00783 typename K::Vector_3 00784 operator*(const typename First_if_different<typename K::RT, 00785 typename K::FT>::Type &c, 00786 const Vector_3<K> &w) 00787 { 00788 return K().construct_scaled_vector_3_object()(w, c); 00789 } 00790 00791 template < class K > 00792 inline 00793 typename K::Vector_3 00794 operator*(const Vector_3<K> &w, 00795 const typename First_if_different<typename K::RT, 00796 typename K::FT>::Type &c) 00797 { 00798 return K().construct_scaled_vector_3_object()(w, c); 00799 } 00800 00801 template < class K > 00802 inline 00803 typename K::FT 00804 operator*(const Vector_3<K> &v, const Vector_3<K> &w) 00805 { 00806 return K().compute_scalar_product_3_object()(v, w); 00807 } 00808 00809 00810 template < class K > 00811 inline 00812 typename K::Point_3 00813 operator+(const Point_3<K> &p, const Vector_3<K> &v) 00814 { 00815 return K().construct_translated_point_3_object()(p, v); 00816 } 00817 00818 template < class K > 00819 inline 00820 typename K::Point_3 00821 operator+(const Origin &o, const Vector_3<K> &v) 00822 { 00823 return K().construct_translated_point_3_object()(o, v); 00824 } 00825 00826 template < class K > 00827 inline 00828 typename K::Point_3 00829 operator-(const Point_3<K> &p, const Vector_3<K> &v) 00830 { 00831 return K().construct_translated_point_3_object() 00832 (p, K().construct_opposite_vector_3_object()(v)); 00833 } 00834 00835 template < class K > 00836 inline 00837 typename K::Point_3 00838 operator-(const Origin &o, const Vector_3<K> &v) 00839 { 00840 return K().construct_translated_point_3_object() 00841 (o, K().construct_opposite_vector_3_object()(v)); 00842 } 00843 00844 template < class K > 00845 inline 00846 typename K::Vector_3 00847 operator-(const Point_3<K> &p, const Point_3<K> &q) 00848 { 00849 return K().construct_vector_3_object()(q, p); 00850 } 00851 00852 template < class K > 00853 inline 00854 typename K::Vector_3 00855 operator-(const Point_3<K> &p, const Origin &o) 00856 { 00857 return K().construct_vector_3_object()(o, p); 00858 } 00859 00860 template < class K > 00861 inline 00862 typename K::Vector_3 00863 operator-(const Origin &o, const Point_3<K> &q) 00864 { 00865 return K().construct_vector_3_object()(q, o); 00866 } 00867 00868 template <class K > 00869 inline 00870 typename K::Orientation 00871 orientation(const Point_3<K> &p, 00872 const Point_3<K> &q, 00873 const Point_3<K> &r, 00874 const Point_3<K> &s) 00875 { 00876 return CGALi::orientation(p, q, r, s, K()); 00877 } 00878 00879 template <class K > 00880 inline 00881 typename K::Orientation 00882 orientation(const Vector_3<K> &u, const Vector_3<K> &v, const Vector_3<K> &w) 00883 { 00884 return CGALi::orientation(u, v, w, K()); 00885 } 00886 00887 template <class K > 00888 inline 00889 typename K::Vector_3 00890 orthogonal_vector(const Point_3<K>& p, 00891 const Point_3<K>& q, 00892 const Point_3<K>& r) 00893 { 00894 return CGALi::orthogonal_vector(p, q, r, K()); 00895 } 00896 00897 template <class K > 00898 inline 00899 typename K::Vector_3 00900 orthogonal_vector(const Plane_3<K>& p) 00901 { 00902 return CGALi::orthogonal_vector(p, K()); 00903 } 00904 00905 // parallel() functions are in Kernel/global_functions.h 00906 00907 template <class K> 00908 inline 00909 typename K::Plane_3 00910 radical_plane(const Sphere_3<K> &s1, 00911 const Sphere_3<K> &s2) 00912 { 00913 return K().construct_radical_plane_3_object()(s1,s2); 00914 } 00915 00916 template <class K > 00917 inline 00918 typename K::Bounded_side 00919 side_of_bounded_sphere(const Point_3<K> &p, 00920 const Point_3<K> &q, 00921 const Point_3<K> &test) 00922 { 00923 return CGALi::side_of_bounded_sphere(p, q, test, K()); 00924 } 00925 00926 template <class K > 00927 inline 00928 typename K::Bounded_side 00929 side_of_bounded_sphere(const Point_3<K> &p, 00930 const Point_3<K> &q, 00931 const Point_3<K> &r, 00932 const Point_3<K> &test) 00933 { 00934 return CGALi::side_of_bounded_sphere(p, q, r, test, K()); 00935 } 00936 00937 template <class K > 00938 inline 00939 typename K::Bounded_side 00940 side_of_bounded_sphere(const Point_3<K> &p, 00941 const Point_3<K> &q, 00942 const Point_3<K> &r, 00943 const Point_3<K> &s, 00944 const Point_3<K> &test) 00945 { 00946 return CGALi::side_of_bounded_sphere(p, q, r, s, test, K()); 00947 } 00948 00949 template <class K > 00950 inline 00951 typename K::Oriented_side 00952 side_of_oriented_sphere(const Point_3<K> &p, 00953 const Point_3<K> &q, 00954 const Point_3<K> &r, 00955 const Point_3<K> &s, 00956 const Point_3<K> &test) 00957 { 00958 return CGALi::side_of_oriented_sphere(p, q, r, s, test, K()); 00959 } 00960 00961 template <typename K> 00962 inline 00963 typename K::FT 00964 squared_area(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 00965 { 00966 return CGALi::squared_area(p, q, r, K()); 00967 } 00968 00969 template < class K > 00970 inline 00971 typename K::FT 00972 squared_radius(const Point_3<K> &p, const Point_3<K> &q, 00973 const Point_3<K> &r, const Point_3<K> &s) 00974 { 00975 return CGALi::squared_radius(p, q, r, s, K()); 00976 } 00977 00978 template < class K > 00979 inline 00980 typename K::FT 00981 squared_radius(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 00982 { 00983 return CGALi::squared_radius(p, q, r, K()); 00984 } 00985 00986 template < class K > 00987 inline 00988 typename K::FT 00989 squared_radius(const Point_3<K> &p, const Point_3<K> &q) 00990 { 00991 return CGALi::squared_radius(p, q, K()); 00992 } 00993 00994 template < class K > 00995 inline 00996 typename K::FT 00997 squared_radius(const Point_3<K> &p) 00998 { 00999 return CGALi::squared_radius(p, K()); 01000 } 01001 01002 template < class K > 01003 inline 01004 typename K::Vector_3 01005 unit_normal(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) 01006 { 01007 return CGALi::unit_normal(p, q, r, K()); 01008 } 01009 01010 template < class K > 01011 inline 01012 typename K::FT 01013 volume(const Point_3<K> &p, const Point_3<K> &q, 01014 const Point_3<K> &r, const Point_3<K> &s) 01015 { 01016 return CGALi::volume(p, q, r, s, K()); 01017 } 01018 01019 template < class K > 01020 inline 01021 typename K::Boolean 01022 x_equal(const Point_3<K> &p, const Point_3<K> &q) 01023 { 01024 return CGALi::x_equal(p, q, K()); 01025 } 01026 01027 template < class K > 01028 inline 01029 typename K::Boolean 01030 y_equal(const Point_3<K> &p, const Point_3<K> &q) 01031 { 01032 return CGALi::y_equal(p, q, K()); 01033 } 01034 01035 template < class K > 01036 inline 01037 typename K::Boolean 01038 z_equal(const Point_3<K> &p, const Point_3<K> &q) 01039 { 01040 return CGALi::z_equal(p, q, K()); 01041 } 01042 01043 CGAL_END_NAMESPACE 01044 01045 #endif // CGAL_KERNEL_GLOBAL_FUNCTIONS_3_H