00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 #ifndef MLN_CORE_SITE_SET_P_N_FACES_PITER_HH
00028 # define MLN_CORE_SITE_SET_P_N_FACES_PITER_HH
00029 
00033 
00034 # include <mln/core/site_set/p_complex.hh>
00035 # include <mln/core/internal/p_complex_piter_base.hh>
00036 # include <mln/topo/n_face_iter.hh>
00037 
00038 
00039 
00040 
00041 
00042 namespace mln
00043 {
00044 
00045   
00046   template <unsigned D, typename G> class p_complex;
00047 
00048 
00049   
00050 
00051 
00052 
00055   template <unsigned D, typename G>
00056   class p_n_faces_fwd_piter
00057     : public internal::p_complex_piter_base_< topo::n_face_fwd_iter<D>,
00058                                               p_complex<D, G>,
00059                                               mln_site(G),
00060                                               p_n_faces_fwd_piter<D, G> >
00061   {
00062     typedef p_n_faces_fwd_piter<D, G> self_;
00063     typedef internal::p_complex_piter_base_< topo::n_face_fwd_iter<D>,
00064                                              p_complex<D, G>,
00065                                              mln_site(G),
00066                                              self_ > super_;
00067 
00068   public:
00071     p_n_faces_fwd_piter();
00072     p_n_faces_fwd_piter(const p_complex<D, G>& pc, unsigned n);
00074 
00079     unsigned n() const;
00080     void set_n (unsigned n);
00082   };
00083 
00084 
00085   
00086 
00087 
00088 
00091   template <unsigned D, typename G>
00092   class p_n_faces_bkd_piter
00093   
00094 
00095     : public internal::p_complex_piter_base_< topo::n_face_bkd_iter<D>,
00096                                               p_complex<D, G>,
00097                                               mln_site(G),
00098                                               p_n_faces_bkd_piter<D, G> >
00099   {
00100     typedef p_n_faces_bkd_piter<D, G> self_;
00101     typedef internal::p_complex_piter_base_< topo::n_face_bkd_iter<D>,
00102                                              p_complex<D, G>,
00103                                              mln_site(G),
00104                                              self_ > super_;
00105 
00106   public:
00109     p_n_faces_bkd_piter();
00110     p_n_faces_bkd_piter(const p_complex<D, G>& pc, unsigned n);
00112 
00117     unsigned n() const;
00118     void set_n (unsigned n);
00120   };
00121 
00122 
00123 
00124 # ifndef MLN_INCLUDE_ONLY
00125 
00126   
00127 
00128 
00129 
00130   template <unsigned D, typename G>
00131   inline
00132   p_n_faces_fwd_piter<D, G>::p_n_faces_fwd_piter()
00133   {
00134   }
00135 
00136   template <unsigned D, typename G>
00137   inline
00138   p_n_faces_fwd_piter<D, G>::p_n_faces_fwd_piter(const p_complex<D, G>& pc,
00139                                                  unsigned n)
00140     : super_(pc)
00141   {
00142     mln_precondition(n <= D);
00143     set_n(n);
00144   }
00145 
00146   template <unsigned D, typename G>
00147   inline
00148   unsigned 
00149   p_n_faces_fwd_piter<D, G>::n() const
00150   {
00151     return this->iter_.n();
00152   }
00153 
00154   template <unsigned D, typename G>
00155   inline
00156   void
00157   p_n_faces_fwd_piter<D, G>::set_n (unsigned n)
00158   {
00159     this->iter_.set_n(n);
00160   }
00161     
00162 
00163   
00164 
00165 
00166 
00167   template <unsigned D, typename G>
00168   inline
00169   p_n_faces_bkd_piter<D, G>::p_n_faces_bkd_piter()
00170   {
00171   }
00172 
00173   template <unsigned D, typename G>
00174   inline
00175   p_n_faces_bkd_piter<D, G>::p_n_faces_bkd_piter(const p_complex<D, G>& pc,
00176                                                  unsigned n)
00177     : super_(pc)
00178   {
00179     mln_precondition(n <= D);
00180     set_n(n);
00181   }
00182 
00183   template <unsigned D, typename G>
00184   inline
00185   unsigned 
00186   p_n_faces_bkd_piter<D, G>::n() const
00187   {
00188     return this->iter_.n();
00189   }
00190 
00191   template <unsigned D, typename G>
00192   inline
00193   void
00194   p_n_faces_bkd_piter<D, G>::set_n (unsigned n)
00195   {
00196     this->iter_.set_n(n);
00197   }
00198 
00199 # endif // ! MLN_INCLUDE_ONLY
00200 
00201 } 
00202 
00203 #endif // ! MLN_CORE_SITE_SET_P_N_FACES_PITER_HH