… | |
… | |
119 | int percent; /**< ratio of lenneg to lenght of whole street in percent */ |
119 | int percent; /**< ratio of lenneg to lenght of whole street in percent */ |
120 | struct street_data *street; /**< The street lp is on */ |
120 | struct street_data *street; /**< The street lp is on */ |
121 | int street_direction; /**< Direction of vehicle on street -1 = Negative direction, 1 = Positive direction, 0 = Unknown */ |
121 | int street_direction; /**< Direction of vehicle on street -1 = Negative direction, 1 = Positive direction, 0 = Unknown */ |
122 | int dir; /**< Direction to take when following the route -1 = Negative direction, 1 = Positive direction */ |
122 | int dir; /**< Direction to take when following the route -1 = Negative direction, 1 = Positive direction */ |
123 | }; |
123 | }; |
|
|
124 | |
|
|
125 | |
|
|
126 | /** |
|
|
127 | * @brief A segment in the route graph or path |
|
|
128 | * |
|
|
129 | * This is a segment in the route graph or path. A segment represents a driveable way. |
|
|
130 | */ |
|
|
131 | struct route_segment_data |
|
|
132 | { |
|
|
133 | struct item item; /**< The item (e.g. street) that this segment represents. */ |
|
|
134 | int flags; |
|
|
135 | int len; /**< Length of this segment */ |
|
|
136 | /*NOTE: After a segment, various fields may follow, depending on what flags are set. Order of fields: |
|
|
137 | 1.) maxspeed Maximum allowed speed on this segment. Present if NAVIT_AF_SPEED_LIMIT is set. |
|
|
138 | 2.) offset If the item is segmented (i.e. represented by more than one segment), this |
|
|
139 | indicates the position of this segment in the item. Present if NAVIT_AF_SEGMENTED is set. |
|
|
140 | */ |
|
|
141 | }; |
|
|
142 | |
|
|
143 | struct size_weight_limit |
|
|
144 | { |
|
|
145 | int width; |
|
|
146 | int length; |
|
|
147 | int height; |
|
|
148 | int weight; |
|
|
149 | int axle_weight; |
|
|
150 | }; |
|
|
151 | |
|
|
152 | |
|
|
153 | /** |
|
|
154 | * @brief A point in the route graph |
|
|
155 | * |
|
|
156 | * This represents a point in the route graph. A point usually connects two or more segments, |
|
|
157 | * but there are also points which don't do that (e.g. at the end of a dead-end). |
|
|
158 | */ |
|
|
159 | struct route_graph_point |
|
|
160 | { |
|
|
161 | struct route_graph_point *hash_next; /**< Pointer to a chained hashlist of all route_graph_points with this hash */ |
|
|
162 | struct route_graph_segment *start; /**< Pointer to a list of segments of which this point is the start. The links |
|
|
163 | * of this linked-list are in route_graph_segment->start_next.*/ |
|
|
164 | struct route_graph_segment *end; /**< Pointer to a list of segments of which this pointer is the end. The links |
|
|
165 | * of this linked-list are in route_graph_segment->end_next. */ |
|
|
166 | struct route_graph_segment *seg; /**< Pointer to the segment one should use to reach the destination at |
|
|
167 | * least costs */ |
|
|
168 | struct fibheap_el *el; /**< When this point is put on a Fibonacci heap, this is a pointer |
|
|
169 | * to this point's heap-element */ |
|
|
170 | int value; /**< The cost at which one can reach the destination from this point on */ |
|
|
171 | struct coord c; /**< Coordinates of this point */ |
|
|
172 | int flags; /**< Flags for this point (eg traffic distortion) */ |
|
|
173 | |
|
|
174 | /* |
|
|
175 | Dijkstra values: |
|
|
176 | ================ |
|
|
177 | seg -> what segment to use |
|
|
178 | value -> cost to reach destination |
|
|
179 | */ |
|
|
180 | }; |
|
|
181 | |
|
|
182 | |
|
|
183 | struct route_graph_segment_data |
|
|
184 | { |
|
|
185 | struct item *item; |
|
|
186 | int offset; |
|
|
187 | int flags; |
|
|
188 | int len; |
|
|
189 | int maxspeed; |
|
|
190 | struct size_weight_limit size_weight; |
|
|
191 | int dangerous_goods; |
|
|
192 | }; |
|
|
193 | |
|
|
194 | /** |
|
|
195 | * @brief A segment in the route graph |
|
|
196 | * |
|
|
197 | * This is a segment in the route graph. A segment represents a driveable way. |
|
|
198 | */ |
|
|
199 | struct route_graph_segment |
|
|
200 | { |
|
|
201 | struct route_graph_segment *next; /**< Linked-list pointer to a list of all route_graph_segments */ |
|
|
202 | struct route_graph_segment *start_next; /**< Pointer to the next element in the list of segments that start at the |
|
|
203 | * same point. Start of this list is in route_graph_point->start. */ |
|
|
204 | struct route_graph_segment *end_next; /**< Pointer to the next element in the list of segments that end at the |
|
|
205 | * same point. Start of this list is in route_graph_point->end. */ |
|
|
206 | struct route_graph_point *start; /**< Pointer to the point this segment starts at. */ |
|
|
207 | struct route_graph_point *end; /**< Pointer to the point this segment ends at. */ |
|
|
208 | |
|
|
209 | // -- NEW -- |
|
|
210 | struct coord c_start_plus_1; // second coord |
|
|
211 | struct coord c_end_minus_1; // second to last coord |
|
|
212 | // -- NEW -- |
|
|
213 | |
|
|
214 | struct route_segment_data data; /**< The segment data */ |
|
|
215 | }; |
|
|
216 | |
|
|
217 | |
|
|
218 | |
|
|
219 | |
|
|
220 | |
|
|
221 | |
|
|
222 | |
124 | |
223 | |
125 | struct street_data; |
224 | struct street_data; |
126 | struct tracking; |
225 | struct tracking; |
127 | struct vehicleprofile; |
226 | struct vehicleprofile; |
128 | struct route *route_new(struct attr *parent, struct attr **attrs); |
227 | struct route *route_new(struct attr *parent, struct attr **attrs); |
… | |
… | |
161 | void route_init(void); |
260 | void route_init(void); |
162 | void route_destroy(struct route *this_); |
261 | void route_destroy(struct route *this_); |
163 | void route_path_destroy(struct route_path *this, int recurse); |
262 | void route_path_destroy(struct route_path *this, int recurse); |
164 | void route_graph_destroy(struct route_graph *this); |
263 | void route_graph_destroy(struct route_graph *this); |
165 | void route_path_update(struct route *this, int cancel, int async); |
264 | void route_path_update(struct route *this, int cancel, int async); |
|
|
265 | int route_get_real_oneway_mask(int road_flag, int mask); |
|
|
266 | struct route_graph_segment *route_graph_get_segment(struct route_graph *graph, struct street_data *sd, struct route_graph_segment *last); |
|
|
267 | |
166 | /* end of prototypes */ |
268 | /* end of prototypes */ |
167 | #ifdef __cplusplus |
269 | #ifdef __cplusplus |
168 | } |
270 | } |
169 | #endif |
271 | #endif |
170 | |
272 | |