28 #include <mln/value/int_u8.hh>
29 #include <mln/core/alias/point2d.hh>
31 #include <mln/core/site_set/p_faces.hh>
32 #include <mln/core/image/complex_image.hh>
35 #include <mln/core/image/complex_neighborhoods.hh>
36 #include <mln/core/image/complex_neighborhood_piter.hh>
43 template <
typename I,
typename N>
46 const std::string& comment);
107 geom.add_location(
point2d(2,0));
108 geom.add_location(
point2d(2,2));
109 geom.add_location(
point2d(0,3));
139 faces_psite<0, D, G> fs0(pf0, v0);
140 faces_psite<1, D, G> fs1(pf1, e0);
141 faces_psite<2, D, G> fs2(pf2, t0);
155 metal::vec<D + 1, std::vector< int_u8 > > values;
157 for (
unsigned d = 0; d <= D; ++d)
158 for (
unsigned n = 0; n < pc.cplx().nfaces_of_dim(d); ++n)
159 values[d].push_back(d);
162 ima_t ima(pc, values);
165 mln_assertion(ima(cs) == 1u);
176 mln_fwd_piter_(ima_t) fp(ima.domain());
178 std::cout << "ima(" << fp << ") = " << ima(fp) << std::endl;
179 std::cout << std::endl;
181 mln_bkd_piter_(ima_t) bp(ima.domain());
183 std::cout << "ima(" << bp << ") = " << ima(bp) << std::endl;
184 std::cout << std::endl;
192 for (
unsigned n = 0; n <= D; ++n)
196 for_all_2(fwd_np, bkd_np)
197 std::cout << "ima(" << fwd_np << ") = " << ima(fwd_np) << '\t'
198 << "ima(" << bkd_np << ") = " << ima(bkd_np)
200 std::cout << std::endl;
209 std::cout << "ima(" << f0p << ") = " << ima(f0p) << std::endl;
223 "Lower-dimension faces");
225 "Higher-dimension faces");
227 "Lower- and higer-dimension faces");
229 test_neighborhood(ima,
231 "Lower-dimension connected n-faces");
232 test_neighborhood(ima,
234 "Higher-dimension connected n-faces");
266 template <
typename I,
typename N>
269 const std::string& comment)
271 const I& ima =
exact(ima_);
272 mln_fwd_piter(I) fp(ima.domain());
274 mln_fwd_niter(N) fn(nbh, fp);
275 mln_bkd_niter(N) bn(nbh, fp);
278 std::cout << comment <<
" adjacent to " << fp << std::endl;
281 mln_assertion((fn.center() ==
static_cast<const mln_psite(I)&
>(fp)));
282 mln_assertion((bn.center() ==
static_cast<const mln_psite(I)&
>(fp)));
283 std::cout <<
" " << fn <<
'\t' << bn << std::endl;
286 std::cout << std::endl;