Milena (Olena)  User documentation 2.0a Id
 All Classes Namespaces Functions Variables Typedefs Enumerator Groups Pages
adj_higher_face_iter.hh
1 // Copyright (C) 2008, 2009, 2010 EPITA Research and Development
2 // Laboratory (LRDE)
3 //
4 // This file is part of Olena.
5 //
6 // Olena is free software: you can redistribute it and/or modify it under
7 // the terms of the GNU General Public License as published by the Free
8 // Software Foundation, version 2 of the License.
9 //
10 // Olena is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // As a special exception, you may use this file as part of a free
19 // software project without restriction. Specifically, if other files
20 // instantiate templates or use macros or inline functions from this
21 // file, or you compile this file and link it with other files to produce
22 // an executable, this file does not by itself cause the resulting
23 // executable to be covered by the GNU General Public License. This
24 // exception does not however invalidate any other reasons why the
25 // executable file might be covered by the GNU General Public License.
26 
27 #ifndef MLN_TOPO_ADJ_HIGHER_FACE_ITER_HH
28 # define MLN_TOPO_ADJ_HIGHER_FACE_ITER_HH
29 
34 
35 # include <mln/topo/internal/complex_relative_iterator_base.hh>
36 # include <mln/topo/algebraic_face.hh>
37 
38 
39 namespace mln
40 {
41 
42  namespace topo
43  {
44 
45  // Forward declaration.
46  template <unsigned D> class complex;
47 
48  namespace internal
49  {
50 
51  template <typename C, typename F, typename E>
52  class forward_complex_relative_iterator_base;
53 
54  template <typename C, typename F, typename E>
55  class backward_complex_relative_iterator_base;
56 
57  } // end of mln::topo::internal
58 
59  template <unsigned D>
60  class algebraic_face;
61 
62  /*------------------------------------.
63  | topo::adj_higher_face_fwd_iter<D>. |
64  `------------------------------------*/
65 
70  //
71  template <unsigned D>
73  : public internal::forward_complex_relative_iterator_base< topo::face<D>,
74  algebraic_face<D>,
75  adj_higher_face_fwd_iter<D> >
76  {
78  typedef internal::forward_complex_relative_iterator_base< topo::face<D>,
80  self_ > super_;
81  // Tech note: we use topo::face to help g++-2.95.
82 
83  public:
87  template <typename Fref>
88  adj_higher_face_fwd_iter(const Fref& f_ref);
90 
92  void update_adj_faces_();
93  };
94 
95 
96  /*------------------------------------.
97  | topo::adj_higher_face_bkd_iter<D>. |
98  `------------------------------------*/
99 
104  //
105  template <unsigned D>
107  : public internal::backward_complex_relative_iterator_base< topo::face<D>,
108  algebraic_face<D>,
109  adj_higher_face_bkd_iter<D> >
110  {
112  typedef internal::backward_complex_relative_iterator_base< topo::face<D>,
114  self_ > super_;
115  // Tech note: we use topo::face to help g++-2.95.
116 
117  public:
121  template <typename Fref>
122  adj_higher_face_bkd_iter(const Fref& f_ref);
124 
126  void update_adj_faces_();
127  };
128 
129 
130 
131 # ifndef MLN_INCLUDE_ONLY
132 
133  /*------------------------------------.
134  | topo::adj_higher_face_fwd_iter<D>. |
135  `------------------------------------*/
136 
137  template <unsigned D>
138  inline
140  {
141  }
142 
143  template <unsigned D>
144  template <typename Fref>
145  inline
147  : super_(f_ref)
148  {
149  }
150 
151  template <unsigned D>
152  inline
153  void
154  adj_higher_face_fwd_iter<D>::update_adj_faces_()
155  {
156  mln_precondition(this->c_);
157  this->adj_faces_ = this->c_->higher_dim_adj_faces();
158  }
159 
160 
161  /*------------------------------------.
162  | topo::adj_higher_face_bkd_iter<D>. |
163  `------------------------------------*/
164 
165  template <unsigned D>
166  inline
168  {
169  }
170 
171  template <unsigned D>
172  template <typename Fref>
173  inline
175  : super_(f_ref)
176  {
177  }
178 
179  template <unsigned D>
180  inline
181  void
182  adj_higher_face_bkd_iter<D>::update_adj_faces_()
183  {
184  mln_precondition(this->c_);
185  this->adj_faces_ = this->c_->higher_dim_adj_faces();
186  }
187 
188 # endif // ! MLN_INCLUDE_ONLY
189 
190  } // end of namespace mln::topo
191 
192 } // end of namespace mln
193 
194 #endif // ! MLN_TOPO_ADJ_HIGHER_FACE_ITER_HH