QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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
QgsGraphDirector
Determine making the graph. QgsGraphBuilder and QgsGraphDirector implemented using "builder" design p...
Definition: qgsgraphdirector.h:43
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
QgsFeatureSource
Definition: qgsfeaturesource.h:37
qgis.h
qgsgraphdirector.h
QgsAttributeList
QList< int > QgsAttributeList
Definition: qgsfield.h:26
QgsGraphBuilderInterface
Determine interface for creating a graph. Contains the settings of the graph. QgsGraphBuilder and Qgs...
Definition: qgsgraphbuilderinterface.h:40
QgsFeedback
Definition: qgsfeedback.h:43
QgsVectorLayerDirector::DirectionBackward
@ DirectionBackward
One-way reversed.
Definition: qgsvectorlayerdirector.h:49
QgsVectorLayerDirector::DirectionForward
@ DirectionForward
One-way direct.
Definition: qgsvectorlayerdirector.h:48
QgsGraphDirector::makeGraph
virtual void makeGraph(QgsGraphBuilderInterface *builder, const QVector< QgsPointXY > &additionalPoints, QVector< QgsPointXY > &snappedPoints, QgsFeedback *feedback=nullptr) const
Make a graph using QgsGraphBuilder.
Definition: qgsgraphdirector.h:73
QgsVectorLayerDirector::DirectionBoth
@ DirectionBoth
Two-way.
Definition: qgsvectorlayerdirector.h:50
QgsVectorLayerDirector
Determine making the graph from vector line layer.
Definition: qgsvectorlayerdirector.h:33
QgsFeature
Definition: qgsfeature.h:55
QgsGraphDirector::name
virtual QString name() const =0
Returns director name.
QgsVectorLayerDirector::Direction
Direction
Edge direction Edge can be one-way with direct flow (one can move only from the start point to the en...
Definition: qgsvectorlayerdirector.h:46