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

Contents of /navit/navit/navigation.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 48 - (show annotations) (download)
Sat Oct 24 13:12:03 2015 UTC (8 years, 5 months ago) by zoff99
File MIME type: text/plain
File size: 4199 byte(s)
v2.0.49
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_NAVIGATION_H
21 #define NAVIT_NAVIGATION_H
22
23 #define FEET_PER_METER 3.2808399
24 #define FEET_PER_MILE 5280
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 /* prototypes */
30 enum attr_type;
31 enum item_type;
32 struct attr;
33 struct attr_iter;
34 struct callback;
35 struct map;
36
37 #include "item.h"
38 #include "coord.h"
39
40 /**
41 * @brief Holds a way that one could possibly drive from a navigation item
42 */
43 struct navigation_way
44 {
45 struct navigation_way *next; /**< Pointer to a linked-list of all navigation_ways from this navigation item */
46 short dir; /**< The direction -1 or 1 of the way */
47 short angle2; /**< The angle one has to steer to drive from the old item to this street */
48 int flags; /**< The flags of the way */
49 struct item item; /**< The item of the way */
50 char *name1; // = streetname
51 char *name2; // = streetname systematic (road number e.g.: E51)
52
53 // -- NEW 002 --
54 // char *name_systematic; /**< The road number ({@code street_name_systematic} attribute, OSM: {@code ref}) */
55 char *exit_ref; /**< Exit_ref if found on the first node of the way*/
56 char *exit_label; /**< Exit_label if found on the first node of the way*/
57 struct street_destination *s_destination; /**< The destination this way leads to (OSM: {@code destination}) */
58 char *street_dest_text; /* selected destination to display in GUI */
59 // -- NEW 002 --
60
61 };
62
63 struct navigation_itm
64 {
65 struct navigation_way way;
66 int angle_end;
67 struct coord start, end;
68 int time;
69 int length;
70 int speed;
71 int dest_time;
72 int dest_length;
73 int told; /**< Indicates if this item's announcement has been told earlier and should not be told again*/
74 int streetname_told; /**< Indicates if this item's streetname has been told in speech navigation*/
75 int dest_count;
76 struct navigation_itm *next;
77 struct navigation_itm *prev;
78 };
79
80 struct navigation
81 {
82 struct route *route;
83 struct map *map;
84 struct item_hash *hash;
85 struct vehicleprofile *vehicleprofile;
86 struct navigation_itm *first;
87 struct navigation_itm *last;
88 struct navigation_command *cmd_first;
89 struct navigation_command *cmd_last;
90 struct callback_list *callback_speech;
91 struct callback_list *callback;
92 struct navit *navit;
93 struct speech *speech;
94 int level_last;
95 struct item item_last;
96 int turn_around;
97 int turn_around_limit;
98 int distance_turn;
99 struct callback *route_cb;
100 int announce[route_item_last - route_item_first + 1][3];
101 int tell_street_name;
102 int delay;
103 int curr_delay;
104 struct navigation_itm *previous;
105 struct navigation_command *cmd_previous;
106 };
107
108 struct route;
109 int navigation_get_attr(struct navigation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
110 int navigation_set_attr(struct navigation *this_, struct attr *attr);
111 struct navigation *navigation_new(struct attr *parent, struct attr **attrs);
112 int navigation_set_announce(struct navigation *this_, enum item_type type, int *level);
113 void navigation_destroy(struct navigation *this_);
114 int navigation_register_callback(struct navigation *this_, enum attr_type type, struct callback *cb);
115 void navigation_unregister_callback(struct navigation *this_, enum attr_type type, struct callback *cb);
116 struct map *navigation_get_map(struct navigation *this_);
117 void navigation_set_route(struct navigation *this_, struct route *route);
118 char *get_distance(struct navigation *nav, int dist, enum attr_type type, int is_length);
119 void navigation_init(void);
120 /* end of prototypes */
121 #ifdef __cplusplus
122 }
123 #endif
124
125 #endif

   
Visit the ZANavi Wiki