From 614e0442d74a79f886b05683eae0910c43b5229b Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 24 Feb 2012 11:07:41 +0100 Subject: [PATCH 1/2] 0000607: Holding down middle mouse button (wheel) will zoom out without scrolling --- src/Gui/NavigationStyle.cpp | 2 -- src/Gui/View3DInventorViewer.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index 883183fc1..34bec5184 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -715,8 +715,6 @@ void NavigationStyle::zoomByCursor(const SbVec2f & thispos, const SbVec2f & prev void NavigationStyle::doZoom(SoCamera* camera, SbBool forward, const SbVec2f& pos) { - if (this->button3down) - return; SbBool zoomAtCur = this->zoomAtCursor; if (zoomAtCur) { const SbViewportRegion & vp = viewer->getViewportRegion(); diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 391cc25bb..1b5ab3af0 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -74,6 +74,7 @@ # include # include # include +# include # include # include # include @@ -1033,6 +1034,14 @@ void View3DInventorViewer::selectAll() */ void View3DInventorViewer::processEvent(QEvent * event) { + // Bug #0000607: Some mices also support horizontal scrolling which however might + // lead to some unwanted zooming when pressing the MMB for panning. + // Thus, we filter out horizontal scrolling. + if (event->type() == QEvent::Wheel) { + QWheelEvent* we = static_cast(event); + if (we->orientation() == Qt::Horizontal) + return; + } if (event->type() == QEvent::KeyPress) { QKeyEvent* ke = static_cast(event); if (ke->matches(QKeySequence::SelectAll)) { From 30b703c072e360294db1b250e148eabb51734f6a Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 24 Feb 2012 12:28:09 +0100 Subject: [PATCH 2/2] Respect placement information when exporting several meshes at once --- src/Mod/Mesh/App/AppMeshPy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Mesh/App/AppMeshPy.cpp b/src/Mod/Mesh/App/AppMeshPy.cpp index e0290fcc9..de9b2645c 100644 --- a/src/Mod/Mesh/App/AppMeshPy.cpp +++ b/src/Mod/Mesh/App/AppMeshPy.cpp @@ -165,10 +165,12 @@ static PyObject * exporter(PyObject *self, PyObject *args) App::DocumentObject* obj = static_cast(item)->getDocumentObjectPtr(); if (obj->getTypeId().isDerivedFrom(meshId)) { const MeshObject& mesh = static_cast(obj)->Mesh.getValue(); + MeshCore::MeshKernel kernel = mesh.getKernel(); + kernel.Transform(mesh.getTransform()); if (global_mesh.countFacets() == 0) - global_mesh = mesh; + global_mesh.setKernel(kernel); else - global_mesh.addMesh(mesh); + global_mesh.addMesh(kernel); } else if (obj->getTypeId().isDerivedFrom(partId)) { App::Property* shape = obj->getPropertyByName("Shape");