CGAL/EPIC_kernel_with_atom.h
Go to the documentation of this file.
00001 // Copyright (c) 2009-2010  INRIA Sophia-Antipolis (France).
00002 // All rights reserved.
00003 //
00004 //This file is part of ESBTL.
00005 //
00006 //ESBTL is free software: you can redistribute it and/or modify
00007 //it under the terms of the GNU General Public License as published by
00008 //the Free Software Foundation, either version 3 of the License, or
00009 //(at your option) any later version.
00010 //
00011 //ESBTL is distributed in the hope that it will be useful,
00012 //but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //GNU General Public License for more details.
00015 //
00016 //You should have received a copy of the GNU General Public License
00017 //along with ESBTL.  If not, see <http://www.gnu.org/licenses/>.
00018 //
00019 //
00020 //Additional permission under GNU GPL version 3 section 7
00021 //
00022 //If you modify this Library, or any covered work, by linking or
00023 //combining it with CGAL (or a modified version of that library), the
00024 //licensors of this Library grant you additional permission to convey
00025 //the resulting work. Corresponding Source for a non-source form of
00026 //such a combination shall include the source code for the parts of CGAL
00027 //used as well as that of the covered work. 
00028 //
00029 //
00030 //
00031 // Author(s)     :  Sébastien Loriot
00032 
00033 
00034 
00035 #ifndef ESBTL_CGAL_EPIC_KERNEL_WITH_ATOM
00036 #define ESBTL_CGAL_EPIC_KERNEL_WITH_ATOM
00037 
00038 //include files for convenience
00039 #include <ESBTL/constants.h>
00040 #include <ESBTL/xyz_utils.h>
00041 #include <ESBTL/line_selectors.h>
00042 #include <ESBTL/builder.h>
00043 #include <ESBTL/line_reader.h>
00044 #include <ESBTL/PDB.h>
00045 #include <ESBTL/occupancy_handlers.h>
00046 //include files needed
00047 #include <ESBTL/molecular_system.h>
00048 #include <ESBTL/coarse_grain.h>
00049 #include <CGAL/Cartesian.h>
00050 #include <CGAL/Filtered_kernel.h>
00051 
00052 
00053 namespace ESBTL{
00054 
00055 namespace CGAL{
00056   
00057 //~ template <class K>
00058 //~ class Construct_atom_3 : public ::CGAL::CartesianKernelFunctors::Construct_point_3<K>{
00059 //~ public:
00060   //~ #ifndef CGAL_CFG_MATCHING_BUG_6 
00061     //~ using ::CGAL::CartesianKernelFunctors::Construct_point_3<K>::operator();
00062   //~ #else 
00063 
00064   //~ #endif
00065 
00066   //~ template <class Items,class Point_base_3>
00067   //~ typename 
00068   //~ K::Point_3 operator()(const Molecular_system<Items, Point_base_3>& atom) const {
00069     //~ return typename K::Point_3(0,0,0);
00070   //~ }
00071 
00072 //~ };
00073 
00074 
00075 //Kernel for atoms
00076 // K_ is the new kernel, and K_Base is the old kernel
00077 template < typename K_, typename K_Base >
00078 class Cartesian_kernel_base
00079   : public K_Base::template Base<K_>::Type
00080 {
00081 public:
00082   typedef K_                                    Kernel;
00083   typedef typename Molecular_system<Default_system_items,typename K_Base::Point_3 >::Atom  Point_3;
00084  
00085   //~ typedef Construct_atom_3<K_>                          Construct_point_3;
00086   //~ Construct_point_3 construct_point_3_object() const {return Construct_point_3();}
00087 
00088   template < typename Kernel2 >
00089   struct Base { typedef Cartesian_kernel_base<Kernel2, K_Base>  Type; };
00090 };
00091 
00092 
00093 template < typename FT_ >
00094 struct Kernel_with_atom
00095   : public ::CGAL::Type_equality_wrapper<
00096                 Cartesian_kernel_base<Kernel_with_atom<FT_>, ::CGAL::Simple_cartesian<FT_> >,
00097                 Kernel_with_atom<FT_> >
00098 {};
00099   
00100   
00101   
00102 //Kernel for coarse grain
00103 // K_ is the new kernel, and K_Base is the old kernel
00104 template < typename K_, typename K_Base >
00105 class Cartesian_kernel_base_cg
00106   : public K_Base::template Base<K_>::Type
00107 {
00108   typedef typename Molecular_system<System_items_with_coarse_grain,typename K_Base::Point_3 >::Atom Atom;
00109 public:
00110   typedef K_                                          Kernel;
00111   typedef Coarse_atom<Atom,typename K_Base::Point_3>  Point_3;
00112 
00113   template < typename Kernel2 >
00114   struct Base { typedef Cartesian_kernel_base_cg<Kernel2, K_Base>  Type; };
00115 };
00116 
00117 
00118 template < typename FT_ >
00119 struct Kernel_with_coarse_atom
00120   : public ::CGAL::Type_equality_wrapper<
00121                 Cartesian_kernel_base_cg<Kernel_with_coarse_atom<FT_>, ::CGAL::Simple_cartesian<FT_> >,
00122                 Kernel_with_coarse_atom<FT_> >
00123 {};
00124   
00126 typedef Molecular_system<Default_system_items, ::CGAL::Simple_cartesian<double>::Point_3 >             Default_system;
00130 typedef ::CGAL::Filtered_kernel< Kernel_with_atom<double> >                                            EPIC_kernel_with_atom;
00131 
00133 typedef Molecular_system<System_items_with_coarse_grain, ::CGAL::Simple_cartesian<double>::Point_3 >   System_with_coarse_grain;
00137 typedef ::CGAL::Filtered_kernel< Kernel_with_coarse_atom<double> >                                     EPIC_kernel_with_coarse_atom;
00138 
00139 }  } //namespace ESBTL::CGAL
00140 
00141 
00142 #endif //ESBTL_CGAL_EPIC_KERNEL_WITH_ATOM
00143