Skip to content

Commit

Permalink
[API][network analysis] move network analysis into analysis library to
Browse files Browse the repository at this point in the history
be consistent with other analysis stuff
  • Loading branch information
alexbruy committed Nov 21, 2016
1 parent 3c3e17a commit 14c930a
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 176 deletions.
20 changes: 7 additions & 13 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,20 @@ IF(NOT QT_MOBILITY_LOCATION_FOUND)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} MOBILITY_LOCATION)
ENDIF(NOT QT_MOBILITY_LOCATION_FOUND)

IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} PROXY_FACTORY)
ENDIF(PYQT4_VERSION_NUM LESS 263680)

#
IF(NOT PYQT4_VERSION_NUM LESS 264194) # 0x040802
IF(NOT PYQT4_VERSION_NUM LESS 264194) # 0x040802
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETTYPE_CONVERSION)
ENDIF(NOT PYQT4_VERSION_NUM LESS 264194)

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

IF(NOT PYQT4_VERSION_NUM LESS 264453) # 0x040905
IF(NOT PYQT4_VERSION_NUM LESS 264453) # 0x040905
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QVECTORINT_CONVERSION)
ENDIF(NOT PYQT4_VERSION_NUM LESS 264453)

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

SET(PY_MODULES core gui analysis networkanalysis)
SET(PY_MODULES core gui analysis)

# server module
IF (WITH_SERVER AND WITH_SERVER_PLUGINS)
Expand Down Expand Up @@ -228,8 +228,8 @@ INCLUDE_DIRECTORIES(
../src/analysis/interpolation
../src/analysis/openstreetmap
${CMAKE_BINARY_DIR}/src/analysis/vector
${CMAKE_BINARY_DIR}/src/analysis/network
${CMAKE_BINARY_DIR}/src/analysis/raster
${CMAKE_BINARY_DIR}/src/analysis/network
${CMAKE_BINARY_DIR}/src/analysis/interpolation
${CMAKE_BINARY_DIR}/src/analysis/openstreetmap
)
Expand All @@ -239,6 +239,7 @@ FILE(GLOB sip_files_analysis
analysis/*.sip
analysis/raster/*.sip
analysis/vector/*.sip
analysis/network/*.sip
analysis/interpolation/*.sip
analysis/openstreetmap/*.sip
)
Expand All @@ -247,21 +248,14 @@ SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.an
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._analysis analysis/analysis.sip cpp_files)
BUILD_SIP_PYTHON_MODULE(qgis._analysis analysis/analysis.sip ${cpp_files} "" qgis_core qgis_analysis)

# network-analysis module
FILE(GLOB_RECURSE sip_files_network_analysis analysis/network/*.sip)
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_network_analysis})
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.networkanalysis.api)
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._networkanalysis analysis/network/networkanalysis.sip cpp_files)
BUILD_SIP_PYTHON_MODULE(qgis._networkanalysis networkanalysis/networkanalysis.sip ${cpp_files} "" qgis_core qgis_networkanalysis)

SET(QGIS_PYTHON_DIR ${PYTHON_SITE_PACKAGES_DIR}/qgis)

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

ADD_CUSTOM_TARGET(qsci-api ALL
DEPENDS python_module_qgis__gui python_module_qgis__core python_module_qgis__analysis python_module_qgis__networkanalysis)
DEPENDS python_module_qgis__gui python_module_qgis__core python_module_qgis__analysis)

# run update/concatenate command
ADD_CUSTOM_COMMAND(TARGET qsci-api
Expand Down
10 changes: 10 additions & 0 deletions python/analysis/analysis.sip
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@
%Include raster/qgsruggednessfilter.sip
%Include raster/qgsslopefilter.sip
%Include raster/qgstotalcurvaturefilter.sip

%Include network/qgsgraph.sip
%Include network/qgsarcproperter.sip
%Include network/qgsspeedarcproperter.sip
%Include network/qgsdistancearcproperter.sip
%Include network/qgsgraphbuilderintr.sip
%Include network/qgsgraphbuilder.sip
%Include network/qgsgraphdirector.sip
%Include network/qgslinevectorlayerdirector.sip
%Include network/qgsgraphanalyzer.sip
15 changes: 0 additions & 15 deletions python/analysis/network/networkanalysis.sip

This file was deleted.

5 changes: 2 additions & 3 deletions python/analysis/network/qgsarcproperter.sip
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
%ModuleHeaderCode
// fix to allow compilation with sip 4.7 that for some reason
// doesn't add these includes to the file where the code from
// ConvertToSubClassCode goes.
#include <qgsspeedarcproperter.h>
#include <qgsdistancearcproperter.h>
%End
Expand All @@ -21,6 +18,8 @@ class QgsArcProperter
%ConvertToSubClassCode
if ( dynamic_cast< QgsDistanceArcProperter* > ( sipCpp ) != NULL )
sipType = sipType_QgsDistanceArcProperter;
else if ( dynamic_cast< QgsSpeedArcProperter* > ( sipCpp ) != NULL )
sipType = sipType_QgsSpeedArcProperter;
else
sipType = NULL;
%End
Expand Down
28 changes: 0 additions & 28 deletions python/networkanalysis/__init__.py

This file was deleted.

23 changes: 21 additions & 2 deletions src/analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
SUBDIRS(network)

#############################################################
# sources

Expand Down Expand Up @@ -48,12 +46,22 @@ SET(QGIS_ANALYSIS_SRCS
openstreetmap/qgsosmdatabase.cpp
openstreetmap/qgsosmdownload.cpp
openstreetmap/qgsosmimport.cpp

network/qgsgraph.cpp
network/qgsgraphbuilder.cpp
network/qgsspeedarcproperter.cpp
network/qgsdistancearcproperter.cpp
network/qgslinevectorlayerdirector.cpp
network/qgsgraphanalyzer.cpp
)

SET(QGIS_ANALYSIS_MOC_HDRS
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h
vector/qgsgeometrysnapper.h

network/qgsgraphdirector.h
network/qgslinevectorlayerdirector.h
)

INCLUDE_DIRECTORIES(SYSTEM ${SPATIALITE_INCLUDE_DIR})
Expand Down Expand Up @@ -134,6 +142,16 @@ SET(QGIS_ANALYSIS_HDRS
openstreetmap/qgsosmdatabase.h
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h

network/qgsgraph.h
network/qgsgraphbuilderintr.h
network/qgsgraphbuilder.h
network/qgsarcproperter.h
network/qgsspeedarcproperter.h
network/qgsdistancearcproperter.h
network/qgsgraphdirector.h
network/qgslinevectorlayerdirector.h
network/qgsgraphanalyzer.h
)

INCLUDE_DIRECTORIES(
Expand All @@ -143,6 +161,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../core/raster
${CMAKE_CURRENT_SOURCE_DIR}/../core/symbology-ng
interpolation
network
)
INCLUDE_DIRECTORIES(SYSTEM
${PROJ_INCLUDE_DIR}
Expand Down
100 changes: 0 additions & 100 deletions src/analysis/network/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/analysis/network/qgsarcproperter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <qgsfeaturerequest.h>

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsArcProperter
* \brief QgsArcProperter is a strategy pattern.
* You can use it for customize arc property. For example look at QgsDistanceArcProperter and QgsSpeedArcProperter
Expand Down
6 changes: 1 addition & 5 deletions src/analysis/network/qgsdistancearcproperter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@
#ifndef QGSDISTANCEARCPROPERTER_H
#define QGSDISTANCEARCPROPERTER_H

// QT4 includes
#include <QVariant>

// QGIS includes
#include <qgsarcproperter.h>

/** \ingroup networkanalysis
/** \ingroup analysis
* \class QgsDistanceArcProperter
*/
class ANALYSIS_EXPORT QgsDistanceArcProperter : public QgsArcProperter
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class QgsGraphVertex;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsGraphArc
* \brief This class implements a graph edge
*/
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraphanalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class QgsGraph;

/** \ingroup networkanalysis
/** \ingroup analysis
* QGIS class with graph analysis functions
*/

Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraphbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class QgsCoordinateTransform;
class QgsGraph;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsGraphBuilder
* \brief This class is used for making the QgsGraph object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraphbuilderintr.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <qgsdistancearea.h>

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsGraphBuilderInterface
* \brief Determine interface for creating a graph. Contains the settings of the graph. QgsGraphBuilder and QgsGraphDirector both use a Builder pattern
*/
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraphdirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class QgsGraphBuilderInterface;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsGraphDirector
* \brief Determine making the graph. QgsGraphBuilder and QgsGraphDirector is a builder patter.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgslinevectorlayerdirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QgsGraphBuilderInterface;
class QgsVectorLayer;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsLineVectorLayerDirector
* \brief Determine making the graph from vector line layer
*/
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsspeedarcproperter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <qgsarcproperter.h>

/** \ingroup networkanalysis
/** \ingroup analysis
* \class QgsSpeedArcProperter
*/
class ANALYSIS_EXPORT QgsSpeedArcProperter : public QgsArcProperter
Expand Down
Loading

0 comments on commit 14c930a

Please sign in to comment.