Commit
Revived globe, compatible with OsgEarth 2.7
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*************************************************************************** | ||
qgsplugininterface.sip | ||
-------------------------------------- | ||
Date : 21.8.2013 | ||
Copyright : (C) 2013 Matthias Kuhn | ||
Email : matthias dot kuhn at gmx dot ch | ||
*************************************************************************** | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
m-kuhn
Member
|
||
* * | ||
* 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 ); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; |
11 comments
on commit 87121d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks support for osgEarth 2.4 as in OSGeo4W.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jef-n I can mail you OSGeo4W packages sources for osgEarth 2.7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also breaks builds for Debian wheezy (osgEarth 2.5), jessie (current stable, 2.5), ubuntu trusty (2.4), wily and xenial (also 2.5). yakkety has 2.7. ubuntugis has 2.7 for xenial.
I suppose QGIS 2.14 (and 2.8) also don't support osgearth 2.7 (relevant for OSGeo4W)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jef-n So with upstream doing API breaks at will and occasional internal changes which can cause breakage even though the API remains the same, it is very hard to maintain a workable implementation for multiple releases.
So for distros not shipping the current version of osgEarth, the plugin should just be disabled. The fix for this would be to set the minimum required version to 2.7 in CMake.
For OSGeo4W, does the package base have to be the same for legacy QGIS versions? I'm open to suggestions, but at some point such breakage from the past is needed if the globe plugin is to be actively maintained (and I already fear the day where osgEarth 3.0 is released, with possibly even more radical breakages, so even getting the code to compile with 2.x might then be a huge challenge).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any opinion about the user base and stability of the globe plugin? I guess it was somewhat experimental anyway and doesn't have many users. In OSGeo4W I could just upgrade OSGEarth to 2.7 and disable the globe plugin for 2.14 in the next point release (when 2.8 will vanish, be replaced be 2.14 as LTR). In the Linux builds (if everything works out as intented - nighlies are still underway) the globe plugin will also vanish where 2.7 is not available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the user base of QGIS globe was probably very low. It wasn't very stable and feature-rich in the past and thus not much in use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed @andreasneumann btw now I can't compile on wily due to dependency and I can't check if now globe works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luipir set WITH_GLOBE=FALSE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jef-n sorry I was saying I can't compile Globe :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luipir osgEarth 2.7 is a hard requirement. Supporting older versions is simply too much work, given the volatility of the osgEarth API.
@m-kuhn Should this be removed? It's not used, and if I recall we decided not to allow plugins to provide their own bindings.