https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
Fix conflict in point.hh.
* mln/core/point.hh (operator algebra::vec<M,float>:
Fail if point coordinate type is already float.
point.hh | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Index: mln/core/point.hh
--- mln/core/point.hh (revision 2090)
+++ mln/core/point.hh (working copy)
@@ -38,6 +38,7 @@
# include <mln/fun/i2v/all_to.hh>
# include <mln/metal/bool.hh>
+# include <mln/metal/is_not.hh>
# include <mln/algebra/vec.hh>
# include <mln/metal/converts_to.hh>
# include <mln/core/h_vec.hh>
@@ -62,7 +63,7 @@
template <typename M, typename C>
struct point_to_
{
- typedef algebra::vec<M::dim, C> metal_vec;
+ typedef algebra::vec<M::dim, C> algebra_vec;
typedef mln::h_vec<M::dim, C> h_vec;
};
@@ -146,7 +147,7 @@
typedef algebra::vec<M::dim, C> vec_t;
/// Hook to coordinates.
- operator typename internal::point_to_<M, C>::metal_vec () const;
+ operator typename internal::point_to_<M, C>::algebra_vec () const;
operator algebra::vec<M::dim, float> () const;
/// Transform to point in homogene coordinate system.
@@ -303,19 +304,22 @@
return *this;
}
+
template <typename M, typename C>
inline
- point_<M,C>::operator typename internal::point_to_<M, C>::metal_vec
() const
+ point_<M,C>::operator typename internal::point_to_<M, C>::algebra_vec
() const
{
return coord_; // FIXME: Is-it OK?
}
+
template <typename M, typename C>
inline
point_<M,C>::operator algebra::vec<M::dim, float> () const
{
+ mlc_is_not(C,float)::check();
algebra::vec<dim, float> tmp;
- for (unsigned i = 0; i < dim; ++i)
+ for (unsigned int i = 0; i < dim; ++i)
tmp[i] = coord_[i];
return tmp;
}