blob: d18f150d031293aad0b4e6362e7d92c19edec8fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#pragma once
#include "routing/turns.hpp"
#include "std/vector.hpp"
namespace ftypes
{
enum class HighwayClass;
}
namespace routing
{
namespace turns
{
/*!
* \brief The TurnCandidate struct contains information about possible ways from a junction.
*/
struct TurnCandidate
{
/*!
* angle is an angle of the turn in degrees. It means angle is 180 minus
* an angle between the current edge and the edge of the candidate. A counterclockwise rotation.
* The current edge is an edge which belongs the route and located before the junction.
* angle belongs to the range [-180; 180];
*/
double angle;
/*!
* node is a possible node (a possible way) from the juction.
* May be NodeId for OSRM router or FeatureId::index for graph router.
*/
TNodeId node;
/*!
* \brief highwayClass field for the road class caching. Because feature reading is a long
* function.
*/
ftypes::HighwayClass highwayClass;
TurnCandidate(double a, TNodeId n, ftypes::HighwayClass c) : angle(a), node(n), highwayClass(c)
{
}
};
struct TurnCandidates
{
vector<TurnCandidate> candidates;
bool isCandidatesAngleValid;
explicit TurnCandidates(bool angleValid = true) : isCandidatesAngleValid(angleValid) {}
};
} // namespace routing
} // namespace turns
|