/[zanavi_public1]/navit/navit/route.h
ZANavi

Contents of /navit/navit/route.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations) (download)
Fri Oct 28 21:19:04 2011 UTC (12 years, 5 months ago) by zoff99
File MIME type: text/plain
File size: 5461 byte(s)
import files
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 /** @file
21 *
22 * @brief Contains exported code for route.c
23 *
24 * This file contains code that works together with route.c and that is exported to
25 * other modules.
26 */
27
28 #ifndef NAVIT_ROUTE_H
29 #define NAVIT_ROUTE_H
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 enum route_status {
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,
42 };
43
44 struct route_crossing {
45 long segid;
46 int dir;
47 };
48
49 struct route_crossings {
50 int count;
51 struct route_crossing crossing[0];
52 };
53
54 /**
55 * @brief Information about a street
56 *
57 * This contains information about a certain street
58 */
59 struct street_data {
60 struct item item; /**< The map item for this street */
61 int count; /**< Number of coordinates this street has */
62 int flags;
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. */
66 };
67
68 /* prototypes */
69 enum attr_type;
70 enum projection;
71 struct attr;
72 struct attr_iter;
73 struct coord;
74 struct item;
75 struct map;
76 struct map_selection;
77 struct mapset;
78 struct pcoord;
79
80
81 struct route {
82 struct mapset *ms; /**< The mapset this route is built upon */
83 unsigned flags;
84 struct route_info *pos; /**< Current position within this route */
85 GList *destinations; /**< Destinations of the route */
86 struct route_info *current_dst; /**< Current destination */
87
88 struct route_graph *graph; /**< Pointer to the route graph */
89 struct route_path *path2; /**< Pointer to the route path */
90 struct map *map;
91 struct map *graph_map;
92 struct callback * route_graph_done_cb ; /**< Callback when route graph is done */
93 struct callback * route_graph_flood_done_cb ; /**< Callback when route graph flooding is done */
94 struct callback_list *cbl2; /**< Callback list to call when route changes */
95 int destination_distance; /**< Distance to the destination at which the destination is considered "reached" */
96 struct vehicleprofile *vehicleprofile; /**< Routing preferences */
97 int route_status; /**< Route Status */
98 int route_status_was_updated; /**< Route Status was updated and needs to be read */
99 int link_path; /**< Link paths over multiple waypoints together */
100 struct pcoord pc;
101 struct vehicle *v;
102 int try_harder;
103 };
104
105
106 struct route_info;
107 struct street_data;
108 struct tracking;
109 struct vehicleprofile;
110 struct route *route_new(struct attr *parent, struct attr **attrs);
111 void route_set_mapset(struct route *this_, struct mapset *ms);
112 void route_set_profile(struct route *this_, struct vehicleprofile *prof);
113 struct mapset *route_get_mapset(struct route *this_);
114 struct route_info *route_get_pos(struct route *this_);
115 struct route_info *route_get_dst(struct route *this_);
116 int route_get_path_set(struct route *this_);
117 int route_contains(struct route *this_, struct item *item);
118 int route_destination_reached(struct route *this_);
119 void route_set_position(struct route *this_, struct pcoord *pos);
120 void route_set_position_from_tracking(struct route *this_, struct tracking *tracking, enum projection pro);
121 struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs);
122 void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async);
123 int route_get_destinations(struct route *this_, struct pcoord *pc, int count);
124 void route_set_destination(struct route *this_, struct pcoord *dst, int async);
125 void route_remove_waypoint(struct route *this_);
126 struct coord route_get_coord_dist(struct route *this_, int dist);
127 struct street_data *street_get_data(struct item *item);
128 struct street_data *street_data_dup(struct street_data *orig);
129 void street_data_free(struct street_data *sd);
130 void route_info_free(struct route_info *inf);
131 struct street_data *route_info_street(struct route_info *rinf);
132 struct map *route_get_map(struct route *this_);
133 struct map *route_get_graph_map(struct route *this_);
134 void route_set_projection(struct route *this_, enum projection pro);
135 void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async);
136 int route_set_attr(struct route *this_, struct attr *attr);
137 int route_add_attr(struct route *this_, struct attr *attr);
138 int route_remove_attr(struct route *this_, struct attr *attr);
139 struct attr_iter * route_attr_iter_new(void);
140 void route_attr_iter_destroy(struct attr_iter *iter);
141 int route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
142 void route_init(void);
143 void route_destroy(struct route *this_);
144 /* end of prototypes */
145 #ifdef __cplusplus
146 }
147 #endif
148
149 #endif
150

   
Visit the ZANavi Wiki