Shortest path algorithms over a height field.
More...
#include <shortestgraph.h>
|
static const double | Infinity = 1.0e8 |
| Maximum cost.
|
|
|
const HeightField & | terrain |
| Reference to heightfield.
|
|
CostGraph | cg |
| Graph used for shortest path computation.
|
|
int | mask = 0 |
| Size of the mask.
|
|
double | celldiagonallength |
| Diagonal of a cell, precomputed from the argument terrain to speed-up computations.
|
|
HeightCost | function |
| Cost function.
|
|
Shortest path algorithms over a height field.
◆ ShortestPathGraph()
ShortestPathGraph::ShortestPathGraph |
( |
const HeightField & | t, |
|
|
int | n = 1, |
|
|
const HeightCost & | f = HeightCost(1.0, 1.0, 0.125, 1.0) ) |
Create the shortest path graph.
Mask size is defined as:
Mask | Neighborhood | Connexity |
0,1 | 1 | 4 ,8 |
2-7 | 2-7 | 16, 32, 48, ... |
- See also
- MaskNext::size
- Parameters
-
t | Terrain. |
n | Size of the neighborhood mask. |
f | Cost function. |
◆ Cost()
double ShortestPathGraph::Cost |
( |
const Vector2 & | a, |
|
|
const Vector2 & | b ) const |
|
virtual |
Compute the cost along a line segment.
Evaluate the integral of the function of the slope over a given segment.
- Parameters
-
◆ ShortestPath() [1/2]
QVector< QPoint > ShortestPathGraph::ShortestPath |
( |
const QPoint & | s, |
|
|
const QPoint & | e ) const |
Compute the shortest path.
- Parameters
-
s,e | Starting and end (target) point. |
- Returns
- Set of points defining the path.
◆ ShortestPath() [2/2]
QVector< QPoint > ShortestPathGraph::ShortestPath |
( |
const Vector2 & | s, |
|
|
const Vector2 & | e ) const |
Compute the shortest path.
- Parameters
-
s,e | Starting and end (target) vertexes. |
- Returns
- Set of points defining the path.
◆ ShortestPathVertexes()
QVector< Vector > ShortestPathGraph::ShortestPathVertexes |
( |
const Vector2 & | s, |
|
|
const Vector2 & | e ) const |
Compute the shortest path.
- Parameters
-
s,e | Starting and end (target) vertexes. |
- Returns
- Set of vertexes targeted onto the terrain.
This is a convenience function equivalent to:
HeightField h;
QVector<QPoint> q = graph.ShortestPath(a,
b);
QVector<Vector> = h.ArrayVertexes(q);
ShortestPathGraph(const HeightField &, int=1, const HeightCost &=HeightCost(1.0, 1.0, 0.125, 1.0))
Create the shortest path graph.
Definition shortest-path-graph.cpp:29
The documentation for this class was generated from the following files:
- E:/X/Code/Libs/LibPath/LibPath/Include/shortestgraph.h
- E:/X/Code/Libs/LibPath/LibPath/Source/shortest-path-graph.cpp