BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Spherical_kernel_3.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/Spherical_kernel_3.h $
00015 // $Id: Spherical_kernel_3.h 50731 2009-07-21 09:08:07Z sloriot $
00016 //
00017 // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado, 
00018 //             Sebastien Loriot, Julien Hazebrouck, Damien Leroy
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_3_H
00025 #define CGAL_SPHERICAL_KERNEL_3_H
00026 
00027 #include <CGAL/Circular_kernel_3/Circular_arc_point_3.h>
00028 #include <CGAL/Circular_arc_point_3.h>
00029 
00030 #include <CGAL/Circular_kernel_3/Line_arc_3.h>
00031 #include <CGAL/Line_arc_3.h>
00032 
00033 #include <CGAL/Circular_kernel_3/Circular_arc_3.h>
00034 #include <CGAL/Circular_arc_3.h>
00035 
00036 #include <CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h>
00037 
00038 #include <CGAL/Circular_kernel_3/get_equation_object_on_curved_kernel_3.h>
00039 
00040 #include <CGAL/Spherical_kernel_type_equality_wrapper.h>
00041 
00042 #include <CGAL/global_functions_spherical_kernel_3.h>
00043 
00044 namespace CGAL {
00045   namespace CGALi {
00046     
00047     template < class SphericalKernel, class LinearKernelBase >
00048       struct Spherical_kernel_base_ref_count: public LinearKernelBase
00049                                  // takes classes in internal sub-namespace
00050       {
00051         typedef CGALi::Circular_arc_point_3<SphericalKernel>                        Circular_arc_point_3;
00052         typedef CGALi::Line_arc_3<SphericalKernel>                                  Line_arc_3;
00053         typedef CGALi::Circular_arc_3<SphericalKernel>                              Circular_arc_3;
00054        
00055         // The mecanism that allows to specify reference-counting or not.
00056         template < typename T >
00057         struct Handle { typedef Handle_for<T>    type; };
00058 
00059         #define CGAL_Spherical_Kernel_pred(Y,Z) typedef SphericalFunctors::Y<SphericalKernel> Y; \
00060             Y Z() const { return Y(); }
00061         #define CGAL_Spherical_Kernel_cons(Y,Z) CGAL_Spherical_Kernel_pred(Y,Z)
00062         #define CGAL_Spherical_Kernel_overload_cons(Y,Z) CGAL_Spherical_Kernel_pred(Y,Z)
00063         #define CGAL_Spherical_Kernel_overload_pred(Y,Z) CGAL_Spherical_Kernel_pred(Y,Z)
00064       
00065         #define CGAL_Spherical_Kernel_pred_on_sphere(Y,Z) typedef SphericalFunctors::Y<SphericalKernel> Y; \
00066             Y Z(const CGAL::Sphere_3<SphericalKernel>& S) const { return Y(S); }
00067         
00068         #include <CGAL/Circular_kernel_3/interface_macros.h>
00069       };
00070     
00071   } // namespace CGALi
00072 
00073   template < class LinearKernel, class AlgebraicKernel >
00074     struct Spherical_kernel_3
00075     :  // there should be a derivation from
00076   // LinearKernel::Kernel_base<Self> to have types equalities for
00077   // the Linearkernel types
00078   public Spherical_kernel_type_equality_wrapper<CGALi::Spherical_kernel_base_ref_count<Spherical_kernel_3<LinearKernel,AlgebraicKernel>,
00079     typename LinearKernel:: template Base<Spherical_kernel_3<LinearKernel,AlgebraicKernel> >::Type >,
00080     Spherical_kernel_3<LinearKernel,AlgebraicKernel> >
00081     {
00082       typedef Spherical_kernel_3<LinearKernel,AlgebraicKernel>      Self;
00083 
00084       typedef typename LinearKernel::template Base<Spherical_kernel_3<LinearKernel,AlgebraicKernel> >::Type  Linear_kernel;
00085       typedef AlgebraicKernel                                 Algebraic_kernel;
00086 
00087       //  //Please remove this if you consider it to be sloppy
00088       struct Circular_tag{};
00089       typedef Circular_tag Definition_tag;
00090       //  ////////////////////////////////////////////////////
00091 
00092 
00093       typedef typename LinearKernel::RT                       RT;
00094       typedef typename LinearKernel::FT                       FT;
00095       //~ typedef Algebraic_kernel AK;
00096       typedef typename Algebraic_kernel::Root_of_2                  Root_of_2;
00097       typedef typename Algebraic_kernel::Root_for_spheres_2_3       Root_for_spheres_2_3;
00098       typedef typename Algebraic_kernel::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3;
00099       typedef typename Algebraic_kernel::Polynomial_1_3             Polynomial_1_3;
00100       typedef typename Algebraic_kernel::Polynomials_for_line_3     Polynomials_for_line_3;
00101       typedef std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 >
00102                                                  Polynomials_for_circle_3;
00103 
00104       // public classes
00105       typedef CGAL::Object Object_3;
00106   
00107     };
00108 
00109 } // namespace CGAL
00110 
00111 #endif // CGAL_SPHERICAL_KERNEL_3_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines