QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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
26
32class ANALYSIS_EXPORT QgsVectorLayerDirector : public QgsGraphDirector
33{
34 Q_OBJECT
35
36 public:
50
61 QgsVectorLayerDirector( QgsFeatureSource *source, int directionFieldId, const QString &directDirectionValue, const QString &reverseDirectionValue, const QString &bothDirectionValue, Direction defaultDirection );
62
63 /*
64 * MANDATORY DIRECTOR PROPERTY DECLARATION
65 */
66 void makeGraph( QgsGraphBuilderInterface *builder, const QVector<QgsPointXY> &additionalPoints, QVector<QgsPointXY> &snappedPoints SIP_OUT, QgsFeedback *feedback = nullptr ) const override;
67
68 QString name() const override;
69
70 private:
71 QgsFeatureSource *mSource = nullptr;
72 int mDirectionFieldId = -1;
73 QString mDirectDirectionValue;
74 QString mReverseDirectionValue;
75 QString mBothDirectionValue;
76 Direction mDefaultDirection = DirectionBoth;
77
78 QgsAttributeList requiredAttributes() const;
79 Direction directionForFeature( const QgsFeature &feature ) const;
80};
81
82#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:58
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
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...
@ DirectionBackward
One-way reversed.
#define SIP_OUT
Definition qgis_sip.h:58
QList< int > QgsAttributeList
Definition qgsfield.h:27