Skip to content
Permalink
Browse files

NavigationControl

  • Loading branch information
pka committed Nov 24, 2010
1 parent bc1ca62 commit b9b3ae840f8762d51016596f0b2a0d234854aabf
Showing with 30 additions and 1 deletion.
  1. +16 −1 src/plugins/globe/globe_plugin.cpp
  2. +14 −0 src/plugins/globe/globe_plugin.h
@@ -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
@@ -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
@@ -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.
You can’t perform that action at this time.