QgsGraphBuilderInterface class

Determine interface for creating a graph.

Contains the settings of the graph. QgsGraphBuilder and QgsGraphDirector both use a "builder" design pattern

Derived classes

class QgsGraphBuilder
This class used for making the QgsGraph object.

Constructors, destructors, conversion operators

QgsGraphBuilderInterface(const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84")
Default constructor.

Public functions

void addEdge(int pt1id, const QgsPointXY& pt1, int pt2id, const QgsPointXY& pt2, const QVector<QVariant>& strategies) virtual
Add edge to the graph.
void addVertex(int id, const QgsPointXY& pt) virtual
Add vertex to the graph.
auto coordinateTransformationEnabled() -> bool
Returns coordinate transformation enabled.
auto destinationCrs() const -> QgsCoordinateReferenceSystem
Returns destinaltion CRS.
auto distanceArea() -> QgsDistanceArea*
Returns measurement tool.
auto topologyTolerance() -> double
Returns topology tolerance.

Function documentation

QgsGraphBuilderInterface::QgsGraphBuilderInterface(const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84")

Default constructor.

Parameters
crs Coordinate reference system for new graph vertex
ctfEnabled enable coordinate transform from source graph CRS to CRS graph
topologyTolerance sqrt distance between source point as one graph vertex
ellipsoidID ellipsoid for edge measurement

void QgsGraphBuilderInterface::addEdge(int pt1id, const QgsPointXY& pt1, int pt2id, const QgsPointXY& pt2, const QVector<QVariant>& strategies) virtual

Add edge to the graph.

Parameters
pt1id first vertex identificator
pt1 first vertex coordinates
pt2id second vertex identificator
pt2 second vertex coordinates
strategies optimization strategies

void QgsGraphBuilderInterface::addVertex(int id, const QgsPointXY& pt) virtual

Add vertex to the graph.

Parameters
id vertex identifier
pt vertex coordinates