QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
QgsNetworkStrategy defines strategy used for calculation of the edge cost. More...
#include <qgsnetworkstrategy.h>
Public Member Functions | |
QgsNetworkStrategy ()=default | |
virtual | ~QgsNetworkStrategy ()=default |
virtual QVariant | cost (double distance, const QgsFeature &f) const =0 |
Returns edge cost. | |
virtual QSet< int > | requiredAttributes () const |
Returns a list of the source layer attributes needed for cost calculation. | |
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 40 of file qgsnetworkstrategy.h.
|
default |
|
virtualdefault |
|
pure virtual |
Returns edge cost.
Implemented in QgsNetworkDistanceStrategy, and QgsNetworkSpeedStrategy.
|
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 64 of file qgsnetworkstrategy.h.