last-svn-commit-211-ga47828e Have topo::is_n_face take a psite type as class parameter.

* mln/topo/is_n_face.hh: Here, so that the argument of this functor (e.g., an iterator) is always converted to the psite type. * apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc, * apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc, * apps/mesh-segm-skel/mesh-complex-skel.cc: Adjust. --- milena/ChangeLog | 12 ++++++++++++ .../mesh-segm-skel/mesh-complex-max-curv-skel.cc | 2 +- .../mesh-segm-skel/mesh-complex-pinv-curv-skel.cc | 2 +- milena/apps/mesh-segm-skel/mesh-complex-skel.cc | 2 +- milena/mln/topo/is_n_face.hh | 16 ++++++++-------- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 11924f1..e0532ab 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,15 @@ +2010-09-19 Roland Levillain <roland@lrde.epita.fr> + + Have topo::is_n_face take a psite type as class parameter. + + * mln/topo/is_n_face.hh: Here, so that the argument of this + functor (e.g., an iterator) is always converted to the psite + type. + * apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc, + * apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc, + * apps/mesh-segm-skel/mesh-complex-skel.cc: + Adjust. + 2010-09-17 Roland Levillain <roland@lrde.epita.fr> Aesthetic changes in thinning algorithms. diff --git a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc index 5c17726..edb943e 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc @@ -261,7 +261,7 @@ main(int argc, char* argv[]) As a workaround, we use the constraint predicate of the skeleton routine to restrict the iteration to 2-cells. */ - mln::topo::is_n_face<bin_ima_t::dim> constraint_p; + mln::topo::is_n_face<mln_psite_(bin_ima_t), bin_ima_t::dim> constraint_p; bin_ima_t skel = mln::topo::skeleton::breadth_first_thinning(surface, nbh, is_simple_p, diff --git a/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc b/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc index 7092b18..e2bdf45 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc @@ -266,7 +266,7 @@ main(int argc, char* argv[]) As a workaround, we use the constraint predicate of the skeleton routine to restrict the iteration to 2-cells. */ - mln::topo::is_n_face<bin_ima_t::dim> constraint_p; + mln::topo::is_n_face<mln_psite_(bin_ima_t), bin_ima_t::dim> constraint_p; bin_ima_t skel = mln::topo::skeleton::breadth_first_thinning(surface, nbh, is_simple_p, diff --git a/milena/apps/mesh-segm-skel/mesh-complex-skel.cc b/milena/apps/mesh-segm-skel/mesh-complex-skel.cc index f5a7f11..b8b7da8 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-skel.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-skel.cc @@ -219,7 +219,7 @@ main(int argc, char* argv[]) As a workaround, we use the constraint predicate of the skeleton routine to restrict the iteration to 2-cells. */ - mln::topo::is_n_face<bin_ima_t::dim> constraint_p; + mln::topo::is_n_face<mln_psite_(bin_ima_t), bin_ima_t::dim> constraint_p; bin_ima_t skel = mln::topo::skeleton::breadth_first_thinning(surface, nbh, is_simple_p, diff --git a/milena/mln/topo/is_n_face.hh b/milena/mln/topo/is_n_face.hh index bc9aa71..ab696c1 100644 --- a/milena/mln/topo/is_n_face.hh +++ b/milena/mln/topo/is_n_face.hh @@ -41,26 +41,26 @@ namespace mln { // Forward declaration. - template <unsigned N> struct is_n_face; + template <typename P, unsigned N> + struct is_n_face; - /// A functor testing wheter a mln::complex_psite is an \p N -face. - template <unsigned N> - struct is_n_face : public mln::Function_v2b< is_n_face<N> > + /// A functor testing wheter a psite (presumably an + /// mln::complex_psite) is an \p N -face. + template <typename P, unsigned N> + struct is_n_face : public mln::Function_v2b< is_n_face<P, N> > { typedef bool result; - template <typename P> bool operator()(const P& p) const; }; # ifndef MLN_INCLUDE_ONLY - template <unsigned N> - template <typename P> + template <typename P, unsigned N> inline bool - is_n_face<N>::operator()(const P& p) const + is_n_face<P, N>::operator()(const P& p) const { return p.n() == N; } -- 1.5.6.5
participants (1)
-
Roland Levillain