// Copyright (c) 2005 Utrecht University (The Netherlands), // ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg // (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; version 2.1 of the License. // See the file LICENSE.LGPL distributed with CGAL. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $Source$ // $Revision$ $Date$ // $Name$ // // Author(s) : Andreas Fabri, Sylvain Pion #ifndef CGAL_LAZY_KERNEL_H #define CGAL_LAZY_KERNEL_H #include #include #include #include #include #include #include #include CGAL_BEGIN_NAMESPACE // EK = exact kernel that will be made lazy // Kernel = lazy kernel template < typename EK_, typename AK_, typename E2A_, typename Kernel > class Lazy_kernel_base { public: typedef AK_ AK; typedef EK_ EK; typedef E2A_ E2A; template < typename Kernel2 > struct Base { typedef Lazy_kernel_base Type; }; // What to do with the tag ? // Probably this should not exist, should it ? // struct filter_tag{}; // typedef filter_tag Kernel_tag; typedef typename EK::Kernel_tag Kernel_tag; // typedef typename CK::Rep_tag Rep_tag; // Types typedef CGAL::Lazy_exact_nt FT; typedef FT RT; typedef CGAL::Object Object_2; typedef CGAL::Object Object_3; typedef Lazy Point_2; typedef Lazy Vector_2; typedef Lazy Direction_2; typedef Lazy Segment_2; typedef Lazy Line_2; typedef Lazy Ray_2; typedef Lazy Triangle_2; typedef Lazy Circle_2; typedef Lazy Iso_rectangle_2; typedef Lazy Aff_transformation_2; typedef Cartesian_coordinate_iterator_2 Cartesian_const_iterator_2; typedef Lazy Data_accessor_2; typedef Lazy Conic_2; typedef Lazy Point_3; typedef Lazy Vector_3; typedef Lazy Direction_3; typedef Lazy Segment_3; typedef Lazy Line_3; typedef Lazy Ray_3; typedef Lazy Plane_3; typedef Lazy Triangle_3; typedef Lazy Tetrahedron_3; typedef Lazy Sphere_3; typedef Lazy Iso_cuboid_3; typedef Lazy Aff_transformation_3; typedef Lazy Cartesian_const_iterator_3; // We don't touch the predicates. #define CGAL_Kernel_pred(P, Pf) \ typedef Filtered_predicate P; \ P Pf() const { return P(); } // We change the constructions. #ifdef CGAL_INTERSECT_WITH_ITERATORS_2 #define CGAL_Kernel_cons(C, Cf) \ typedef typename boost::mpl::if_, \ Lazy_intersect_with_iterators, \ typename boost::mpl::if_, \ Lazy_construction_bbox, \ typename boost::mpl::if_,\ Lazy_construction_nt,\ typename boost::mpl::if_,\ Lazy_construction_object,\ Lazy_construction >::type >::type > ::type > ::type C; \ C Cf() const { return C(); } CGAL_Kernel_cons(Intersect_with_iterators_2, intersect_with_iterators_2_object) #else #define CGAL_Kernel_cons(C, Cf) \ typedef typename boost::mpl::if_, \ Lazy_cartesian_const_iterator_2, \ typename boost::mpl::if_, \ Lazy_construction_bbox, \ typename boost::mpl::if_,\ Lazy_construction_nt,\ typename boost::mpl::if_,\ Lazy_construction_object,\ Lazy_construction >::type >::type >::type > ::type C; \ C Cf() const { return C(); } #endif //CGAL_INTERSECT_WITH_ITERATORS_2 #include }; template struct Lazy_kernel_adaptor : public Lazy_kernel_base< EK, AK, E2A, Lazy_kernel_adaptor > {}; template struct Lazy_kernel_without_type_equality : public Lazy_kernel_base< EK, AK, E2A, Lazy_kernel_without_type_equality > {}; template , class E2A = Cartesian_converter > > struct Lazy_kernel : public Type_equality_wrapper< Lazy_kernel_base< EK, AK, E2A, Lazy_kernel >, Lazy_kernel > {}; CGAL_END_NAMESPACE #endif // CGAL_LAZY_KERNEL_H