← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3690: Fix compilation with QGLViewer>=2.6.3

 

------------------------------------------------------------
revno: 3690
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2015-06-26 22:15:36 +0200
message:
  Fix compilation with QGLViewer>=2.6.3
modified:
  gui/qt4/GLViewer.cpp
  gui/qt4/GLViewer.hpp
  gui/qt4/GLViewerDisplay.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'gui/qt4/GLViewer.cpp'
--- gui/qt4/GLViewer.cpp	2015-02-24 14:03:18 +0000
+++ gui/qt4/GLViewer.cpp	2015-06-26 20:15:36 +0000
@@ -466,8 +466,11 @@
 
 boost::posix_time::ptime GLViewer::getLastUserEvent(){return last_user_event;};
 
-
+#if QGLVIEWER_VERSION>=0x020603
+qreal YadeCamera::zNear() const
+#else
 float YadeCamera::zNear() const
+#endif
 {
   float z = distanceToSceneCenter() - zClippingCoefficient()*sceneRadius()*(1.f-2*cuttingDistance);
 

=== modified file 'gui/qt4/GLViewer.hpp'
--- gui/qt4/GLViewer.hpp	2014-10-15 06:44:01 +0000
+++ gui/qt4/GLViewer.hpp	2015-06-26 20:15:36 +0000
@@ -151,7 +151,11 @@
 		float cuttingDistance;
         public :
 		YadeCamera():cuttingDistance(0){};
+#if QGLVIEWER_VERSION>=0x020603
+		virtual qreal zNear() const;
+#else
 		virtual float zNear() const;
+#endif
 		virtual void setCuttingDistance(float s){cuttingDistance=s;};
 };
 

=== modified file 'gui/qt4/GLViewerDisplay.cpp'
--- gui/qt4/GLViewerDisplay.cpp	2015-04-24 06:07:03 +0000
+++ gui/qt4/GLViewerDisplay.cpp	2015-06-26 20:15:36 +0000
@@ -82,7 +82,11 @@
 		int selection = selectedName();
 		if(selection!=-1 && (*(Omega::instance().getScene()->bodies)).exists(selection) && isMoving){
 			static Real lastTimeMoved(0);
+#if QGLVIEWER_VERSION>=0x020603
+			qreal v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
+#else
 			float v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
+#endif
 			if(last == selection) // delay by one redraw, so the body will not jump into 0,0,0 coords
 			{
 				Quaternionr& q = (*(Omega::instance().getScene()->bodies))[selection]->state->ori;
@@ -100,7 +104,11 @@
 		}
 		if(manipulatedClipPlane>=0){
 			assert(manipulatedClipPlane<renderer->numClipPlanes);
+#if QGLVIEWER_VERSION>=0x020603
+			qreal v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
+#else
 			float v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
+#endif
 			double q0,q1,q2,q3; manipulatedFrame()->getOrientation(q0,q1,q2,q3);
 			Se3r newSe3(Vector3r(v0,v1,v2),Quaternionr(q0,q1,q2,q3)); newSe3.orientation.normalize();
 			const Se3r& oldSe3=renderer->clipPlaneSe3[manipulatedClipPlane];