Adding comments to route.c / route.h
[profile/ivi/navit.git] / navit / navit / route.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef NAVIT_ROUTE_H
21 #define NAVIT_ROUTE_H
22
23 struct route_crossing {
24         long segid;
25         int dir;
26 };
27
28 struct route_crossings {
29         int count;
30         struct route_crossing crossing[0];
31 };
32
33 /**
34  * @brief Information about a street
35  *
36  * This contains information about a certain street
37  */
38 struct street_data {
39         struct item item;       /** The map item for this street */
40         int count;                      /** Number of coordinates this street has */
41         int flags;
42         struct coord c[0];      /** Pointer to the coordinates of this street */
43 };
44
45 #define route_item_first type_street_0
46 #define route_item_last type_ferry
47
48 /* prototypes */
49 enum item_type;
50 struct coord;
51 struct displaylist;
52 struct item;
53 struct map_selection;
54 struct mapset;
55 struct route;
56 struct route_info;
57 struct route_info_handle;
58 struct route_path_coord_handle;
59 struct route_path_handle;
60 struct route_path_segment;
61 struct street_data;
62 struct tracking;
63 struct transformation;
64 struct route *route_new(struct attr **attrs);
65 void route_set_mapset(struct route *this, struct mapset *ms);
66 struct mapset *route_get_mapset(struct route *this);
67 struct route_info *route_get_pos(struct route *this);
68 struct route_info *route_get_dst(struct route *this);
69 int *route_get_speedlist(struct route *this);
70 int route_get_path_set(struct route *this);
71 int route_set_speed(struct route *this, enum item_type type, int value);
72 int route_contains(struct route *this, struct item *item);
73 void route_set_position(struct route *this, struct pcoord *pos);
74 void route_set_position_from_tracking(struct route *this, struct tracking *tracking);
75 struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs);
76 void route_set_destination(struct route *this, struct pcoord *dst);
77 struct route_path_handle *route_path_open(struct route *this);
78 struct route_path_segment *route_path_get_segment(struct route_path_handle *h);
79 struct coord *route_path_segment_get_start(struct route_path_segment *s);
80 struct coord *route_path_segment_get_end(struct route_path_segment *s);
81 struct item *route_path_segment_get_item(struct route_path_segment *s);
82 int route_path_segment_get_length(struct route_path_segment *s);
83 int route_path_segment_get_time(struct route_path_segment *s);
84 void route_path_close(struct route_path_handle *h);
85 struct route_path_coord_handle *route_path_coord_open(struct route *this);
86 struct coord *route_path_coord_get(struct route_path_coord_handle *h);
87 void route_path_coord_close(struct route_path_coord_handle *h);
88 int route_time(int *speedlist, struct item *item, int len);
89 int route_info_length(struct route_info *pos, struct route_info *dst, int dir);
90 struct street_data *street_get_data(struct item *item);
91 struct street_data *street_data_dup(struct street_data *orig);
92 void street_data_free(struct street_data *sd);
93 void route_info_free(struct route_info *inf);
94 struct street_data *route_info_street(struct route_info *rinf);
95 struct coord *route_info_point(struct route_info *rinf, int point);
96 struct route_info_handle *route_info_open(struct route_info *start, struct route_info *end, int dir);
97 struct coord *route_info_get(struct route_info_handle *h);
98 void route_info_close(struct route_info_handle *h);
99 void route_draw(struct route *this, struct transformation *t, struct displaylist *dsp);
100 struct map *route_get_map(struct route *route);
101 struct map *route_get_graph_map(struct route *route);
102 void route_toggle_routegraph_display(struct route *route);
103 void route_set_projection(struct route *this_, enum projection pro);
104 void route_init(void);
105 /* end of prototypes */
106
107 #endif
108