26 #ifndef MLN_TOPO_N_FACE_ITER_HH
27 # define MLN_TOPO_N_FACE_ITER_HH
34 # include <mln/topo/internal/complex_set_iterator_base.hh>
35 # include <mln/topo/face.hh>
50 template <
unsigned D>
class complex;
56 template <
typename F,
typename E>
57 class complex_set_iterator_base;
73 :
public internal::complex_set_iterator_base< topo::face<D>,
79 typedef internal::complex_set_iterator_base< topo::face<D>,
self_ > super_;
82 using super_::is_valid;
83 using super_::invalidate;
107 void set_n (
unsigned n);
112 void invalidate_face_id_();
126 template <
unsigned D>
128 :
public internal::complex_set_iterator_base< topo::face<D>,
134 typedef internal::complex_set_iterator_base< topo::face<D>,
self_ > super_;
137 using super_::is_valid;
138 using super_::invalidate;
162 void set_n (
unsigned n);
167 void invalidate_face_id_();
175 # ifndef MLN_INCLUDE_ONLY
181 template <
unsigned D>
188 template <
unsigned D>
190 n_face_fwd_iter<D>::n_face_fwd_iter(complex<D>& c,
unsigned n)
193 mln_precondition(n <= D);
196 mln_postcondition(!is_valid());
199 template <
unsigned D>
207 template <
unsigned D>
214 if (f_.face_id() + 1 < f_.cplx().nfaces_of_dim(n()))
220 invalidate_face_id_();
224 template <
unsigned D>
227 n_face_fwd_iter<D>::invalidate_face_id_()
229 f_.set_face_id(f_.cplx().nfaces_of_dim(n()));
232 template <
unsigned D>
240 template <
unsigned D>
245 mln_precondition(n <= D);
254 template <
unsigned D>
256 n_face_bkd_iter<D>::n_face_bkd_iter()
261 template <
unsigned D>
263 n_face_bkd_iter<D>::n_face_bkd_iter(complex<D>& c,
unsigned n)
266 mln_precondition(n <= D);
269 mln_postcondition(!is_valid());
272 template <
unsigned D>
277 f_.set_face_id(f_.cplx().nfaces_of_dim(n()) - 1);
280 template <
unsigned D>
287 if (f_.face_id() > 0)
293 invalidate_face_id_();
297 template <
unsigned D>
300 n_face_bkd_iter<D>::invalidate_face_id_()
302 f_.set_face_id(f_.cplx().nfaces_of_dim(n()));
305 template <
unsigned D>
313 template <
unsigned D>
318 mln_precondition(n <= D);
322 # endif // ! MLN_INCLUDE_ONLY
328 #endif // ! MLN_TOPO_N_FACE_ITER_HH