Skip to content

Commit 14c930a

Browse files
committed
[API][network analysis] move network analysis into analysis library to
be consistent with other analysis stuff
1 parent 3c3e17a commit 14c930a

18 files changed

+50
-176
lines changed

python/CMakeLists.txt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,20 @@ IF(NOT QT_MOBILITY_LOCATION_FOUND)
138138
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} MOBILITY_LOCATION)
139139
ENDIF(NOT QT_MOBILITY_LOCATION_FOUND)
140140

141-
IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
141+
IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
142142
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} PROXY_FACTORY)
143143
ENDIF(PYQT4_VERSION_NUM LESS 263680)
144144

145145
#
146-
IF(NOT PYQT4_VERSION_NUM LESS 264194) # 0x040802
146+
IF(NOT PYQT4_VERSION_NUM LESS 264194) # 0x040802
147147
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETTYPE_CONVERSION)
148148
ENDIF(NOT PYQT4_VERSION_NUM LESS 264194)
149149

150150
IF(PYQT4_VERSION_NUM LESS 264196) # 0x040804
151151
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QLISTCONSTPTR_CONVERSION)
152152
ENDIF(PYQT4_VERSION_NUM LESS 264196)
153153

154-
IF(NOT PYQT4_VERSION_NUM LESS 264453) # 0x040905
154+
IF(NOT PYQT4_VERSION_NUM LESS 264453) # 0x040905
155155
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QVECTORINT_CONVERSION)
156156
ENDIF(NOT PYQT4_VERSION_NUM LESS 264453)
157157

@@ -200,7 +200,7 @@ ENDIF(UNIX AND NOT SIP_VERSION_NUM LESS 265984)
200200
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._gui gui/gui.sip cpp_files)
201201
BUILD_SIP_PYTHON_MODULE(qgis._gui gui/gui.sip ${cpp_files} "" qgis_core qgis_gui)
202202

203-
SET(PY_MODULES core gui analysis networkanalysis)
203+
SET(PY_MODULES core gui analysis)
204204

205205
# server module
206206
IF (WITH_SERVER AND WITH_SERVER_PLUGINS)
@@ -228,8 +228,8 @@ INCLUDE_DIRECTORIES(
228228
../src/analysis/interpolation
229229
../src/analysis/openstreetmap
230230
${CMAKE_BINARY_DIR}/src/analysis/vector
231-
${CMAKE_BINARY_DIR}/src/analysis/network
232231
${CMAKE_BINARY_DIR}/src/analysis/raster
232+
${CMAKE_BINARY_DIR}/src/analysis/network
233233
${CMAKE_BINARY_DIR}/src/analysis/interpolation
234234
${CMAKE_BINARY_DIR}/src/analysis/openstreetmap
235235
)
@@ -239,6 +239,7 @@ FILE(GLOB sip_files_analysis
239239
analysis/*.sip
240240
analysis/raster/*.sip
241241
analysis/vector/*.sip
242+
analysis/network/*.sip
242243
analysis/interpolation/*.sip
243244
analysis/openstreetmap/*.sip
244245
)
@@ -247,21 +248,14 @@ SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.an
247248
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._analysis analysis/analysis.sip cpp_files)
248249
BUILD_SIP_PYTHON_MODULE(qgis._analysis analysis/analysis.sip ${cpp_files} "" qgis_core qgis_analysis)
249250

250-
# network-analysis module
251-
FILE(GLOB_RECURSE sip_files_network_analysis analysis/network/*.sip)
252-
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_network_analysis})
253-
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.networkanalysis.api)
254-
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._networkanalysis analysis/network/networkanalysis.sip cpp_files)
255-
BUILD_SIP_PYTHON_MODULE(qgis._networkanalysis networkanalysis/networkanalysis.sip ${cpp_files} "" qgis_core qgis_networkanalysis)
256-
257251
SET(QGIS_PYTHON_DIR ${PYTHON_SITE_PACKAGES_DIR}/qgis)
258252

259253
IF(WITH_QSCIAPI)
260254
# wait until after python module builds for api files to be available
261255
SET(QGIS_PYTHON_API_FILE "${CMAKE_BINARY_DIR}/python/qsci_apis/PyQGIS.api")
262256

263257
ADD_CUSTOM_TARGET(qsci-api ALL
264-
DEPENDS python_module_qgis__gui python_module_qgis__core python_module_qgis__analysis python_module_qgis__networkanalysis)
258+
DEPENDS python_module_qgis__gui python_module_qgis__core python_module_qgis__analysis)
265259

266260
# run update/concatenate command
267261
ADD_CUSTOM_COMMAND(TARGET qsci-api

python/analysis/analysis.sip

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,13 @@
5252
%Include raster/qgsruggednessfilter.sip
5353
%Include raster/qgsslopefilter.sip
5454
%Include raster/qgstotalcurvaturefilter.sip
55+
56+
%Include network/qgsgraph.sip
57+
%Include network/qgsarcproperter.sip
58+
%Include network/qgsspeedarcproperter.sip
59+
%Include network/qgsdistancearcproperter.sip
60+
%Include network/qgsgraphbuilderintr.sip
61+
%Include network/qgsgraphbuilder.sip
62+
%Include network/qgsgraphdirector.sip
63+
%Include network/qgslinevectorlayerdirector.sip
64+
%Include network/qgsgraphanalyzer.sip

python/analysis/network/networkanalysis.sip

Lines changed: 0 additions & 15 deletions
This file was deleted.

python/analysis/network/qgsarcproperter.sip

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
%ModuleHeaderCode
2-
// fix to allow compilation with sip 4.7 that for some reason
3-
// doesn't add these includes to the file where the code from
4-
// ConvertToSubClassCode goes.
52
#include <qgsspeedarcproperter.h>
63
#include <qgsdistancearcproperter.h>
74
%End
@@ -21,6 +18,8 @@ class QgsArcProperter
2118
%ConvertToSubClassCode
2219
if ( dynamic_cast< QgsDistanceArcProperter* > ( sipCpp ) != NULL )
2320
sipType = sipType_QgsDistanceArcProperter;
21+
else if ( dynamic_cast< QgsSpeedArcProperter* > ( sipCpp ) != NULL )
22+
sipType = sipType_QgsSpeedArcProperter;
2423
else
2524
sipType = NULL;
2625
%End

python/networkanalysis/__init__.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/analysis/CMakeLists.txt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
SUBDIRS(network)
2-
31
#############################################################
42
# sources
53

@@ -48,12 +46,22 @@ SET(QGIS_ANALYSIS_SRCS
4846
openstreetmap/qgsosmdatabase.cpp
4947
openstreetmap/qgsosmdownload.cpp
5048
openstreetmap/qgsosmimport.cpp
49+
50+
network/qgsgraph.cpp
51+
network/qgsgraphbuilder.cpp
52+
network/qgsspeedarcproperter.cpp
53+
network/qgsdistancearcproperter.cpp
54+
network/qgslinevectorlayerdirector.cpp
55+
network/qgsgraphanalyzer.cpp
5156
)
5257

5358
SET(QGIS_ANALYSIS_MOC_HDRS
5459
openstreetmap/qgsosmdownload.h
5560
openstreetmap/qgsosmimport.h
5661
vector/qgsgeometrysnapper.h
62+
63+
network/qgsgraphdirector.h
64+
network/qgslinevectorlayerdirector.h
5765
)
5866

5967
INCLUDE_DIRECTORIES(SYSTEM ${SPATIALITE_INCLUDE_DIR})
@@ -134,6 +142,16 @@ SET(QGIS_ANALYSIS_HDRS
134142
openstreetmap/qgsosmdatabase.h
135143
openstreetmap/qgsosmdownload.h
136144
openstreetmap/qgsosmimport.h
145+
146+
network/qgsgraph.h
147+
network/qgsgraphbuilderintr.h
148+
network/qgsgraphbuilder.h
149+
network/qgsarcproperter.h
150+
network/qgsspeedarcproperter.h
151+
network/qgsdistancearcproperter.h
152+
network/qgsgraphdirector.h
153+
network/qgslinevectorlayerdirector.h
154+
network/qgsgraphanalyzer.h
137155
)
138156

139157
INCLUDE_DIRECTORIES(
@@ -143,6 +161,7 @@ INCLUDE_DIRECTORIES(
143161
${CMAKE_CURRENT_SOURCE_DIR}/../core/raster
144162
${CMAKE_CURRENT_SOURCE_DIR}/../core/symbology-ng
145163
interpolation
164+
network
146165
)
147166
INCLUDE_DIRECTORIES(SYSTEM
148167
${PROJ_INCLUDE_DIR}

src/analysis/network/CMakeLists.txt

Lines changed: 0 additions & 100 deletions
This file was deleted.

src/analysis/network/qgsarcproperter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <qgsfeaturerequest.h>
2323

2424
/**
25-
* \ingroup networkanalysis
25+
* \ingroup analysis
2626
* \class QgsArcProperter
2727
* \brief QgsArcProperter is a strategy pattern.
2828
* You can use it for customize arc property. For example look at QgsDistanceArcProperter and QgsSpeedArcProperter

src/analysis/network/qgsdistancearcproperter.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@
1616
#ifndef QGSDISTANCEARCPROPERTER_H
1717
#define QGSDISTANCEARCPROPERTER_H
1818

19-
// QT4 includes
20-
#include <QVariant>
21-
22-
// QGIS includes
2319
#include <qgsarcproperter.h>
2420

25-
/** \ingroup networkanalysis
21+
/** \ingroup analysis
2622
* \class QgsDistanceArcProperter
2723
*/
2824
class ANALYSIS_EXPORT QgsDistanceArcProperter : public QgsArcProperter

src/analysis/network/qgsgraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
class QgsGraphVertex;
3636

3737
/**
38-
* \ingroup networkanalysis
38+
* \ingroup analysis
3939
* \class QgsGraphArc
4040
* \brief This class implements a graph edge
4141
*/

0 commit comments

Comments
 (0)