QGIS API Documentation  3.6.0-Noosa (5873452)
Public Types | Public Member Functions | List of all members
QgsVectorLayerDirector Class Reference

Determine making the graph from vector line layer. More...

#include <qgsvectorlayerdirector.h>

Inheritance diagram for QgsVectorLayerDirector:
Inheritance graph
[legend]

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) More...
 

Public Member Functions

 QgsVectorLayerDirector (QgsFeatureSource *source, int directionFieldId, const QString &directDirectionValue, const QString &reverseDirectionValue, const QString &bothDirectionValue, Direction defaultDirection)
 Default constructor. More...
 
void makeGraph (QgsGraphBuilderInterface *builder, const QVector< QgsPointXY > &additionalPoints, QVector< QgsPointXY > &snappedPoints, QgsFeedback *feedback=nullptr) const override
 Make a graph using QgsGraphBuilder. More...
 
QString name () const override
 Returns director name. More...
 
- Public Member Functions inherited from QgsGraphDirector
 ~QgsGraphDirector () override
 
void addStrategy (QgsNetworkStrategy *prop)
 Add optimization strategy. More...
 

Additional Inherited Members

- Protected Attributes inherited from QgsGraphDirector
QList< QgsNetworkStrategy * > mStrategies
 

Detailed Description

Determine making the graph from vector line layer.

Since
QGIS 3.0

Definition at line 33 of file qgsvectorlayerdirector.h.

Member Enumeration Documentation

◆ 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)

Enumerator
DirectionForward 

One-way direct.

DirectionBackward 

One-way reversed.

DirectionBoth 

Two-way.

Definition at line 46 of file qgsvectorlayerdirector.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerDirector()

QgsVectorLayerDirector::QgsVectorLayerDirector ( QgsFeatureSource source,
int  directionFieldId,
const QString &  directDirectionValue,
const QString &  reverseDirectionValue,
const QString &  bothDirectionValue,
Direction  defaultDirection 
)

Default constructor.

Parameters
sourcefeature source representing network
directionFieldIdfield containing direction value
directDirectionValuevalue for direct one-way road
reverseDirectionValuevalue for reversed one-way road
bothDirectionValuevalue for two-way (bidirectional) road
defaultDirectiondefault direction. Will be used if corresponding attribute value is not set or does not equal to the given values

Definition at line 57 of file qgsvectorlayerdirector.cpp.

Member Function Documentation

◆ makeGraph()

void QgsVectorLayerDirector::makeGraph ( QgsGraphBuilderInterface builder,
const QVector< QgsPointXY > &  additionalPoints,
QVector< QgsPointXY > &  snappedPoints,
QgsFeedback feedback = nullptr 
) const
overridevirtual

Make a graph using QgsGraphBuilder.

Parameters
builderthe graph builder
additionalPointslist of points that should be snapped to the graph
snappedPointslist of snapped points
feedbackfeedback object for reporting progress
Note
if snappedPoints[i] == QgsPointXY(0.0,0.0) then snapping failed.

Reimplemented from QgsGraphDirector.

Definition at line 169 of file qgsvectorlayerdirector.cpp.

◆ name()

QString QgsVectorLayerDirector::name ( ) const
overridevirtual

Returns director name.

Implements QgsGraphDirector.

Definition at line 72 of file qgsvectorlayerdirector.cpp.


The documentation for this class was generated from the following files: