4#ifndef TREEPATHVERTICE_H
5#define TREEPATHVERTICE_H
10#include "Kanoop/kanoopcommon.h"
53 class Map :
public QMap<QString, TreePathVertice*>
58 class List :
public QList<TreePathVertice*>
66 List(
const QList<TreePathVertice*> source) {
124 QString
name()
const {
return _name; }
130 void setName(
const QString& value) { _name = value; }
A Dijkstra-based spanning tree for finding shortest paths through a line network.
A list of TreePathVertice pointers.
List(const QList< TreePathVertice * > source)
Construct from a QList of TreePathVertice pointers.
List()
Default constructor.
A map from hash-name string to TreePathVertice pointer.
Represents a single vertex in the spanning-tree graph used by PathRouter.
void setState(VerticeState value)
Set the visitation state.
TreePathVertice * source() const
Return the predecessor vertex in the shortest path.
static QString makeHashName(const QPointF &point)
Create a canonical hash name for a point.
TreePathVertice(const QPointF &position, VerticeType type, SpanningTree *parent)
Construct a vertice at the given position with a type and parent tree.
QString name() const
Return the human-readable name of this vertex.
QString hashName() const
Return the hash key used to identify this vertex in the graph map.
void setName(const QString &value)
Set the human-readable name of this vertex.
VerticeType type() const
Return the role of this vertex.
void setDistance(double value)
Set the accumulated path distance.
void setSource(TreePathVertice *value)
Set the predecessor vertex in the shortest path.
void tryReplaceNeighbor(TreePathVertice *neighbor, TreePathVertice *newNeighbor)
Replace an existing neighbour with a different vertice.
QPointF position() const
Return the 2D position of this vertex.
QString toString() const
Return the human-readable name (alias for name()).
VerticeState state() const
Return the visitation state.
void tryAddNeighbor(TreePathVertice *neighbor)
Add a neighbour if not already present.
Map neighbors() const
Return the map of neighbouring vertices.
double distance() const
Return the accumulated path distance to this vertex.
VerticeState
Tracks whether this vertex has been visited during traversal.
@ Unvisited
Not yet visited.
VerticeType
Classifies a vertice's role in the path graph.
@ AdHocDestination
Synthetic destination vertex.
@ Standard
Ordinary obstacle-corner vertex.
@ AdHocDestinationProximal
Vertex proximal to the destination.
@ AdHocOrigin
Synthetic origin vertex.
@ AdHocOriginProximal
Vertex proximal to the origin.