Skip to content

Commit

Permalink
astyle globe
Browse files Browse the repository at this point in the history
  • Loading branch information
pka committed Jul 12, 2011
1 parent 372e805 commit 540fb7a
Show file tree
Hide file tree
Showing 8 changed files with 576 additions and 566 deletions.
391 changes: 196 additions & 195 deletions src/plugins/globe/globe_plugin.cpp

Large diffs are not rendered by default.

67 changes: 35 additions & 32 deletions src/plugins/globe/globe_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class QgisInterface;

class GlobePlugin : public QObject, public QgisPlugin
{
Q_OBJECT
Q_OBJECT

public:
GlobePlugin( QgisInterface* theQgisInterface );
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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 );

Expand All @@ -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
Loading

0 comments on commit 540fb7a

Please sign in to comment.