From 4f5a0b72578050c1967903e7c74765288e6686f7 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Fri, 7 Feb 2020 15:25:11 +0100 Subject: [PATCH] added ToEigenVector function to Point3 with templated return type --- vcg/space/deprecated_point3.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vcg/space/deprecated_point3.h b/vcg/space/deprecated_point3.h index 0ddb3f39..1468e9bb 100644 --- a/vcg/space/deprecated_point3.h +++ b/vcg/space/deprecated_point3.h @@ -186,6 +186,16 @@ public: b[1]=_v[1] ; b[2]=_v[2] ; } + template + inline EigenVector ToEigenVector(void) const + { + assert(EigenVector::RowsAtCompileTime == 3 || EigenVector::RowsAtCompileTime == 4); + EigenVector b = EigenVector::Zero(); + b[0]=_v[0]; + b[1]=_v[1]; + b[2]=_v[2]; + return b; + } template static inline Point3 Construct( const Point3 & b ) {