From 2297ade90ab599d76d620040772167c344c7338a Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mon, 30 May 2016 11:53:22 +0200 Subject: [PATCH] [Globe] Remove python bindings --- python/core/core.sip | 1 - python/core/qgsplugininterface.sip | 28 ----------- src/core/CMakeLists.txt | 2 - src/core/qgsplugininterface.cpp | 0 src/core/qgsplugininterface.h | 33 ------------- src/plugins/globe/CMakeLists.txt | 8 ---- src/plugins/globe/globe_plugin.cpp | 8 ---- src/plugins/globe/globe_plugin.h | 6 --- src/plugins/globe/python/CMakeLists.txt | 38 --------------- src/plugins/globe/python/__init__.py | 24 ---------- src/plugins/globe/python/globe.sip | 16 ------- .../globe/python/qgsglobefeatureutils.sip | 16 ------- .../globe/python/qgsglobeinterface.sip | 44 ----------------- src/plugins/globe/qgsglobeinterface.cpp | 48 ------------------- src/plugins/globe/qgsglobeinterface.h | 46 ------------------ 15 files changed, 318 deletions(-) delete mode 100644 python/core/qgsplugininterface.sip delete mode 100644 src/core/qgsplugininterface.cpp delete mode 100644 src/core/qgsplugininterface.h delete mode 100644 src/plugins/globe/python/CMakeLists.txt delete mode 100755 src/plugins/globe/python/__init__.py delete mode 100644 src/plugins/globe/python/globe.sip delete mode 100644 src/plugins/globe/python/qgsglobefeatureutils.sip delete mode 100644 src/plugins/globe/python/qgsglobeinterface.sip delete mode 100644 src/plugins/globe/qgsglobeinterface.cpp delete mode 100644 src/plugins/globe/qgsglobeinterface.h diff --git a/python/core/core.sip b/python/core/core.sip index f403ae9550d3..5a14169b7cda 100644 --- a/python/core/core.sip +++ b/python/core/core.sip @@ -104,7 +104,6 @@ %Include qgsowsconnection.sip %Include qgspaintenginehack.sip %Include qgspallabeling.sip -%Include qgsplugininterface.sip %Include qgspluginlayer.sip %Include qgspluginlayerregistry.sip %Include qgspoint.sip diff --git a/python/core/qgsplugininterface.sip b/python/core/qgsplugininterface.sip deleted file mode 100644 index 11bf01f69354..000000000000 --- a/python/core/qgsplugininterface.sip +++ /dev/null @@ -1,28 +0,0 @@ -/*************************************************************************** - 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 ); -}; diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 7b21f07a84ca..b9bc984708ae 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -168,7 +168,6 @@ SET(QGIS_CORE_SRCS qgspallabeling.cpp qgspluginlayer.cpp qgspluginlayerregistry.cpp - qgsplugininterface.cpp qgspoint.cpp qgspointlocator.cpp qgsproject.cpp @@ -482,7 +481,6 @@ SET(QGIS_CORE_MOC_HDRS qgsofflineediting.h qgsowsconnection.h qgspluginlayer.h - qgsplugininterface.h qgspointlocator.h qgsproject.h qgsrelationmanager.h diff --git a/src/core/qgsplugininterface.cpp b/src/core/qgsplugininterface.cpp deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/core/qgsplugininterface.h b/src/core/qgsplugininterface.h deleted file mode 100644 index bd107970475f..000000000000 --- a/src/core/qgsplugininterface.h +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - qgsplugininterface.h - -------------------------------------- - 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. * - * * - ***************************************************************************/ - -#ifndef QGSPLUGININTERFACE_H -#define QGSPLUGININTERFACE_H - -#include - -/** - * @brief Trivial base class for plugin interfaces - */ -class CORE_EXPORT QgsPluginInterface : public QObject -{ - Q_OBJECT - - protected: - /** Should only be instantiated from subclasses */ - QgsPluginInterface( QObject* parent = 0 ) : QObject( parent ) {} -}; - -#endif // QGSPLUGININTERFACE_H diff --git a/src/plugins/globe/CMakeLists.txt b/src/plugins/globe/CMakeLists.txt index acfc53e9c055..e6fc1c1d203d 100644 --- a/src/plugins/globe/CMakeLists.txt +++ b/src/plugins/globe/CMakeLists.txt @@ -12,7 +12,6 @@ SET (GLOBE_PLUGIN_SRCS globe_plugin.cpp qgsglobetilesource.cpp qgsglobeplugindialog.cpp - qgsglobeinterface.cpp qgsglobevectorlayerproperties.cpp qgsglobefeatureidentify.cpp qgsglobefrustumhighlight.cpp @@ -27,14 +26,12 @@ SET (GLOBE_PLUGIN_UIS SET (GLOBE_PLUGIN_MOC_HDRS globe_plugin.h qgsglobeplugindialog.h - qgsglobeinterface.h qgsglobevectorlayerproperties.h qgsglobetilesource.h qgsglobewidget.h ) SET (GLOBE_PLUGIN_HDRS - qgsglobeinterface.h qgsglobevectorlayerproperties.h qgsglobefeatureidentify.h qgsglobefrustumhighlight.h @@ -92,11 +89,6 @@ TARGET_LINK_LIBRARIES(globeplugin ${OPENTHREADS_LIBRARY} ) -IF (WITH_BINDINGS) - # Restore default CXX flags (without visibility=hidden, which breaks python bindings) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_OLD}") - ADD_SUBDIRECTORY(python) -ENDIF (WITH_BINDINGS) ADD_SUBDIRECTORY(featuresource) ######################################################## diff --git a/src/plugins/globe/globe_plugin.cpp b/src/plugins/globe/globe_plugin.cpp index 9b846af73f70..7b9b22c1f508 100644 --- a/src/plugins/globe/globe_plugin.cpp +++ b/src/plugins/globe/globe_plugin.cpp @@ -18,8 +18,6 @@ // Include this first to avoid _POSIX_C_SOURCE redefined warnings // see http://bytes.com/topic/python/answers/30009-warning-_posix_c_source-redefined -#include "qgsglobeinterface.h" - #include "globe_plugin.h" #include "qgsglobeplugindialog.h" #include "qgsglobefeatureidentify.h" @@ -238,7 +236,6 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface ) , mViewerWidget( 0 ) , mDockWidget( 0 ) , mSettingsDialog( 0 ) - , mGlobeInterface( this ) , mSelectedLat( 0. ) , mSelectedLon( 0. ) , mSelectedElevation( 0. ) @@ -1295,8 +1292,3 @@ QGISEXTERN void unload( QgisPlugin * thePluginPointer ) { delete thePluginPointer; } - -QgsPluginInterface* GlobePlugin::pluginInterface() -{ - return &mGlobeInterface; -} diff --git a/src/plugins/globe/globe_plugin.h b/src/plugins/globe/globe_plugin.h index c5d91c05f755..b978ca48fecf 100644 --- a/src/plugins/globe/globe_plugin.h +++ b/src/plugins/globe/globe_plugin.h @@ -24,7 +24,6 @@ #include #include -#include "qgsglobeinterface.h" #include "qgsglobeplugindialog.h" #include "qgsrectangle.h" @@ -35,7 +34,6 @@ class QgsAnnotationItem; class QgsBillBoardItem; class QgsGlobeAnnotation; class QgsGlobeLayerPropertiesFactory; -class QgsGlobeInterface; class QgsGlobePluginDialog; class QgsGlobeWidget; class QgsMapLayer; @@ -85,8 +83,6 @@ class GLOBE_EXPORT GlobePlugin : public QObject, public QgisPlugin GlobePlugin( QgisInterface* theQgisInterface ); ~GlobePlugin(); - //! offer an interface for python plugins - virtual QgsPluginInterface* pluginInterface(); //! init the gui virtual void initGui() override; //! unload the plugin @@ -130,8 +126,6 @@ class GLOBE_EXPORT GlobePlugin : public QObject, public QgisPlugin osgEarth::QtGui::ViewerWidget* mViewerWidget; QgsGlobeWidget* mDockWidget; QgsGlobePluginDialog* mSettingsDialog; - - QgsGlobeInterface mGlobeInterface; QString mBaseLayerUrl; QList mImagerySources; QList mElevationSources; diff --git a/src/plugins/globe/python/CMakeLists.txt b/src/plugins/globe/python/CMakeLists.txt deleted file mode 100644 index 3e1d877822d3..000000000000 --- a/src/plugins/globe/python/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -SET (PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python) - -SET (QGIS_GLOBE_PYTHON_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/qgis) - -SET (QGIS_GLOBE_PYTHON_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -SET (QGIS_GLOBE_INCLUDE_DIRECTORY {CMAKE_CURRENT_SOURCE_DIR}/..) - -INCLUDE_DIRECTORIES( - ${PYTHON_INCLUDE_PATH} - ${SIP_INCLUDE_DIR} - .. - ../../../core -) - -IF(WIN32) - IF(MSVC) - ADD_DEFINITIONS("-DGLOBE_EXPORT=${DLLIMPORT}") - ENDIF(MSVC) -ENDIF(WIN32) - - -SET(SIP_INCLUDES ${SIP_INCLUDES} ${QGIS_GLOBE_PYTHON_DIRECTORY}) - -SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETINT_CONVERSION) -SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETTYPE_CONVERSION) -SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QVECTORINT_CONVERSION) -IF(NOT ENABLE_QT5) - SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QT5_SUPPORT) -ENDIF(NOT ENABLE_QT5) - -# globe module -SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_GLOBE_PYTHON_OUTPUT_DIRECTORY}) -SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_GLOBE_PYTHON_OUTPUT_DIRECTORY}) -FILE(GLOB_RECURSE sip_files_globe *.sip) -SET(SIP_EXTRA_FILES_DEPEND ${sip_files_globe}) -SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.globe.api) -GENERATE_SIP_PYTHON_MODULE_CODE(qgis.globe globe.sip cpp_files) -BUILD_SIP_PYTHON_MODULE(qgis.globe globe.sip ${cpp_files} "" globeplugin) diff --git a/src/plugins/globe/python/__init__.py b/src/plugins/globe/python/__init__.py deleted file mode 100755 index 44d95bfb4f00..000000000000 --- a/src/plugins/globe/python/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -*************************************************************************** - __init__.py - --------------------- - Date : Aug 2013 - Copyright : (C) 2013 by 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. * -* * -*************************************************************************** -""" - -__author__ = 'Matthias Kuhn' -__date__ = 'August 2013' -__copyright__ = '(C) 2013, Matthias Kuhn' -# This will get replaced with a git SHA1 when you do a git archive -__revision__ = '$Format:%H$' diff --git a/src/plugins/globe/python/globe.sip b/src/plugins/globe/python/globe.sip deleted file mode 100644 index 0efaf36dd683..000000000000 --- a/src/plugins/globe/python/globe.sip +++ /dev/null @@ -1,16 +0,0 @@ -%Import QtCore/QtCoremod.sip -%Import QtGui/QtGuimod.sip - -%Import gui/gui.sip -%Import core/core.sip - -%Module(name=qgis.globe, - version=0, - keyword_arguments="Optional") - -%If(WS_WIN) -typedef void XEvent; -%End - -//%Include qgsglobefeatureutils.sip -%Include qgsglobeinterface.sip diff --git a/src/plugins/globe/python/qgsglobefeatureutils.sip b/src/plugins/globe/python/qgsglobefeatureutils.sip deleted file mode 100644 index b77ebe03e6a9..000000000000 --- a/src/plugins/globe/python/qgsglobefeatureutils.sip +++ /dev/null @@ -1,16 +0,0 @@ -class QgsGlobeFeatureUtils -{ -%TypeHeaderCode -#include -%End - public: - static inline QgsPointV2 qgsPointFromPoint( const osg::Vec3d& pt ); - static inline osg::Vec3d pointFromQgsPoint( const QgsPointV2& pt ); - static inline osgEarth::Features::LineString* lineStringFromQgsLineString( const QgsLineStringV2* lineString ); - static inline osgEarth::Features::Polygon* polygonFromQgsPolygon( const QgsPolygonV2* polygon ); - static inline osgEarth::Features::Geometry* geometryFromQgsGeometry( const QgsGeometry& geom ); - static osgEarth::Features::Feature* featureFromQgsFeature( QgsVectorLayer* layer, QgsFeature& feat ); - static void setFeatureField( osgEarth::Features::Feature* feature, const QgsField& field, const QVariant& value ); - static osgEarth::Features::FeatureSchema schemaForFields( const QgsFields& fields ); -}; - diff --git a/src/plugins/globe/python/qgsglobeinterface.sip b/src/plugins/globe/python/qgsglobeinterface.sip deleted file mode 100644 index 7810dca4502f..000000000000 --- a/src/plugins/globe/python/qgsglobeinterface.sip +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************** - qgsglobeinterface.sip - -------------------------------------- - Date : 22.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. * - * * - ***************************************************************************/ - -class QgsGlobeInterface : QObject -{ -%TypeHeaderCode - #include "qgsglobeinterface.h" -%End - -// Provide converter code -// Attention: qgis.globe has to be imported before this interface -// is requested the first time. In case this is not done, -// the converter code will not be executed and this will be treated as -// a (useless) QgsPluginInterface object instead. -%ConvertToSubClassCode - if ( sipCpp->inherits( sipName_QgsGlobeInterface ) ) - sipType = sipType_QgsGlobeInterface; - else - sipType = NULL; -%End - - - public: -// osgViewer::Viewer* osgViewer(); -// osgEarth::MapNode* mapNode(); - void syncExtent(); - void enableFrustumHighlight( bool status ); - void enableFeatureIdentification( bool status ); - private: - // Instances will only be created from the globe plugin itself - QgsGlobeInterface(); -}; diff --git a/src/plugins/globe/qgsglobeinterface.cpp b/src/plugins/globe/qgsglobeinterface.cpp deleted file mode 100644 index 32791c4791f8..000000000000 --- a/src/plugins/globe/qgsglobeinterface.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - qgsglobeinterface.cpp - -------------------------------------- - Date : 22.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. * - * * - ***************************************************************************/ - -#include "qgsglobeinterface.h" -#include "globe_plugin.h" - -QgsGlobeInterface::QgsGlobeInterface( GlobePlugin* const globe, QObject* parent ) - : QgsPluginInterface( parent ) - , mGlobe( globe ) -{ -} - -osgViewer::Viewer* QgsGlobeInterface::osgViewer() -{ - return mGlobe->osgViewer(); -} - -osgEarth::MapNode* QgsGlobeInterface::mapNode() -{ - return mGlobe->mapNode(); -} - -void QgsGlobeInterface::syncExtent() -{ - mGlobe->syncExtent(); -} - -void QgsGlobeInterface::enableFrustumHighlight( bool status ) -{ - mGlobe->enableFrustumHighlight( status ); -} - -void QgsGlobeInterface::enableFeatureIdentification( bool status ) -{ - mGlobe->enableFeatureIdentification( status ); -} diff --git a/src/plugins/globe/qgsglobeinterface.h b/src/plugins/globe/qgsglobeinterface.h deleted file mode 100644 index e416ab4bc0bc..000000000000 --- a/src/plugins/globe/qgsglobeinterface.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - qgsglobeinterface.h - -------------------------------------- - Date : 22.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. * - * * - ***************************************************************************/ - -#ifndef QGSGLOBEINTERFACE_H -#define QGSGLOBEINTERFACE_H - -#include -#include "qgsplugininterface.h" - -class GlobePlugin; -class QDateTime; -namespace osgViewer { class Viewer; } -namespace osgEarth { class MapNode; } - -class GLOBE_EXPORT QgsGlobeInterface : public QgsPluginInterface -{ - public: - QgsGlobeInterface( GlobePlugin* const globe, QObject* parent = 0 ); - - osgViewer::Viewer* osgViewer(); - - osgEarth::MapNode* mapNode(); - - void syncExtent(); - - void enableFrustumHighlight( bool status ); - - void enableFeatureIdentification( bool status ); - - private: - GlobePlugin* mGlobe; -}; - -#endif // QGSGLOBEINTERFACE_H