• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List

adj_higher_face_iter.hh

00001 // Copyright (C) 2008, 2009, 2010 EPITA Research and Development
00002 // Laboratory (LRDE)
00003 //
00004 // This file is part of Olena.
00005 //
00006 // Olena is free software: you can redistribute it and/or modify it under
00007 // the terms of the GNU General Public License as published by the Free
00008 // Software Foundation, version 2 of the License.
00009 //
00010 // Olena is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Olena.  If not, see <http://www.gnu.org/licenses/>.
00017 //
00018 // As a special exception, you may use this file as part of a free
00019 // software project without restriction.  Specifically, if other files
00020 // instantiate templates or use macros or inline functions from this
00021 // file, or you compile this file and link it with other files to produce
00022 // an executable, this file does not by itself cause the resulting
00023 // executable to be covered by the GNU General Public License.  This
00024 // exception does not however invalidate any other reasons why the
00025 // executable file might be covered by the GNU General Public License.
00026 
00027 #ifndef MLN_TOPO_ADJ_HIGHER_FACE_ITER_HH
00028 # define MLN_TOPO_ADJ_HIGHER_FACE_ITER_HH
00029 
00034 
00035 # include <mln/topo/internal/complex_relative_iterator_base.hh>
00036 # include <mln/topo/algebraic_face.hh>
00037 
00038 
00039 namespace mln
00040 {
00041 
00042   namespace topo
00043   {
00044 
00045     // Forward declaration.
00046     template <unsigned D> class complex;
00047 
00048     namespace internal
00049     {
00050 
00051       template <typename C, typename F, typename E>
00052       class forward_complex_relative_iterator_base;
00053 
00054       template <typename C, typename F, typename E>
00055       class backward_complex_relative_iterator_base;
00056 
00057     } // end of mln::topo::internal
00058 
00059     template <unsigned D>
00060     class algebraic_face;
00061 
00062     /*------------------------------------.
00063     | topo::adj_higher_face_fwd_iter<D>.  |
00064     `------------------------------------*/
00065 
00070     //
00071     template <unsigned D>
00072     class adj_higher_face_fwd_iter
00073       : public internal::forward_complex_relative_iterator_base< topo::face<D>,
00074                                                                  algebraic_face<D>,
00075                                                                  adj_higher_face_fwd_iter<D> >
00076     {
00077       typedef adj_higher_face_fwd_iter<D> self_;
00078       typedef internal::forward_complex_relative_iterator_base< topo::face<D>,
00079                                                                 algebraic_face<D>,
00080                                                                 self_ > super_;
00081       // Tech note: we use topo::face to help g++-2.95.
00082 
00083     public:
00086       adj_higher_face_fwd_iter();
00087       template <typename Fref>
00088       adj_higher_face_fwd_iter(const Fref& f_ref);
00090 
00092       void update_adj_faces_();
00093     };
00094 
00095 
00096     /*------------------------------------.
00097     | topo::adj_higher_face_bkd_iter<D>.  |
00098     `------------------------------------*/
00099 
00104     //
00105     template <unsigned D>
00106     class adj_higher_face_bkd_iter
00107       : public internal::backward_complex_relative_iterator_base< topo::face<D>,
00108                                                                   algebraic_face<D>,
00109                                                                   adj_higher_face_bkd_iter<D> >
00110     {
00111       typedef adj_higher_face_bkd_iter<D> self_;
00112       typedef internal::backward_complex_relative_iterator_base< topo::face<D>,
00113                                                                  algebraic_face<D>,
00114                                                                  self_ > super_;
00115       // Tech note: we use topo::face to help g++-2.95.
00116 
00117     public:
00120       adj_higher_face_bkd_iter();
00121       template <typename Fref>
00122       adj_higher_face_bkd_iter(const Fref& f_ref);
00124 
00126       void update_adj_faces_();
00127     };
00128 
00129 
00130 
00131 # ifndef MLN_INCLUDE_ONLY
00132 
00133     /*------------------------------------.
00134     | topo::adj_higher_face_fwd_iter<D>.  |
00135     `------------------------------------*/
00136 
00137     template <unsigned D>
00138     inline
00139     adj_higher_face_fwd_iter<D>::adj_higher_face_fwd_iter()
00140     {
00141     }
00142 
00143     template <unsigned D>
00144     template <typename Fref>
00145     inline
00146     adj_higher_face_fwd_iter<D>::adj_higher_face_fwd_iter(const Fref& f_ref)
00147       : super_(f_ref)
00148     {
00149     }
00150 
00151     template <unsigned D>
00152     inline
00153     void
00154     adj_higher_face_fwd_iter<D>::update_adj_faces_()
00155     {
00156       mln_precondition(this->c_);
00157       this->adj_faces_ = this->c_->higher_dim_adj_faces();
00158     }
00159 
00160 
00161     /*------------------------------------.
00162     | topo::adj_higher_face_bkd_iter<D>.  |
00163     `------------------------------------*/
00164 
00165     template <unsigned D>
00166     inline
00167     adj_higher_face_bkd_iter<D>::adj_higher_face_bkd_iter()
00168     {
00169     }
00170 
00171     template <unsigned D>
00172     template <typename Fref>
00173     inline
00174     adj_higher_face_bkd_iter<D>::adj_higher_face_bkd_iter(const Fref& f_ref)
00175       : super_(f_ref)
00176     {
00177     }
00178 
00179     template <unsigned D>
00180     inline
00181     void
00182     adj_higher_face_bkd_iter<D>::update_adj_faces_()
00183     {
00184       mln_precondition(this->c_);
00185       this->adj_faces_ = this->c_->higher_dim_adj_faces();
00186     }
00187 
00188 # endif // ! MLN_INCLUDE_ONLY
00189 
00190   } // end of namespace mln::topo
00191 
00192 } // end of namespace mln
00193 
00194 #endif // ! MLN_TOPO_ADJ_HIGHER_FACE_ITER_HH

Generated on Tue Oct 4 2011 15:23:23 for Milena (Olena) by  doxygen 1.7.1