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

adj_lower_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_LOWER_FACE_ITER_HH
00028 # define MLN_TOPO_ADJ_LOWER_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 declarations.
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 namespace mln::topo::internal
00058 
00059     template <unsigned D>
00060     class algebraic_face;
00061 
00062 
00063     /*-----------------------------------.
00064     | topo::adj_lower_face_fwd_iter<D>.  |
00065     `-----------------------------------*/
00066 
00071     //
00072     template <unsigned D>
00073     class adj_lower_face_fwd_iter
00074       : public internal::forward_complex_relative_iterator_base< topo::face<D>,
00075                                                                  algebraic_face<D>,
00076                                                                  adj_lower_face_fwd_iter<D> >
00077     {
00078       // Tech note: we use topo::face to help g++-2.95.
00079     private:
00080       typedef adj_lower_face_fwd_iter<D> self_;
00081       typedef internal::forward_complex_relative_iterator_base< topo::face<D>,
00082                                                                 algebraic_face<D>,
00083                                                                 self_ > super_;
00084 
00085     public:
00088       adj_lower_face_fwd_iter();
00089       template <typename Fref>
00090       adj_lower_face_fwd_iter(const Fref& f_ref);
00092 
00094       void update_adj_faces_();
00095     };
00096 
00097 
00098     /*-----------------------------------.
00099     | topo::adj_lower_face_bkd_iter<D>.  |
00100     `-----------------------------------*/
00101 
00106     //
00107     template <unsigned D>
00108     class adj_lower_face_bkd_iter
00109       : public internal::backward_complex_relative_iterator_base< topo::face<D>,
00110                                                                   algebraic_face<D>,
00111                                                                   adj_lower_face_bkd_iter<D> >
00112     {
00113       // Tech note: we use topo::face to help g++-2.95.
00114     private:
00115       typedef adj_lower_face_bkd_iter<D> self_;
00116       typedef internal::backward_complex_relative_iterator_base< topo::face<D>,
00117                                                                  algebraic_face<D>,
00118                                                                  self_ > super_;
00119     public:
00122       adj_lower_face_bkd_iter();
00123       template <typename Fref>
00124       adj_lower_face_bkd_iter(const Fref& f_ref);
00126 
00128       void update_adj_faces_();
00129     };
00130 
00131 
00132 
00133 # ifndef MLN_INCLUDE_ONLY
00134 
00135     /*-----------------------------------.
00136     | topo::adj_lower_face_fwd_iter<D>.  |
00137     `-----------------------------------*/
00138 
00139     template <unsigned D>
00140     inline
00141     adj_lower_face_fwd_iter<D>::adj_lower_face_fwd_iter()
00142     {
00143     }
00144 
00145     template <unsigned D>
00146     template <typename Fref>
00147     inline
00148     adj_lower_face_fwd_iter<D>::adj_lower_face_fwd_iter(const Fref& f_ref)
00149       : super_(f_ref)
00150     {
00151     }
00152 
00153     template <unsigned D>
00154     inline
00155     void
00156     adj_lower_face_fwd_iter<D>::update_adj_faces_()
00157     {
00158       mln_precondition(this->c_);
00159       this->adj_faces_ = this->c_->lower_dim_adj_faces();
00160     }
00161 
00162 
00163     /*-----------------------------------.
00164     | topo::adj_lower_face_bkd_iter<D>.  |
00165     `-----------------------------------*/
00166 
00167     template <unsigned D>
00168     inline
00169     adj_lower_face_bkd_iter<D>::adj_lower_face_bkd_iter()
00170     {
00171     }
00172 
00173     template <unsigned D>
00174     template <typename Fref>
00175     inline
00176     adj_lower_face_bkd_iter<D>::adj_lower_face_bkd_iter(const Fref& f_ref)
00177       : super_(f_ref)
00178     {
00179     }
00180 
00181     template <unsigned D>
00182     inline
00183     void
00184     adj_lower_face_bkd_iter<D>::update_adj_faces_()
00185     {
00186       mln_precondition(this->c_);
00187       this->adj_faces_ = this->c_->lower_dim_adj_faces();
00188     }
00189 
00190 # endif // ! MLN_INCLUDE_ONLY
00191 
00192   } // end of namespace mln::topo
00193 
00194 } // end of namespace mln
00195 
00196 #endif // ! MLN_TOPO_ADJ_LOWER_FACE_ITER_HH

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