26 #ifndef MLN_TOPO_ADJ_LOWER_DIM_CONNECTED_N_FACE_ITER_HH
27 # define MLN_TOPO_ADJ_LOWER_DIM_CONNECTED_N_FACE_ITER_HH
37 # include <mln/topo/internal/complex_relative_iterator_base.hh>
38 # include <mln/topo/algebraic_face.hh>
48 template <
unsigned D>
class complex;
51 template <
unsigned D>
class adj_lower_dim_connected_n_face_iterator;
66 :
public internal::forward_complex_relative_iterator_base< topo::face<D>,
68 adj_lower_dim_connected_n_face_fwd_iter<D> >,
69 private internal::adj_lower_dim_connected_n_face_iterator<D>
74 typedef internal::forward_complex_relative_iterator_base< topo::face<D>,
82 template <
typename Fref>
90 void update_adj_faces_();
103 template <
unsigned D>
105 :
public internal::backward_complex_relative_iterator_base< topo::face<D>,
107 adj_lower_dim_connected_n_face_bkd_iter<D> >,
108 private internal::adj_lower_dim_connected_n_face_iterator<D>
113 typedef internal::backward_complex_relative_iterator_base< topo::face<D>,
121 template <
typename Fref>
129 void update_adj_faces_();
140 template <
unsigned D>
141 class adj_lower_dim_connected_n_face_iterator
154 # ifndef MLN_INCLUDE_ONLY
160 template <
unsigned D>
166 template <
unsigned D>
167 template <
typename Fref>
179 template <
unsigned D>
182 adj_lower_dim_connected_n_face_fwd_iter<D>::update_adj_faces_()
184 mln_precondition(this->c_);
186 this->update_adj_faces__(*this->c_, this->adj_faces_);
194 template <
unsigned D>
200 template <
unsigned D>
201 template <
typename Fref>
208 template <
unsigned D>
211 adj_lower_dim_connected_n_face_bkd_iter<D>::update_adj_faces_()
213 mln_precondition(this->c_);
215 this->update_adj_faces__(*this->c_, this->adj_faces_);
230 template <
unsigned D>
233 adj_lower_dim_connected_n_face_iterator<D>::update_adj_faces__(
const topo::face<D>& center,
234 std::vector< algebraic_face<D> >& adj_faces)
244 std::set< algebraic_face<D> > faces_set;
245 typedef std::vector< algebraic_face<D> > faces_t;
248 faces_t shared_lower_faces = center.lower_dim_adj_faces();
249 for (
typename faces_t::const_iterator slf = shared_lower_faces.begin();
250 slf != shared_lower_faces.end(); ++slf)
254 faces_t adj_n_faces = slf->higher_dim_adj_faces();
255 for (
typename faces_t::const_iterator af = adj_n_faces.begin();
256 af != adj_n_faces.end(); ++af)
262 faces_set.find(*af) == faces_set.end())
264 adj_faces.push_back(*af);
265 faces_set.insert(*af);
273 # endif // ! MLN_INCLUDE_ONLY
279 #endif // ! MLN_TOPO_ADJ_LOWER_DIM_CONNECTED_N_FACE_ITER_HH