-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
extraction_turn.hpp
134 lines (116 loc) · 4.87 KB
/
extraction_turn.hpp
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef OSRM_EXTRACTION_TURN_HPP
#define OSRM_EXTRACTION_TURN_HPP
#include "extractor/road_classification.hpp"
#include "extractor/travel_mode.hpp"
#include <boost/numeric/conversion/cast.hpp>
#include <cstdint>
#include <vector>
namespace osrm::extractor
{
struct ExtractionTurnLeg
{
ExtractionTurnLeg(bool is_restricted,
bool is_motorway,
bool is_link,
int number_of_lanes,
int highway_turn_classification,
int access_turn_classification,
int speed,
RoadPriorityClass::Enum priority_class,
bool is_incoming,
bool is_outgoing)
: is_restricted(is_restricted), is_motorway(is_motorway), is_link(is_link),
number_of_lanes(number_of_lanes),
highway_turn_classification(highway_turn_classification),
access_turn_classification(access_turn_classification), speed(speed),
priority_class(priority_class), is_incoming(is_incoming), is_outgoing(is_outgoing)
{
}
bool is_restricted;
bool is_motorway;
bool is_link;
int number_of_lanes;
int highway_turn_classification;
int access_turn_classification;
int speed;
RoadPriorityClass::Enum priority_class;
bool is_incoming;
bool is_outgoing;
};
struct ExtractionTurn
{
ExtractionTurn(double angle,
int number_of_roads,
bool is_u_turn,
bool has_traffic_light,
bool is_left_hand_driving,
bool source_restricted,
TravelMode source_mode,
bool source_is_motorway,
bool source_is_link,
int source_number_of_lanes,
int source_highway_turn_classification,
int source_access_turn_classification,
int source_speed,
RoadPriorityClass::Enum source_priority_class,
bool target_restricted,
TravelMode target_mode,
bool target_is_motorway,
bool target_is_link,
int target_number_of_lanes,
int target_highway_turn_classification,
int target_access_turn_classification,
int target_speed,
RoadPriorityClass::Enum target_priority_class,
const std::vector<ExtractionTurnLeg> &roads_on_the_right,
const std::vector<ExtractionTurnLeg> &roads_on_the_left)
: angle(180. - angle), number_of_roads(number_of_roads), is_u_turn(is_u_turn),
has_traffic_light(has_traffic_light), is_left_hand_driving(is_left_hand_driving),
source_restricted(source_restricted), source_mode(source_mode),
source_is_motorway(source_is_motorway), source_is_link(source_is_link),
source_number_of_lanes(source_number_of_lanes),
source_highway_turn_classification(source_highway_turn_classification),
source_access_turn_classification(source_access_turn_classification),
source_speed(source_speed), source_priority_class(source_priority_class),
target_restricted(target_restricted), target_mode(target_mode),
target_is_motorway(target_is_motorway), target_is_link(target_is_link),
target_number_of_lanes(target_number_of_lanes),
target_highway_turn_classification(target_highway_turn_classification),
target_access_turn_classification(target_access_turn_classification),
target_speed(target_speed), target_priority_class(target_priority_class),
roads_on_the_right(roads_on_the_right), roads_on_the_left(roads_on_the_left), weight(0.),
duration(0.)
{
}
const double angle;
const int number_of_roads;
const bool is_u_turn;
const bool has_traffic_light;
const bool is_left_hand_driving;
// source info
const bool source_restricted;
const TravelMode source_mode;
const bool source_is_motorway;
const bool source_is_link;
const int source_number_of_lanes;
const int source_highway_turn_classification;
const int source_access_turn_classification;
const int source_speed;
const RoadPriorityClass::Enum source_priority_class;
// target info
const bool target_restricted;
const TravelMode target_mode;
const bool target_is_motorway;
const bool target_is_link;
const int target_number_of_lanes;
const int target_highway_turn_classification;
const int target_access_turn_classification;
const int target_speed;
const RoadPriorityClass::Enum target_priority_class;
const std::vector<ExtractionTurnLeg> roads_on_the_right;
const std::vector<ExtractionTurnLeg> roads_on_the_left;
double weight;
double duration;
};
} // namespace osrm::extractor
#endif