QGIS API Documentation  2.99.0-Master (d55fa22)
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 <qgis.h>
24 #include <qgspoint.h>
25 #include "qgsnetworkstrategy.h"
26 #include "qgis_analysis.h"
27 
29 
30 #ifdef SIP_RUN
31 % ModuleHeaderCode
32 #include <qgsvectorlayerdirector.h>
33 % End
34 #endif
35 
42 class ANALYSIS_EXPORT QgsGraphDirector : public QObject
43 {
44 
45 #ifdef SIP_RUN
47  if ( dynamic_cast< QgsVectorLayerDirector * >( sipCpp ) != NULL )
48  sipType = sipType_QgsVectorLayerDirector;
49  else
50  sipType = NULL;
51  SIP_END
52 #endif
53 
54  Q_OBJECT
55 
56  signals:
58  void buildProgress( int, int ) const;
60  void buildMessage( const QString & ) const;
61 
62  public:
63 
64  virtual ~QgsGraphDirector() { }
65 
74  virtual void makeGraph( QgsGraphBuilderInterface *builder,
75  const QVector< QgsPoint > &additionalPoints,
76  QVector< QgsPoint > &snappedPoints SIP_OUT ) const
77  {
78  Q_UNUSED( builder );
79  Q_UNUSED( additionalPoints );
80  Q_UNUSED( snappedPoints );
81  }
82 
85  {
86  mStrategies.push_back( prop );
87  }
88 
90  virtual QString name() const = 0;
91 
92  protected:
93  QList<QgsNetworkStrategy *> mStrategies;
94 };
95 
96 #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.
#define SIP_TRANSFER
Definition: qgis_sip.h:24
#define SIP_END
Definition: qgis_sip.h:133
void addStrategy(QgsNetworkStrategy *prop)
Add optimization strategy.
#define SIP_OUT
Definition: qgis_sip.h:39
QList< QgsNetworkStrategy * > mStrategies
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:128
Determine making the graph.
virtual void makeGraph(QgsGraphBuilderInterface *builder, const QVector< QgsPoint > &additionalPoints, QVector< QgsPoint > &snappedPoints) const
Make a graph using QgsGraphBuilder.