Skip to content

Commit a2a391c

Browse files
committedJul 5, 2011
Revert FlyToExtentHandler
1 parent 655bd09 commit a2a391c

File tree

1 file changed

+22
-67
lines changed

1 file changed

+22
-67
lines changed
 

‎src/plugins/globe/globe_plugin.cpp

Lines changed: 22 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -104,28 +104,6 @@ void GlobePlugin::initGui()
104104
this, SLOT( layersChanged() ) );
105105
}
106106

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-
129107

130108
void GlobePlugin::run()
131109
{
@@ -274,6 +252,28 @@ void GlobePlugin::setupMap()
274252
#endif
275253
}
276254

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+
277277
void GlobePlugin::setupControls()
278278
{
279279

@@ -554,57 +554,12 @@ void GlobePlugin::copyFolder(QString sourceFolder, QString destFolder)
554554

555555
bool FlyToExtentHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
556556
{
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-
565557
if ( ea.getEventType() == ea.KEYDOWN && ea.getKey() == '1' )
566-
567558
{
568559
QgsPoint center = mQGisIface->mapCanvas()->extent().center();
569560
osgEarthUtil::Viewpoint viewpoint( osg::Vec3d( center.x(), center.y(), 0.0 ), 0.0, -90.0, 1e4 );
570561
_manip->setViewpoint( viewpoint, 4.0 );
571562
}
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-
608563
return false;
609564
}
610565

0 commit comments

Comments
 (0)
Please sign in to comment.