From fdfb58cf7e90341e6c18df9bc988c14ac6774e64 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Fri, 14 Dec 2018 16:43:31 +0100 Subject: [PATCH] added eigen conversion to point2 --- vcg/space/deprecated_point2.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vcg/space/deprecated_point2.h b/vcg/space/deprecated_point2.h index b93b49af..c95789a4 100644 --- a/vcg/space/deprecated_point2.h +++ b/vcg/space/deprecated_point2.h @@ -301,6 +301,18 @@ public: inline void Import( const Point2 & b ) { _v[0] = b.X(); _v[1] = b.Y(); + } + template + inline void FromEigenVector(const EigenVector & b) + { + _v[0] = ScalarType(b[0]); + _v[1] = ScalarType(b[1]); + } + template + inline void ToEigenVector(EigenVector & b) const + { + b[0]=_v[0]; + b[1]=_v[1]; } /// constructs a 2D points from an existing one of different type template