|
KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
|
|
Represents a single vertex in the spanning-tree graph used by PathRouter. More...
#include <treepathvertice.h>
Classes | |
| class | List |
| A list of TreePathVertice pointers. More... | |
| class | Map |
| A map from hash-name string to TreePathVertice pointer. More... | |
Public Types | |
| enum | VerticeType { Standard , AdHocOrigin , AdHocDestination , AdHocOriginProximal , AdHocDestinationProximal } |
| Classifies a vertice's role in the path graph. More... | |
| enum | VerticeState { Unvisited , Visited } |
| Tracks whether this vertex has been visited during traversal. More... | |
Public Member Functions | |
| TreePathVertice (const QPointF &position, VerticeType type, SpanningTree *parent) | |
| Construct a vertice at the given position with a type and parent tree. | |
| void | tryAddNeighbor (TreePathVertice *neighbor) |
| Add a neighbour if not already present. | |
| void | tryReplaceNeighbor (TreePathVertice *neighbor, TreePathVertice *newNeighbor) |
| Replace an existing neighbour with a different vertice. | |
| VerticeType | type () const |
| Return the role of this vertex. | |
| QPointF | position () const |
| Return the 2D position of this vertex. | |
| double | distance () const |
| Return the accumulated path distance to this vertex. | |
| void | setDistance (double value) |
| Set the accumulated path distance. | |
| VerticeState | state () const |
| Return the visitation state. | |
| void | setState (VerticeState value) |
| Set the visitation state. | |
| QString | name () const |
| Return the human-readable name of this vertex. | |
| void | setName (const QString &value) |
| Set the human-readable name of this vertex. | |
| TreePathVertice * | source () const |
| Return the predecessor vertex in the shortest path. | |
| void | setSource (TreePathVertice *value) |
| Set the predecessor vertex in the shortest path. | |
| Map | neighbors () const |
| Return the map of neighbouring vertices. | |
| QString | hashName () const |
| Return the hash key used to identify this vertex in the graph map. | |
| QString | toString () const |
| Return the human-readable name (alias for name()). | |
Static Public Member Functions | |
| static QString | makeHashName (const QPointF &point) |
| Create a canonical hash name for a point. | |
Represents a single vertex in the spanning-tree graph used by PathRouter.
Each vertice holds a 2D position, a type (standard, ad-hoc origin/destination, or proximal), a visitation state for graph traversal, and a map of neighbouring vertices.
Definition at line 20 of file treepathvertice.h.
Tracks whether this vertex has been visited during traversal.
| Enumerator | |
|---|---|
| Unvisited | Not yet visited. |
| Visited | Already processed by the traversal algorithm. |
Definition at line 38 of file treepathvertice.h.
Classifies a vertice's role in the path graph.
Definition at line 26 of file treepathvertice.h.
| TreePathVertice::TreePathVertice | ( | const QPointF & | position, |
| VerticeType | type, | ||
| SpanningTree * | parent | ||
| ) |
Construct a vertice at the given position with a type and parent tree.
| position | 2D position of this vertex |
| type | Role of this vertex in the path graph |
| parent | Owning SpanningTree |
|
inline |
Return the accumulated path distance to this vertex.
Definition at line 100 of file treepathvertice.h.
|
inline |
Return the hash key used to identify this vertex in the graph map.
Definition at line 154 of file treepathvertice.h.
|
static |
Create a canonical hash name for a point.
| point | Point to hash |
|
inline |
Return the human-readable name of this vertex.
Definition at line 124 of file treepathvertice.h.
|
inline |
Return the map of neighbouring vertices.
Definition at line 148 of file treepathvertice.h.
|
inline |
Return the 2D position of this vertex.
Definition at line 94 of file treepathvertice.h.
|
inline |
Set the accumulated path distance.
| value | New distance value |
Definition at line 106 of file treepathvertice.h.
|
inline |
Set the human-readable name of this vertex.
| value | New name string |
Definition at line 130 of file treepathvertice.h.
|
inline |
Set the predecessor vertex in the shortest path.
| value | Pointer to the new source vertex |
Definition at line 142 of file treepathvertice.h.
|
inline |
Set the visitation state.
| value | New VerticeState |
Definition at line 118 of file treepathvertice.h.
|
inline |
Return the predecessor vertex in the shortest path.
Definition at line 136 of file treepathvertice.h.
|
inline |
Return the visitation state.
Definition at line 112 of file treepathvertice.h.
|
inline |
Return the human-readable name (alias for name()).
Definition at line 158 of file treepathvertice.h.
| void TreePathVertice::tryAddNeighbor | ( | TreePathVertice * | neighbor | ) |
Add a neighbour if not already present.
| neighbor | Vertice to add as a neighbour |
| void TreePathVertice::tryReplaceNeighbor | ( | TreePathVertice * | neighbor, |
| TreePathVertice * | newNeighbor | ||
| ) |
Replace an existing neighbour with a different vertice.
| neighbor | Neighbour to replace |
| newNeighbor | Replacement vertice |
|
inline |
Return the role of this vertex.
Definition at line 88 of file treepathvertice.h.