27 #ifndef MLN_TOPO_ADJ_M_FACE_ITER_HH
28 # define MLN_TOPO_ADJ_M_FACE_ITER_HH
39 # include <mln/topo/internal/complex_relative_iterator_base.hh>
40 # include <mln/topo/face.hh>
50 template <
unsigned D>
class complex;
53 template <
unsigned D>
class adj_m_face_iterator;
77 adj_m_face_fwd_iter<D> >,
96 template <
typename Fref>
124 template <
unsigned D>
128 adj_m_face_bkd_iter<D> >,
147 template <
typename Fref>
166 template <
unsigned D>
177 void set_m(
unsigned m);
193 # ifndef MLN_INCLUDE_ONLY
199 template <
unsigned D>
205 template <
unsigned D>
206 template <
typename Fref>
209 : super_(f_ref), impl_(m)
213 template <
unsigned D>
216 adj_m_face_fwd_iter<D>::update_adj_faces_()
218 mln_precondition(this->c_);
220 this->update_adj_faces__(*this->c_, this->adj_faces_);
228 template <
unsigned D>
230 adj_m_face_bkd_iter<D>::adj_m_face_bkd_iter()
234 template <
unsigned D>
235 template <
typename Fref>
237 adj_m_face_bkd_iter<D>::adj_m_face_bkd_iter(
const Fref& f_ref,
unsigned m)
238 : super_(f_ref), impl_(m)
242 template <
unsigned D>
245 adj_m_face_bkd_iter<D>::update_adj_faces_()
247 mln_precondition(this->c_);
249 this->update_adj_faces__(*this->c_, this->adj_faces_);
260 template <
unsigned D>
262 adj_m_face_iterator<D>::adj_m_face_iterator()
267 template <
unsigned D>
272 mln_precondition(m <= D);
275 template <
unsigned D>
282 template <
unsigned D>
289 template <
unsigned D>
297 if (center.n() == m_)
300 typedef std::vector < topo::algebraic_face<D> > faces_t;
301 typedef std::set < topo::algebraic_face<D> > faces_set_t;
317 faces_set_t work_faces_set;
320 for (
unsigned p = center.n();
p != m_; (
p < m_ ? ++
p : --
p) )
322 mln_invariant (
p != m_);
323 for (
typename faces_t::const_iterator g = p_faces.begin();
324 g != p_faces.end(); ++g)
326 mln_invariant (g->n() != m_);
327 faces_t q_faces = g->n() < m_ ?
328 g->higher_dim_adj_faces() :
329 g->lower_dim_adj_faces();
338 for (
typename faces_t::const_iterator h = q_faces.begin();
339 h != q_faces.end(); ++h)
341 if (work_faces_set.find(*h) == work_faces_set.end())
343 work_faces.push_back(*h);
344 work_faces_set.insert(*h);
349 for (
typename faces_t::const_reverse_iterator h =
354 h != (
typename faces_t::const_reverse_iterator) q_faces.rend();
357 if (work_faces_set.find(*h) == work_faces_set.end())
359 work_faces.push_back(*h);
360 work_faces_set.insert(*h);
364 work_faces.swap(p_faces);
366 work_faces_set.clear();
374 # endif // ! MLN_INCLUDE_ONLY
380 #endif // ! MLN_TOPO_ADJ_M_FACE_ITER_HH