Skip to content

Commit 13cc17d

Browse files
committed
Fix more globe warnings
1 parent f037766 commit 13cc17d

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/plugins/globe/globe_plugin.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
7676
viewer(),
7777
mQDockWidget( tr( "Globe" ) ),
7878
mSettingsDialog( &viewer, theQgisInterface->mainWindow(), QgisGui::ModalDialogFlags ),
79-
mTileSource( 0 ),
8079
mQgisMapLayer( 0 ),
80+
mTileSource( 0 ),
8181
mElevationManager( NULL ),
8282
mObjectPlacer( NULL )
8383
{
@@ -97,7 +97,7 @@ GlobePlugin::~GlobePlugin()
9797
struct PanControlHandler : public NavigationControlHandler
9898
{
9999
PanControlHandler( osgEarth::Util::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }
100-
virtual void onMouseDown( Control* control, int mouseButtonMask )
100+
virtual void onMouseDown( Control* /*control*/, int /*mouseButtonMask*/ )
101101
{
102102
_manip->pan( _dx, _dy );
103103
}
@@ -110,7 +110,7 @@ struct PanControlHandler : public NavigationControlHandler
110110
struct RotateControlHandler : public NavigationControlHandler
111111
{
112112
RotateControlHandler( osgEarth::Util::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }
113-
virtual void onMouseDown( Control* control, int mouseButtonMask )
113+
virtual void onMouseDown( Control* /*control*/, int /*mouseButtonMask*/ )
114114
{
115115
if ( 0 == _dx && 0 == _dy )
116116
{
@@ -130,7 +130,7 @@ struct RotateControlHandler : public NavigationControlHandler
130130
struct ZoomControlHandler : public NavigationControlHandler
131131
{
132132
ZoomControlHandler( osgEarth::Util::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }
133-
virtual void onMouseDown( Control* control, int mouseButtonMask )
133+
virtual void onMouseDown( Control* /*control*/, int /*mouseButtonMask*/ )
134134
{
135135
_manip->zoom( _dx, _dy );
136136
}
@@ -143,7 +143,7 @@ struct ZoomControlHandler : public NavigationControlHandler
143143
struct HomeControlHandler : public NavigationControlHandler
144144
{
145145
HomeControlHandler( osgEarth::Util::EarthManipulator* manip ) : _manip( manip ) { }
146-
virtual void onClick( Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
146+
virtual void onClick( Control* /*control*/, int /*mouseButtonMask*/, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
147147
{
148148
_manip->home( ea, aa );
149149
}
@@ -154,7 +154,7 @@ struct HomeControlHandler : public NavigationControlHandler
154154
struct RefreshControlHandler : public ControlEventHandler
155155
{
156156
RefreshControlHandler( GlobePlugin* globe ) : mGlobe( globe ) { }
157-
virtual void onClick( Control* control, int mouseButtonMask )
157+
virtual void onClick( Control* /*control*/, int /*mouseButtonMask*/ )
158158
{
159159
mGlobe->layersChanged();
160160
}
@@ -165,7 +165,7 @@ struct RefreshControlHandler : public ControlEventHandler
165165
struct SyncExtentControlHandler : public ControlEventHandler
166166
{
167167
SyncExtentControlHandler( GlobePlugin* globe ) : mGlobe( globe ) { }
168-
virtual void onClick( Control* control, int mouseButtonMask )
168+
virtual void onClick( Control* /*control*/, int /*mouseButtonMask*/ )
169169
{
170170
mGlobe->syncExtent();
171171
}
@@ -838,6 +838,8 @@ bool NavigationControl::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActi
838838
}
839839
_mouse_down_event = NULL;
840840
break;
841+
default:
842+
/* ignore */;
841843
}
842844
if ( _mouse_down_event )
843845
{
@@ -854,7 +856,7 @@ bool NavigationControl::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActi
854856
return Control::handle( ea, aa, cx );
855857
}
856858

857-
bool KeyboardControlHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
859+
bool KeyboardControlHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/ )
858860
{
859861
/*
860862
osgEarth::Util::EarthManipulator::Settings* _manipSettings = _manip->getSettings();
@@ -961,7 +963,7 @@ bool KeyboardControlHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GU
961963
return false;
962964
}
963965

964-
bool FlyToExtentHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
966+
bool FlyToExtentHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/ )
965967
{
966968
if ( ea.getEventType() == ea.KEYDOWN && ea.getKey() == '1' )
967969
{
@@ -1002,6 +1004,7 @@ bool QueryCoordinatesHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::G
10021004
osg::Vec3d QueryCoordinatesHandler::getCoords( float x, float y, osgViewer::View* view, bool getElevation )
10031005
{
10041006
osgUtil::LineSegmentIntersector::Intersections results;
1007+
osg::Vec3d coords;
10051008
if ( view->computeIntersections( x, y, results, 0x01 ) )
10061009
{
10071010
// find the first hit under the mouse:
@@ -1041,9 +1044,9 @@ osg::Vec3d QueryCoordinatesHandler::getCoords( float x, float y, osgViewer::View
10411044
}
10421045
}
10431046

1044-
osg::Vec3d coords = osg::Vec3d( lon_deg, lat_deg, elevation );
1045-
return coords;
1047+
coords = osg::Vec3d( lon_deg, lat_deg, elevation );
10461048
}
1049+
return coords;
10471050
}
10481051

10491052
/**

src/plugins/globe/qgsosgviewer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class QgsOsgViewer : public osgViewer::Viewer, public QgsGLWidgetAdapter
9696

9797
virtual void paintGL()
9898
{
99-
frame();
99+
if ( isVisible() ) frame();
100100
}
101101

102102
protected:

0 commit comments

Comments
 (0)