Skip to content
Permalink
Browse files

[API][network analysis] move network analysis into analysis library to

be consistent with other analysis stuff
  • Loading branch information
alexbruy committed Nov 21, 2016
1 parent 3c3e17a commit 14c930a5a88c7add7b4a20cf91ca5c7fd7299824
@@ -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)

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

This file was deleted.

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

This file was deleted.

@@ -1,5 +1,3 @@
SUBDIRS(network)

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

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

This file was deleted.

@@ -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
@@ -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
@@ -35,7 +35,7 @@
class QgsGraphVertex;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsGraphArc
* \brief This class implements a graph edge
*/
@@ -22,7 +22,7 @@

class QgsGraph;

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

@@ -25,7 +25,7 @@ class QgsCoordinateTransform;
class QgsGraph;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsGraphBuilder
* \brief This class is used for making the QgsGraph object
*/
@@ -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
*/
@@ -26,7 +26,7 @@
class QgsGraphBuilderInterface;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsGraphDirector
* \brief Determine making the graph. QgsGraphBuilder and QgsGraphDirector is a builder patter.
*/
@@ -22,7 +22,7 @@ class QgsGraphBuilderInterface;
class QgsVectorLayer;

/**
* \ingroup networkanalysis
* \ingroup analysis
* \class QgsLineVectorLayerDirector
* \brief Determine making the graph from vector line layer
*/
@@ -18,7 +18,7 @@

#include <qgsarcproperter.h>

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

0 comments on commit 14c930a

Please sign in to comment.
You can’t perform that action at this time.