QGIS API Documentation  2.99.0-Master (08c2e66)
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 #include "qgis_analysis.h"
26 
28 
35 class ANALYSIS_EXPORT QgsGraphDirector : public QObject
36 {
37  Q_OBJECT
38 
39  signals:
40  void buildProgress( int, int ) const;
41  void buildMessage( const QString& ) const;
42 
43  public:
44 
45  virtual ~QgsGraphDirector() { }
46 
55  virtual void makeGraph( QgsGraphBuilderInterface *builder,
56  const QVector< QgsPoint > &additionalPoints,
57  QVector< QgsPoint > &snappedPoints ) const
58  {
59  Q_UNUSED( builder );
60  Q_UNUSED( additionalPoints );
61  Q_UNUSED( snappedPoints );
62  }
63 
66  {
67  mStrategies.push_back( prop );
68  }
69 
71  virtual QString name() const = 0;
72 
73  protected:
74  QList<QgsNetworkStrategy*> mStrategies;
75 };
76 
77 #endif // QGSGRAPHDIRECTOR_H
QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can take in...
virtual ~QgsGraphDirector()
Determine interface for creating a graph.
void addStrategy(QgsNetworkStrategy *prop)
Add optimization strategy.
virtual void makeGraph(QgsGraphBuilderInterface *builder, const QVector< QgsPoint > &additionalPoints, QVector< QgsPoint > &snappedPoints) const
Make a graph using QgsGraphBuilder.
QList< QgsNetworkStrategy * > mStrategies
Determine making the graph.