26 #ifndef MLN_TOPO_ATTIC_FACES_ITER_HH
27 # define MLN_TOPO_ATTIC_FACES_ITER_HH
33 # include <mln/topo/internal/complex_set_iterator_base.hh>
34 # include <mln/topo/n_face.hh>
50 template <
unsigned N,
unsigned D>
52 :
public internal::complex_set_iterator_base< n_face<N, D>,
53 faces_fwd_iter_<N, D> >
57 typedef n_face<N, D> face;
60 typedef faces_fwd_iter_<N, D> self_;
61 typedef internal::complex_set_iterator_base< face, self_ > super_;
64 using super_::is_valid;
65 using super_::invalidate;
73 faces_fwd_iter_(complex<D>& c);
97 template <
unsigned N,
unsigned D>
99 :
public internal::complex_set_iterator_base< n_face<N, D>,
100 faces_bkd_iter_<N, D> >
104 typedef n_face<N, D> face;
107 typedef faces_bkd_iter_<N, D> self_;
108 typedef internal::complex_set_iterator_base< face, self_ > super_;
111 using super_::is_valid;
112 using super_::invalidate;
120 faces_bkd_iter_(complex<D>& c);
137 # ifndef MLN_INCLUDE_ONLY
143 template <
unsigned N,
unsigned D>
145 faces_fwd_iter_<N, D>::faces_fwd_iter_()
149 metal::bool_< N <= D >::check();
150 mln_postcondition(!is_valid());
153 template <
unsigned N,
unsigned D>
155 faces_fwd_iter_<N, D>::faces_fwd_iter_(complex<D>& c)
159 metal::bool_< N <= D >::check();
160 mln_postcondition(!is_valid());
163 template <
unsigned N,
unsigned D>
166 faces_fwd_iter_<N, D>::start()
168 face_.set_face_id(0u);
171 template <
unsigned N,
unsigned D>
174 faces_fwd_iter_<N, D>::next_()
178 unsigned face_id = face_.face_id();
179 if (face_id + 1 < face_.cplx().template nfaces_of_static_dim<N>())
186 face_.set_face_id(face_id + 1);
197 template <
unsigned N,
unsigned D>
199 faces_bkd_iter_<N, D>::faces_bkd_iter_()
203 metal::bool_< N <= D >::check();
204 mln_postcondition(!is_valid());
207 template <
unsigned N,
unsigned D>
209 faces_bkd_iter_<N, D>::faces_bkd_iter_(complex<D>& c)
213 metal::bool_< N <= D >::check();
214 mln_postcondition(!is_valid());
217 template <
unsigned N,
unsigned D>
220 faces_bkd_iter_<N, D>::start()
222 face_.set_face_id(face_.cplx().template nfaces_of_static_dim<N>() - 1);
225 template <
unsigned N,
unsigned D>
228 faces_bkd_iter_<N, D>::next_()
232 unsigned face_id = face_.face_id();
240 face_.set_face_id(face_id - 1);
246 # endif // ! MLN_INCLUDE_ONLY
252 #endif // ! MLN_TOPO_ATTIC_FACES_ITER_HH