QgsVectorLayerDirector class
Determine making the graph from vector line layer.
Contents
Base classes
- class QgsGraphDirector
- Determine making the graph.
Public types
- enum Direction { DirectionForward, DirectionBackward, DirectionBoth }
- Edge direction Edge can be one-way with direct flow (one can move only from the start point to the end point), one-way with reversed flow (one can move only from the end point to the start point) and bidirectional or two-way (one can move in any direction)
Constructors, destructors, conversion operators
- QgsVectorLayerDirector(QgsFeatureSource* source, int directionFieldId, const QString& directDirectionValue, const QString& reverseDirectionValue, const QString& bothDirectionValue, Direction defaultDirection)
- Default constructor.
Public functions
- void makeGraph(QgsGraphBuilderInterface* builder, const QVector<QgsPointXY>& additionalPoints, QVector<QgsPointXY>& snappedPoints, QgsFeedback* feedback = nullptr) const override
- Make a graph using QgsGraphBuilder.
- auto name() const -> QString override
- Returns director name.
Enum documentation
enum QgsVectorLayerDirector:: Direction
Edge direction Edge can be one-way with direct flow (one can move only from the start point to the end point), one-way with reversed flow (one can move only from the end point to the start point) and bidirectional or two-way (one can move in any direction)
| Enumerators | |
|---|---|
| DirectionForward |
One-way direct. |
| DirectionBackward |
One-way reversed. |
| DirectionBoth |
Two-way. |
Function documentation
QgsVectorLayerDirector:: QgsVectorLayerDirector(QgsFeatureSource* source,
int directionFieldId,
const QString& directDirectionValue,
const QString& reverseDirectionValue,
const QString& bothDirectionValue,
Direction defaultDirection)
Default constructor.
| Parameters | |
|---|---|
| source | feature source representing network |
| directionFieldId | field containing direction value |
| directDirectionValue | value for direct one-way road |
| reverseDirectionValue | value for reversed one-way road |
| bothDirectionValue | value for two-way (bidirectional) road |
| defaultDirection | default direction. Will be used if corresponding attribute value is not set or does not equal to the given values |
void QgsVectorLayerDirector:: makeGraph(QgsGraphBuilderInterface* builder,
const QVector<QgsPointXY>& additionalPoints,
QVector<QgsPointXY>& snappedPoints,
QgsFeedback* feedback = nullptr) const override
Make a graph using QgsGraphBuilder.
| Parameters | |
|---|---|
| builder | the graph builder |
| additionalPoints | list of points that should be snapped to the graph |
| snappedPoints | list of snapped points |
| feedback | feedback object for reporting progress |