2011-06-02 19:02:20 +06:00
|
|
|
%ModuleHeaderCode
|
|
|
|
#include <qgslinevectorlayerdirector.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
/**
|
2016-11-16 16:48:41 +02:00
|
|
|
* \ingroup analysis
|
2011-06-02 19:02:20 +06:00
|
|
|
* \class QgsGraphDirector
|
|
|
|
* \brief Determine making the graph. QgsGraphBuilder and QgsGraphDirector is a builder patter.
|
|
|
|
*/
|
|
|
|
class QgsGraphDirector : QObject
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsgraphbuilder.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
%ConvertToSubClassCode
|
|
|
|
if ( dynamic_cast< QgsLineVectorLayerDirector* > ( sipCpp ) != NULL )
|
2015-10-20 18:09:33 +02:00
|
|
|
sipType = sipType_QgsLineVectorLayerDirector;
|
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
|
|
|
|
* @param tiedPoints list of snapped points
|
|
|
|
* @note if tiedPoints[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
|
|
|
|
void addStrategy( QgsStrategy* 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;
|
|
|
|
};
|
|
|
|
|