2011-06-02 19:02:20 +06:00
|
|
|
%ModuleHeaderCode
|
2016-11-21 16:33:34 +02:00
|
|
|
#include <qgsvectorlayerdirector.h>
|
2011-06-02 19:02:20 +06:00
|
|
|
%End
|
|
|
|
|
|
|
|
/**
|
2016-11-16 16:48:41 +02:00
|
|
|
* \ingroup analysis
|
2011-06-02 19:02:20 +06:00
|
|
|
* \class QgsGraphDirector
|
2016-11-21 16:44:44 +02:00
|
|
|
* \brief Determine making the graph. QgsGraphBuilder and QgsGraphDirector
|
|
|
|
* are implemented using "builder" design patter.
|
2011-06-02 19:02:20 +06:00
|
|
|
*/
|
|
|
|
class QgsGraphDirector : QObject
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsgraphbuilder.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
%ConvertToSubClassCode
|
2016-11-21 16:33:34 +02:00
|
|
|
if ( dynamic_cast< QgsVectorLayerDirector* > ( sipCpp ) != NULL )
|
|
|
|
sipType = sipType_QgsVectorLayerDirector;
|
2011-06-02 19:02:20 +06:00
|
|
|
else
|
2015-10-20 18:09:33 +02:00
|
|
|
sipType = NULL;
|
2011-06-02 19:02:20 +06:00
|
|
|
%End
|
|
|
|
|
2013-01-12 23:48:58 +01:00
|
|
|
|
2011-06-02 19:02:20 +06:00
|
|
|
signals:
|
|
|
|
void buildProgress( int, int ) const;
|
2015-10-26 22:46:25 +11:00
|
|
|
void buildMessage( const QString& ) const;
|
2011-06-02 19:02:20 +06:00
|
|
|
|
|
|
|
public:
|
|
|
|
//! Destructor
|
|
|
|
virtual ~QgsGraphDirector();
|
|
|
|
|
|
|
|
/**
|
2016-11-17 17:30:10 +02:00
|
|
|
* Make a graph using QgsGraphBuilder
|
2011-06-02 19:02:20 +06:00
|
|
|
*
|
2016-11-17 17:30:10 +02:00
|
|
|
* @param builder the graph builder
|
|
|
|
* @param additionalPoints list of points that should be snapped to the graph
|
2016-11-17 20:37:48 +02:00
|
|
|
* @param snappedPoints list of snapped points
|
|
|
|
* @note if snappedPoints[i] == QgsPoint(0.0,0.0) then snapping failed.
|
2011-06-02 19:02:20 +06:00
|
|
|
*/
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void makeGraph( QgsGraphBuilderInterface *builder,
|
|
|
|
const QVector< QgsPoint > &additionalPoints,
|
2016-11-17 17:30:10 +02:00
|
|
|
QVector< QgsPoint > &snappedPoints /Out/ ) const;
|
2013-01-12 23:48:58 +01:00
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
//! Add optimization strategy
|
2017-05-01 18:13:15 +02:00
|
|
|
void addStrategy( QgsNetworkStrategy *prop /Transfer/);
|
2013-01-12 23:48:58 +01:00
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
//! Returns director name
|
2011-06-02 19:02:20 +06:00
|
|
|
virtual QString name() const = 0;
|
|
|
|
};
|
|
|
|
|