yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #10567
[Branch ~yade-pkg/yade/git-trunk] Rev 3834: Fix compilation with libqglviewer>=2.5.1
------------------------------------------------------------
revno: 3834
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Sat 2014-03-08 22:19:02 +0100
message:
Fix compilation with libqglviewer>=2.5.1
modified:
gui/qt4/GLViewer.cpp
gui/qt4/GLViewer.hpp
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-07 20:39:22 +0000
+++ gui/qt4/GLViewer.cpp 2014-03-08 21:19:02 +0000
@@ -25,7 +25,6 @@
#include<boost/algorithm/string/case_conv.hpp>
#include<yade/lib/serialization/ObjectIO.hpp>
#include<yade/lib/pyutil/gil.hpp>
-#include<QGLViewer/manipulatedFrame.h>
#include<QtGui/qevent.h>
using namespace boost;
=== modified file 'gui/qt4/GLViewer.hpp'
--- gui/qt4/GLViewer.hpp 2014-02-16 14:03:41 +0000
+++ gui/qt4/GLViewer.hpp 2014-03-08 21:19:02 +0000
@@ -10,6 +10,7 @@
#endif
#include<QGLViewer/qglviewer.h>
+#include<QGLViewer/manipulatedFrame.h>
#include<QGLViewer/constraint.h>
#include<set>
=== modified file 'gui/qt4/GLViewerMouse.cpp'
--- gui/qt4/GLViewerMouse.cpp 2014-01-06 13:57:32 +0000
+++ gui/qt4/GLViewerMouse.cpp 2014-03-08 21:19:02 +0000
@@ -36,15 +36,15 @@
#endif
void GLViewer::mouseMovesCamera(){
- camera()->frame()->setWheelSensitivity(-1.0f);
-
setWheelBinding(Qt::ShiftModifier , FRAME, ZOOM);
setWheelBinding(Qt::NoModifier, CAMERA, ZOOM);
#if QGLVIEWER_VERSION>=0x020500
+ manipulatedFrame()->setWheelSensitivity(-1.0f);
setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, SELECT);
- setMouseBinding(Qt::ShiftModifier, Qt::LeftButton | Qt::RightButton, FRAME, ZOOM);
+ 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);
@@ -53,8 +53,9 @@
setMouseBinding(Qt::NoModifier, Qt::LeftButton, CAMERA, ROTATE);
setMouseBinding(Qt::NoModifier, Qt::RightButton, CAMERA, TRANSLATE);
#else
+ camera()->frame()->setWheelSensitivity(-1.0f);
+
setMouseBinding(Qt::SHIFT + Qt::LeftButton, SELECT);
-
setMouseBinding(Qt::SHIFT + Qt::LeftButton + Qt::RightButton, FRAME, ZOOM);
setMouseBinding(Qt::SHIFT + Qt::MidButton, FRAME, TRANSLATE);
setMouseBinding(Qt::SHIFT + Qt::RightButton, FRAME, ROTATE);
@@ -102,7 +103,6 @@
#endif
switch (event->button()){
case Qt::LeftButton: manipulatedFrame()->alignWithFrame(NULL,true); LOG_DEBUG("Aligning cutting plane"); break;
- // case Qt::RightButton: projectOnLine(camera->position(), camera->viewDirection()); break;
default: break; // avoid warning
}
}
@@ -113,8 +113,6 @@
if(manipulatedClipPlane<0){ QGLViewer::wheelEvent(event); return; }
assert(manipulatedClipPlane<renderer->numClipPlanes);
float distStep=1e-3*sceneRadius();
- //const float wheelSensitivityCoef = 8E-4f;
- //Vec trans(0.0, 0.0, -event->delta()*wheelSensitivity()*wheelSensitivityCoef*(camera->position()-position()).norm());
float dist=event->delta()*manipulatedFrame()->wheelSensitivity()*distStep;
Vector3r normal=renderer->clipPlaneSe3[manipulatedClipPlane].orientation*Vector3r(0,0,1);
qglviewer::Vec newPos=manipulatedFrame()->position()+qglviewer::Vec(normal[0],normal[1],normal[2])*dist;