Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename QgsStrategy to QgsNetworkStrategy to avoid possible future
confusion when we will have other stuff with strategies. Also rename corresponding subclasses
- Loading branch information
Showing
16 changed files
with
116 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../analysis/network/qgsdistancestrategy.sip → ...is/network/qgsnetworkdistancestrategy.sip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class QgsNetworkSpeedStrategy : QgsNetworkStrategy | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsnetworkspeedstrategy.h> | ||
%End | ||
|
||
public: | ||
QgsNetworkSpeedStrategy( int attributeId, double defaultValue, double toMetricFactor ); | ||
|
||
QVariant cost( double distance, const QgsFeature& f ) const; | ||
|
||
QgsAttributeList requiredAttributes() const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
%ModuleHeaderCode | ||
#include <qgsnetworkspeedstrategy.h> | ||
#include <qgsnetworkdistancestrategy.h> | ||
%End | ||
|
||
/** | ||
* \ingroup analysis | ||
* \class QgsNetworkStrategy | ||
* \brief 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. | ||
*/ | ||
class QgsNetworkStrategy | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsnetworkstrategy.h> | ||
%End | ||
|
||
%ConvertToSubClassCode | ||
if ( dynamic_cast< QgsNetworkDistanceStrategy* > ( sipCpp ) != NULL ) | ||
sipType = sipType_QgsNetworkDistanceStrategy; | ||
else if ( dynamic_cast< QgsNetworkSpeedStrategy* > ( sipCpp ) != NULL ) | ||
sipType = sipType_QgsNetworkSpeedStrategy; | ||
else | ||
sipType = NULL; | ||
%End | ||
|
||
|
||
public: | ||
|
||
/** | ||
* Default constructor | ||
*/ | ||
QgsNetworkStrategy(); | ||
|
||
virtual ~QgsNetworkStrategy(); | ||
|
||
/** | ||
* Returns list of the source layer attributes needed for cost calculation. | ||
* This method called by QgsGraphDirector. | ||
* \return list of required attributes | ||
*/ | ||
virtual QgsAttributeList requiredAttributes() const; | ||
|
||
/** | ||
* Returns edge cost | ||
*/ | ||
virtual QVariant cost( double distance, const QgsFeature &f ) const = 0; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.