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 ];
58 return mGraphVertexes.
size();
63 return mGraphArc.
size();
69 for ( i = 0; i < mGraphVertexes.
size(); ++i )
71 if ( mGraphVertexes[ i ].point() == pt )
88 return mProperties[ i ];
107 : mCoordinate( point )
QgsGraphArcIdList inArc() const
return incoming edges
const QgsGraphArc & arc(int idx) const
return edge at index
int inVertex() const
return index of incoming vertex
QVariant property(int propertyIndex) const
return property value
void append(const T &value)
QgsGraphArcIdList outArc() const
return outgoing edges
QgsPoint point() const
return vertex point
int outVertex() const
return index of outgoing vertex
QVector< QVariant > properties() const
get array of properties
This class implement a graph edge.
int findVertex(const QgsPoint &pt) const
find vertex by point
int arcCount() const
return edge count
int addArc(int outVertexIdx, int inVertexIdx, const QVector< QVariant > &properties)
add edge to a graph
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.
void push_back(const T &value)
const QgsGraphVertex & vertex(int idx) const
return vertex at index
int vertexCount() const
return vertex count