[Globe] Remove python bindings

This commit is contained in:
Sandro Mani 2016-05-30 11:53:22 +02:00
parent 00502620c0
commit 2297ade90a
15 changed files with 0 additions and 318 deletions

View File

@ -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

View File

@ -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 );
};

View File

@ -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

View File

@ -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 <QObject>
/**
* @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

View File

@ -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)
########################################################

View File

@ -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;
}

View File

@ -24,7 +24,6 @@
#include <osg/ref_ptr>
#include <osgEarth/Version>
#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<QgsGlobePluginDialog::LayerDataSource> mImagerySources;
QList<QgsGlobePluginDialog::LayerDataSource> mElevationSources;

View File

@ -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)

View File

@ -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$'

View File

@ -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

View File

@ -1,16 +0,0 @@
class QgsGlobeFeatureUtils
{
%TypeHeaderCode
#include <qgsglobefeatureutils.h>
%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 );
};

View File

@ -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();
};

View File

@ -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 );
}

View File

@ -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 <QObject>
#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