QGIS API Documentation  2.99.0-Master (e077efd)
qgsgraphdirector.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgraphdirector.h
3  --------------------------------------
4  Date : 2010-10-18
5  Copyright : (C) 2010 by Yakushev Sergey
6  Email : YakushevS <at> list.ru
7 ****************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15 
16 #ifndef QGSGRAPHDIRECTOR_H
17 #define QGSGRAPHDIRECTOR_H
18 
19 #include <QObject>
20 #include <QVector>
21 #include <QList>
22 
23 #include <qgspoint.h>
24 #include "qgsnetworkstrategy.h"
25 
27 
34 class ANALYSIS_EXPORT QgsGraphDirector : public QObject
35 {
36  Q_OBJECT
37 
38  signals:
39  void buildProgress( int, int ) const;
40  void buildMessage( const QString& ) const;
41 
42  public:
44  virtual ~QgsGraphDirector() { }
45 
54  virtual void makeGraph( QgsGraphBuilderInterface *builder,
55  const QVector< QgsPoint > &additionalPoints,
56  QVector< QgsPoint > &snappedPoints ) const
57  {
58  Q_UNUSED( builder );
59  Q_UNUSED( additionalPoints );
60  Q_UNUSED( snappedPoints );
61  }
62 
65  {
66  mStrategies.push_back( prop );
67  }
68 
70  virtual QString name() const = 0;
71 
72  protected:
73  QList<QgsNetworkStrategy*> mStrategies;
74 };
75 
76 #endif // QGSGRAPHDIRECTOR_H
QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can take in...
virtual ~QgsGraphDirector()
Destructor.
Determine interface for creating a graph.
void addStrategy(QgsNetworkStrategy *prop)
Add optimization strategy.
QList< QgsNetworkStrategy * > mStrategies
Determine making the graph.
virtual void makeGraph(QgsGraphBuilderInterface *builder, const QVector< QgsPoint > &additionalPoints, QVector< QgsPoint > &snappedPoints) const
Make a graph using QgsGraphBuilder.