Skip to content
Permalink
Browse files

Mouse wheel zoom

  • Loading branch information
pka committed Oct 6, 2010
1 parent 2fa95c4 commit 3ada3ae1ec88bebc55a3c33afad861b88cefaba9
Showing with 8 additions and 6 deletions.
  1. +2 −6 src/plugins/globe/globe_plugin.cpp
  2. +5 −0 src/plugins/globe/qgsosgviewer.cpp
  3. +1 −0 src/plugins/globe/qgsosgviewer.h
@@ -117,17 +117,13 @@ void GlobePlugin::run()
// The MapNode will render the Map object in the scene graph.
mMapNode = new osgEarth::MapNode( map );

viewer.setSceneData( mMapNode );

// Set a home viewpoint
manip->setHomeViewpoint(
osgEarthUtil::Viewpoint( osg::Vec3d( -90, 0, 0 ), 0.0, -90.0, 4e7 ),
1.0 );

viewer.setSceneData( mMapNode );

manip->getSettings()->bindMouseDoubleClick(
osgEarthUtil::EarthManipulator::ACTION_GOTO,
osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON );

// add our fly-to handler
viewer.addEventHandler(new FlyToExtentHandler( manip, mQGisIface ));

@@ -87,6 +87,11 @@ void QgsGLWidgetAdapter::mouseMoveEvent( QMouseEvent* event )
}


void QgsGLWidgetAdapter::wheelEvent(QWheelEvent *event)
{
_gw->getEventQueue()->mouseScroll((event->delta()>0) ? osgGA::GUIEventAdapter::SCROLL_UP : osgGA::GUIEventAdapter::SCROLL_DOWN);
}

// int mainAdapterWidget(QApplication& a, osg::ArgumentParser& arguments)
// {
// // load the scene.
@@ -48,6 +48,7 @@ class QgsGLWidgetAdapter : public QGLWidget
virtual void mousePressEvent( QMouseEvent* event );
virtual void mouseReleaseEvent( QMouseEvent* event );
virtual void mouseMoveEvent( QMouseEvent* event );
virtual void wheelEvent( QWheelEvent * event );

osg::ref_ptr<osgViewer::GraphicsWindowEmbedded> _gw;
};

0 comments on commit 3ada3ae

Please sign in to comment.
You can’t perform that action at this time.