3299: Small changes in transformation related classes.

* mln/algebra/quat.hh: use mln_precondition instead of assert. * mln/core/image/interpolated.hh: add a fixme. * mln/fun/x2x/translation.hh: add a missing accessor to the translation vector. * mln/transform/internal/closest_point_functor.hh: fix wrong update of the closest point image. --- milena/ChangeLog | 14 ++++++++++++++ milena/mln/algebra/quat.hh | 2 +- milena/mln/core/image/interpolated.hh | 1 + milena/mln/fun/x2x/translation.hh | 11 +++++++++++ .../transform/internal/closest_point_functor.hh | 2 +- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 25aa240..8960f74 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,4 +1,18 @@ 2009-02-05 Guillaume Lazzara <z@lrde.epita.fr> + + Small changes in transformation related classes. + + * mln/algebra/quat.hh: use mln_precondition instead of assert. + + * mln/core/image/interpolated.hh: add a fixme. + + * mln/fun/x2x/translation.hh: add a missing accessor to the + translation vector. + + * mln/transform/internal/closest_point_functor.hh: fix wrong update of + the closest point image. + +2009-02-05 Guillaume Lazzara <z@lrde.epita.fr> Fix make::h_mat. diff --git a/milena/mln/algebra/quat.hh b/milena/mln/algebra/quat.hh index 9dee769..33e7d07 100644 --- a/milena/mln/algebra/quat.hh +++ b/milena/mln/algebra/quat.hh @@ -410,7 +410,7 @@ namespace mln inline quat quat::inv() const { - assert(! is_null()); + mln_precondition(! is_null()); float f = norm::l2(v_); return conj().to_vec() / (f * f); } diff --git a/milena/mln/core/image/interpolated.hh b/milena/mln/core/image/interpolated.hh index 5b37eb5..70250f6 100644 --- a/milena/mln/core/image/interpolated.hh +++ b/milena/mln/core/image/interpolated.hh @@ -105,6 +105,7 @@ namespace mln /// Constructors. + ///FIXME: don't we want a 'const' here? interpolated(I& ima); interpolated(); diff --git a/milena/mln/fun/x2x/translation.hh b/milena/mln/fun/x2x/translation.hh index 6d1e707..4101d77 100644 --- a/milena/mln/fun/x2x/translation.hh +++ b/milena/mln/fun/x2x/translation.hh @@ -75,6 +75,9 @@ namespace mln /// Set a net translation vector. void set_t(const algebra::vec<n,C>& t); + /// Return the translation vector. + const algebra::vec<n,C>& t() const; + protected: void update(); @@ -127,6 +130,14 @@ namespace mln template <unsigned n, typename C> inline + const algebra::vec<n,C>& + translation<n,C>::t() const + { + return this->t_; + } + + template <unsigned n, typename C> + inline void translation<n,C>::update() { diff --git a/milena/mln/transform/internal/closest_point_functor.hh b/milena/mln/transform/internal/closest_point_functor.hh index 02b3401..eff0e96 100644 --- a/milena/mln/transform/internal/closest_point_functor.hh +++ b/milena/mln/transform/internal/closest_point_functor.hh @@ -98,7 +98,7 @@ namespace mln inline void closest_point_functor<I>::process(const P& p, const P& n) { - cp_ima(n) = p; + cp_ima(n) = cp_ima(p); } # endif // ! MLN_INCLUDE_ONLY -- 1.5.6.5
participants (1)
-
Guillaume Lazzara