26 #ifndef MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOOD_PITER_HH
27 # define MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOOD_PITER_HH
32 # include <mln/core/concept/neighborhood.hh>
33 # include <mln/core/internal/site_relative_iterator_base.hh>
52 template <
typename I,
typename G,
typename N>
54 :
public internal::site_relative_iterator_base< N,
55 complex_neighborhood_fwd_piter<I, G, N> >
58 typedef internal::site_relative_iterator_base< N, self_ > super_;
70 template <typename Pref>
71 complex_neighborhood_fwd_piter(const
Neighborhood<N>& nbh,
76 template <typename Pref>
77 void init_(const
Neighborhood<N>& nbh, const Pref& p_ref);
82 bool is_valid_() const;
92 template <typename Pref>
93 void center_at_(const Pref& c);
96 psite compute_p_() const;
101 const iter_type&
iter() const;
112 template <typename I, typename G, typename N>
114 operator<<(std::ostream& ostr,
115 const complex_neighborhood_fwd_piter<I, G, N>& p);
123 template <typename I, typename G, typename N>
125 : public internal::site_relative_iterator_base< N,
129 typedef internal::site_relative_iterator_base< N, self_ > super_;
133 typedef mln_psite(N) psite;
135 typedef typename N::complex_bkd_iter iter_type;
141 template <typename Pref>
142 complex_neighborhood_bkd_piter(const
Neighborhood<N>& nbh,
147 template <typename Pref>
148 void init_(const
Neighborhood<N>& nbh, const Pref& p_ref);
153 bool is_valid_() const;
163 template <typename Pref>
164 void center_at_(const Pref& c);
167 psite compute_p_() const;
172 const iter_type& iter() const;
183 template <typename I, typename G, typename N>
185 operator<<(std::ostream& ostr,
186 const complex_neighborhood_bkd_piter<I, G, N>& p);
190 # ifndef MLN_INCLUDE_ONLY
196 template <
typename I,
typename G,
typename N>
202 template <
typename I,
typename G,
typename N>
203 template <
typename Pref>
211 template <
typename I,
typename G,
typename N>
212 template <
typename Pref>
215 complex_neighborhood_fwd_piter<I, G, N>::init_(
const Neighborhood<N>& nbh,
218 this->change_target(exact(nbh));
219 this->center_at(p_ref);
220 mln_postcondition(!this->is_valid());
223 template <
typename I,
typename G,
typename N>
226 complex_neighborhood_fwd_piter<I, G, N>::is_valid_()
const
228 return iter_.is_valid();
231 template <
typename I,
typename G,
typename N>
234 complex_neighborhood_fwd_piter<I, G, N>::invalidate_()
239 template <
typename I,
typename G,
typename N>
242 complex_neighborhood_fwd_piter<I, G, N>::do_start_()
247 template <
typename I,
typename G,
typename N>
250 complex_neighborhood_fwd_piter<I, G, N>::do_next_()
255 template <
typename I,
typename G,
typename N>
256 template <
typename Pref>
259 complex_neighborhood_fwd_piter<I, G, N>::center_at_(
const Pref&)
261 iter_.center_at(this->center().face());
264 template <
typename I,
typename G,
typename N>
267 complex_neighborhood_fwd_piter<I, G, N>::compute_p_()
const
272 template <
typename I,
typename G,
typename N>
274 const typename N::complex_fwd_iter&
280 template <
typename I,
typename G,
typename N>
282 typename N::complex_fwd_iter&
289 template <
typename I,
typename G,
typename N>
292 operator<<(std::ostream& ostr,
295 return ostr << p.unproxy_();
303 template <
typename I,
typename G,
typename N>
309 template <
typename I,
typename G,
typename N>
310 template <
typename Pref>
318 template <
typename I,
typename G,
typename N>
319 template <
typename Pref>
322 complex_neighborhood_bkd_piter<I, G, N>::init_(
const Neighborhood<N>& nbh,
325 this->change_target(exact(nbh));
326 this->center_at(p_ref);
327 mln_postcondition(!this->is_valid());
330 template <
typename I,
typename G,
typename N>
333 complex_neighborhood_bkd_piter<I, G, N>::is_valid_()
const
335 return iter_.is_valid();
338 template <
typename I,
typename G,
typename N>
341 complex_neighborhood_bkd_piter<I, G, N>::invalidate_()
346 template <
typename I,
typename G,
typename N>
349 complex_neighborhood_bkd_piter<I, G, N>::do_start_()
354 template <
typename I,
typename G,
typename N>
357 complex_neighborhood_bkd_piter<I, G, N>::do_next_()
362 template <
typename I,
typename G,
typename N>
363 template <
typename Pref>
366 complex_neighborhood_bkd_piter<I, G, N>::center_at_(
const Pref&)
368 iter_.center_at(this->center().face());
371 template <
typename I,
typename G,
typename N>
374 complex_neighborhood_bkd_piter<I, G, N>::compute_p_()
const
379 template <
typename I,
typename G,
typename N>
381 const typename N::complex_bkd_iter&
387 template <
typename I,
typename G,
typename N>
389 typename N::complex_bkd_iter&
396 template <
typename I,
typename G,
typename N>
399 operator<<(std::ostream& ostr,
402 return ostr << p.unproxy_();
405 # endif // ! MLN_INCLUDE_ONLY
409 #endif // ! MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOOD_PITER_HH