BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h
Go to the documentation of this file.
00001 // Copyright (c) 2008  INRIA Sophia-Antipolis (France).
00002 // All rights reserved.
00003 //
00004 // This file is part of CGAL (www.cgal.org); you may redistribute it under
00005 // the terms of the Q Public License version 1.0.
00006 // See the file LICENSE.QPL distributed with CGAL.
00007 //
00008 // Licensees holding a valid commercial license may use this file in
00009 // accordance with the commercial license agreement provided with the software.
00010 //
00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 //
00014 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h $
00015 // $Id: function_objects_polynomial_sphere.h 50731 2009-07-21 09:08:07Z sloriot $
00016 //
00017 // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado, 
00018 //             Sebastien Loriot
00019 
00020 // Partially supported by the IST Programme of the EU as a 
00021 // STREP (FET Open) Project under Contract No  IST-006413 
00022 // (ACS -- Algorithms for Complex Shapes)
00023 
00024 #ifndef CGAL_SPHERICAL_KERNEL_FUNCTION_OBJECTS_POLYNOMIAL_SPHERE_H
00025 #define CGAL_SPHERICAL_KERNEL_FUNCTION_OBJECTS_POLYNOMIAL_SPHERE_H
00026 
00027 #include <CGAL/kernel_basic.h>
00028 
00029 #include <CGAL/Spherical_kernel_intersections.h>
00030 #include <CGAL/Circular_kernel_3/internal_functions_on_circular_arc_point_3.h>
00031 #include <CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h>
00032 #include <CGAL/Circular_kernel_3/internal_functions_on_line_3.h>
00033 #include <CGAL/Circular_kernel_3/internal_functions_on_plane_3.h>
00034 #include <CGAL/Circular_kernel_3/internal_functions_on_circle_3.h>
00035 #include <CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h>
00036 #include <CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h>
00037 #include <CGAL/Circular_kernel_3/internal_function_has_on_spherical_kernel.h>
00038 #include <CGAL/Circular_kernel_3/internal_function_compare_spherical_kernel.h>
00039 #include <CGAL/Circular_kernel_3/internal_function_compare_to_right_spherical_kernel.h>
00040 #include <CGAL/Object.h>
00041 
00042 
00043 namespace CGAL {
00044         
00045 namespace SphericalFunctors {
00046 
00047 #ifndef CGAL_CFG_MATCHING_BUG_6
00048 #define CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(V)\
00049 template < class SK > \
00050   class Compare_ ##V## _3: public SK::Linear_kernel::Compare_ ##V## _3{\
00051     typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;\
00052     typedef typename SK::Point_3 Point_3;\
00053   public:\
00054     typedef  typename SK::Linear_kernel::Compare_ ##V## _3::result_type result_type;\
00055     using SK::Linear_kernel::Compare_ ##V## _3::operator();\
00056     result_type\
00057     operator() (const Circular_arc_point_3 &p0,\
00058                 const Circular_arc_point_3 &p1) const\
00059     { return SphericalFunctors::compare_ ##V <SK>(p0, p1); }\
00060     result_type\
00061     operator() (const Circular_arc_point_3 &p0,\
00062                 const Point_3 &p1) const\
00063     { return SphericalFunctors::compare_ ##V <SK>(p0, p1); }\
00064     result_type\
00065     operator() (const Point_3 &p0,\
00066                 const Circular_arc_point_3 &p1) const\
00067     { return SphericalFunctors::compare_ ##V <SK>(p0, p1); }\
00068   };\
00069   
00070 #else 
00071 #define CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(V)\
00072 template < class SK > \
00073   class Compare_ ##V## _3 {\
00074     typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;\
00075     typedef typename SK::Point_3 Point_3;\
00076   public:\
00077     typedef  typename SK::Linear_kernel::Compare_ ##V## _3 LK_Compare_ ##V## _3;\
00078     typedef  typename SK::Linear_kernel::Compare_ ##V## _3::result_type result_type;\
00079     \
00080     result_type\
00081     operator() (const Circular_arc_point_3 &p0,\
00082                 const Circular_arc_point_3 &p1) const\
00083     { return SphericalFunctors::compare_ ##V <SK>(p0, p1); }\
00084     \
00085     result_type\
00086     operator() (const Circular_arc_point_3 &p0,\
00087                 const Point_3 &p1) const\
00088     { return SphericalFunctors::compare_ ##V <SK>(p0, p1); }\
00089     \
00090     result_type\
00091     operator() (const Point_3 &p0,\
00092                 const Circular_arc_point_3 &p1) const\
00093     { return SphericalFunctors::compare_ ##V <SK>(p0, p1); }\
00094     \
00095     result_type\
00096     operator() (const Point_3 &p0,\
00097                 const Point_3 &p1) const\
00098     { return LK_Compare_ ##V## _3 ()(p0, p1); }\
00099   };
00100 #endif
00101 
00102   CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(x)
00103   CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(y)
00104   CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(z)
00105   CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(xy)
00106   CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(xyz)
00107 
00108   template <class SK>
00109   class Compute_circular_x_3: Has_qrt
00110   {
00111     typedef typename SK::Circular_arc_point_3   Circular_arc_point_3;
00112     typedef typename SK::Root_of_2                 Root_of_2;
00113 
00114   public:
00115 
00116     typedef  Root_of_2  result_type;
00117     typedef const result_type &        qualified_result_type;
00118 
00119     qualified_result_type operator() (const Circular_arc_point_3 & a) const
00120     { return (a.rep().x()); }
00121   };
00122 
00123   template <class SK>
00124   class Compute_circular_y_3: Has_qrt
00125   {
00126     typedef typename SK::Circular_arc_point_3   Circular_arc_point_3;
00127     typedef typename SK::Root_of_2                 Root_of_2;
00128 
00129   public:
00130 
00131     typedef  Root_of_2  result_type;
00132     typedef const result_type &        qualified_result_type;
00133 
00134     qualified_result_type operator() (const Circular_arc_point_3 & a) const
00135     { return (a.rep().y()); }
00136   };
00137 
00138   template <class SK>
00139   class Compute_circular_z_3: Has_qrt
00140   {
00141     typedef typename SK::Circular_arc_point_3   Circular_arc_point_3;
00142     typedef typename SK::Root_of_2                 Root_of_2;
00143 
00144   public:
00145 
00146     typedef  Root_of_2  result_type;
00147     typedef const result_type &        qualified_result_type;
00148 
00149     qualified_result_type operator() (const Circular_arc_point_3 & a) const
00150     { return (a.rep().z()); }
00151   };
00152 
00153   template < class SK >
00154   class Equal_3
00155 #ifndef CGAL_CFG_MATCHING_BUG_6
00156     : public SK::Linear_kernel::Equal_3
00157 #endif
00158   {
00159     typedef typename SK::Linear_kernel LK;
00160     typedef typename LK::Equal_3 LK_Equal_3;
00161 
00162     typedef typename SK::Point_3 Point_3;
00163     typedef typename SK::Vector_3 Vector_3;
00164     typedef typename SK::Direction_3 Direction_3;
00165     typedef typename SK::Line_3 Line_3;
00166     typedef typename SK::Ray_3 Ray_3;
00167     typedef typename SK::Segment_3 Segment_3;
00168     typedef typename SK::Triangle_3 Triangle_3;
00169     typedef typename SK::Tetrahedron_3 Tetrahedron_3;
00170     typedef typename SK::Iso_cuboid_3 Iso_cuboid_3;
00171     typedef typename SK::Plane_3 Plane_3;
00172     typedef typename SK::Circular_arc_point_3     Circular_arc_point_3;
00173     typedef typename SK::Circle_3                 Circle_3;
00174     typedef typename SK::Sphere_3                 Sphere_3;
00175 
00176     typedef typename SK::Line_arc_3               Line_arc_3;
00177     typedef typename SK::Circular_arc_3           Circular_arc_3;
00178 
00179   public:
00180 
00181     typedef typename SK::Linear_kernel::Equal_3::result_type result_type;    
00182 
00183 #ifndef CGAL_CFG_MATCHING_BUG_6
00184     using SK::Linear_kernel::Equal_3::operator();
00185 #else  
00186 
00187     result_type
00188     operator() (const Point_3 &p0,
00189                 const Point_3 &p1) const
00190     { return LK_Equal_3()(p0,p1); }
00191 
00192     result_type
00193     operator() (const Vector_3 &d0,
00194                 const Vector_3 &d1) const
00195     { return LK_Equal_3()(d0,d1); }
00196 
00197     result_type
00198     operator() (const Direction_3 &d0,
00199                 const Direction_3 &d1) const
00200     { return LK_Equal_3()(d0,d1); }
00201 
00202     result_type
00203     operator() (const Line_3 &l0,
00204                 const Line_3 &l1) const
00205     { return LK_Equal_3()(l0,l1); }
00206 
00207     result_type
00208     operator() (const Segment_3 &l0,
00209                 const Segment_3 &l1) const
00210     { return LK_Equal_3()(l0,l1); }
00211 
00212     result_type
00213     operator() (const Ray_3 &l0,
00214                 const Ray_3 &l1) const
00215     { return LK_Equal_3()(l0,l1); }
00216 
00217     result_type
00218     operator() (const Triangle_3 &l0,
00219                 const Triangle_3 &l1) const
00220     { return LK_Equal_3()(l0,l1); }
00221 
00222 
00223     result_type
00224     operator() (const Tetrahedron_3 &l0,
00225                 const Tetrahedron_3 &l1) const
00226     { return LK_Equal_3()(l0,l1); }
00227 
00228     result_type
00229     operator() (const Iso_cuboid_3 &l0,
00230                 const Iso_cuboid_3 &l1) const
00231     { return LK_Equal_3()(l0,l1); }
00232 
00233     result_type
00234     operator() (const Plane_3 &l0,
00235                 const Plane_3 &l1) const
00236     { return LK_Equal_3()(l0,l1); }
00237 
00238     result_type
00239     operator() (const Circle_3 &c0,
00240                 const Circle_3 &c1) const
00241     { return LK_Equal_3()(c0, c1); }
00242 
00243     result_type
00244     operator() (const Sphere_3 &c0,
00245                 const Sphere_3 &c1) const
00246     { return LK_Equal_3()(c0, c1); }
00247 
00248 #endif
00249 
00250     result_type
00251     operator() (const Circular_arc_point_3 &c0,
00252                 const Circular_arc_point_3 &c1) const
00253     { return SphericalFunctors::equal<SK>(c0, c1); }
00254     
00255     result_type
00256     operator() (const Circular_arc_point_3 &c0,
00257                 const Point_3 &c1) const
00258     { return SphericalFunctors::equal<SK>(c0, Circular_arc_point_3(c1)); }
00259 
00260     result_type
00261     operator() (const Point_3 &c0,
00262                 const Circular_arc_point_3 &c1) const
00263     { return SphericalFunctors::equal<SK>(Circular_arc_point_3(c0), c1); }    
00264 
00265     // Our Line_arc_3 dont have orientation
00266     result_type
00267     operator() (const Line_arc_3 &l0,
00268                 const Line_arc_3 &l1) const
00269     { return SphericalFunctors::equal<SK>(l0, l1); }
00270 
00271     // Our Circular_arc_3 dont have orientation (as parameter)
00272     result_type
00273     operator() (const Circular_arc_3 &c0,
00274                 const Circular_arc_3 &c1) const
00275     { return SphericalFunctors::equal<SK>(c0, c1); }
00276     
00277   };
00278 
00279   template < class SK >
00280   class Construct_circular_arc_point_3
00281   {
00282     typedef typename SK::Point_3                            Point_3;
00283     typedef typename SK::Plane_3                            Plane_3;
00284     typedef typename SK::Line_3                             Line_3;
00285     typedef typename SK::Circle_3                           Circle_3;
00286     typedef typename SK::Sphere_3                           Sphere_3;
00287     typedef typename SK::Circular_arc_point_3               Circular_arc_point_3;
00288     typedef typename SK::Kernel_base::Circular_arc_point_3  RCircular_arc_point_3;
00289     typedef typename SK::Root_of_2                          Root_of_2;
00290     typedef typename Circular_arc_point_3::Rep              Rep;
00291     typedef typename Circular_arc_point_3::Root_for_spheres_2_3  Root_for_spheres_2_3;
00292 
00293   public:
00294     typedef  Circular_arc_point_3 result_type;
00295 
00296     result_type
00297     operator()(void) 
00298     { return Rep(); }
00299 
00300     result_type
00301       operator()(const Root_of_2 & x,
00302                  const Root_of_2 & y,
00303                  const Root_of_2 & z
00304                  ) const
00305     { return Rep(x,y,z); }
00306     
00307     result_type
00308     operator()(const Root_for_spheres_2_3 & np) const
00309     { return Rep(np); }
00310 
00311     result_type
00312     operator()(const Point_3 & p) const
00313     { return Rep(p); }
00314 
00315     // Not Documented
00316     result_type
00317     operator()(const Sphere_3 & s1,
00318                const Sphere_3 & s2,
00319                const Sphere_3 & s3,
00320                const bool less_xyz = true) const
00321     { return Rep(s1,s2,s3,less_xyz); }
00322 
00323     // Not Documented
00324     result_type
00325     operator()(const Plane_3 & p,
00326                const Sphere_3 & s1,
00327                const Sphere_3 & s2,
00328                const bool less_xyz = true) const
00329     { return Rep(p,s1,s2,less_xyz); }
00330 
00331     // Not Documented
00332     result_type
00333     operator()(const Sphere_3 & s1,
00334                const Plane_3 & p,
00335                const Sphere_3 & s2,
00336                const bool less_xyz = true) const
00337     { return Rep(p,s1,s2,less_xyz); }
00338 
00339     // Not Documented
00340     result_type
00341     operator()(const Sphere_3 & s1,
00342                const Sphere_3 & s2,
00343                const Plane_3 & p,
00344                const bool less_xyz = true) const
00345     { return Rep(p,s1,s2,less_xyz); }
00346 
00347     // Not Documented
00348     result_type
00349     operator()(const Plane_3 & p1,
00350                const Plane_3 & p2,
00351                const Sphere_3 & s,
00352                const bool less_xyz = true) const
00353     { return Rep(p1,p2,s,less_xyz); }
00354 
00355     // Not Documented
00356     result_type
00357     operator()(const Plane_3 & p1,
00358                const Sphere_3 & s,
00359                const Plane_3 & p2,
00360                const bool less_xyz = true) const
00361     { return Rep(p1,p2,s,less_xyz); }
00362 
00363     // Not Documented
00364     result_type
00365     operator()(const Sphere_3 & s,
00366                const Plane_3 & p1,
00367                const Plane_3 & p2,
00368                const bool less_xyz = true) const
00369     { return Rep(p1,p2,s,less_xyz); }
00370 
00371     // Not Documented
00372     result_type
00373     operator()(const Line_3 & l,
00374                const Sphere_3 & s,
00375                const bool less_xyz = true) const
00376     { return Rep(l,s,less_xyz); }
00377 
00378     // Not Documented
00379     result_type
00380     operator()(const Sphere_3 & s,
00381                const Line_3 & l,
00382                const bool less_xyz = true) const
00383     { return Rep(l,s,less_xyz); }
00384 
00385     // Not Documented
00386     result_type
00387     operator()(const Circle_3 & c,
00388                const Sphere_3 & s,
00389                const bool less_xyz = true) const
00390     { return Rep(c,s,less_xyz); }
00391 
00392     // Not Documented
00393     result_type
00394     operator()(const Sphere_3 & s,
00395                const Circle_3 & c,
00396                const bool less_xyz = true) const
00397     { return Rep(c,s,less_xyz); }
00398 
00399     // Not Documented
00400     result_type
00401     operator()(const Circle_3 & c,
00402                const Plane_3 & p,
00403                const bool less_xyz = true) const
00404     { return Rep(c,p,less_xyz); }
00405 
00406     // Not Documented
00407     result_type
00408     operator()(const Plane_3 & p,
00409                const Circle_3 & c,
00410                const bool less_xyz = true) const
00411     { return Rep(c,p,less_xyz); }
00412 
00413   };
00414 
00415   template < class SK >
00416   class Construct_sphere_3
00417 #ifndef  CGAL_CFG_MATCHING_BUG_6
00418  : public  SK::Linear_kernel::Construct_sphere_3
00419 #endif
00420   {
00421           typedef typename SK::Circular_arc_3 Circular_arc_3;
00422         
00423   public:
00424     
00425                 typedef typename SK::Linear_kernel::Construct_sphere_3::result_type result_type; 
00426 #ifndef CGAL_CFG_MATCHING_BUG_6
00427     using SK::Linear_kernel::Construct_sphere_3::operator();
00428 #else 
00429     typedef typename SK::Linear_kernel LK;
00430     typedef typename LK::Point_3 Point_3;
00431     typedef typename LK::Circle_3 Circle_3;
00432     typedef typename LK::Sphere_3 Sphere_3;
00433     typedef typename LK::Construct_sphere_3 LK_Construct_sphere_3;
00434     typedef typename LK::FT FT;
00435 
00436 
00437     result_type
00438     operator()( Return_base_tag tag, const Point_3& center, const FT& squared_radius,
00439                 Orientation orientation = COUNTERCLOCKWISE) const
00440     { return LK_Construct_sphere_3()(tag, center, squared_radius, orientation); }
00441 
00442     result_type
00443     operator()( Return_base_tag tag, const Point_3& p, const Point_3& q,
00444                 const Point_3& r, const Point_3& s) const
00445     { return LK_Construct_sphere_3()(tag, p, q, r, s); }
00446 
00447     result_type
00448     operator()( Return_base_tag tag, const Point_3& p, const Point_3& q, const Point_3& r,
00449                 Orientation orientation  = COUNTERCLOCKWISE) const
00450     { return LK_Construct_sphere_3()(tag, p, q, r, orientation); }
00451 
00452     result_type
00453     operator()( Return_base_tag tag, const Point_3& p, const Point_3& q,
00454                 Orientation orientation = COUNTERCLOCKWISE) const
00455     { return LK_Construct_sphere_3()(tag, p, q, orientation); }
00456 
00457     result_type
00458     operator()( Return_base_tag tag, const Point_3& center,
00459                 Orientation orientation = COUNTERCLOCKWISE) const
00460     { return LK_Construct_sphere_3()(tag, center, orientation); }
00461 
00462     result_type
00463     operator() (Return_base_tag tag, const Circle_3 & c) const
00464     { return LK_Construct_sphere_3()(tag, c); }
00465 
00466 
00467 
00468 
00469     result_type
00470     operator()( const Point_3& center, const FT& squared_radius,
00471                 Orientation orientation = COUNTERCLOCKWISE) const
00472     { return LK_Construct_sphere_3()(center, squared_radius, orientation); }
00473 
00474     result_type
00475     operator()( const Point_3& p, const Point_3& q,
00476                 const Point_3& r, const Point_3& s) const
00477     { return LK_Construct_sphere_3()(p, q, r, s); }
00478 
00479     result_type
00480     operator()( const Point_3& p, const Point_3& q, const Point_3& r,
00481                 Orientation orientation = COUNTERCLOCKWISE) const
00482     { return LK_Construct_sphere_3()(p, q, r, orientation); }
00483 
00484     result_type
00485     operator()( const Point_3& p, const Point_3& q,
00486                 Orientation orientation = COUNTERCLOCKWISE) const
00487     { return LK_Construct_sphere_3()(p, q, orientation); }
00488 
00489     result_type
00490     operator()( const Point_3& center,
00491                 Orientation orientation = COUNTERCLOCKWISE) const
00492     { return LK_Construct_sphere_3()(center, orientation); }
00493 
00494     result_type
00495     operator() (const Circle_3 & c) const
00496     { return LK_Construct_sphere_3()(c); }
00497 
00498 
00499 
00500 
00501 #endif
00502 
00503     result_type
00504     operator() ( const typename SK::Polynomial_for_spheres_2_3 &eq )
00505     { return SphericalFunctors::construct_sphere_3<SK>(eq); }
00506 
00507     result_type operator() (const Circular_arc_3 & c) const
00508     { return c.rep().diametral_sphere(); }
00509 
00510   };
00511 
00512   template < class SK >
00513   class Construct_plane_3
00514 #ifndef CGAL_CFG_MATCHING_BUG_6
00515  : public  SK::Linear_kernel::Construct_plane_3
00516 #endif
00517   {
00518           typedef typename SK::Circular_arc_3 Circular_arc_3;
00519         
00520   public:
00521     
00522                 typedef typename SK::Linear_kernel::Construct_plane_3::result_type result_type;
00523 
00524 #ifndef CGAL_CFG_MATCHING_BUG_6    
00525     using SK::Linear_kernel::Construct_plane_3::operator();
00526 #else 
00527     typedef typename SK::Linear_kernel LK;
00528     typedef typename LK::Construct_plane_3 LK_Construct_plane_3;
00529     typedef typename LK::RT           RT;
00530     typedef typename LK::Point_3      Point_3;
00531     typedef typename LK::Vector_3     Vector_3;
00532     typedef typename LK::Direction_3  Direction_3;
00533     typedef typename LK::Line_3       Line_3;
00534     typedef typename LK::Ray_3        Ray_3;
00535     typedef typename LK::Segment_3    Segment_3;
00536     typedef typename LK::Plane_3      Plane_3;
00537     typedef typename LK::Circle_3     Circle_3;
00538 
00539   public:
00540 
00541     result_type
00542     operator()(Return_base_tag tag, const RT& a, const RT& b, const RT& c, const RT& d) const
00543     { return LK_Construct_plane_3()(tag, a, b, c, d); }
00544 
00545     result_type
00546     operator()(Return_base_tag tag, const Point_3& p, const Point_3& q, const Point_3& r) const
00547     { return LK_Construct_plane_3()(tag, p, q, r); }
00548 
00549     result_type
00550     operator()(Return_base_tag tag, const Point_3& p, const Direction_3& d) const
00551     { return LK_Construct_plane_3()(tag, p, d); }
00552 
00553     result_type
00554     operator()(Return_base_tag tag, const Point_3& p, const Vector_3& v) const
00555     { return LK_Construct_plane_3()(tag, p, v); }
00556 
00557     result_type
00558     operator()(Return_base_tag tag, const Line_3& l, const Point_3& p) const
00559     { return LK_Construct_plane_3()(tag, l, p); }
00560 
00561     result_type
00562     operator()(Return_base_tag tag, const Ray_3& r, const Point_3& p) const
00563     { return LK_Construct_plane_3()(tag, r, p); }
00564 
00565     result_type
00566     operator()(Return_base_tag tag, const Segment_3& s, const Point_3& p) const
00567     { return LK_Construct_plane_3()(tag, s, p); }
00568 
00569     result_type
00570     operator()(Return_base_tag tag, const Circle_3 & c) const
00571     { return LK_Construct_plane_3()(tag, c); }
00572 
00573     result_type
00574     operator()(const RT& a, const RT& b, const RT& c, const RT& d) const
00575     { return this->operator()(Return_base_tag(), a, b, c, d); }
00576 
00577     result_type
00578     operator()(const Point_3& p, const Point_3& q, const Point_3& r) const
00579     { return this->operator()(Return_base_tag(), p, q, r); }
00580 
00581     result_type
00582     operator()(const Point_3& p, const Direction_3& d) const
00583     { return this->operator()(Return_base_tag(), p, d); }
00584 
00585     result_type
00586     operator()(const Point_3& p, const Vector_3& v) const
00587     { return this->operator()(Return_base_tag(), p, v); }
00588 
00589     result_type
00590     operator()(const Line_3& l, const Point_3& p) const
00591     { return this->operator()(Return_base_tag(), l, p); }
00592 
00593     result_type
00594     operator()(const Ray_3& r, const Point_3& p) const
00595     { return this->operator()(Return_base_tag(), r, p); }
00596 
00597     result_type
00598     operator()(const Segment_3& s, const Point_3& p) const
00599     { return this->operator()(Return_base_tag(), s, p); }
00600 
00601     result_type
00602     operator()(const Circle_3 & c) const
00603     { return this->operator()(Return_base_tag(), c); }
00604 
00605 #endif
00606 
00607     result_type
00608     operator() ( const typename SK::Polynomial_1_3 &eq )
00609     { return SphericalFunctors::construct_plane_3<SK>(eq); }
00610 
00611     result_type operator() (const Circular_arc_3 & c) const
00612     { return c.rep().supporting_plane(); }
00613   };
00614 
00615 
00616 
00617   template <class SK>
00618   class Construct_line_3
00619 #ifndef CGAL_CFG_MATCHING_BUG_6
00620 
00621  : public SK::Linear_kernel::Construct_line_3
00622 #endif
00623   {
00624     typedef typename SK::Line_arc_3                Line_arc_3;
00625     typedef typename SK::Line_3                    Line_3;
00626 
00627   public:
00628 
00629     typedef typename SK::Linear_kernel::Construct_line_3::result_type 
00630       result_type;
00631 
00632     typedef const result_type &  qualified_result_type;
00633 
00634 #ifndef CGAL_CFG_MATCHING_BUG_6   
00635     using SK::Linear_kernel::Construct_line_3::operator();
00636 #else 
00637 
00638     typedef typename SK::Point_3 Point_3;
00639     typedef typename SK::Direction_3 Direction_3;
00640     typedef typename SK::Vector_3 Vector_3;
00641     typedef typename SK::Segment_3 Segment_3;
00642     typedef typename SK::Ray_3 Ray_3;
00643     typedef typename SK::Linear_kernel::Construct_line_3 LK_Construct_line_3;
00644 
00645     result_type
00646     operator()(Return_base_tag, const Point_3& p, const Point_3& q) const
00647     { return LK_Construct_line_3()(p, Vector_3(p, q)); }
00648 
00649     result_type
00650     operator()(Return_base_tag, const Point_3& p, const Direction_3& d) const
00651     { return operator()(Return_base_tag(), p, Vector_3(d.dx(), d.dy(), d.dz())); }
00652 
00653     result_type
00654     operator()(Return_base_tag, const Point_3& p, const Vector_3& v) const
00655     { return LK_Construct_line_3()(p, v); }
00656 
00657     result_type
00658     operator()(Return_base_tag, const Segment_3& s) const
00659     { return LK_Construct_line_3()(s.source(), Vector_3(s.source(), s.target())); }
00660 
00661     result_type
00662     operator()(Return_base_tag, const Ray_3& r) const
00663     { return LK_Construct_line_3()(r.source(), Vector_3(r.source(), r.second_point())); }
00664 
00665 
00666     result_type
00667     operator()(const Point_3& p, const Point_3& q) const
00668     { return this->operator()(Return_base_tag(), p, q); }
00669 
00670     result_type
00671     operator()(const Point_3& p, const Direction_3& d) const
00672     { return this->operator()(Return_base_tag(), p, d); }
00673 
00674     result_type
00675     operator()(const Point_3& p, const Vector_3& v) const
00676     { return this->operator()(Return_base_tag(), p, v); }
00677 
00678     result_type
00679     operator()(const Segment_3& s) const
00680     { return this->operator()(Return_base_tag(), s); }
00681 
00682     result_type
00683     operator()(const Ray_3& r) const
00684     { return this->operator()(Return_base_tag(), r); }
00685 
00686 
00687 #endif
00688     qualified_result_type operator() (const Line_arc_3 & a) const
00689     { return (a.rep().supporting_line()); }
00690 
00691     result_type
00692     operator() ( const typename SK::Polynomials_for_line_3 &eq )
00693     { return SphericalFunctors::construct_line_3<SK>(eq); }
00694 
00695   };
00696 
00697   template < class SK >
00698   class Construct_circle_3 : public  SK::Linear_kernel::Construct_circle_3
00699   {
00700   public:
00701 
00702     typedef typename SK::FT FT;
00703     typedef typename SK::Point_3 Point_3;
00704     typedef typename SK::Plane_3 Plane_3;
00705     typedef typename SK::Sphere_3 Sphere_3;
00706     typedef typename SK::Circle_3 Circle_3;
00707     typedef typename SK::Vector_3    Vector_3;
00708     typedef typename SK::Direction_3 Direction_3;
00709     typedef typename SK::Circular_arc_3            Circular_arc_3;
00710     typedef typename SK::Kernel_base::Circle_3  RCircle_3;
00711     typedef typename Circle_3::Rep              Rep;
00712 
00713                 typedef typename SK::Linear_kernel::Construct_circle_3::result_type result_type;
00714                 typedef const result_type &  qualified_result_type;
00715 
00716     using SK::Linear_kernel::Construct_circle_3::operator();
00717 
00718     result_type
00719     operator() ( const typename SK::Polynomials_for_circle_3 &eq )
00720     { return Rep(construct_circle_3<SK>(eq)); }
00721 
00722     qualified_result_type 
00723     operator() (const Circular_arc_3 & a) const
00724     { return (a.rep().supporting_circle()); }
00725 
00726   };
00727 
00728   template < class SK >
00729   class Construct_line_arc_3
00730   {
00731 
00732     typedef typename SK::Line_3                    Line_3;
00733     typedef typename SK::Point_3                   Point_3;
00734     typedef typename SK::Segment_3                 Segment_3;
00735     typedef typename SK::Sphere_3                  Sphere_3;
00736     typedef typename SK::Plane_3                   Plane_3;
00737     typedef typename SK::Circular_arc_point_3      Circular_arc_point_3;
00738     typedef typename SK::Line_arc_3                Line_arc_3;
00739     typedef typename SK::Kernel_base::Line_arc_3   RLine_arc_3;
00740     typedef typename Line_arc_3::Rep               Rep;
00741 
00742   public:
00743     typedef Line_arc_3   result_type;
00744 
00745     result_type
00746     operator()(void) const
00747     { return Rep(); }
00748 
00749     result_type
00750     operator()(const Line_3 &l,
00751                const Circular_arc_point_3 &s,
00752                const Circular_arc_point_3 &t) const
00753     { return Rep(l,s,t); }
00754 
00755     result_type
00756     operator()(const Point_3 &s,
00757                      const Point_3 &t) const
00758     { return Rep(s,t); }
00759 
00760     result_type
00761     operator()(const Segment_3 &s) const
00762     { return Rep(s); }
00763 
00764     // Not Documented
00765     result_type
00766     operator()(const Line_3 &l,
00767                const Sphere_3 &s,
00768                bool less_xyz_first = true) const
00769     { return Rep(l,s,less_xyz_first); }
00770 
00771     // Not Documented
00772     result_type
00773     operator()(const Sphere_3 &s,
00774                const Line_3 &l,
00775                bool less_xyz_first = true) const
00776     { return Rep(l,s,less_xyz_first); }
00777 
00778     // Not Documented
00779     result_type
00780     operator()(const Line_3 &l, 
00781                const Sphere_3 &s1, bool less_xyz_s1,
00782                const Sphere_3 &s2, bool less_xyz_s2) const
00783     { return Rep(l,s1,less_xyz_s1,
00784                    s2,less_xyz_s2); }
00785 
00786     // Not Documented
00787     result_type
00788     operator()(const Sphere_3 &s1, bool less_xyz_s1,
00789                const Sphere_3 &s2, bool less_xyz_s2,
00790                const Line_3 &l) const
00791     { return Rep(l,s1,less_xyz_s1,
00792                    s2,less_xyz_s2); }
00793 
00794     // Not Documented
00795     result_type
00796     operator()(const Line_3 &l,
00797                const Plane_3 &p1,
00798                const Plane_3 &p2) const
00799     { return Rep(l,p1,p2); }
00800 
00801     // Not Documented
00802     result_type
00803     operator()(const Plane_3 &p1,
00804                const Plane_3 &p2,
00805                const Line_3 &l) const
00806     { return Rep(l,p1,p2); }
00807 
00808   };
00809 
00810   template < class SK >
00811   class Construct_circular_arc_3
00812   {
00813 
00814     typedef typename SK::Line_3                        Line_3;
00815     typedef typename SK::Point_3                       Point_3;
00816     typedef typename SK::Segment_3                     Segment_3;
00817     typedef typename SK::Sphere_3                      Sphere_3;
00818     typedef typename SK::Plane_3                       Plane_3;
00819     typedef typename SK::Line_arc_3                    Line_arc_3;
00820     
00821     typedef typename SK::Circular_arc_point_3          Circular_arc_point_3;
00822     typedef typename SK::Circle_3                      Circle_3;
00823     typedef typename SK::Circular_arc_3                Circular_arc_3;
00824     typedef typename SK::Kernel_base::Circular_arc_3   RCircular_arc_3;
00825     typedef typename Circular_arc_3::Rep               Rep;
00826   public:
00827     typedef Circular_arc_3   result_type;
00828 
00829     result_type
00830     operator()(void) const
00831     { return Rep(); }
00832 
00833     result_type
00834     operator()(const Circle_3 &c) const
00835     { return Rep(c); }
00836 
00837     result_type
00838     operator()(const Circle_3 &c,const Circular_arc_point_3& pt) const
00839     { return Rep(c,pt); }    
00840     
00841     result_type
00842     operator()(const Circle_3 &l,
00843                const Circular_arc_point_3 &s,
00844                const Circular_arc_point_3 &t) const
00845     { return Rep(l,s,t); }
00846 
00847     // Not Documented
00848     result_type
00849     operator()(const Circle_3 &c, 
00850                const Sphere_3 &s1, bool less_xyz_s1,
00851                const Sphere_3 &s2, bool less_xyz_s2) const
00852     { return Rep(c,s1,less_xyz_s1,s2,less_xyz_s2); }
00853 
00854     // Not Documented
00855     result_type
00856     operator()(const Sphere_3 &s1, bool less_xyz_s1,
00857                const Sphere_3 &s2, bool less_xyz_s2,
00858                const Circle_3 &c) const
00859     { return Rep(c,s1,less_xyz_s1,s2,less_xyz_s2); }
00860 
00861     // Not Documented
00862     result_type
00863     operator()(const Circle_3 &c, 
00864                const Plane_3 &p1, bool less_xyz_p1,
00865                const Plane_3 &p2, bool less_xyz_p2) const
00866     { return Rep(c,p1,less_xyz_p1,p2,less_xyz_p2); }
00867 
00868     // Not Documented
00869     result_type
00870     operator()(const Plane_3 &p1, bool less_xyz_p1,
00871                const Plane_3 &p2, bool less_xyz_p2,
00872                const Circle_3 &c) const
00873     { return Rep(c,p1,less_xyz_p1,p2,less_xyz_p2); }
00874 
00875     result_type
00876     operator()(const Point_3 &begin,
00877                const Point_3 &middle, 
00878                const Point_3 &end) const
00879     { return Rep(begin,middle,end); }   
00880 
00881   };
00882 
00883   template <class SK>
00884   class Construct_circular_min_vertex_3 : Has_qrt
00885   {
00886     typedef typename SK::Line_arc_3                Line_arc_3;
00887     typedef typename SK::Circular_arc_point_3      Circular_arc_point_3;
00888 
00889   public:
00890 
00891     typedef Circular_arc_point_3 result_type;
00892     typedef const result_type &  qualified_result_type;
00893 
00894     qualified_result_type operator() (const Line_arc_3 & a) const
00895     { return (a.rep().lower_xyz_extremity()); }
00896 
00897   };
00898 
00899   template <class SK>
00900   class Construct_circular_max_vertex_3 : Has_qrt
00901   {
00902     typedef typename SK::Line_arc_3                Line_arc_3;
00903     typedef typename SK::Circular_arc_point_3      Circular_arc_point_3;
00904 
00905   public:
00906 
00907     typedef Circular_arc_point_3 result_type;
00908     typedef const result_type &  qualified_result_type;
00909 
00910     qualified_result_type operator() (const Line_arc_3 & a) const
00911     { return (a.rep().higher_xyz_extremity()); }
00912 
00913   };
00914 
00915   template <class SK>
00916   class Construct_circular_source_vertex_3 : Has_qrt
00917   {
00918     typedef typename SK::Line_arc_3                Line_arc_3;
00919     typedef typename SK::Circular_arc_3            Circular_arc_3;
00920     typedef typename SK::Circular_arc_point_3      Circular_arc_point_3;
00921 
00922   public:
00923 
00924     typedef Circular_arc_point_3 result_type;
00925     typedef const result_type &  qualified_result_type;
00926 
00927     qualified_result_type operator() (const Line_arc_3 & a) const
00928     { return (a.rep().source()); }
00929 
00930     qualified_result_type operator() (const Circular_arc_3 & a) const
00931     { return (a.rep().source()); }
00932 
00933   };
00934 
00935   template <class SK>
00936   class Construct_circular_target_vertex_3 : Has_qrt
00937   {
00938     typedef typename SK::Line_arc_3                Line_arc_3;
00939     typedef typename SK::Circular_arc_point_3      Circular_arc_point_3;
00940     typedef typename SK::Circular_arc_3            Circular_arc_3;
00941 
00942   public:
00943 
00944     typedef Circular_arc_point_3 result_type;
00945     typedef const result_type &  qualified_result_type;
00946 
00947     qualified_result_type operator() (const Line_arc_3 & a) const
00948     { return (a.rep().target()); }
00949 
00950     qualified_result_type operator() (const Circular_arc_3 & a) const
00951     { return (a.rep().target()); }
00952 
00953   };
00954 
00955   template < class SK >
00956   class Has_on_3 
00957 #ifndef CGAL_CFG_MATCHING_BUG_6
00958     : public SK::Linear_kernel::Has_on_3
00959 #endif
00960   {
00961     typedef typename SK::Point_3                 Point_3;
00962     typedef typename SK::Sphere_3                Sphere_3;
00963     typedef typename SK::Plane_3                 Plane_3;
00964     typedef typename SK::Line_3                  Line_3;
00965     typedef typename SK::Segment_3                   Segment_3;
00966     typedef typename SK::Ray_3                   Ray_3;
00967     typedef typename SK::Triangle_3              Triangle_3;
00968     typedef typename SK::Line_arc_3              Line_arc_3;
00969     typedef typename SK::Circular_arc_point_3    Circular_arc_point_3;
00970     typedef typename SK::Circular_arc_3          Circular_arc_3;
00971     typedef typename SK::Circle_3                Circle_3;
00972     
00973 
00974   public:
00975     typedef typename SK::Linear_kernel::Has_on_3::result_type result_type;
00976 
00977 #ifndef CGAL_CFG_MATCHING_BUG_6
00978     using SK::Linear_kernel::Has_on_3::operator();
00979 #else 
00980     typedef typename SK::Linear_kernel::Has_on_3 LK_Has_on_3;
00981 
00982     result_type
00983     operator()( const Line_3& l, const Point_3& p) const
00984     { return LK_Has_on_3()(l,p); }
00985 
00986     result_type
00987     operator()( const Ray_3& r, const Point_3& p) const
00988     { return LK_Has_on_3()(r,p); }
00989 
00990     result_type
00991     operator()( const Segment_3& s, const Point_3& p) const
00992     { return LK_Has_on_3()(s,p); }
00993 
00994     result_type
00995     operator()( const Plane_3& pl, const Point_3& p) const
00996     { return LK_Has_on_3()(pl,p); }
00997 
00998     result_type
00999     operator()( const Plane_3& pl, const Line_3& l) const
01000     { return LK_Has_on_3()(pl,l); }
01001 
01002     result_type
01003     operator()( const Triangle_3& t, const Point_3& p) const
01004     {
01005       return LK_Has_on_3()(t,p);
01006     }
01007 
01008     result_type
01009     operator()(const Sphere_3 &a, const Point_3 &p) const
01010     { return LK_Has_on_3()(a,p); }
01011 
01012     result_type
01013     operator()(const Circle_3 &a, const Point_3 &p) const
01014     { return LK_Has_on_3()(a,p); }
01015 
01016     result_type
01017     operator()(const Sphere_3 &a, const Circle_3 &p) const
01018     { return LK_Has_on_3()(a,p); }
01019 
01020     result_type
01021     operator()(const Plane_3 &a, const Circle_3 &p) const
01022     { return LK_Has_on_3()(a,p); }
01023 
01024 #endif
01025 
01026     result_type
01027     operator()(const Sphere_3 &a, const Circular_arc_point_3 &p) const
01028     { return SphericalFunctors::has_on<SK>(a, p); }
01029 
01030     result_type
01031     operator()(const Plane_3 &a, const Circular_arc_point_3 &p) const
01032     { return SphericalFunctors::has_on<SK>(a, p); }
01033 
01034     result_type
01035     operator()(const Line_3 &a, const Circular_arc_point_3 &p) const
01036     { return SphericalFunctors::has_on<SK>(a, p); }
01037 
01038     result_type
01039     operator()(const Circle_3 &a, const Circular_arc_point_3 &p) const
01040     { return SphericalFunctors::has_on<SK>(a, p); }
01041 
01042     result_type
01043     operator()(const Line_arc_3 &a, const Circular_arc_point_3 &p,
01044                const bool already_know_point_on_line = false) const
01045     { return SphericalFunctors::has_on<SK>(a, p, already_know_point_on_line); }
01046 
01047     result_type
01048     operator()(const Line_arc_3 &a, const Point_3 &p,
01049                const bool already_know_point_on_line = false) const
01050     { return SphericalFunctors::has_on<SK>(a, p, already_know_point_on_line); }
01051 
01052     result_type
01053     operator()(const Plane_3 &p, const Line_arc_3 &a) const
01054     { return SphericalFunctors::has_on<SK>(p, a); }
01055 
01056     result_type
01057     operator()(const Line_3 &a, const Line_arc_3 &p) const
01058     { return SphericalFunctors::has_on<SK>(a, p); }
01059 
01060     result_type
01061     operator()(const Circular_arc_3 &a, const Point_3 &p,
01062                const bool has_on_supporting_circle = false) const
01063     { return SphericalFunctors::has_on<SK>(a, p, has_on_supporting_circle); }
01064 
01065     result_type
01066     operator()(const Circular_arc_3 &a, const Circular_arc_point_3 &p,
01067                const bool has_on_supporting_circle = false) const
01068     { return SphericalFunctors::has_on<SK>(a, p, has_on_supporting_circle); }
01069 
01070     result_type
01071     operator()(const Sphere_3 &a, const Circular_arc_3 &p) const
01072     { return SphericalFunctors::has_on<SK>(a, p); }
01073 
01074     result_type
01075     operator()(const Plane_3 &a, const Circular_arc_3 &p) const
01076     { return SphericalFunctors::has_on<SK>(a, p); }
01077 
01078     result_type
01079     operator()(const Circle_3 &a, const Circular_arc_3 &p) const
01080     { return SphericalFunctors::has_on<SK>(a, p); }
01081 
01082     result_type
01083     operator()(const Circular_arc_3 &p, const Circle_3 &a) const
01084     { return SphericalFunctors::has_on<SK>(p, a); }
01085     
01086   };
01087 
01088   template < class SK >
01089   class Do_intersect_3
01090     : public SK::Linear_kernel::Do_intersect_3
01091   {
01092   
01093     typedef typename SK::Sphere_3                 Sphere_3;
01094     typedef typename SK::Line_3                   Line_3;
01095     typedef typename SK::Line_arc_3               Line_arc_3;
01096     typedef typename SK::Circular_arc_3           Circular_arc_3;
01097     typedef typename SK::Plane_3                  Plane_3;
01098     typedef typename SK::Circle_3                 Circle_3;
01099   
01100   public:
01101 
01102           typedef typename SK::Linear_kernel::Do_intersect_3::result_type result_type;
01103   
01104     using SK::Linear_kernel::Do_intersect_3::operator();
01105 
01106 #define CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(A,B) \
01107   result_type \
01108   operator()(const A & c1, const B & c2) const \
01109   { std::vector< Object > res; \
01110     typename SK::Intersect_3()(c1,c2,std::back_inserter(res)); \
01111           return res.size() != 0; }
01112         
01113 #define CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(A,B,C) \
01114   result_type \
01115   operator()(const A & c1, const B & c2, const C & c3) const \
01116   { std::vector< Object > res; \
01117     typename SK::Intersect_3()(c1,c2,c3,std::back_inserter(res)); \
01118           return res.size() != 0; }
01119 
01120         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Sphere_3, Line_3)
01121         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_3, Sphere_3)
01122         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Sphere_3, Sphere_3, Sphere_3)
01123         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Sphere_3, Sphere_3, Plane_3)
01124         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Plane_3, Sphere_3, Sphere_3)
01125         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Plane_3, Plane_3, Sphere_3)
01126         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_3(Sphere_3, Plane_3, Plane_3)
01127         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circle_3, Plane_3)
01128         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Plane_3, Circle_3)
01129         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circle_3, Sphere_3)
01130         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Sphere_3, Circle_3)
01131         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circle_3, Circle_3)
01132         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circle_3, Line_3)
01133         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_3, Circle_3)
01134         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_arc_3, Line_arc_3)
01135         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_3, Line_arc_3)
01136         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_arc_3, Line_3)
01137         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circle_3, Line_arc_3)
01138         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_arc_3, Circle_3)
01139         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Sphere_3, Line_arc_3)
01140         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_arc_3, Sphere_3)
01141         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Plane_3, Line_arc_3)
01142         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_arc_3, Plane_3)
01143         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circular_arc_3, Circular_arc_3)
01144         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_3, Circular_arc_3)
01145         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circular_arc_3, Line_3)
01146         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circle_3, Circular_arc_3)
01147         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circular_arc_3, Circle_3)
01148         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Sphere_3, Circular_arc_3)
01149         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circular_arc_3, Sphere_3)
01150         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Plane_3, Circular_arc_3)
01151         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circular_arc_3, Plane_3)
01152         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Circular_arc_3, Line_arc_3)
01153         CGAL_SPHERICAL_KERNEL_MACRO_DO_INTERSECTION_3_2(Line_arc_3, Circular_arc_3)
01154 
01155   };
01156 
01157   template < class SK >
01158   class Intersect_3
01159     : public SK::Linear_kernel::Intersect_3
01160   {
01161   
01162     typedef typename SK::Sphere_3                 Sphere_3;
01163     typedef typename SK::Line_3                   Line_3;
01164     typedef typename SK::Line_arc_3               Line_arc_3;
01165     typedef typename SK::Circular_arc_3           Circular_arc_3;
01166     typedef typename SK::Plane_3                  Plane_3;
01167     typedef typename SK::Circle_3                 Circle_3;
01168     
01169     public:
01170 
01171                 typedef typename SK::Linear_kernel::Intersect_3::result_type result_type;
01172                                 
01173     typedef typename SK::Object_3 Object_3;
01174     
01175     using SK::Linear_kernel::Intersect_3::operator();
01176 
01177     template < class OutputIterator >
01178     OutputIterator
01179     operator()(const Sphere_3 & s, const Line_3 & l, 
01180                OutputIterator res) const
01181     { return SphericalFunctors::intersect_3<SK> (s,l,res); }
01182     
01183      template < class OutputIterator >
01184     OutputIterator
01185       operator()(const Line_3 & l,const Sphere_3 & s, 
01186                OutputIterator res) const
01187     { return SphericalFunctors::intersect_3<SK> (s,l,res); }
01188 
01189     template < class OutputIterator >
01190     OutputIterator
01191     operator()(const Sphere_3 & s1, const Sphere_3 & s2, 
01192                const Sphere_3 & s3, OutputIterator res) const
01193     { return SphericalFunctors::intersect_3<SK> (s1,s2,s3,res); }
01194 
01195     template < class OutputIterator >
01196     OutputIterator
01197     operator()(const Sphere_3 & s1, const Sphere_3 & s2, 
01198                const Plane_3 & p, OutputIterator res) const
01199     { return SphericalFunctors::intersect_3<SK> (p,s1,s2,res); }
01200 
01201     template < class OutputIterator >
01202     OutputIterator
01203     operator()(const Plane_3 & p, const Sphere_3 & s1,  
01204                const Sphere_3 & s2, OutputIterator res) const
01205     { return SphericalFunctors::intersect_3<SK> (p,s1,s2,res); }
01206 
01207     template < class OutputIterator >
01208     OutputIterator
01209     operator()(const Plane_3 & p1, const Plane_3 & p2,  
01210                const Sphere_3 & s, OutputIterator res) const
01211     { return SphericalFunctors::intersect_3<SK> (p1,p2,s,res); }
01212 
01213     template < class OutputIterator >
01214     OutputIterator
01215     operator()(const Sphere_3 & s, const Plane_3 & p1, 
01216                const Plane_3 & p2, OutputIterator res) const
01217     { return SphericalFunctors::intersect_3<SK> (p1,p2,s,res); }
01218 
01219     template < class OutputIterator >
01220     OutputIterator
01221     operator()(const Circle_3 & c, const Plane_3 & p, 
01222                OutputIterator res) const
01223     { return SphericalFunctors::intersect_3<SK> (c,p,res); }
01224 
01225     template < class OutputIterator >
01226     OutputIterator
01227     operator()(const Plane_3 & p, const Circle_3 & c, 
01228                OutputIterator res) const
01229     { return SphericalFunctors::intersect_3<SK> (c,p,res); }
01230 
01231     template < class OutputIterator >
01232     OutputIterator
01233     operator()(const Circle_3 & c, const Sphere_3 & s, 
01234                OutputIterator res) const
01235     { return SphericalFunctors::intersect_3<SK> (c,s,res); }
01236 
01237     template < class OutputIterator >
01238     OutputIterator
01239     operator()(const Sphere_3 & s, const Circle_3 & c, 
01240                OutputIterator res) const
01241     { return SphericalFunctors::intersect_3<SK> (c,s,res); }
01242 
01243     template < class OutputIterator >
01244     OutputIterator
01245     operator()(const Circle_3 & c1, const Circle_3 & c2, 
01246                OutputIterator res) const
01247     { return SphericalFunctors::intersect_3<SK> (c1,c2,res); }
01248 
01249     template < class OutputIterator >
01250     OutputIterator
01251     operator()(const Circle_3 & c, const Line_3 & l, 
01252                OutputIterator res) const
01253     { return SphericalFunctors::intersect_3<SK> (c,l,res); }
01254 
01255     template < class OutputIterator >
01256     OutputIterator
01257     operator()(const Line_3 & l, const Circle_3 & c,
01258                OutputIterator res) const
01259     { return SphericalFunctors::intersect_3<SK> (c,l,res); }
01260 
01261     template < class OutputIterator >
01262     OutputIterator
01263     operator()(const Line_arc_3 & l1, const Line_arc_3 & l2, 
01264                OutputIterator res) const
01265     { return SphericalFunctors::intersect_3<SK> (l1,l2,res); }
01266 
01267     template < class OutputIterator >
01268     OutputIterator
01269     operator()(const Line_3 & l, const Line_arc_3 & la, 
01270                OutputIterator res) const
01271     { return SphericalFunctors::intersect_3<SK> (l,la,res); }
01272 
01273     template < class OutputIterator >
01274     OutputIterator
01275     operator()(const Line_arc_3 & la, const Line_3 & l, 
01276                OutputIterator res) const
01277     { return SphericalFunctors::intersect_3<SK> (l,la,res); }
01278 
01279     template < class OutputIterator >
01280     OutputIterator
01281     operator()(const Circle_3 & c, const Line_arc_3 & l, 
01282                OutputIterator res) const
01283     { return SphericalFunctors::intersect_3<SK> (c,l,res); }
01284 
01285     template < class OutputIterator >
01286     OutputIterator
01287     operator()(const Line_arc_3 & l, const Circle_3 & c,
01288                OutputIterator res) const
01289     { return SphericalFunctors::intersect_3<SK> (c,l,res); }
01290 
01291     template < class OutputIterator >
01292     OutputIterator
01293     operator()(const Sphere_3 & s, const Line_arc_3 & l, 
01294                OutputIterator res) const
01295     { return SphericalFunctors::intersect_3<SK> (s,l,res); }
01296     
01297     template < class OutputIterator >
01298     OutputIterator
01299     operator()(const Line_arc_3 & l,const Sphere_3 & s, 
01300                OutputIterator res) const
01301     { return SphericalFunctors::intersect_3<SK> (s,l,res); }
01302 
01303     template < class OutputIterator >
01304     OutputIterator
01305     operator()(const Plane_3 & s, const Line_arc_3 & l, 
01306                OutputIterator res) const
01307     { return SphericalFunctors::intersect_3<SK> (s,l,res); }
01308 
01309     template < class OutputIterator >
01310     OutputIterator
01311     operator()(const Line_arc_3 & l,const Plane_3 & s, 
01312                OutputIterator res) const
01313     { return SphericalFunctors::intersect_3<SK> (s,l,res); }
01314 
01315     template < class OutputIterator >
01316     OutputIterator
01317     operator()(const Circular_arc_3 & c1, const Circular_arc_3 & c2, 
01318                OutputIterator res) const
01319     { return SphericalFunctors::intersect_3<SK> (c1,c2,res); }
01320 
01321     template < class OutputIterator >
01322     OutputIterator
01323     operator()(const Line_3 & l, const Circular_arc_3 & ca, 
01324                OutputIterator res) const
01325     { return SphericalFunctors::intersect_3<SK> (l,ca,res); }
01326 
01327     template < class OutputIterator >
01328     OutputIterator
01329     operator()(const Circular_arc_3 & ca, const Line_3 & l, 
01330                OutputIterator res) const
01331     { return SphericalFunctors::intersect_3<SK> (l,ca,res); }
01332 
01333     template < class OutputIterator >
01334     OutputIterator
01335     operator()(const Circle_3 & c, const Circular_arc_3 & ca, 
01336                OutputIterator res) const
01337     { return SphericalFunctors::intersect_3<SK> (c,ca,res); }
01338 
01339     template < class OutputIterator >
01340     OutputIterator
01341     operator()(const Circular_arc_3 & ca, const Circle_3 & c,
01342                OutputIterator res) const
01343     { return SphericalFunctors::intersect_3<SK> (c,ca,res); }
01344 
01345     template < class OutputIterator >
01346     OutputIterator
01347     operator()(const Sphere_3 & s, const Circular_arc_3 & ca, 
01348                OutputIterator res) const
01349     { return SphericalFunctors::intersect_3<SK> (s,ca,res); }
01350     
01351     template < class OutputIterator >
01352     OutputIterator
01353     operator()(const Circular_arc_3 & ca,const Sphere_3 & s, 
01354                OutputIterator res) const
01355     { return SphericalFunctors::intersect_3<SK> (s,ca,res); }
01356 
01357     template < class OutputIterator >
01358     OutputIterator
01359     operator()(const Plane_3 & p, const Circular_arc_3 & ca, 
01360                OutputIterator res) const
01361     { return SphericalFunctors::intersect_3<SK> (p,ca,res); }
01362 
01363     template < class OutputIterator >
01364     OutputIterator
01365     operator()(const Circular_arc_3 & ca, const Plane_3 & p, 
01366                OutputIterator res) const
01367     { return SphericalFunctors::intersect_3<SK> (p,ca,res); }
01368 
01369     template < class OutputIterator >
01370     OutputIterator
01371     operator()(const Circular_arc_3 & ca, const Line_arc_3 & la, 
01372                OutputIterator res) const
01373     { return SphericalFunctors::intersect_3<SK> (ca,la,res); }
01374 
01375     template < class OutputIterator >
01376     OutputIterator
01377     operator()(const Line_arc_3 & la, const Circular_arc_3 & ca,
01378                OutputIterator res) const
01379     { return SphericalFunctors::intersect_3<SK> (ca,la,res); }
01380     
01381   };
01382 
01383 // If 2 line_arc have the same supporting line
01384 // if they intersect only at a point
01385 // even in this case we consider that the 2 line_arc overlap
01386   template < class SK >
01387   class Do_overlap_3
01388   {
01389     typedef typename SK::Line_arc_3     Line_arc_3;
01390     typedef typename SK::Circular_arc_3 Circular_arc_3;
01391 
01392   public:
01393     typedef bool         result_type;
01394 
01395     result_type
01396     operator() (const Line_arc_3 &l1, const Line_arc_3 &l2,
01397                 const bool known_equal_supporting_line = false) const
01398     { return SphericalFunctors::do_overlap<SK>(l1, l2, known_equal_supporting_line); }
01399 
01400     result_type
01401     operator() (const Circular_arc_3 &c1, const Circular_arc_3 &c2,
01402                 const bool known_equal_supporting_circle = false) const
01403     { return SphericalFunctors::do_overlap<SK>(c1, c2, known_equal_supporting_circle); }
01404 
01405   };
01406 
01407   template < class SK >
01408   class Split_3
01409   {
01410     typedef typename SK::Circular_arc_point_3    Circular_arc_point_3;
01411     typedef typename SK::Line_arc_3              Line_arc_3;
01412     typedef typename SK::Circular_arc_3          Circular_arc_3;
01413 
01414   public:
01415 
01416     typedef void         result_type;
01417 
01418     result_type
01419     operator()(const Line_arc_3 &l, 
01420                const Circular_arc_point_3 &p,
01421                Line_arc_3 &ca1, Line_arc_3 &ca2) const
01422     { return SphericalFunctors::split<SK>(l, p, ca1, ca2); }
01423 
01424     result_type
01425     operator()(const Circular_arc_3 &c, 
01426                const Circular_arc_point_3 &p,
01427                Circular_arc_3 &ca1, Circular_arc_3 &ca2) const
01428     { return SphericalFunctors::split<SK>(c, p, ca1, ca2); }
01429 
01430   };
01431 
01432   template <class SK>
01433   class Construct_bbox_3
01434 #ifndef CGAL_CFG_MATCHING_BUG_6
01435     : public SK::Linear_kernel::Construct_bbox_3
01436 #endif
01437   {
01438     typedef typename SK::Circular_arc_point_3      Circular_arc_point_3;
01439     typedef typename SK::Circular_arc_3            Circular_arc_3;
01440     typedef typename SK::Point_3                   Point_3;
01441     typedef typename SK::Segment_3                 Segment_3;
01442     typedef typename SK::Circle_3                  Circle_3;
01443     typedef typename SK::Triangle_3                Triangle_3;
01444     typedef typename SK::Tetrahedron_3             Tetrahedron_3;
01445     typedef typename SK::Sphere_3                  Sphere_3;
01446     typedef typename SK::Iso_cuboid_3              Iso_cuboid_3;
01447     typedef typename SK::Line_arc_3                Line_arc_3;
01448 
01449   public:
01450 
01451     typedef typename SK::Linear_kernel::Construct_bbox_3::result_type result_type;
01452 
01453 #ifndef CGAL_CFG_MATCHING_BUG_6
01454     using SK::Linear_kernel::Construct_bbox_3::operator();
01455 #else 
01456     typedef typename SK::Linear_kernel LK;
01457     typedef typename LK::Construct_bbox_3 LK_Construct_bbox_3;
01458 
01459     result_type
01460     operator()(const Point_3& p) const
01461     {
01462       return LK_Construct_bbox_3()(p);
01463     }
01464 
01465     result_type
01466     operator()(const Segment_3& p) const
01467     {
01468       return LK_Construct_bbox_3()(p);
01469     }
01470 
01471     result_type
01472     operator()(const Triangle_3& p) const
01473     {
01474       return LK_Construct_bbox_3()(p);
01475     }
01476 
01477 
01478     result_type
01479     operator()(const Iso_cuboid_3& p) const
01480     {
01481       return LK_Construct_bbox_3()(p);
01482     }
01483 
01484     result_type
01485     operator()(const Tetrahedron_3& p) const
01486     {
01487       return LK_Construct_bbox_3()(p);
01488     }
01489 
01490     result_type
01491     operator()(const Sphere_3& p) const
01492     {
01493       return LK_Construct_bbox_3()(p);
01494     }
01495 
01496     result_type
01497     operator()(const Circle_3& p) const
01498     {
01499       return LK_Construct_bbox_3()(p);
01500     }
01501 
01502 
01503 #endif
01504 
01505     result_type operator() (const Circular_arc_point_3 & c) const
01506     { return c.rep().bbox(); }
01507 
01508     result_type operator() (const Line_arc_3 & l) const
01509     { return l.rep().bbox(); }
01510 
01511     result_type operator() (const Circular_arc_3 & c) const
01512     { return c.rep().bbox(); }
01513 
01514   };
01515 
01516   template <class SK>
01517   class Compute_approximate_squared_length_3
01518   #ifndef CGAL_CFG_MATCHING_BUG_6
01519     : public SK::Linear_kernel::Compute_approximate_squared_length_3
01520 #endif
01521   {
01522     typedef typename SK::Circle_3                  Circle_3;
01523     typedef typename SK::Circular_arc_3            Circular_arc_3;
01524     typedef typename SK::FT                        FT;
01525 
01526   public:
01527 
01528     typedef double result_type;
01529 #ifndef CGAL_CFG_MATCHING_BUG_6
01530     using SK::Linear_kernel::Compute_approximate_squared_length_3::operator();
01531 #else
01532     result_type 
01533     operator() (const Circle_3 & c) const
01534     { return CGAL_PI * CGAL_PI * 4.0 * to_double(c.squared_radius()); }
01535 #endif  
01536   
01537     result_type operator() (const Circular_arc_3 & c) const
01538     { return c.rep().approximate_squared_length(); }
01539 
01540   };
01541 
01542   template <class SK>
01543   class Compute_approximate_angle_3
01544   {
01545     typedef typename SK::Circular_arc_3            Circular_arc_3;
01546 
01547   public:
01548 
01549     typedef double result_type;
01550 
01551     result_type operator() (const Circular_arc_3 & c) const
01552     { return c.rep().approximate_angle(); }
01553 
01554   };
01555 
01556   template <class SK>
01557   class Bounded_side_3
01558 #ifndef CGAL_CFG_MATCHING_BUG_6
01559     : public SK::Linear_kernel::Bounded_side_3
01560 #endif
01561   {
01562     typedef typename SK::Sphere_3              Sphere_3;
01563     typedef typename SK::Circle_3              Circle_3;
01564     typedef typename SK::Circular_arc_point_3  Circular_arc_point_3;
01565     typedef typename SK::Point_3               Point_3;
01566 
01567   public:
01568     typedef typename SK::Linear_kernel::Bounded_side_3::result_type    result_type;
01569 
01570 #ifndef CGAL_CFG_MATCHING_BUG_6
01571     using SK::Linear_kernel::Bounded_side_3::operator();
01572 #else
01573     typedef typename SK::Tetrahedron_3 Tetrahedron_3;
01574     typedef typename SK::Iso_cuboid_3 Iso_cuboid_3;
01575     typedef typename SK::Linear_kernel::Bounded_side_3 LK_Bounded_side_3;
01576 
01577     result_type
01578     operator()( const Sphere_3& s, const Point_3& p) const
01579     { return LK_Bounded_side_3()(s,p); }
01580 
01581     result_type
01582     operator()( const Tetrahedron_3& t, const Point_3& p) const
01583     { return LK_Bounded_side_3()(t,p); }
01584 
01585     result_type
01586     operator()( const Iso_cuboid_3& c, const Point_3& p) const
01587     { return LK_Bounded_side_3()(c,p); }
01588 
01589     result_type
01590     operator()(const Circle_3& c, const Point_3& p) const
01591     { return LK_Bounded_side_3()(c,p); }
01592 #endif
01593 
01594     result_type
01595     operator()( const Sphere_3& s, const Circular_arc_point_3& p) const
01596     { return SphericalFunctors::bounded_side<SK>(s,p); }
01597 
01598     result_type
01599     operator()( const Circle_3& c, const Circular_arc_point_3& p) const
01600     { return SphericalFunctors::bounded_side<SK>(c,p); }
01601 
01602     // We can maybe optimize it doing the operator() for point_3 too
01603 
01604   };
01605 
01606   template <class SK>
01607   class Has_on_bounded_side_3
01608 #ifndef CGAL_CFG_MATCHING_BUG_6
01609     : public SK::Linear_kernel::Has_on_bounded_side_3
01610 #endif
01611   {
01612     typedef typename SK::Sphere_3              Sphere_3;
01613     typedef typename SK::Circle_3              Circle_3;
01614     typedef typename SK::Circular_arc_point_3  Circular_arc_point_3;
01615     typedef typename SK::Point_3               Point_3;
01616 
01617   public:
01618     typedef typename SK::Linear_kernel::Has_on_bounded_side_3::result_type    result_type;
01619 
01620 #ifndef CGAL_CFG_MATCHING_BUG_6
01621     using SK::Linear_kernel::Has_on_bounded_side_3::operator();
01622 #else
01623     typedef typename SK::Tetrahedron_3 Tetrahedron_3;
01624     typedef typename SK::Iso_cuboid_3 Iso_cuboid_3;
01625     typedef typename SK::Linear_kernel::Has_on_bounded_side_3 LK_Has_on_bounded_side_3;
01626 
01627     result_type
01628     operator()( const Sphere_3& s, const Point_3& p) const
01629     { return LK_Has_on_bounded_side_3()(s,p); }
01630 
01631     result_type
01632     operator()( const Tetrahedron_3& t, const Point_3& p) const
01633     { return LK_Has_on_bounded_side_3()(t,p); }
01634 
01635     result_type
01636     operator()( const Iso_cuboid_3& c, const Point_3& p) const
01637     { return LK_Has_on_bounded_side_3()(c,p); }
01638 
01639     result_type
01640     operator()(const Circle_3& c, const Point_3& p) const
01641     { return LK_Has_on_bounded_side_3()(c,p); }
01642 #endif
01643 
01644     result_type
01645     operator()( const Sphere_3& s, const Circular_arc_point_3& p) const
01646     { return SK().bounded_side_3_object()(s,p) == ON_BOUNDED_SIDE; }
01647 
01648     result_type
01649     operator()( const Circle_3& c, const Circular_arc_point_3& p) const
01650     { return SK().bounded_side_3_object()(c,p) == ON_BOUNDED_SIDE; }
01651 
01652     // We can maybe optimize it doing the operator() for point_3 too
01653 
01654   };
01655 
01656   template <class SK>
01657   class Has_on_unbounded_side_3
01658 #ifndef CGAL_CFG_MATCHING_BUG_6
01659     : public SK::Linear_kernel::Has_on_unbounded_side_3
01660 #endif
01661   {
01662     typedef typename SK::Sphere_3              Sphere_3;
01663     typedef typename SK::Circle_3              Circle_3;
01664     typedef typename SK::Circular_arc_point_3  Circular_arc_point_3;
01665     typedef typename SK::Point_3               Point_3;
01666 
01667   public:
01668     typedef typename SK::Linear_kernel::Has_on_unbounded_side_3::result_type    result_type;
01669 
01670 #ifndef CGAL_CFG_MATCHING_BUG_6
01671     using SK::Linear_kernel::Has_on_unbounded_side_3::operator();
01672 #else
01673     typedef typename SK::Tetrahedron_3 Tetrahedron_3;
01674     typedef typename SK::Iso_cuboid_3 Iso_cuboid_3;
01675     typedef typename SK::Linear_kernel::Has_on_unbounded_side_3 LK_Has_on_unbounded_side_3;
01676 
01677     result_type
01678     operator()( const Sphere_3& s, const Point_3& p) const
01679     { return LK_Has_on_unbounded_side_3()(s,p); }
01680 
01681     result_type
01682     operator()( const Tetrahedron_3& t, const Point_3& p) const
01683     { return LK_Has_on_unbounded_side_3()(t,p); }
01684 
01685     result_type
01686     operator()( const Iso_cuboid_3& c, const Point_3& p) const
01687     { return LK_Has_on_unbounded_side_3()(c,p); }
01688 
01689     result_type
01690     operator()(const Circle_3& c, const Point_3& p) const
01691     { return LK_Has_on_unbounded_side_3()(c,p); }
01692 #endif
01693 
01694     result_type
01695     operator()( const Sphere_3& s, const Circular_arc_point_3& p) const
01696     { return SK().bounded_side_3_object()(s,p) == ON_UNBOUNDED_SIDE; }
01697 
01698     result_type
01699     operator()( const Circle_3& c, const Circular_arc_point_3& p) const
01700     { return SK().bounded_side_3_object()(c,p) == ON_UNBOUNDED_SIDE; }
01701 
01702     // We can maybe optimize it doing the operator() for point_3 too
01703 
01704   };
01705   
01706   template <class SK>
01707   class Is_theta_monotone_3{
01708     typename SK::Sphere_3 sphere_;
01709   public:
01710     typedef bool result_type;
01711   
01712     Is_theta_monotone_3(const typename SK::Sphere_3& sphere):sphere_(sphere){}
01713   
01714     result_type 
01715     operator()(const typename SK::Circular_arc_3& arc) const {
01716       return SphericalFunctors::is_theta_monotone_3<SK>(arc,sphere_);
01717     }
01718   };
01719 
01720   template < class SK > 
01721   class Compare_theta_3{
01722     typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;
01723     typedef typename SK::Vector_3 Vector_3;
01724     
01725     typename SK::Sphere_3 sphere_;
01726     
01727   public:
01728     typedef  CGAL::Comparison_result result_type;
01729   
01730     Compare_theta_3(const typename SK::Sphere_3& sphere):sphere_(sphere){}
01731   
01732     result_type
01733     operator() (const Circular_arc_point_3 &p0,
01734                 const Circular_arc_point_3 &p1) const
01735     { return SphericalFunctors::compare_theta_of_pts<SK>(p0, p1,sphere_); }
01736     
01737     result_type
01738     operator() (const Circular_arc_point_3 &p,
01739                 const Vector_3 &v) const
01740     { return SphericalFunctors::compare_theta_pt_vector<SK>(p,v,sphere_); }
01741 
01742     result_type
01743     operator() (const Vector_3 &m1,
01744                 const Vector_3 &m2) const
01745     { return SphericalFunctors::compare_theta_vectors<SK>(m1,m2); }
01746     
01747     result_type
01748     operator() (const Vector_3 &v,const Circular_arc_point_3 &p0) const
01749     { return CGAL::opposite( SphericalFunctors::compare_theta_pt_vector<SK>(p0, v,sphere_) ); }
01750   };
01751   
01752   template < class SK > 
01753   class Compare_theta_z_3{
01754     typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;
01755     typename SK::Sphere_3 sphere_;
01756     
01757   public:
01758     typedef  CGAL::Comparison_result result_type;
01759   
01760     Compare_theta_z_3(const typename SK::Sphere_3& sphere):sphere_(sphere){}
01761   
01762     result_type
01763     operator() (const Circular_arc_point_3 &p0,
01764                 const Circular_arc_point_3 &p1,bool decreasing_z=false) const
01765     { return SphericalFunctors::compare_theta_z<SK>(p0, p1,sphere_,decreasing_z); }
01766     
01767   };
01768 
01769   template < class SK > 
01770   class Make_theta_monotone_3{
01771     typename SK::Sphere_3 sphere_;
01772     
01773   public:
01774     Make_theta_monotone_3(const typename SK::Sphere_3& sphere):sphere_(sphere){}
01775   
01776     template <class OutputIterator>
01777     OutputIterator
01778     operator() (const typename SK::Circle_3 &circle,OutputIterator out_it) const
01779     { return SphericalFunctors::make_circle_theta_monotone<SK>(circle,sphere_,out_it); }
01780     
01781     template <class OutputIterator>
01782     OutputIterator
01783     operator() (const typename SK::Circular_arc_3 &arc,OutputIterator out_it) const
01784     { return SphericalFunctors::make_circular_arc_theta_monotone<SK>(arc,sphere_,out_it); }    
01785     
01786   };
01787   
01788   template <class SK>
01789   class Compare_z_to_right_3{
01790     typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;
01791     typedef typename SK::Circular_arc_3 Circular_arc_3;
01792     typename SK::Sphere_3 sphere_;
01793     
01794   public:
01795     typedef  CGAL::Comparison_result result_type;
01796     Compare_z_to_right_3(const typename SK::Sphere_3& sphere):sphere_(sphere){}
01797       
01798     result_type
01799     operator()(const Circular_arc_3& arc1,const Circular_arc_3& arc2,const Circular_arc_point_3& pt,bool do_to_the_left=false){
01800       CGAL_kernel_precondition(SK().has_on_3_object()(sphere_,arc1));
01801       CGAL_kernel_precondition(SK().has_on_3_object()(sphere_,arc2));
01802       CGAL_kernel_precondition(SphericalFunctors::is_theta_monotone_3<SK>(arc1,sphere_));
01803       CGAL_kernel_precondition(SphericalFunctors::is_theta_monotone_3<SK>(arc2,sphere_));
01804       CGAL_kernel_precondition(SK().has_on_3_object()(arc1,pt));
01805       CGAL_kernel_precondition(SK().has_on_3_object()(arc2,pt));
01806       CGAL_kernel_precondition(classify_circle_3<SK>(arc1.supporting_circle(),sphere_)!=NORMAL || pt.z()!=extremal_points_z_coordinate<SK>(arc1.supporting_circle(),sphere_));
01807       CGAL_kernel_precondition(classify_circle_3<SK>(arc2.supporting_circle(),sphere_)!=NORMAL || pt.z()!=extremal_points_z_coordinate<SK>(arc2.supporting_circle(),sphere_));
01808       
01809       if (pt.y() == sphere_.center().y() && pt.x() > sphere_.center().x()) //case theta = 0
01810         return 
01811           Compare_to_right_of_arcs<SK,Trait_for_cmp_tgt_theta_0<SK> >( Trait_for_cmp_tgt_theta_0<SK>(pt.coordinates(),sphere_),sphere_ )
01812             (arc1,arc2,do_to_the_left);
01813       else //general case
01814         return
01815           Compare_to_right_of_arcs<SK,Trait_for_cmp_tgt<SK> >( Trait_for_cmp_tgt<SK>(pt.coordinates(),sphere_),sphere_ )
01816             (arc1,arc2,do_to_the_left);
01817     }
01818   };
01819   
01820   template <class SK>
01821   class Compare_z_at_theta_3{
01822      typename SK::Sphere_3 sphere_;   
01823     
01824   public:
01825     typedef  CGAL::Comparison_result result_type;
01826     Compare_z_at_theta_3(const typename SK::Sphere_3& sphere):sphere_(sphere){}
01827      
01828     result_type
01829     operator()( const typename SK::Circular_arc_3& arc1,
01830                 const typename SK::Circular_arc_3& arc2,
01831                 const typename SK::Vector_3& m) const
01832     {
01833       return SphericalFunctors::compare_z_at_theta_arcs<SK>(arc1,arc2,m,sphere_);
01834     }
01835 
01836     result_type
01837     operator()(const typename SK::Circular_arc_point_3& point,
01838                const typename SK::Circular_arc_3& arc) const
01839     {
01840       return SphericalFunctors::compare_z_at_theta_pt_arc<SK>(point,arc,sphere_);
01841     }
01842   };
01843   
01844 
01845 } // namespace SphericalFunctors
01846 
01847 template < typename K >
01848 struct Qualified_result_of<SphericalFunctors::Construct_line_3<K>,
01849                            typename K::Line_arc_3>
01850 {
01851   typedef typename K::Line_3 const &   type;
01852 };
01853 
01854 template < typename K >
01855 struct Qualified_result_of<SphericalFunctors::Construct_circle_3<K>,
01856                            typename K::Circular_arc_3>
01857 {
01858   typedef typename K::Circle_3 const &   type;
01859 };
01860 
01861 } // namespace CGAL
01862 
01863 #endif // CGAL_SPHERICAL_KERNEL_FUNCTION_OBJECTS_POLYNOMIAL_SPHERE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines