26 #ifndef MLN_CORE_IMAGE_GRAPH_WINDOW_IF_PITER_HH
27 # define MLN_CORE_IMAGE_GRAPH_WINDOW_IF_PITER_HH
33 # include <mln/core/internal/is_masked_impl_selector.hh>
34 # include <mln/core/internal/site_relative_iterator_base.hh>
41 template <
typename S,
typename I>
class p_graph_piter;
46 template <
typename S,
typename W,
typename I>
48 :
public internal::site_relative_iterator_base< W,
49 graph_window_if_piter<S,W,I> >,
50 public internal::is_masked_impl_selector< S,
51 typename W::mask_t::domain_t,
52 graph_window_if_piter<S,W,I> >
55 typedef internal::site_relative_iterator_base<W,self_> super_;
60 typedef mln_result(S::fun_t)
P;
66 template <typename Pref>
72 template <typename Pref>
73 void init_(const
Window<W>& win, const Pref& p_ref);
78 bool is_valid_() const;
88 template <typename Pref>
89 void center_at_(const Pref& c);
92 template <typename I2>
96 const mln_graph_element(S)&
element() const;
99 mln_psite(W) compute_p_() const;
118 # ifndef MLN_INCLUDE_ONLY
120 template <
typename S,
typename W,
typename I>
126 template <
typename S,
typename W,
typename I>
127 template <
typename Pref>
135 template <
typename S,
typename W,
typename I>
136 template <
typename Pref>
139 graph_window_if_piter<S,W,I>::init_(
const Window<W>& win,
142 this->center_at(p_ref);
143 this->change_target(exact(win));
145 mln_postcondition(!this->is_valid());
148 template <
typename S,
typename W,
typename I>
151 graph_window_if_piter<S,W,I>::is_valid_()
const
153 return iter_.is_valid();
156 template <
typename S,
typename W,
typename I>
159 graph_window_if_piter<S,W,I>::invalidate_()
164 template <
typename S,
typename W,
typename I>
167 graph_window_if_piter<S,W,I>::do_start_()
170 while (iter_.is_valid() && this->is_masked(this->c_->element(), iter_))
174 template <
typename S,
typename W,
typename I>
177 graph_window_if_piter<S,W,I>::do_next_()
180 while (iter_.is_valid() && this->is_masked(this->c_->element(), iter_))
184 template <
typename S,
typename W,
typename I>
185 template <
typename Pref>
188 graph_window_if_piter<S,W,I>::center_at_(
const Pref& c)
190 iter_.center_at(c.p_hook_());
193 template <
typename S,
typename W,
typename I>
194 template <
typename I2>
197 graph_window_if_piter<S,W,I>::center_at_(
const p_graph_piter<S, I2>& c)
199 iter_.center_at(c.hook_elt_());
202 template <
typename S,
typename W,
typename I>
207 return mln_psite(S)(this->center().site_set(), iter_.id());
210 template <
typename S,
typename W,
typename I>
212 const mln_graph_element(S)&
218 template <
typename S,
typename W,
typename I>
227 # endif // ! MLN_INCLUDE_ONLY
231 #endif // ! MLN_CORE_IMAGE_GRAPH_WINDOW_IF_PITER_HH