QGIS API Documentation
3.4.15-Madeira (e83d02e274)
|
QgsNetworkStrategy defines strategy used for calculation of the edge cost. More...
#include <qgsnetworkstrategy.h>
Public Member Functions | |
QgsNetworkStrategy ()=default | |
Default constructor. More... | |
virtual | ~QgsNetworkStrategy ()=default |
virtual QVariant | cost (double distance, const QgsFeature &f) const =0 |
Returns edge cost. More... | |
virtual QSet< int > | requiredAttributes () const |
Returns a list of the source layer attributes needed for cost calculation. More... | |
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.
Definition at line 42 of file qgsnetworkstrategy.h.
|
default |
Default constructor.
|
virtualdefault |
|
pure virtual |
Returns edge cost.
Implemented in QgsNetworkSpeedStrategy, and QgsNetworkDistanceStrategy.
|
inlinevirtual |
Returns a list of the source layer attributes needed for cost calculation.
This is method called by QgsGraphDirector.
Reimplemented in QgsNetworkSpeedStrategy.
Definition at line 69 of file qgsnetworkstrategy.h.