BWAPI
|
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/Simple_spherical_kernel_3.h $ 00015 // $Id: Simple_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_SIMPLE_SPHERICAL_KERNEL_3_H 00025 #define CGAL_SIMPLE_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_no_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 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 00069 00070 #include <CGAL/Circular_kernel_3/interface_macros.h> 00071 }; 00072 00073 } // namespace CGALi 00074 00075 template < class LinearKernel, class AlgebraicKernel > 00076 struct Simple_spherical_kernel_3 00077 : // there should be a derivation from 00078 // LinearKernel::Kernel_base<Self> to have types equalities for 00079 // the Linearkernel types 00080 public Spherical_kernel_type_equality_wrapper<CGALi::Spherical_kernel_base_no_ref_count<Simple_spherical_kernel_3<LinearKernel,AlgebraicKernel>, 00081 typename LinearKernel:: template Base<Simple_spherical_kernel_3<LinearKernel,AlgebraicKernel> >::Type >, 00082 Simple_spherical_kernel_3<LinearKernel,AlgebraicKernel> > 00083 { 00084 typedef Simple_spherical_kernel_3<LinearKernel,AlgebraicKernel> Self; 00085 00086 typedef typename LinearKernel::template Base<Simple_spherical_kernel_3<LinearKernel,AlgebraicKernel> >::Type Linear_kernel; 00087 typedef AlgebraicKernel Algebraic_kernel; 00088 00089 // //Please remove this if you consider it to be sloppy 00090 struct Circular_tag{}; 00091 typedef Circular_tag Definition_tag; 00092 // //////////////////////////////////////////////////// 00093 00094 00095 typedef typename LinearKernel::RT RT; 00096 typedef typename LinearKernel::FT FT; 00097 //~ typedef Algebraic_kernel AK; 00098 typedef typename Algebraic_kernel::Root_of_2 Root_of_2; 00099 typedef typename Algebraic_kernel::Root_for_spheres_2_3 Root_for_spheres_2_3; 00100 typedef typename Algebraic_kernel::Polynomial_for_spheres_2_3 Polynomial_for_spheres_2_3; 00101 typedef typename Algebraic_kernel::Polynomial_1_3 Polynomial_1_3; 00102 typedef typename Algebraic_kernel::Polynomials_for_line_3 Polynomials_for_line_3; 00103 typedef std::pair< Polynomial_for_spheres_2_3, Polynomial_1_3 > 00104 Polynomials_for_circle_3; 00105 00106 // public classes 00107 typedef CGAL::Object Object_3; 00108 00109 }; 00110 00111 } // namespace CGAL 00112 00113 #endif // CGAL_SIMPLE_SPHERICAL_KERNEL_3_H