added ToEigenVector function to Point2 with templated return type

This commit is contained in:
Luigi Malomo 2020-03-03 19:14:45 +01:00
parent e9737e93f3
commit 5c21b15d36
1 changed files with 8 additions and 0 deletions

View File

@ -325,6 +325,14 @@ public:
b[0]=_v[0];
b[1]=_v[1];
}
template <class EigenVector>
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 <class T>
static Point2 Construct( const Point2<T> & b )