@@ -104,28 +104,6 @@ void GlobePlugin::initGui()
104
104
this , SLOT ( layersChanged () ) );
105
105
}
106
106
107
- struct MyClickHandler : public ControlEventHandler
108
- {
109
- void onClick ( Control* control, int mouseButtonMask)
110
- {
111
- OE_NOTICE << " Thank you for clicking on " << typeid (control).name ()
112
- << std::endl;
113
- }
114
- };
115
-
116
- struct PanControlHandler : public NavigationControlHandler
117
- {
118
- PanControlHandler ( osgEarthUtil::EarthManipulator* manip, double dx, double dy ) : _manip(manip), _dx(dx), _dy(dy) { }
119
- virtual void onMouseDown ( Control* control, int mouseButtonMask )
120
- {
121
- _manip->pan ( _dx, _dy );
122
- }
123
- private:
124
- osg::observer_ptr<osgEarthUtil::EarthManipulator> _manip;
125
- double _dx;
126
- double _dy;
127
- };
128
-
129
107
130
108
void GlobePlugin::run ()
131
109
{
@@ -274,6 +252,28 @@ void GlobePlugin::setupMap()
274
252
#endif
275
253
}
276
254
255
+ struct MyClickHandler : public ControlEventHandler
256
+ {
257
+ void onClick ( Control* control, int mouseButtonMask)
258
+ {
259
+ OE_NOTICE << " Thank you for clicking on " << typeid (control).name ()
260
+ << std::endl;
261
+ }
262
+ };
263
+
264
+ struct PanControlHandler : public NavigationControlHandler
265
+ {
266
+ PanControlHandler ( osgEarthUtil::EarthManipulator* manip, double dx, double dy ) : _manip(manip), _dx(dx), _dy(dy) { }
267
+ virtual void onMouseDown ( Control* control, int mouseButtonMask )
268
+ {
269
+ _manip->pan ( _dx, _dy );
270
+ }
271
+ private:
272
+ osg::observer_ptr<osgEarthUtil::EarthManipulator> _manip;
273
+ double _dx;
274
+ double _dy;
275
+ };
276
+
277
277
void GlobePlugin::setupControls ()
278
278
{
279
279
@@ -554,57 +554,12 @@ void GlobePlugin::copyFolder(QString sourceFolder, QString destFolder)
554
554
555
555
bool FlyToExtentHandler::handle ( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
556
556
{
557
- float deg = 3.14159 / 180 ;
558
-
559
- // this should be the way to implement this I think, but it segfaults...
560
- // TODO: put this in the correct place, here is ok for now to test
561
- // _manipSettings.bindKey(osgEarthUtil::EarthManipulator::ACTION_ZOOM_IN, osgGA::GUIEventAdapter::KEY_Page_Up);
562
- // _manip->applySettings( _manipSettings );
563
-
564
-
565
557
if ( ea.getEventType () == ea.KEYDOWN && ea.getKey () == ' 1' )
566
-
567
558
{
568
559
QgsPoint center = mQGisIface ->mapCanvas ()->extent ().center ();
569
560
osgEarthUtil::Viewpoint viewpoint ( osg::Vec3d ( center.x (), center.y (), 0.0 ), 0.0 , -90.0 , 1e4 );
570
561
_manip->setViewpoint ( viewpoint, 4.0 );
571
562
}
572
-
573
-
574
- /* if ( ea.getEventType() == ea.KEYDOWN && ea.getKey() == '4' )
575
- {
576
- _manip->pan(-1,0);
577
- }
578
- if ( ea.getEventType() == ea.KEYDOWN && ea.getKey() == '6' )
579
- {
580
- _manip->pan(1,0);
581
- }
582
- if ( ea.getEventType() == ea.KEYDOWN && ea.getKey() == '8' )
583
- {
584
- _manip->pan(0,1);
585
- }
586
- if ( ea.getEventType() == ea.KEYDOWN && ea.getKey() == '2' )
587
- {
588
- _manip->pan(0,-1);
589
- }
590
- if ( ea.getEventType() == ea.KEYDOWN && ea.getKey() == '+' )
591
- {
592
- _manip->rotate(0,1*deg);
593
- }
594
- */
595
- if ( ea.getEventType () == ea.KEYDOWN && ea.getKey () == ' -' )
596
- {
597
- _manip->rotate (0 ,-1 *deg);
598
- }
599
- if ( ea.getEventType () == ea.KEYDOWN && ea.getKey () == ' /' )
600
- {
601
- _manip->rotate (1 *deg,0 );
602
- }
603
- if ( ea.getEventType () == ea.KEYDOWN && ea.getKey () == ' *' )
604
- {
605
- _manip->rotate (-1 *deg,0 );
606
- }
607
-
608
563
return false ;
609
564
}
610
565
0 commit comments