Skip to content

Commit

Permalink
NavigationControl
Browse files Browse the repository at this point in the history
  • Loading branch information
pka committed Jul 5, 2011
1 parent bc1ca62 commit b9b3ae8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/plugins/globe/globe_plugin.cpp
Expand Up @@ -278,7 +278,7 @@ void GlobePlugin::setupControls()

//Move Left
osg::Image* moveLeftImg = osgDB::readImageFile( imgDir + "/move-left.png" );
ImageControl* moveLeft = new ImageControl( moveLeftImg );
ImageControl* moveLeft = new NavigationControl( moveLeftImg );
moveLeft->addEventHandler( new MyClickHandler );

//Move Right
Expand Down Expand Up @@ -563,6 +563,21 @@ bool FlyToExtentHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIAct
return false;
}

// ----------

bool
NavigationControl::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, ControlContext& cx )
{
if ( ea.getEventType() == osgGA::GUIEventAdapter::PUSH )
{
OE_NOTICE << "Thank you for pushing " << std::endl;
aa.requestContinuousUpdate(true);
}
OE_NOTICE << "getEventType " << ea.getEventType() << std::endl;
return Control::handle( ea, aa, cx );
}

// ----------

/**
* Required extern functions needed for every plugin
Expand Down
14 changes: 14 additions & 0 deletions src/plugins/globe/globe_plugin.h
Expand Up @@ -124,4 +124,18 @@ class FlyToExtentHandler : public osgGA::GUIEventHandler
QgisInterface *mQGisIface;
};

namespace osgEarthUtil { namespace Controls2
{
class NavigationControl : public ImageControl
{
public:
NavigationControl( osg::Image* image =0L ) : ImageControl(image) {}

protected:
virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, ControlContext& cx );

};
}
}

#endif // QGS_GLOBE_PLUGIN_H

0 comments on commit b9b3ae8

Please sign in to comment.