← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3841: Set mouse parameters, only if frame is created.

 

------------------------------------------------------------
revno: 3841
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2014-03-17 14:55:27 +0100
message:
  Set mouse parameters, only if frame is created.
  
  Thanks Bruno for discussion.
  http://www.mail-archive.com/yade-dev@xxxxxxxxxxxxxxxxxxx/msg09909.html
modified:
  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/GLViewerMouse.cpp'
--- gui/qt4/GLViewerMouse.cpp	2014-03-15 15:30:36 +0000
+++ gui/qt4/GLViewerMouse.cpp	2014-03-17 13:55:27 +0000
@@ -40,19 +40,20 @@
   setWheelBinding(Qt::NoModifier, CAMERA, ZOOM);
 
 #if QGLVIEWER_VERSION>=0x020500
-	if(manipulatedFrame()==0) setManipulatedFrame(new qglviewer::ManipulatedFrame());
-  manipulatedFrame()->setWheelSensitivity(-1.0);
-  setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, SELECT);
-  
-  setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, FRAME, ZOOM);
-  setMouseBinding(Qt::ShiftModifier, Qt::RightButton, FRAME, ZOOM);
-  setMouseBinding(Qt::ShiftModifier, Qt::MidButton, FRAME, TRANSLATE);
-  setMouseBinding(Qt::ShiftModifier, Qt::RightButton, FRAME, ROTATE);
+  if(manipulatedFrame()!=0) {
+    manipulatedFrame()->setWheelSensitivity(-1.0);
+    setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, SELECT);
     
-  setMouseBinding(Qt::NoModifier, Qt::RightButton, CAMERA, ZOOM);
-  setMouseBinding(Qt::NoModifier, Qt::MidButton, CAMERA, ZOOM);
-  setMouseBinding(Qt::NoModifier, Qt::LeftButton, CAMERA, ROTATE);
-  setMouseBinding(Qt::NoModifier, Qt::RightButton, CAMERA, TRANSLATE);
+    setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, FRAME, ZOOM);
+    setMouseBinding(Qt::ShiftModifier, Qt::RightButton, FRAME, ZOOM);
+    setMouseBinding(Qt::ShiftModifier, Qt::MidButton, FRAME, TRANSLATE);
+    setMouseBinding(Qt::ShiftModifier, Qt::RightButton, FRAME, ROTATE);
+      
+    setMouseBinding(Qt::NoModifier, Qt::RightButton, CAMERA, ZOOM);
+    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);