QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Static Public Member Functions | List of all members
QgsGraphAnalyzer Class Reference

The QGis class provides graph analysis functions. More...

#include <qgsgraphanalyzer.h>

Static Public Member Functions

static void dijkstra (const QgsGraph *source, int startVertexIdx, int criterionNum, QVector< int > *resultTree=NULL, QVector< double > *resultCost=NULL)
 solve shortest path problem using dijkstra algorithm More...
 
static QgsGraphshortestTree (const QgsGraph *source, int startVertexIdx, int criterionNum)
 return shortest path tree with root-node in startVertexIdx More...
 

Detailed Description

The QGis class provides graph analysis functions.

Definition at line 31 of file qgsgraphanalyzer.h.

Member Function Documentation

void QgsGraphAnalyzer::dijkstra ( const QgsGraph source,
int  startVertexIdx,
int  criterionNum,
QVector< int > *  resultTree = NULL,
QVector< double > *  resultCost = NULL 
)
static

solve shortest path problem using dijkstra algorithm

Parameters
sourceThe source graph
startVertexIdxindex of start vertex
criterionNumindex of arc property as optimization criterion
resultTreearray represents the shortest path tree. resultTree[ vertexIndex ] == inboundingArcIndex if vertex reacheble and resultTree[ vertexIndex ] == -1 others.
resultCostarray of cost paths

Definition at line 29 of file qgsgraphanalyzer.cpp.

References QgsGraph::arc(), QgsGraphArc::inVertex(), QgsGraphVertex::outArc(), QgsGraphArc::property(), QgsGraph::vertex(), and QgsGraph::vertexCount().

Referenced by shortestTree().

QgsGraph * QgsGraphAnalyzer::shortestTree ( const QgsGraph source,
int  startVertexIdx,
int  criterionNum 
)
static

return shortest path tree with root-node in startVertexIdx

Parameters
sourceThe source graph
startVertexIdxindex of start vertex
criterionNumindex of edge property as optimization criterion

Definition at line 90 of file qgsgraphanalyzer.cpp.

References QgsGraph::addArc(), QgsGraph::addVertex(), QgsGraph::arc(), dijkstra(), QgsGraphArc::inVertex(), QgsGraphArc::outVertex(), QgsGraphVertex::point(), QgsGraphArc::properties(), QgsGraph::vertex(), and QgsGraph::vertexCount().


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