QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsGraphBuilder Class Reference

This class used for making the QgsGraph object. More...

#include <qgsgraphbuilder.h>

Inheritance diagram for QgsGraphBuilder:
Inheritance graph
[legend]

Public Member Functions

 QgsGraphBuilder (const QgsCoordinateReferenceSystem &crs, bool otfEnabled=true, double topologyTolerance=0.0, const QString &ellipsoidID="WGS84")
 Default constructor.
 
 ~QgsGraphBuilder () override
 
void addEdge (int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &prop) override
 Add edge to the graph.
 
void addVertex (int id, const QgsPointXY &pt) override
 Add vertex to the graph.
 
QgsGraph graph () const
 Returns the generated QgsGraph.
 
QgsGraphtakeGraph ()
 Takes the generated graph from the builder, resetting the builder back to its initial state ready for additional graph construction.
 
- Public Member Functions inherited from QgsGraphBuilderInterface
 QgsGraphBuilderInterface (const QgsCoordinateReferenceSystem &crs, bool ctfEnabled=true, double topologyTolerance=0.0, const QString &ellipsoidID="WGS84")
 Default constructor.
 
virtual ~QgsGraphBuilderInterface ()=default
 
bool coordinateTransformationEnabled () const
 Returns coordinate transformation enabled.
 
QgsCoordinateReferenceSystem destinationCrs () const
 Returns destinaltion CRS.
 
QgsDistanceAreadistanceArea ()
 Returns measurement tool.
 
double topologyTolerance () const
 Returns topology tolerance.
 

Detailed Description

This class used for making the QgsGraph object.

Definition at line 35 of file qgsgraphbuilder.h.

Constructor & Destructor Documentation

◆ QgsGraphBuilder()

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

Default constructor.

Definition at line 26 of file qgsgraphbuilder.cpp.

◆ ~QgsGraphBuilder()

QgsGraphBuilder::~QgsGraphBuilder ( )
overridedefault

Member Function Documentation

◆ addEdge()

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

Add edge to the graph.

Parameters
pt1idfirst vertex identificator
pt1first vertex coordinates
pt2idsecond vertex identificator
pt2second vertex coordinates
strategiesoptimization strategies
Note
pt1id, pt1 and pt2id, pt2 is a redundant interface. You can use vertex coordinates or their identificators.

Reimplemented from QgsGraphBuilderInterface.

Definition at line 39 of file qgsgraphbuilder.cpp.

◆ addVertex()

void QgsGraphBuilder::addVertex ( int  id,
const QgsPointXY pt 
)
overridevirtual

Add vertex to the graph.

Parameters
idvertex identifier
ptvertex coordinates
Note
id and pt are redundant. You can use pt or id to identify the vertex

Reimplemented from QgsGraphBuilderInterface.

Definition at line 34 of file qgsgraphbuilder.cpp.

◆ graph()

QgsGraph QgsGraphBuilder::graph ( ) const

Returns the generated QgsGraph.

The builder is left in its current state.

See also
takeGraph()

Definition at line 44 of file qgsgraphbuilder.cpp.

◆ takeGraph()

QgsGraph * QgsGraphBuilder::takeGraph ( )

Takes the generated graph from the builder, resetting the builder back to its initial state ready for additional graph construction.

Since
QGIS 3.22

Definition at line 49 of file qgsgraphbuilder.cpp.


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