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

adj_higher_face_iter.hh

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

Generated on Thu Sep 8 2011 18:31:29 for Milena (Olena) by  doxygen 1.7.1