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
|
|
|
|
{
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can
|
|
|
|
take into account travel distance, amount of time or money. Currently there are two strategies
|
|
|
|
implemented in the analysis library: QgsNetworkDistanceStrategy and QgsNetworkSpeedStrategy.
|
|
|
|
QgsNetworkStrategy implemented using "strategy" design pattern.
|
|
|
|
%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
|
|
|
|
Default constructor
|
|
|
|
%End
|
2016-11-19 15:41:39 +02:00
|
|
|
|
|
|
|
virtual ~QgsNetworkStrategy();
|
|
|
|
|
|
|
|
virtual QgsAttributeList requiredAttributes() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Returns list of the source layer attributes needed for cost calculation.
|
|
|
|
This method called by QgsGraphDirector.
|
|
|
|
:return: list of required attributes
|
|
|
|
:rtype: QgsAttributeList
|
|
|
|
%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
|
|
|
|
Returns edge cost
|
|
|
|
:rtype: QVariant
|
|
|
|
%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 *
|
|
|
|
************************************************************************/
|