From 8092604ab55339d882ba7ae436e9974c3db6a564 Mon Sep 17 00:00:00 2001
From: jcarpent <jcarpent@laas.fr>
Date: Tue, 17 Oct 2017 21:38:13 +0200
Subject: [PATCH] =?UTF-8?q?[Geometry]=C2=A0Make=20Quaternion=20with=20newe?=
 =?UTF-8?q?st=20versions=20of=20Eigen?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/quaternion.hpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/quaternion.hpp b/src/quaternion.hpp
index 811bb50d..b35a7672 100644
--- a/src/quaternion.hpp
+++ b/src/quaternion.hpp
@@ -71,16 +71,16 @@ namespace eigenpy
             "The [] operator numbers them differently, 0...4 for *x* *y* *z* *w*!"))
       
       .add_property("x",
-                    (Scalar (Quaternion::*)()const)&Quaternion::x,
+                    &QuaternionVisitor::getCoeff<0>,
                     &QuaternionVisitor::setCoeff<0>,"The x coefficient.")
       .add_property("y",
-                    (Scalar (Quaternion::*)()const)&Quaternion::y,
+                    &QuaternionVisitor::getCoeff<1>,
                     &QuaternionVisitor::setCoeff<1>,"The y coefficient.")
       .add_property("z",
-                    (Scalar (Quaternion::*)()const)&Quaternion::z,
+                    &QuaternionVisitor::getCoeff<2>,
                     &QuaternionVisitor::setCoeff<2>,"The z coefficient.")
       .add_property("w",
-                    (Scalar (Quaternion::*)()const)&Quaternion::w,
+                    &QuaternionVisitor::getCoeff<3>,
                     &QuaternionVisitor::setCoeff<3>,"The w coefficient.")
       
 //      .def("isApprox",(bool (Quaternion::*)(const Quaternion &))&Quaternion::template isApprox<Quaternion>,
@@ -151,6 +151,9 @@ namespace eigenpy
     template<int i>
     static void setCoeff(Quaternion & self, Scalar value) { self.coeffs()[i] = value; }
     
+    template<int i>
+    static Scalar getCoeff(Quaternion & self) { return self.coeffs()[i]; }
+    
     static Quaternion & setFromTwoVectors(Quaternion & self, const Vector3 & a, const Vector3 & b)
     { return self.setFromTwoVectors(a,b); }
     
-- 
GitLab