Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revived globe, compatible with OsgEarth 2.7 #3126

Merged
merged 5 commits into from May 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmake/FindOSGEARTH.cmake
Expand Up @@ -96,6 +96,9 @@ FIND_OSGEARTH_LIBRARY( OSGEARTHSYMBOLOGY_LIBRARY_DEBUG osgEarthSymbologyd )
FIND_OSGEARTH_LIBRARY( OSGEARTHQT_LIBRARY osgEarthQt )
FIND_OSGEARTH_LIBRARY( OSGEARTHQT_LIBRARY_DEBUG osgEarthQtd )

FIND_OSGEARTH_LIBRARY( OSGEARTHANNOTATION_LIBRARY osgEarthAnnotation )
FIND_OSGEARTH_LIBRARY( OSGEARTHANNOTATION_LIBRARY_DEBUG osgEarthAnnotationd )


SET( OSGEARTH_FOUND "NO" )
IF( OSGEARTH_LIBRARY AND OSGEARTH_INCLUDE_DIR )
Expand Down
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -522,6 +522,7 @@
<file>themes/default/symbologyRemove.svg</file>
<file>themes/default/symbologyUp.png</file>
<file>themes/default/symbologyUp.svg</file>
<file>themes/default/sync_views.svg</file>
<file>themes/default/text.png</file>
<file>themes/default/tracking.png</file>
<file>themes/default/transformed.png</file>
Expand Down
151 changes: 151 additions & 0 deletions images/themes/default/sync_views.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions python/core/core.sip
Expand Up @@ -24,6 +24,7 @@
%Include qgsaggregatecalculator.sip
%Include qgsattributeaction.sip
%Include qgsattributetableconfig.sip
%Include qgsbillboardregistry.sip
%Include qgsbrowsermodel.sip
%Include qgsclipper.sip
%Include qgscolorscheme.sip
Expand Down Expand Up @@ -103,6 +104,7 @@
%Include qgsowsconnection.sip
%Include qgspaintenginehack.sip
%Include qgspallabeling.sip
%Include qgsplugininterface.sip
%Include qgspluginlayer.sip
%Include qgspluginlayerregistry.sip
%Include qgspoint.sip
Expand Down
56 changes: 56 additions & 0 deletions python/core/qgsbillboardregistry.sip
@@ -0,0 +1,56 @@
/** Billboard items stored in the QgsBillBoardRegistry */
class QgsBillBoardItem
{
%TypeHeaderCode
#include <qgsbillboardregistry.h>
%End
public:
QImage image; /* The image of the billboard */
QgsPoint worldPos; /* The WGS84 world position of the billboard */
QString layerId; /* The layer which the image is part of, if any */
};

/**
* @brief The QgsBillBoardRegistry class stores images which should
* be displayed as billboards in the globe plugin.
* Map canvas items and layers may decide to add items which should
* be drawn as billboards in the globe.
*
* Retreive the instance pointer to a QgsBillBoardRegistry for a
* project via QgsProject::instance()->billboardRegistry().
*/
class QgsBillBoardRegistry : public QObject
{
%TypeHeaderCode
#include <qgsbillboardregistry.h>
%End
public:
/**
* @brief Adds a billboard to the registry
* @param parent The parent (i.e. a QgsMapLayer or a QgsMapCanvasItem) which is creating the billboard
* @param image The billboard image
* @param worldPos The geo position of the image, in WGS84
* @param layerId The id of the layer to which the item belongs, if any
*/
void addItem( void* parent, const QImage& image, const QgsPoint& worldPos, const QString& layerId = QString() );
/**
* @brief Removes all billboards which were created by the specified parent
* @param parent The parent
*/
void removeItem( void* parent );

/**
* @brief Retreive all registered billboard items
* @return List of registered billboard items
*/
QList<QgsBillBoardItem*> items() const;

signals:
/** Emitted when an item is added to the registry */
void itemAdded( QgsBillBoardItem* item );
/** Emitted when an item is removed from the registry */
void itemRemoved( QgsBillBoardItem* item );

private:
QgsBillBoardRegistry( QObject* parent = 0 );
};
5 changes: 5 additions & 0 deletions python/core/qgsmapsettings.sip
Expand Up @@ -60,6 +60,11 @@ class QgsMapSettings
//! @note added in 2.8
void setLayerStyleOverrides( const QMap<QString, QString>& overrides );

//! Get custom rendering flags, separated by ';'. Layers might honour these to alter their rendering.
const QString& customRenderFlags() const;
//! Set custom rendering flags, separated by ';'. Layers might honour these to alter their rendering.
void setCustomRenderFlags( const QString& customRenderFlags );

//! sets whether to use projections for this layer set
void setCrsTransformEnabled( bool enabled );
//! returns true if projections are enabled for this layer set
Expand Down
28 changes: 28 additions & 0 deletions python/core/qgsplugininterface.sip
@@ -0,0 +1,28 @@
/***************************************************************************
qgsplugininterface.sip
--------------------------------------
Date : 21.8.2013
Copyright : (C) 2013 Matthias Kuhn
Email : matthias dot kuhn at gmx dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

/**
* @brief Trivial base class for plugin interfaces
*/
class QgsPluginInterface : QObject
{
%TypeHeaderCode
#include "qgsplugininterface.h"
%End

protected:
/** Should only be instantiated from subclasses */
QgsPluginInterface( QObject* parent = 0 );
};
5 changes: 5 additions & 0 deletions python/core/qgsproject.sip
Expand Up @@ -275,6 +275,11 @@ class QgsProject : QObject

QgsRelationManager* relationManager() const;

/** Return the project's billboard manager instance pointer
* @note added in QGIS 2.16
*/
QgsBillBoardRegistry* billboardRegistry() const;

/** Return pointer to the root (invisible) node of the project's layer tree
* @note added in 2.4
*/
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsrectangle.sip
Expand Up @@ -74,7 +74,7 @@ class QgsRectangle
//! return true when rectangle contains a point
bool contains( const QgsPoint &p ) const;
//! expand the rectangle so that covers both the original rectangle and the given rectangle
void combineExtentWith( QgsRectangle *rect );
void combineExtentWith( const QgsRectangle& rect );
//! expand the rectangle so that covers both the original rectangle and the given point
void combineExtentWith( double x, double y );
//! test if rectangle is empty.
Expand Down
2 changes: 2 additions & 0 deletions python/gui/gui.sip
Expand Up @@ -102,6 +102,7 @@
%Include qgsmaplayeractionregistry.sip
%Include qgsmaplayercombobox.sip
%Include qgsmaplayermodel.sip
%Include qgsmaplayerpropertiesfactory.sip
%Include qgsmaplayerproxymodel.sip
%Include qgsmapmouseevent.sip
%Include qgsmapoverviewcanvas.sip
Expand Down Expand Up @@ -155,6 +156,7 @@
%Include qgsunitselectionwidget.sip
%Include qgsuserinputdockwidget.sip
%Include qgsvariableeditorwidget.sip
%Include qgsvectorlayerpropertiespage.sip
%Include qgsvectorlayertools.sip
%Include qgsvertexmarker.sip

Expand Down
6 changes: 6 additions & 0 deletions python/gui/qgisinterface.sip
Expand Up @@ -279,6 +279,12 @@ class QgisInterface : QObject
/** Unregister a previously registered action. (e.g. when plugin is going to be unloaded) */
virtual bool unregisterMainWindowAction( QAction* action ) = 0;

/** Register a new tab in the vector layer properties dialog */
virtual void registerMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) = 0;

/** Unregister a previously registered tab in the layer properties dialog */
virtual void unregisterMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) = 0;

// @todo is this deprecated in favour of QgsContextHelp?
/** Open a url in the users browser. By default the QGIS doc directory is used
* as the base for the URL. To open a URL that is not relative to the installed
Expand Down
32 changes: 32 additions & 0 deletions python/gui/qgsmaplayerpropertiesfactory.sip
@@ -0,0 +1,32 @@
/** \ingroup gui
* \note added in 2.1
*/
class QgsMapLayerPropertiesFactory
{
%TypeHeaderCode
#include <qgsmaplayerpropertiesfactory.h>
%End

public:
/** Constructor */
QgsMapLayerPropertiesFactory();

/** Destructor */
virtual ~QgsMapLayerPropertiesFactory();

/**
* @brief Create a new properties page
* @param layer The layer for which to create the page
* @param parent The parent widget
* @return The new properties page instance
*/
virtual QgsVectorLayerPropertiesPage* createVectorLayerPropertiesPage( QgsVectorLayer* layer, QWidget* parent ) = 0;

/**
* @brief Creates the QListWidgetItem for the properties page
* @param layer The layer for which to create the item
* @param view The parent QListView
* @return The QListWidgetItem for the properties page
*/
virtual QListWidgetItem* createVectorLayerPropertiesItem( QgsVectorLayer* layer, QListWidget* view ) = 0;
};
21 changes: 21 additions & 0 deletions python/gui/qgsvectorlayerpropertiespage.sip
@@ -0,0 +1,21 @@
/** \ingroup gui
* \note added in 2.1
*/

/**
* @brief Base class for custom vector layer property pages
*/
class QgsVectorLayerPropertiesPage : QWidget
{
%TypeHeaderCode
#include <qgsvectorlayerpropertiespage.h>
%End

public:
/** Constructor */
explicit QgsVectorLayerPropertiesPage( QWidget *parent = 0 );

public slots:
/** Apply changes */
virtual void apply() = 0;
};