2 * Navit, a modular navigation system.
3 * Copyright (C) 2005-2008 Navit Team
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.
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.
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.
22 * @brief Contains exported code for route.c
24 * This file contains code that works together with route.c and that is exported to
35 route_status_no_destination=0,
36 route_status_destination_set=1,
37 route_status_not_found=1|2,
38 route_status_building_path=1|4,
39 route_status_building_graph=1|4|8,
40 route_status_path_done_new=1|16,
41 route_status_path_done_incremental=1|32,
44 struct route_crossing {
49 struct route_crossings {
51 struct route_crossing crossing[0];
55 * @brief Information about a street
57 * This contains information about a certain street
60 struct item item; /**< The map item for this street */
61 int count; /**< Number of coordinates this street has */
63 int maxspeed; /**< Maximum speed allowed on this street. */
64 struct coord c[0]; /**< Pointer to the coordinates of this street.
65 * DO NOT INSERT FIELDS AFTER THIS. */
83 struct vehicleprofile;
84 struct route *route_new(struct attr *parent, struct attr **attrs);
85 void route_set_mapset(struct route *this_, struct mapset *ms);
86 void route_set_profile(struct route *this_, struct vehicleprofile *prof);
87 struct mapset *route_get_mapset(struct route *this_);
88 struct route_info *route_get_pos(struct route *this_);
89 struct route_info *route_get_dst(struct route *this_);
90 int route_get_path_set(struct route *this_);
91 int route_contains(struct route *this_, struct item *item);
92 int route_destination_reached(struct route *this_);
93 void route_set_position(struct route *this_, struct pcoord *pos);
94 void route_set_position_from_tracking(struct route *this_, struct tracking *tracking, enum projection pro);
95 struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs);
96 void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async);
97 int route_get_destinations(struct route *this_, struct pcoord *pc, int count);
98 int route_get_destination_count(struct route *this_);
99 void route_set_destination(struct route *this_, struct pcoord *dst, int async);
100 void route_append_destination(struct route *this_, struct pcoord *dst, int async);
101 void route_remove_nth_waypoint(struct route *this_, int n);
102 void route_remove_waypoint(struct route *this_);
103 char* route_get_destination_description(struct route *this_, int n);
104 struct coord route_get_coord_dist(struct route *this_, int dist);
105 struct street_data *street_get_data(struct item *item);
106 struct street_data *street_data_dup(struct street_data *orig);
107 void street_data_free(struct street_data *sd);
108 void route_info_free(struct route_info *inf);
109 struct street_data *route_info_street(struct route_info *rinf);
110 struct map *route_get_map(struct route *this_);
111 struct map *route_get_graph_map(struct route *this_);
112 void route_set_projection(struct route *this_, enum projection pro);
113 void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async);
114 int route_set_attr(struct route *this_, struct attr *attr);
115 int route_add_attr(struct route *this_, struct attr *attr);
116 int route_remove_attr(struct route *this_, struct attr *attr);
117 struct attr_iter * route_attr_iter_new(void);
118 void route_attr_iter_destroy(struct attr_iter *iter);
119 int route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
120 void route_init(void);
121 void route_destroy(struct route *this_);
122 /* end of prototypes */