2017-05-01 12:44:45 +03:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/network/qgsnetworkstrategy.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-01 18:32:37 +03:00
|
|
|
%ModuleHeaderCode
|
2016-11-19 15:41:39 +02:00
|
|
|
#include <qgsnetworkspeedstrategy.h>
|
|
|
|
#include <qgsnetworkdistancestrategy.h>
|
|
|
|
%End
|
|
|
|
|
2017-05-01 12:44:45 +03:00
|
|
|
|
2016-11-19 15:41:39 +02:00
|
|
|
class QgsNetworkStrategy
|
|
|
|
{
|
2021-03-22 21:13:52 +01:00
|
|
|
%Docstring(signature="appended")
|
2021-01-30 09:16:35 +10:00
|
|
|
:py:class:`QgsNetworkStrategy` defines strategy used for calculation of the edge cost. For example it can
|
2017-12-15 10:36:55 -04:00
|
|
|
take into account travel distance, amount of time or money. Currently there are two strategies
|
2021-01-30 09:16:35 +10:00
|
|
|
implemented in the analysis library: :py:class:`QgsNetworkDistanceStrategy` and :py:class:`QgsNetworkSpeedStrategy`.
|
|
|
|
:py:class:`QgsNetworkStrategy` implemented using "strategy" design pattern.
|
2017-05-01 12:44:45 +03:00
|
|
|
%End
|
|
|
|
|
2016-11-19 15:41:39 +02:00
|
|
|
%TypeHeaderCode
|
2017-05-01 12:44:45 +03:00
|
|
|
#include "qgsnetworkstrategy.h"
|
2016-11-19 15:41:39 +02:00
|
|
|
%End
|
|
|
|
%ConvertToSubClassCode
|
2017-05-01 12:44:45 +03:00
|
|
|
if ( dynamic_cast< QgsNetworkDistanceStrategy * >( sipCpp ) != NULL )
|
|
|
|
sipType = sipType_QgsNetworkDistanceStrategy;
|
|
|
|
else if ( dynamic_cast< QgsNetworkSpeedStrategy * >( sipCpp ) != NULL )
|
|
|
|
sipType = sipType_QgsNetworkSpeedStrategy;
|
|
|
|
else
|
|
|
|
sipType = NULL;
|
2016-11-19 15:41:39 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
QgsNetworkStrategy();
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Default constructor
|
2017-05-01 12:44:45 +03:00
|
|
|
%End
|
2016-11-19 15:41:39 +02:00
|
|
|
|
|
|
|
virtual ~QgsNetworkStrategy();
|
|
|
|
|
2017-10-29 08:43:47 +10:00
|
|
|
virtual QSet< int > requiredAttributes() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a list of the source layer attributes needed for cost calculation.
|
2017-12-19 11:43:52 -04:00
|
|
|
This is method called by :py:class:`QgsGraphDirector`.
|
2017-05-01 12:44:45 +03:00
|
|
|
%End
|
2016-11-19 15:41:39 +02:00
|
|
|
|
|
|
|
virtual QVariant cost( double distance, const QgsFeature &f ) const = 0;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns edge cost
|
2017-05-01 12:44:45 +03:00
|
|
|
%End
|
2016-11-19 15:41:39 +02:00
|
|
|
};
|
2017-05-01 12:44:45 +03:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/network/qgsnetworkstrategy.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|