1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
/**
* \ingroup networkanalysis
* \class QgsGraphArc
* \brief This class implement a graph edge
*/
class QgsGraphArc
{
%TypeHeaderCode
#include <qgsgraph.h>
%End
public:
QgsGraphArc();
/**
* return property value
* @param propertyIndex property index
*/
QVariant property( int propertyIndex ) const;
/**
* get array of proertyes
*/
QVector< QVariant > properties() const;
/**
* return index of outgoing vertex
*/
int outVertex() const;
/**
* return index of incoming vertex
*/
int inVertex() const;
};
typedef QList< int > QgsGraphArcIdList;
/**
* \ingroup networkanalysis
* \class QgsGraphVertex
* \brief This class implement a graph vertex
*/
class QgsGraphVertex
{
%TypeHeaderCode
#include <qgsgraph.h>
%End
public:
/**
* default constructor. It need for QT's container, e.g. QVector
*/
QgsGraphVertex();
/**
* This constructor initializes QgsGraphVertex object and associates a vertex with a point
*/
QgsGraphVertex( const QgsPoint& point );
/**
* return outgoing edges
*/
QgsGraphArcIdList outArc() const;
/**
* return incoming edges
*/
QgsGraphArcIdList inArc() const;
/**
* return vertex point
*/
QgsPoint point() const;
};
/**
* \ingroup networkanalysis
* \class QgsGraph
* \brief Mathematics graph representation
*/
class QgsGraph
{
%TypeHeaderCode
#include <qgsgraph.h>
%End
public:
QgsGraph();
~QgsGraph();
// begin graph constructing methods
/**
* add vertex to a grap
*/
int addVertex( const QgsPoint& pt );
/**
* add edge to a graph
*/
int addArc( int outVertexIdx, int inVertexIdx, const QVector< QVariant >& properties );
/**
* return vertex count
*/
int vertexCount() const;
/**
* return vertex at index
*/
const QgsGraphVertex& vertex( int idx ) const;
/**
* return edge count
*/
int arcCount() const;
/**
* return edge at index
*/
const QgsGraphArc& arc( int idx ) const;
/**
* find vertex by point
* \return vertex index
*/
int findVertex( const QgsPoint& pt ) const;
};
|