← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3842: Better fix for QGLviewer next version.

 

------------------------------------------------------------
revno: 3842
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Tue 2014-03-18 17:40:43 +0100
message:
  Better fix for QGLviewer next version.
modified:
  gui/qt4/GLViewer.cpp
  gui/qt4/GLViewerMouse.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	2014-03-08 21:19:02 +0000
+++ gui/qt4/GLViewer.cpp	2014-03-18 16:40:43 +0000
@@ -74,9 +74,10 @@
 	if(manipulatedFrame()==0) setManipulatedFrame(new qglviewer::ManipulatedFrame());
 
 	xyPlaneConstraint=shared_ptr<qglviewer::LocalConstraint>(new qglviewer::LocalConstraint());
-	//xyPlaneConstraint->setTranslationConstraint(qglviewer::AxisPlaneConstraint::AXIS,qglviewer::Vec(0,0,1));
-	//xyPlaneConstraint->setRotationConstraint(qglviewer::AxisPlaneConstraint::FORBIDDEN,qglviewer::Vec(0,0,1));
 	manipulatedFrame()->setConstraint(NULL);
+#if QGLVIEWER_VERSION>=0x020500
+  manipulatedFrame()->setWheelSensitivity(-1.0f);
+#endif
 
 	setKeyDescription(Qt::Key_A,"Toggle visibility of global axes.");
 	setKeyDescription(Qt::Key_C,"Set scene center so that all bodies are visible; if a body is selected, center around this body.");
@@ -95,12 +96,6 @@
 	setKeyDescription(Qt::Key_P,"Set wider field of view");
 	setKeyDescription(Qt::Key_R,"Revolve around scene center");
 	setKeyDescription(Qt::Key_V,"Save PDF of the current view to /tmp/yade-snapshot-0001.pdf (whichever number is available first). (Must be compiled with the gl2ps feature.)");
-#if 0
-	setKeyDescription(Qt::Key_Plus,    "Cut plane increase");
-	setKeyDescription(Qt::Key_Minus,   "Cut plane decrease");
-	setKeyDescription(Qt::Key_Slash,   "Cut plane step decrease");
-	setKeyDescription(Qt::Key_Asterisk,"Cut plane step increase");
-#endif
  	setPathKey(-Qt::Key_F1);
  	setPathKey(-Qt::Key_F2);
 	setKeyDescription(Qt::Key_Escape,"Manipulate scene (default)");
@@ -120,9 +115,6 @@
 	setKeyDescription(Qt::Key_Space,"Center scene (same as Alt-C); clip plane: activate/deactivate");
 
 	centerScene();
-
-	//connect(&GLGlobals::redrawTimer,SIGNAL(timeout()),this,SLOT(updateGL()));
-
 }
 
 bool GLViewer::isManipulating(){

=== modified file 'gui/qt4/GLViewerMouse.cpp'
--- gui/qt4/GLViewerMouse.cpp	2014-03-17 13:55:27 +0000
+++ gui/qt4/GLViewerMouse.cpp	2014-03-18 16:40:43 +0000
@@ -40,8 +40,6 @@
   setWheelBinding(Qt::NoModifier, CAMERA, ZOOM);
 
 #if QGLVIEWER_VERSION>=0x020500
-  if(manipulatedFrame()!=0) {
-    manipulatedFrame()->setWheelSensitivity(-1.0);
     setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, SELECT);
     
     setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, FRAME, ZOOM);
@@ -53,7 +51,6 @@
     setMouseBinding(Qt::NoModifier, Qt::MidButton, CAMERA, ZOOM);
     setMouseBinding(Qt::NoModifier, Qt::LeftButton, CAMERA, ROTATE);
     setMouseBinding(Qt::NoModifier, Qt::RightButton, CAMERA, TRANSLATE);
-  }
 #else
   camera()->frame()->setWheelSensitivity(-1.0f);