Skip to content
Permalink
Browse files

astyle globe

  • Loading branch information
pka committed Jul 12, 2011
1 parent 372e805 commit 540fb7a1b7a06e2bd03616b288a81675ba83cb59

Large diffs are not rendered by default.

@@ -38,7 +38,7 @@ class QgisInterface;

class GlobePlugin : public QObject, public QgisPlugin
{
Q_OBJECT
Q_OBJECT

public:
GlobePlugin( QgisInterface* theQgisInterface );
@@ -76,7 +76,7 @@ class GlobePlugin : public QObject, public QgisPlugin
//! prints the ccordinates in a QMessageBox
void showSelectedCoordinates();
//! emits signal with current mouse coordinates
void showCurrentCoordinates(double lon, double lat);
void showCurrentCoordinates( double lon, double lat );
//! get longitude of user right click
double getSelectedLon();
//! get latitude of user right click
@@ -89,7 +89,7 @@ class GlobePlugin : public QObject, public QgisPlugin
void placeNode( osg::Node* node, double lat, double lon, double alt = 0.0 );

//! Recursive copy folder
static void copyFolder(QString sourceFolder, QString destFolder);
static void copyFolder( QString sourceFolder, QString destFolder );

private:
//! Set HTTP proxy settings
@@ -132,7 +132,7 @@ class GlobePlugin : public QObject, public QgisPlugin
//! coordinates of the right-clicked point on the globe
double mSelectedLat, mSelectedLon, mSelectedElevation;

signals:
signals:
//! emits current mouse position
void xyCoordinates( const QgsPoint & p );
//! emits position of right click on globe
@@ -142,27 +142,27 @@ class GlobePlugin : public QObject, public QgisPlugin
class FlyToExtentHandler : public osgGA::GUIEventHandler
{
public:
FlyToExtentHandler( GlobePlugin* globe ) : mGlobe ( globe ) { }
FlyToExtentHandler( GlobePlugin* globe ) : mGlobe( globe ) { }

bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa );

private:
GlobePlugin* mGlobe;
GlobePlugin* mGlobe;
};

// An event handler that will print out the coordinates at the clicked point
class QueryCoordinatesHandler : public osgGA::GUIEventHandler
{
public:
public:
QueryCoordinatesHandler( GlobePlugin* globe, osgEarth::Util::ElevationManager* elevMan,
const osgEarth::SpatialReference* mapSRS )
: mGlobe ( globe ), _elevMan(elevMan), _mapSRS( mapSRS ), _mouseDown( false ) { }
: mGlobe( globe ), _elevMan( elevMan ), _mapSRS( mapSRS ), _mouseDown( false ) { }

bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa);
bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa );

virtual osg::Vec3d getCoords( float x, float y, osgViewer::View* view, bool getElevation = false);
virtual osg::Vec3d getCoords( float x, float y, osgViewer::View* view, bool getElevation = false );

private:
private:
GlobePlugin* mGlobe;
osg::ref_ptr<const SpatialReference> _mapSRS;
osg::ref_ptr<osgEarth::Util::ElevationManager> _elevMan;
@@ -173,7 +173,7 @@ class QueryCoordinatesHandler : public osgGA::GUIEventHandler
class KeyboardControlHandler : public osgGA::GUIEventHandler
{
public:
KeyboardControlHandler( osgEarth::Util::EarthManipulator* manip, QgisInterface *qGisIface ) : _manip(manip), mQGisIface(qGisIface) { }
KeyboardControlHandler( osgEarth::Util::EarthManipulator* manip, QgisInterface *qGisIface ) : _manip( manip ), mQGisIface( qGisIface ) { }

bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa );

@@ -185,29 +185,32 @@ class KeyboardControlHandler : public osgGA::GUIEventHandler
};


namespace osgEarth { namespace Util
namespace osgEarth
{
namespace Controls
namespace Util
{
class NavigationControlHandler : public ControlEventHandler
namespace Controls
{
public:
virtual void onMouseDown( class Control* control, int mouseButtonMask ) { }
virtual void onClick( class Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa ) { }
};

class NavigationControl : public ImageControl
{
public:
NavigationControl( osg::Image* image = 0L ) : ImageControl( image ), _mouse_down_event( NULL ) {}

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

private:
osg::ref_ptr<const osgGA::GUIEventAdapter> _mouse_down_event;
};
class NavigationControlHandler : public ControlEventHandler
{
public:
virtual void onMouseDown( class Control* control, int mouseButtonMask ) { }
virtual void onClick( class Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa ) { }
};

class NavigationControl : public ImageControl
{
public:
NavigationControl( osg::Image* image = 0L ) : ImageControl( image ), _mouse_down_event( NULL ) {}

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

private:
osg::ref_ptr<const osgGA::GUIEventAdapter> _mouse_down_event;
};
}
}
} }
}

#endif // QGS_GLOBE_PLUGIN_H

0 comments on commit 540fb7a

Please sign in to comment.
You can’t perform that action at this time.