Mathematical graph representation.
More...
#include <qgsgraph.h>
Mathematical graph representation.
- Since
- QGIS 3.0
Definition at line 142 of file qgsgraph.h.
◆ QgsGraph()
◆ addEdge()
int QgsGraph::addEdge |
( |
int |
fromVertexIdx, |
|
|
int |
toVertexIdx, |
|
|
const QVector< QVariant > & |
strategies |
|
) |
| |
Add an edge to the graph, going from the fromVertexIdx to toVertexIdx.
Definition at line 30 of file qgsgraph.cpp.
◆ addVertex()
Add a vertex to the graph.
Definition at line 24 of file qgsgraph.cpp.
◆ edge()
Returns the edge at the given index.
Definition at line 76 of file qgsgraph.cpp.
◆ edgeCount()
int QgsGraph::edgeCount |
( |
| ) |
const |
Returns number of graph edges.
Definition at line 120 of file qgsgraph.cpp.
◆ findOppositeEdge()
int QgsGraph::findOppositeEdge |
( |
int |
index | ) |
const |
Finds the first edge which is the opposite of the edge with the specified index.
This represents the edge which has the same vertices as the specified edge, but the opposite direction in the graph.(I.e. the edge which starts at the "from" vertex of the specified edge and ends at the "to" vertex.)
Returns -1 if no opposite edge exists.
- Since
- QGIS 3.24
Definition at line 150 of file qgsgraph.cpp.
◆ findVertex()
int QgsGraph::findVertex |
( |
const QgsPointXY & |
pt | ) |
const |
Find vertex by associated point.
- Returns
- vertex index
Definition at line 125 of file qgsgraph.cpp.
◆ hasEdge()
bool QgsGraph::hasEdge |
( |
int |
index | ) |
const |
Returns whether the edge of the given index exists.
- Since
- QGIS 3.24
Definition at line 144 of file qgsgraph.cpp.
◆ hasVertex()
bool QgsGraph::hasVertex |
( |
int |
index | ) |
const |
Returns whether the vertex of the given index exists.
- Since
- QGIS 3.24
Definition at line 138 of file qgsgraph.cpp.
◆ removeEdge()
void QgsGraph::removeEdge |
( |
int |
index | ) |
|
Removes the edge at specified index.
The incoming and outgoing edges for all graph vertices will be updated accordingly. Vertices which no longer have any incoming or outgoing edges as a result will be removed from the graph automatically.
- Since
- QGIS 3.24
Definition at line 87 of file qgsgraph.cpp.
◆ removeVertex()
void QgsGraph::removeVertex |
( |
int |
index | ) |
|
Removes the vertex at specified index.
All edges which are incoming or outgoing edges for the vertex will also be removed.
- Since
- QGIS 3.24
Definition at line 58 of file qgsgraph.cpp.
◆ vertex()
Returns the vertex at the given index.
Definition at line 47 of file qgsgraph.cpp.
◆ vertexCount()
int QgsGraph::vertexCount |
( |
| ) |
const |
Returns number of graph vertices.
Definition at line 115 of file qgsgraph.cpp.
◆ mGraphEdges
◆ mGraphVertices
The documentation for this class was generated from the following files:
- /build/qgis-3.28.0+99sid/src/analysis/network/qgsgraph.h
- /build/qgis-3.28.0+99sid/src/analysis/network/qgsgraph.cpp