2011-06-02 13:49:43 +06:00
|
|
|
%ModuleHeaderCode
|
|
|
|
// fix to allow compilation with sip 4.7 that for some reason
|
|
|
|
// doesn't add these includes to the file where the code from
|
|
|
|
// ConvertToSubClassCode goes.
|
|
|
|
#include <qgsdistancearcproperter.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \ingroup networkanalysis
|
|
|
|
* \class QgsEdgeProperter
|
2012-09-24 02:28:15 +02:00
|
|
|
* \brief QgsEdgeProperter is a strategy pattern.
|
|
|
|
* You can use it for customize arc property. For example look at QgsDistanceArcProperter or src/plugins/roadgraph/speedproperter.h
|
2011-06-02 13:49:43 +06:00
|
|
|
*/
|
|
|
|
class QgsArcProperter
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsarcproperter.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
%ConvertToSubClassCode
|
|
|
|
if ( dynamic_cast< QgsDistanceArcProperter* > ( sipCpp ) != NULL )
|
|
|
|
sipClass = sipClass_QgsDistanceArcProperter;
|
|
|
|
else
|
|
|
|
sipClass = NULL;
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* default constructor
|
|
|
|
*/
|
|
|
|
QgsArcProperter();
|
2013-01-12 23:48:58 +01:00
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
/**
|
|
|
|
* QgsGraphDirector call this method for fetching attribute from source layer
|
|
|
|
* \return required attributes list
|
|
|
|
*/
|
|
|
|
virtual QgsAttributeList requiredAttributes() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
/**
|
|
|
|
* calculate and return adge property
|
|
|
|
*/
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual QVariant property( double distance, const QgsFeature &f ) const;
|
2011-06-02 13:49:43 +06:00
|
|
|
};
|