27 #ifndef MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH
28 # define MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH
34 # include <mln/core/concept/browsing.hh>
35 # include <mln/core/concept/image.hh>
94 void operator()(F& f)
const;
99 # ifndef MLN_INCLUDE_ONLY
101 # ifndef MLN_WO_GLOBAL_VARS
105 # endif // ! MLN_WO_GLOBAL_VARS
108 dir_struct_elt_incr_update_t::dir_struct_elt_incr_update_t()
112 template <
typename F>
115 dir_struct_elt_incr_update_t::operator()(F& f)
const
117 trace::entering(
"canvas::browsing::dir_struct_elt_incr_update");
118 mln_precondition(f.dir < f.dim);
119 typedef typename F::I I;
122 pmin = f.input.domain().pmin(),
123 pmax = f.input.domain().pmax();
125 typedef mln_deduce(I, site, coord) C;
127 pmin_dir = pmin[f.dir],
128 pmax_dir = pmax[f.dir],
129 pmin_dir_plus_half_length = static_cast<C>(pmin_dir + f.length / 2),
130 pmax_dir_minus_half_length = static_cast<C>(pmax_dir - f.length / 2);
151 std::cout <<
"init" << std::endl;
152 for (ct = pmin_dir; ct < pmin_dir_plus_half_length; ++ ct)
155 std::cout <<
'+' << pt <<
' ';
160 std::cout <<
"left" << std::endl;
161 for (p_dir = pmin_dir; p_dir <= pmin_dir_plus_half_length; ++p_dir, ++ct)
165 std::cout <<
'+' << pt <<
' ';
172 std::cout <<
"middle" << std::endl;
174 for (; p_dir <= pmax_dir_minus_half_length; ++cu, ++p_dir, ++ct)
178 std::cout <<
'+' << pt <<
' ';
183 std::cout <<
'-' << pu <<
' ';
190 std::cout <<
"right" << std::endl;
191 for (; p_dir <= pmax_dir; ++cu, ++p_dir)
195 std::cout <<
'-' << pu <<
' ';
203 for (
int c = F::dim - 1; c >= 0; --c)
207 if (f.p[c] != pmax[c])
214 }
while (f.p != pmin);
217 trace::exiting(
"canvas::browsing::dir_struct_elt_incr_update");
220 # endif // ! MLN_INCLUDE_ONLY
228 #endif // ! MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH