2017-05-01 12:44:45 +03:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/network/qgsgraph.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
class QgsGraphEdge
|
2011-06-02 13:49:43 +06:00
|
|
|
{
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
This class implements a graph edge
|
2011-06-02 13:49:43 +06:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 12:44:45 +03:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsgraph.h"
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
public:
|
2017-09-28 08:17:06 +10:00
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
QgsGraphEdge();
|
2017-09-28 08:17:06 +10:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsGraphEdge.
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
QVariant cost( int strategyIndex ) const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Returns edge cost calculated using specified strategy
|
|
|
|
\param strategyIndex strategy index
|
|
|
|
:rtype: QVariant
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
QVector< QVariant > strategies() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Returns array of available strategies
|
|
|
|
:rtype: list of QVariant
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
|
2017-10-29 08:34:24 +10:00
|
|
|
int toVertex() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-10-29 08:34:24 +10:00
|
|
|
Returns the index of the vertex at the end of this edge.
|
|
|
|
.. seealso:: fromVertex()
|
2017-05-01 12:44:45 +03:00
|
|
|
:rtype: int
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
|
2017-10-29 08:34:24 +10:00
|
|
|
int fromVertex() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-10-29 08:34:24 +10:00
|
|
|
Returns the index of the vertex at the start of this edge.
|
|
|
|
.. seealso:: toVertex()
|
2017-05-01 12:44:45 +03:00
|
|
|
:rtype: int
|
|
|
|
%End
|
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
typedef QList< int > QgsGraphEdgeIds;
|
2011-06-02 13:49:43 +06:00
|
|
|
|
|
|
|
class QgsGraphVertex
|
|
|
|
{
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
This class implements a graph vertex
|
2017-10-29 08:34:24 +10:00
|
|
|
.. versionadded:: 3.0
|
2011-06-02 13:49:43 +06:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 12:44:45 +03:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsgraph.h"
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
public:
|
2017-05-01 12:44:45 +03:00
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
QgsGraphVertex();
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Default constructor. It is needed for Qt's container, e.g. QVector
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsGraphVertex( const QgsPointXY &point );
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
This constructor initializes QgsGraphVertex object and associates a vertex with a point
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-10-29 08:34:24 +10:00
|
|
|
QgsGraphEdgeIds incomingEdges() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-10-29 08:34:24 +10:00
|
|
|
Returns the incoming edge ids, i.e. edges which end at this node.
|
|
|
|
.. seealso:: outgoingEdges()
|
2017-05-01 12:44:45 +03:00
|
|
|
:rtype: QgsGraphEdgeIds
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-10-29 08:34:24 +10:00
|
|
|
QgsGraphEdgeIds outgoingEdges() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-10-29 08:34:24 +10:00
|
|
|
Returns outgoing edge ids, i.e. edges which start at this node.
|
|
|
|
.. seealso:: incomingEdges()
|
2017-05-01 12:44:45 +03:00
|
|
|
:rtype: QgsGraphEdgeIds
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsPointXY point() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-10-29 08:34:24 +10:00
|
|
|
Returns point associated with graph vertex.
|
2017-06-01 12:18:43 +02:00
|
|
|
:rtype: QgsPointXY
|
2017-05-01 12:44:45 +03:00
|
|
|
%End
|
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class QgsGraph
|
|
|
|
{
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Mathematical graph representation
|
2017-10-29 08:34:24 +10:00
|
|
|
.. versionadded:: 3.0
|
2011-06-02 13:49:43 +06:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 12:44:45 +03:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsgraph.h"
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
public:
|
2017-09-11 21:55:20 +10:00
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
QgsGraph();
|
2017-09-11 21:55:20 +10:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsGraph.
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
int addVertex( const QgsPointXY &pt );
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Add a vertex to the graph
|
|
|
|
:rtype: int
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-10-29 08:34:24 +10:00
|
|
|
int addEdge( int fromVertexIdx, int toVertexIdx, const QVector< QVariant > &strategies );
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
2017-10-29 08:34:24 +10:00
|
|
|
Add an edge to the graph, going from the ``fromVertexIdx``
|
|
|
|
to ``toVertexIdx``.
|
2017-05-01 12:44:45 +03:00
|
|
|
:rtype: int
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
int vertexCount() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Returns number of graph vertices
|
|
|
|
:rtype: int
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
const QgsGraphVertex &vertex( int idx ) const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Returns vertex at given index
|
|
|
|
:rtype: QgsGraphVertex
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
|
2016-11-17 17:30:10 +02:00
|
|
|
int edgeCount() const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Returns number of graph edges
|
|
|
|
:rtype: int
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
const QgsGraphEdge &edge( int idx ) const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Returns edge at given index
|
|
|
|
:rtype: QgsGraphEdge
|
|
|
|
%End
|
2011-06-02 13:49:43 +06:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
int findVertex( const QgsPointXY &pt ) const;
|
2017-05-01 12:44:45 +03:00
|
|
|
%Docstring
|
|
|
|
Find vertex by associated point
|
|
|
|
:return: vertex index
|
|
|
|
:rtype: int
|
|
|
|
%End
|
|
|
|
|
2011-06-02 13:49:43 +06:00
|
|
|
};
|
2017-05-01 12:44:45 +03:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/network/qgsgraph.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|