navit  0.5.3-trunk
route_protected.h
Go to the documentation of this file.
1 
30 #ifndef NAVIT_ROUTE_PROTECTED_H
31 #define NAVIT_ROUTE_PROTECTED_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 #define RP_TRAFFIC_DISTORTION 1
39 #define RP_TURN_RESTRICTION 2
40 #define RP_TURN_RESTRICTION_RESOLVED 4
41 
42 #define RSD_MAXSPEED(x) *((int *)route_segment_data_field_pos((x), attr_maxspeed))
43 
58  struct fibheap_el *el;
60  int value;
63  int rhs;
65  int dst_val;
69  struct coord c;
70  int flags;
71 };
72 
79  struct item item;
80  int flags;
81  int len;
82  int score;
84  /*NOTE: After a segment, various fields may follow, depending on what flags are set. Order of fields:
85  1.) maxspeed Maximum allowed speed on this segment. Present if AF_SPEED_LIMIT is set.
86  2.) offset If the item is segmented (i.e. represented by more than one segment), this
87  indicates the position of this segment in the item. Present if AF_SEGMENTED is set.
88  */
89 };
90 
95  int width;
96  int length;
97  int height;
98  int weight;
100 };
101 
106  struct item *item;
107  int offset;
110  int flags;
111  int len;
112  int maxspeed;
116  int score;
118 };
119 
133  struct route_segment_data data;
134 };
135 
142 struct route_graph {
143  int busy;
146  struct map_selection *sel;
147  struct mapset_handle *h;
148  struct map *m;
149  struct map_rect *mr;
151  struct callback *idle_cb;
152  struct callback *done_cb;
153  struct event_idle *idle_ev;
156  struct fibheap *heap;
157 #define HASH_SIZE 8192
159 };
160 
161 
162 /* prototypes */
163 struct route_graph * route_get_graph(struct route *this_);
164 struct map_selection * route_get_selection(struct route * this_);
165 void route_free_selection(struct map_selection *sel);
166 void route_add_traffic_distortion(struct route *this_, struct item *item);
167 void route_remove_traffic_distortion(struct route *this_, struct item *item);
168 void route_change_traffic_distortion(struct route *this_, struct item *item);
169 struct route_graph_point * route_graph_add_point(struct route_graph *this, struct coord *f);
170 void route_graph_add_turn_restriction(struct route_graph *this, struct item *item);
171 void route_graph_free_points(struct route_graph *this);
172 struct route_graph_point *route_graph_get_point(struct route_graph *this, struct coord *c);
173 struct route_graph_point *route_graph_get_point_next(struct route_graph *this, struct coord *c,
174  struct route_graph_point *last);
178 void route_graph_free_segments(struct route_graph *this);
179 void route_graph_build_done(struct route_graph *rg, int cancel);
180 void route_recalculate_partial(struct route *this_);
182 /* end of prototypes */
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif
188 
attr_type
Definition: attr.h:34
char data
Definition: garmin_img.c:2
char type[3]
Definition: garmin_img.c:2
#define HASH_SIZE
Definition: route_protected.h:157
static struct pcoord c
Definition: popup.c:375
int route_graph_segment_is_duplicate(struct route_graph_point *start, struct route_graph_segment_data *data)
Checks if the route graph already contains a particular segment.
Definition: route.c:1589
struct route_graph_point * route_graph_add_point(struct route_graph *this, struct coord *f)
Inserts a point into the route graph at the specified coordinates.
Definition: route.c:1413
void route_recalculate_partial(struct route *this_)
Triggers partial recalculation of the route, based on the existing route graph.
Definition: route.c:2723
void route_remove_traffic_distortion(struct route *this_, struct item *item)
Removes a traffic distortion item from the route.
Definition: route.c:4204
void route_free_selection(struct map_selection *sel)
Destroys a list of map selections.
Definition: route.c:1077
void route_change_traffic_distortion(struct route *this_, struct item *item)
Changes a traffic distortion item on the route.
Definition: route.c:4134
struct route_graph_point * route_graph_get_point(struct route_graph *this, struct coord *c)
Gets the first route_graph_point with the specified coordinates.
Definition: route.c:1351
void route_graph_add_segment(struct route_graph *this, struct route_graph_point *start, struct route_graph_point *end, struct route_graph_segment_data *data)
Inserts a new segment into the route graph.
Definition: route.c:1614
void route_graph_free_segments(struct route_graph *this)
Destroys all segments of a route graph.
Definition: route.c:1867
void * route_segment_data_field_pos(struct route_segment_data *seg, enum attr_type type)
Returns the position of a certain field appended to a route graph segment.
Definition: route.c:1532
struct route_graph_point * route_graph_get_point_next(struct route_graph *this, struct coord *c, struct route_graph_point *last)
Gets the next route_graph_point with the specified coordinates.
Definition: route.c:1327
void route_graph_add_turn_restriction(struct route_graph *this, struct item *item)
Adds a turn restriction item to the route graph.
Definition: route.c:2480
void route_add_traffic_distortion(struct route *this_, struct item *item)
Adds a traffic distortion item to the route.
Definition: route.c:4121
struct route_graph * route_get_graph(struct route *this_)
Retrieves the route graph.
Definition: route.c:4183
struct map_selection * route_get_selection(struct route *this_)
Retrieves the map selection for the route.
Definition: route.c:1056
void route_graph_build_done(struct route_graph *rg, int cancel)
Releases all resources needed to build the route graph.
Definition: route.c:3140
void route_graph_free_points(struct route_graph *this)
Frees all the memory used for points in the route graph passed.
Definition: route.c:1427
Definition: callback.c:27
Definition: coord.h:34
Definition: event_glib.c:115
Definition: fibpriv.h:75
Definition: fibpriv.h:38
Represents an object on a map.
Definition: item.h:115
Definition: map.c:62
Used to select data from a map.
Definition: map.h:58
Definition: map.c:55
Handle for a mapset in use.
Definition: mapset.c:150
A point in the route graph.
Definition: route_protected.h:50
struct route_graph_point * hash_next
Definition: route_protected.h:51
struct route_graph_segment * seg
Definition: route_protected.h:56
struct route_graph_segment * start
Definition: route_protected.h:52
struct route_graph_segment * end
Definition: route_protected.h:54
int rhs
Definition: route_protected.h:63
int value
Definition: route_protected.h:60
struct coord c
Definition: route_protected.h:69
int flags
Definition: route_protected.h:70
int dst_val
Definition: route_protected.h:65
struct route_graph_segment * dst_seg
Definition: route_protected.h:67
struct fibheap_el * el
Definition: route_protected.h:58
Data for a segment in the route graph.
Definition: route_protected.h:105
int flags
Definition: route_protected.h:110
int score
Definition: route_protected.h:116
int len
Definition: route_protected.h:111
struct size_weight_limit size_weight
Definition: route_protected.h:114
int maxspeed
Definition: route_protected.h:112
int dangerous_goods
Definition: route_protected.h:115
struct item * item
Definition: route_protected.h:106
int offset
Definition: route_protected.h:107
A segment in the route graph.
Definition: route_protected.h:125
struct route_graph_point * start
Definition: route_protected.h:131
struct route_graph_point * end
Definition: route_protected.h:132
struct route_graph_segment * start_next
Definition: route_protected.h:127
struct route_graph_segment * next
Definition: route_protected.h:126
struct route_graph_segment * end_next
Definition: route_protected.h:129
struct route_segment_data data
Definition: route_protected.h:133
A complete route graph.
Definition: route_protected.h:142
struct fibheap * heap
Definition: route_protected.h:156
struct vehicleprofile * vehicleprofile
Definition: route_protected.h:150
struct map_rect * mr
Definition: route_protected.h:149
struct route_graph_segment * avoid_seg
Definition: route_protected.h:155
struct callback * idle_cb
Definition: route_protected.h:151
struct route_graph_point * hash[HASH_SIZE]
Definition: route_protected.h:158
struct map_selection * sel
Definition: route_protected.h:146
struct callback * done_cb
Definition: route_protected.h:152
struct map * m
Definition: route_protected.h:148
struct route_graph_segment * route_segments
Definition: route_protected.h:154
struct event_idle * idle_ev
Definition: route_protected.h:153
int busy
Definition: route_protected.h:143
struct mapset_handle * h
Definition: route_protected.h:147
A segment in the route graph or path.
Definition: route_protected.h:78
int flags
Definition: route_protected.h:80
int len
Definition: route_protected.h:81
int score
Definition: route_protected.h:82
A complete route.
Definition: route.c:201
Size and weight limits for a route segment.
Definition: route_protected.h:94
int width
Definition: route_protected.h:95
int axle_weight
Definition: route_protected.h:99
int height
Definition: route_protected.h:97
int length
Definition: route_protected.h:96
int weight
Definition: route_protected.h:98
Definition: vehicleprofile.h:33