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

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

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