
* mln/topo/is_simple_cell.hh (mln::topo::is_simple_cell<I, N, NL, NH>::operator()): Replace ad hoc code by a call to is_facet. --- milena/ChangeLog | 8 ++++++++ milena/mln/topo/is_simple_cell.hh | 21 +++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index f1da3f6..06b0478 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,13 @@ 2011-02-24 Roland Levillain <roland@lrde.epita.fr> + Revamp mln::topo::is_simple_cell. + + * mln/topo/is_simple_cell.hh + (mln::topo::is_simple_cell<I, N, NL, NH>::operator()): + Replace ad hoc code by a call to is_facet. + +2011-02-24 Roland Levillain <roland@lrde.epita.fr> + Have is_facet take into account the values of a (complex) image. * mln/topo/is_facet.hh (mln::topo::is_facet): Take a binary image diff --git a/milena/mln/topo/is_simple_cell.hh b/milena/mln/topo/is_simple_cell.hh index 0cf50fb..8796c16 100644 --- a/milena/mln/topo/is_simple_cell.hh +++ b/milena/mln/topo/is_simple_cell.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -38,6 +39,7 @@ # include <mln/core/image/complex_neighborhoods.hh> # include <mln/core/image/complex_neighborhood_piter.hh> +# include <mln/topo/is_facet.hh> # include <mln/make/attachment.hh> @@ -132,21 +134,12 @@ namespace mln // FIXME: Introduce `const I& ima = *ima_;' and use it instead of // `ima_'. Or introduce an `ima()' accessor? - // FIXME: We should be using topo::is_facet, but this routine is - // too naive, and does not take the values of the image into - // account. + // The cell corresponding to P cannot be simple unless P is + // facet. { - // This (part of) ``algorithm'' considers that looking for - // faces of dimension n+1 is enough (which is the case - // if the image is a complex). NH higher_adj_nbh; - mln_niter(NH) n(higher_adj_nbh, p); - for_all(n) - // If the higher-dim-faces neighborhood is not empty, then P - // is included in a face of higher dimension. - if (ima_->has(n) && (*ima_)(n)) - return false; - // Otherwise, F is a facet; continue. + if (!is_facet(*ima_, p, higher_adj_nbh)) + return false; } typedef p_set<mln_psite(I)> faces_t; -- 1.5.6.5