Skip to content

Commit

Permalink
forward declaration of QgsProject
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Oct 8, 2018
1 parent 0901a21 commit 711ec1d
Show file tree
Hide file tree
Showing 27 changed files with 102 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@




%ModuleHeaderCode
#include <qgsgraphbuilder.h>
%End
Expand All @@ -31,7 +32,8 @@ QgsGraphBuilder and QgsGraphDirector both use a "builder" design pattern
%End
public:

QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" );
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true,
double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" );
%Docstring
Default constructor

Expand Down
2 changes: 2 additions & 0 deletions python/server/auto_generated/qgsconfigcache.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@





class QgsConfigCache : QObject
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/server/auto_generated/qgsservercachefilter.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@




class QgsServerCacheFilter
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/server/auto_generated/qgsservercachemanager.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@




class QgsServerCacheManager
{
%Docstring
Expand Down
2 changes: 2 additions & 0 deletions python/server/auto_generated/qgsserverprojectutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@





%ModuleHeaderCode
#include "qgsserverprojectutils.h"
%End
Expand Down
1 change: 1 addition & 0 deletions src/analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ SET(QGIS_ANALYSIS_SRCS

network/qgsgraph.cpp
network/qgsgraphbuilder.cpp
network/qgsgraphbuilderinterface.cpp
network/qgsnetworkspeedstrategy.cpp
network/qgsnetworkdistancestrategy.cpp
network/qgsvectorlayerdirector.cpp
Expand Down
45 changes: 45 additions & 0 deletions src/analysis/network/qgsgraphbuilderinterface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/***************************************************************************
qgsgraphbuilderinterface.cpp
--------------------------------------
Date : 2018-10-08
Copyright : (C) 2018 Denis Rouzaud
Email : denis@opengis.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 "qgsgraphbuilderinterface.h"

#include "qgsproject.h"

QgsGraphBuilderInterface::QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled,
double topologyTolerance, const QString &ellipsoidID )
: mCrs( crs )
, mCtfEnabled( ctfEnabled )
, mTopologyTolerance( topologyTolerance )
{
mDa.setSourceCrs( mCrs, QgsProject::instance()->transformContext() );
mDa.setEllipsoid( ellipsoidID );
}

void QgsGraphBuilderInterface::addVertex( int id, const QgsPointXY &pt )
{
Q_UNUSED( id );
Q_UNUSED( pt );
}

void QgsGraphBuilderInterface::addEdge( int pt1id, const QgsPointXY &pt1,
int pt2id, const QgsPointXY &pt2,
const QVector<QVariant> &strategies )
{
Q_UNUSED( pt1id );
Q_UNUSED( pt1 );
Q_UNUSED( pt2id );
Q_UNUSED( pt2 );
Q_UNUSED( strategies );
}
29 changes: 6 additions & 23 deletions src/analysis/network/qgsgraphbuilderinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
#include <QVector>
#include <QVariant>

#include "qgspoint.h"
#include "qgsproject.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsdistancearea.h"
#include "qgis_analysis.h"

class QgsPoint;

#ifdef SIP_RUN
% ModuleHeaderCode
#include <qgsgraphbuilder.h>
Expand Down Expand Up @@ -58,14 +58,8 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
* \param topologyTolerance sqrt distance between source point as one graph vertex
* \param ellipsoidID ellipsoid for edge measurement
*/
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" )
: mCrs( crs )
, mCtfEnabled( ctfEnabled )
, mTopologyTolerance( topologyTolerance )
{
mDa.setSourceCrs( mCrs, QgsProject::instance()->transformContext() );
mDa.setEllipsoid( ellipsoidID );
}
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true,
double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" );

virtual ~QgsGraphBuilderInterface() = default;

Expand Down Expand Up @@ -99,11 +93,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
* \param pt vertex coordinates
* \note id and pt are redundant. You can use pt or id to identify the vertex
*/
virtual void addVertex( int id, const QgsPointXY &pt )
{
Q_UNUSED( id );
Q_UNUSED( pt );
}
virtual void addVertex( int id, const QgsPointXY &pt );

/**
* Add edge to the graph
Expand All @@ -114,14 +104,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
* \param strategies optimization strategies
* \note pt1id, pt1 and pt2id, pt2 is a redundant interface. You can use vertex coordinates or their identificators.
*/
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &strategies )
{
Q_UNUSED( pt1id );
Q_UNUSED( pt1 );
Q_UNUSED( pt2id );
Q_UNUSED( pt2 );
Q_UNUSED( strategies );
}
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &strategies );

private:
QgsCoordinateReferenceSystem mCrs;
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsattributesformproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "qgis_app.h"
#include "qgsaddattrdialog.h"
#include "qgslogger.h"
#include "qgsproject.h"
#include "qgsexpressionbuilderdialog.h"
#include "qgsfieldcalculator.h"
#include "qgsfieldexpressionwidget.h"
Expand Down
1 change: 0 additions & 1 deletion src/app/qgshandlebadlayers.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#define QGSHANDLEBADLAYERS_H

#include "ui_qgshandlebadlayersbase.h"
#include "qgsproject.h"
#include "qgsprojectbadlayerhandler.h"
#include "qgis_app.h"

Expand Down
1 change: 1 addition & 0 deletions src/app/qgslayercapabilitiesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "qgslayertree.h"
#include "qgslayertreemodel.h"
#include "qgsvectorlayer.h"
#include "qgsproject.h"

QgsLayerCapabilitiesModel::QgsLayerCapabilitiesModel( QgsProject *project, QObject *parent )
: QSortFilterProxyModel( parent )
Expand Down
5 changes: 4 additions & 1 deletion src/app/qgslayercapabilitiesmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
#define QGSLAYERCAPABILITIESMODEL_H

#include <QObject>
#include <QSortFilterProxyModel>

#include "qgis_app.h"
#include "qgsproject.h"

class QgsLayerTreeModel;
class QgsLayerTreeNode;
class QgsProject;
class QgsMapLayer;


class APP_EXPORT QgsLayerCapabilitiesModel : public QSortFilterProxyModel
{
Expand Down
1 change: 1 addition & 0 deletions src/app/qgssourcefieldsproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "qgssourcefieldsproperties.h"
#include "qgsvectorlayer.h"
#include "qgsproject.h"

QgsSourceFieldsProperties::QgsSourceFieldsProperties( QgsVectorLayer *layer, QWidget *parent )
: QWidget( parent )
Expand Down
1 change: 0 additions & 1 deletion src/app/qgssourcefieldsproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "qgis_app.h"
#include "qgsaddattrdialog.h"
#include "qgslogger.h"
#include "qgsproject.h"
#include "qgsexpressionbuilderdialog.h"
#include "qgsfieldcalculator.h"

Expand Down
4 changes: 3 additions & 1 deletion src/server/qgsconfigcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

#include "qgis_server.h"
#include "qgis_sip.h"
#include "qgsproject.h"


class QgsProject;

/**
* \ingroup server
Expand Down
3 changes: 2 additions & 1 deletion src/server/qgsservercachefilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
#include <QMultiMap>
#include <QDomDocument>
#include <QObject>
#include "qgsproject.h"
#include "qgsserverrequest.h"
#include "qgis_server.h"
#include "qgis_sip.h"

class QgsProject;

SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )

class QgsServerInterface;
Expand Down
3 changes: 2 additions & 1 deletion src/server/qgsservercachemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@

#include <QMultiMap>
#include <QDomDocument>
#include "qgsproject.h"
#include "qgis_server.h"
#include "qgis_sip.h"

class QgsProject;

SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )

/**
Expand Down
1 change: 1 addition & 0 deletions src/server/qgsserverprojectutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include "qgsserverprojectutils.h"
#include "qgsproject.h"

bool QgsServerProjectUtils::owsServiceCapabilities( const QgsProject &project )
{
Expand Down
6 changes: 5 additions & 1 deletion src/server/qgsserverprojectutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
#ifndef QGSSERVERPROJECTUTILS_H
#define QGSSERVERPROJECTUTILS_H

#include <QString>

#include "qgis_server.h"
#include "qgsproject.h"

class QgsProject;
class QgsRectangle;

#ifdef SIP_RUN
% ModuleHeaderCode
Expand Down
5 changes: 4 additions & 1 deletion src/server/services/wcs/qgswcsgetcoverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@
* (at your option) any later version. *
* *
***************************************************************************/

#include <QTemporaryFile>

#include "qgswcsutils.h"
#include "qgsserverprojectutils.h"
#include "qgswcsgetcoverage.h"

#include "qgsproject.h"
#include "qgsrasterlayer.h"
#include "qgsrasterdataprovider.h"
#include "qgsrasterpipe.h"
#include "qgsrasterprojector.h"
#include "qgsrasterfilewriter.h"

#include <QTemporaryFile>

namespace QgsWcs
{
Expand Down
4 changes: 4 additions & 0 deletions src/server/services/wfs/qgswfstransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* (at your option) any later version. *
* *
***************************************************************************/


#include "qgswfsutils.h"
#include "qgsserverprojectutils.h"
#include "qgsfields.h"
Expand All @@ -31,6 +33,8 @@
#include "qgsfilterrestorer.h"
#include "qgsogcutils.h"
#include "qgswfstransaction.h"
#include "qgsproject.h"


namespace QgsWfs
{
Expand Down
3 changes: 3 additions & 0 deletions src/server/services/wfs/qgswfstransaction_1_0_0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
* (at your option) any later version. *
* *
***************************************************************************/


#include "qgswfsutils.h"
#include "qgsserverprojectutils.h"
#include "qgsfields.h"
#include "qgsexpression.h"
#include "qgsgeometry.h"
#include "qgsmaplayer.h"
#include "qgsproject.h"
#include "qgsfeatureiterator.h"
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
Expand Down
1 change: 1 addition & 0 deletions src/server/services/wfs/qgswfsutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "qgsserverprojectutils.h"
#include "qgswfsparameters.h"
#include "qgsvectorlayer.h"
#include "qgsproject.h"

namespace QgsWfs
{
Expand Down
2 changes: 2 additions & 0 deletions src/server/services/wms/qgslayerrestorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <QList>
#include <QDomDocument>
#include <QMap>

#include "qgsfeatureid.h"

Expand Down Expand Up @@ -49,6 +50,7 @@ class QgsLayerRestorer
~QgsLayerRestorer();

private:

struct QgsLayerSettings
{
QString name;
Expand Down
2 changes: 2 additions & 0 deletions src/server/services/wms/qgswmsdescribelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgswmsutils.h"
#include "qgswmsdescribelayer.h"
#include "qgsserverprojectutils.h"
#include "qgsproject.h"

namespace QgsWms
{
Expand Down
4 changes: 4 additions & 0 deletions src/server/services/wms/qgswmsgetstyles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
* (at your option) any later version. *
* *
***************************************************************************/


#include "qgswmsutils.h"
#include "qgswmsgetstyles.h"
#include "qgsserverprojectutils.h"

#include "qgsproject.h"
#include "qgsrenderer.h"
#include "qgsvectorlayer.h"
#include "qgsmaplayerstylemanager.h"


namespace QgsWms
{

Expand Down
Loading

0 comments on commit 711ec1d

Please sign in to comment.