26 return mGraphVertexes.
size() - 1;
33 e.mProperties = properties;
34 e.mOut = outVertexIdx;
37 int edgeIdx = mGraphArc.
size() - 1;
39 mGraphVertexes[ outVertexIdx ].mOutArc.
push_back( edgeIdx );
40 mGraphVertexes[ inVertexIdx ].mInArc.
push_back( edgeIdx );
42 return mGraphArc.
size() - 1;
47 return mGraphVertexes[ idx ];
52 return mGraphArc[ idx ];
57 return mGraphVertexes.
size();
62 return mGraphArc.
size();
68 for ( i = 0; i < mGraphVertexes.
size(); ++i )
70 if ( mGraphVertexes[ i ].point() == pt )
87 return mProperties[ i ];
106 : mCoordinate( point )
QVariant property(int propertyIndex) const
return property value
int vertexCount() const
return vertex count
void append(const T &value)
int inVertex() const
return index of incoming vertex
int outVertex() const
return index of outgoing vertex
QVector< QVariant > properties() const
get array of properties
int findVertex(const QgsPoint &pt) const
find vertex by point
This class implement a graph edge.
QgsGraphArcIdList inArc() const
return incoming edges
const QgsGraphArc & arc(int idx) const
return edge at index
QgsGraphArcIdList outArc() const
return outgoing edges
int addArc(int outVertexIdx, int inVertexIdx, const QVector< QVariant > &properties)
add edge to a graph
QgsPoint point() const
return vertex point
int addVertex(const QgsPoint &pt)
add vertex to a grap
A class to represent a point.
This class implement a graph vertex.
QgsGraphVertex()
default constructor.
const QgsGraphVertex & vertex(int idx) const
return vertex at index
int arcCount() const
return edge count
void push_back(const T &value)