// Copyright (c) 2014 // INRIA Saclay-Ile de France (France) // // 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; either version 3 of the License, // or (at your option) any later version. // // 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. // // $URL$ // $Id$ // // Author(s) : Marc Glisse #ifndef CGAL_KERNEL_D_CARTESIAN_FILTER_K_H #define CGAL_KERNEL_D_CARTESIAN_FILTER_K_H #include #include #include #include #include namespace CGAL { template < typename Base_, typename AK_, typename EK_ > struct Cartesian_filter_K : public Base_, private Store_kernel, private Store_kernel2 { CGAL_CONSTEXPR Cartesian_filter_K(){} CGAL_CONSTEXPR Cartesian_filter_K(int d):Base_(d){} //FIXME: or do we want an instance of AK and EK belonging to this kernel, //instead of a reference to external ones? CGAL_CONSTEXPR Cartesian_filter_K(AK_ const&a,EK_ const&b):Base_(),Store_kernel(a),Store_kernel2(b){} CGAL_CONSTEXPR Cartesian_filter_K(int d,AK_ const&a,EK_ const&b):Base_(d),Store_kernel(a),Store_kernel2(b){} typedef Base_ Kernel_base; typedef AK_ AK; typedef EK_ EK; typedef typename Store_kernel::reference_type AK_rt; AK_rt approximate_kernel()const{return this->kernel();} typedef typename Store_kernel2::reference2_type EK_rt; EK_rt exact_kernel()const{return this->kernel2();} // MSVC is too dumb to perform the empty base optimization. typedef boost::mpl::and_< internal::Do_not_store_kernel, internal::Do_not_store_kernel, internal::Do_not_store_kernel > Do_not_store_kernel; //TODO: C2A/C2E could be able to convert *this into this->kernel() or this->kernel2(). typedef KernelD_converter C2A; typedef KernelD_converter C2E; // fix the types // TODO: only fix some types, based on some criterion? template struct Type : Get_type {}; template::type> struct Functor : Inherit_functor {}; template struct Functor { typedef typename Get_functor::type AP; typedef typename Get_functor::type EP; typedef Filtered_predicate2 type; }; // TODO: // template struct Functor : // Kernel_base::template Functor {}; // TODO: // detect when Less_cartesian_coordinate doesn't need filtering }; } //namespace CGAL #endif // CGAL_KERNEL_D_CARTESIAN_FILTER_K_H