27 #ifndef MLN_CORE_IMAGE_GRAPH_WINDOW_PITER_HH
28 # define MLN_CORE_IMAGE_GRAPH_WINDOW_PITER_HH
37 # include <mln/core/concept/site_set.hh>
38 # include <mln/core/concept/window.hh>
39 # include <mln/core/internal/site_relative_iterator_base.hh>
46 template <
typename S,
typename I>
class p_graph_piter;
57 template <
typename C,
typename P,
typename E>
62 internal::force_exact<E>(*this).iter_.start();
74 template <
typename C,
typename E>
79 E& this_ = internal::force_exact<E>(*this);
90 this_.change_target_site_set(this_.center().site_set());
106 template <
typename S,
typename W,
typename I>
109 graph_window_piter<S,W,I>,
110 typename W::center_t >,
112 graph_window_piter<S,W,I> >
126 typedef mln_result(S::fun_t)
P;
149 template <typename Pref>
161 template <typename Pref>
170 template <typename Pref>
171 void init_(const
Window<W>& win, const Pref& p_ref);
173 template <typename Pref>
190 template <typename Pref>
194 template <typename S2, typename I2>
202 const graph_element&
element() const;
218 const S& target_site_set() const;
222 friend struct internal::impl_selector<typename W::center_t, mln_psite(W),
231 # ifndef MLN_INCLUDE_ONLY
234 template <
typename S,
typename W,
typename I>
242 template <
typename S,
typename W,
typename I>
243 template <
typename Pref>
251 mlc_is(center_t, mln_psite(W))::check();
256 template <
typename S,
typename W,
typename I>
257 template <
typename Pref>
260 const Site_Set<S>& target_site_set,
266 mlc_is_not(center_t, mln_psite(W))::check();
267 init_(win, target_site_set, p_ref);
270 template <
typename S,
typename W,
typename I>
271 template <
typename Pref>
277 this->center_at(p_ref);
280 mln_postcondition(!this->is_valid());
283 template <
typename S,
typename W,
typename I>
284 template <
typename Pref>
288 const Site_Set<S>& target_site_set,
291 this->center_at(p_ref);
293 change_target_site_set(
exact(target_site_set));
294 mln_postcondition(!this->is_valid());
298 template <
typename S,
typename W,
typename I>
303 return s_ != 0 && s_->is_valid() && iter_.is_valid();
306 template <
typename S,
typename W,
typename I>
314 template <
typename S,
typename W,
typename I>
322 template <
typename S,
typename W,
typename I>
323 template <
typename Pref>
328 iter_.center_at(c.p_hook_());
331 template <
typename S,
typename W,
typename I>
332 template <
typename S2,
typename I2>
337 iter_.center_at(c.hook_elt_());
340 template <
typename S,
typename W,
typename I>
343 graph_window_piter<S,W,I>::compute_p_()
const
345 return mln_psite(S)(target_site_set(), iter_.id());
348 template <
typename S,
typename W,
typename I>
350 const typename graph_window_piter<S,W,I>::graph_element&
356 template <
typename S,
typename W,
typename I>
364 template <
typename S,
typename W,
typename I>
370 mln_assertion(s_ != 0);
373 template <
typename S,
typename W,
typename I>
378 mln_precondition(s_ != 0);
379 mln_precondition(s_->is_valid());
384 # endif // ! MLN_INCLUDE_ONLY
388 #endif // ! MLN_CORE_IMAGE_GRAPH_WINDOW_PITER_HH