From 5c21b15d3687b57133aa67f5b540b4e318da4bc1 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Tue, 3 Mar 2020 19:14:45 +0100 Subject: [PATCH] added ToEigenVector function to Point2 with templated return type --- vcg/space/deprecated_point2.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vcg/space/deprecated_point2.h b/vcg/space/deprecated_point2.h index 81e70f4e..8085d6ed 100644 --- a/vcg/space/deprecated_point2.h +++ b/vcg/space/deprecated_point2.h @@ -325,6 +325,14 @@ public: b[0]=_v[0]; b[1]=_v[1]; } + template + inline EigenVector ToEigenVector(void) const + { + assert(EigenVector::RowsAtCompileTime == 2); + EigenVector b; + b << _v[0], _v[1]; + return b; + } /// constructs a 2D points from an existing one of different type template static Point2 Construct( const Point2 & b )