QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgsvectorlayerdirector.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayerdirector.h
3  --------------------------------------
4  Date : 2010-10-20
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 QGSVECTORLAYERDIRECTOR_H
17 #define QGSVECTORLAYERDIRECTOR_H
18 
19 #include "qgis.h"
20 
21 #include "qgsgraphdirector.h"
22 #include "qgis_analysis.h"
23 
25 class QgsFeatureSource;
26 
33 class ANALYSIS_EXPORT QgsVectorLayerDirector : public QgsGraphDirector
34 {
35  Q_OBJECT
36 
37  public:
38 
46  enum Direction
47  {
51  };
52 
64  int directionFieldId,
65  const QString &directDirectionValue,
66  const QString &reverseDirectionValue,
67  const QString &bothDirectionValue,
68  Direction defaultDirection
69  );
70 
71  /*
72  * MANDATORY DIRECTOR PROPERTY DECLARATION
73  */
74  void makeGraph( QgsGraphBuilderInterface *builder,
75  const QVector< QgsPointXY > &additionalPoints,
76  QVector< QgsPointXY> &snappedPoints SIP_OUT,
77  QgsFeedback *feedback = nullptr ) const override;
78 
79  QString name() const override;
80 
81  private:
82  QgsFeatureSource *mSource = nullptr;
83  int mDirectionFieldId = -1;
84  QString mDirectDirectionValue;
85  QString mReverseDirectionValue;
86  QString mBothDirectionValue;
87  Direction mDefaultDirection = DirectionBoth;
88 
89  QgsAttributeList requiredAttributes() const;
90  Direction directionForFeature( const QgsFeature &feature ) const;
91 };
92 
93 #endif // QGSVECTORLAYERDIRECTOR_H
An interface for objects which provide features via a getFeatures method.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:56
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:45
Determine interface for creating a graph.
Determine making the graph.
virtual void makeGraph(QgsGraphBuilderInterface *builder, const QVector< QgsPointXY > &additionalPoints, QVector< QgsPointXY > &snappedPoints, QgsFeedback *feedback=nullptr) const
Make a graph using QgsGraphBuilder.
virtual QString name() const =0
Returns director name.
Determine making the graph from vector line layer.
Direction
Edge direction Edge can be one-way with direct flow (one can move only from the start point to the en...
@ DirectionForward
One-way direct.
@ DirectionBackward
One-way reversed.
#define SIP_OUT
Definition: qgis_sip.h:58
QList< int > QgsAttributeList
Definition: qgsfield.h:26