Skip to content

Commit 711ec1d

Browse files
committed
forward declaration of QgsProject
1 parent 0901a21 commit 711ec1d

27 files changed

+102
-33
lines changed

python/analysis/auto_generated/network/qgsgraphbuilderinterface.sip.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111

12+
1213
%ModuleHeaderCode
1314
#include <qgsgraphbuilder.h>
1415
%End
@@ -31,7 +32,8 @@ QgsGraphBuilder and QgsGraphDirector both use a "builder" design pattern
3132
%End
3233
public:
3334

34-
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" );
35+
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true,
36+
double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" );
3537
%Docstring
3638
Default constructor
3739

python/server/auto_generated/qgsconfigcache.sip.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212

1313

14+
15+
1416
class QgsConfigCache : QObject
1517
{
1618
%Docstring

python/server/auto_generated/qgsservercachefilter.sip.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414

15+
1516
class QgsServerCacheFilter
1617
{
1718
%Docstring

python/server/auto_generated/qgsservercachemanager.sip.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212

1313

14+
1415
class QgsServerCacheManager
1516
{
1617
%Docstring

python/server/auto_generated/qgsserverprojectutils.sip.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010

1111

12+
13+
1214
%ModuleHeaderCode
1315
#include "qgsserverprojectutils.h"
1416
%End

src/analysis/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ SET(QGIS_ANALYSIS_SRCS
130130

131131
network/qgsgraph.cpp
132132
network/qgsgraphbuilder.cpp
133+
network/qgsgraphbuilderinterface.cpp
133134
network/qgsnetworkspeedstrategy.cpp
134135
network/qgsnetworkdistancestrategy.cpp
135136
network/qgsvectorlayerdirector.cpp
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/***************************************************************************
2+
qgsgraphbuilderinterface.cpp
3+
--------------------------------------
4+
Date : 2018-10-08
5+
Copyright : (C) 2018 Denis Rouzaud
6+
Email : denis@opengis.ch
7+
****************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#include "qgsgraphbuilderinterface.h"
17+
18+
#include "qgsproject.h"
19+
20+
QgsGraphBuilderInterface::QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled,
21+
double topologyTolerance, const QString &ellipsoidID )
22+
: mCrs( crs )
23+
, mCtfEnabled( ctfEnabled )
24+
, mTopologyTolerance( topologyTolerance )
25+
{
26+
mDa.setSourceCrs( mCrs, QgsProject::instance()->transformContext() );
27+
mDa.setEllipsoid( ellipsoidID );
28+
}
29+
30+
void QgsGraphBuilderInterface::addVertex( int id, const QgsPointXY &pt )
31+
{
32+
Q_UNUSED( id );
33+
Q_UNUSED( pt );
34+
}
35+
36+
void QgsGraphBuilderInterface::addEdge( int pt1id, const QgsPointXY &pt1,
37+
int pt2id, const QgsPointXY &pt2,
38+
const QVector<QVariant> &strategies )
39+
{
40+
Q_UNUSED( pt1id );
41+
Q_UNUSED( pt1 );
42+
Q_UNUSED( pt2id );
43+
Q_UNUSED( pt2 );
44+
Q_UNUSED( strategies );
45+
}

src/analysis/network/qgsgraphbuilderinterface.h

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
#include <QVector>
2020
#include <QVariant>
2121

22-
#include "qgspoint.h"
23-
#include "qgsproject.h"
2422
#include "qgscoordinatereferencesystem.h"
2523
#include "qgsdistancearea.h"
2624
#include "qgis_analysis.h"
2725

26+
class QgsPoint;
27+
2828
#ifdef SIP_RUN
2929
% ModuleHeaderCode
3030
#include <qgsgraphbuilder.h>
@@ -58,14 +58,8 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
5858
* \param topologyTolerance sqrt distance between source point as one graph vertex
5959
* \param ellipsoidID ellipsoid for edge measurement
6060
*/
61-
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" )
62-
: mCrs( crs )
63-
, mCtfEnabled( ctfEnabled )
64-
, mTopologyTolerance( topologyTolerance )
65-
{
66-
mDa.setSourceCrs( mCrs, QgsProject::instance()->transformContext() );
67-
mDa.setEllipsoid( ellipsoidID );
68-
}
61+
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true,
62+
double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" );
6963

7064
virtual ~QgsGraphBuilderInterface() = default;
7165

@@ -99,11 +93,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
9993
* \param pt vertex coordinates
10094
* \note id and pt are redundant. You can use pt or id to identify the vertex
10195
*/
102-
virtual void addVertex( int id, const QgsPointXY &pt )
103-
{
104-
Q_UNUSED( id );
105-
Q_UNUSED( pt );
106-
}
96+
virtual void addVertex( int id, const QgsPointXY &pt );
10797

10898
/**
10999
* Add edge to the graph
@@ -114,14 +104,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
114104
* \param strategies optimization strategies
115105
* \note pt1id, pt1 and pt2id, pt2 is a redundant interface. You can use vertex coordinates or their identificators.
116106
*/
117-
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &strategies )
118-
{
119-
Q_UNUSED( pt1id );
120-
Q_UNUSED( pt1 );
121-
Q_UNUSED( pt2id );
122-
Q_UNUSED( pt2 );
123-
Q_UNUSED( strategies );
124-
}
107+
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &strategies );
125108

126109
private:
127110
QgsCoordinateReferenceSystem mCrs;

src/app/qgsattributesformproperties.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "qgis_app.h"
3636
#include "qgsaddattrdialog.h"
3737
#include "qgslogger.h"
38-
#include "qgsproject.h"
3938
#include "qgsexpressionbuilderdialog.h"
4039
#include "qgsfieldcalculator.h"
4140
#include "qgsfieldexpressionwidget.h"

src/app/qgshandlebadlayers.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#define QGSHANDLEBADLAYERS_H
1919

2020
#include "ui_qgshandlebadlayersbase.h"
21-
#include "qgsproject.h"
2221
#include "qgsprojectbadlayerhandler.h"
2322
#include "qgis_app.h"
2423

0 commit comments

Comments
 (0)