Parent Directory | Revision Log
Track handling redone
1 | /* |
2 | * Copyright (C) 2008 Till Harbaum <till@harbaum.org>. |
3 | * |
4 | * This file is part of OSM2Go. |
5 | * |
6 | * OSM2Go is free software: you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation, either version 3 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * OSM2Go is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with OSM2Go. If not, see <http://www.gnu.org/licenses/>. |
18 | */ |
19 | |
20 | #ifndef TRACK_H |
21 | #define TRACK_H |
22 | |
23 | typedef struct track_point_s { |
24 | pos_t pos; /* position in lat/lon format */ |
25 | time_t time; |
26 | float altitude; |
27 | struct track_point_s *next; |
28 | } track_point_t; |
29 | |
30 | typedef struct track_item_chain_s { |
31 | canvas_item_t *item; |
32 | struct track_item_chain_s *next; |
33 | } track_item_chain_t; |
34 | |
35 | typedef struct track_seg_s { |
36 | track_point_t *track_point; |
37 | struct track_seg_s *next; |
38 | track_item_chain_t *item_chain; |
39 | } track_seg_t; |
40 | |
41 | typedef struct track_s { |
42 | track_seg_t *track_seg; |
43 | gboolean dirty; |
44 | track_seg_t *cur_seg; |
45 | } track_t; |
46 | |
47 | gint track_seg_points(track_seg_t *seg); |
48 | |
49 | /* used internally to save and restore the currently displayed track */ |
50 | void track_save(project_t *project, track_t *track); |
51 | track_t *track_restore(appdata_t *appdata, project_t *project); |
52 | |
53 | /* accessible via the menu */ |
54 | void track_clear(appdata_t *appdata, track_t *track); |
55 | void track_export(appdata_t *appdata, char *filename); |
56 | track_t *track_import(appdata_t *appdata, char *filename); |
57 | |
58 | void track_enable_gps(appdata_t *appdata, gboolean enable); |
59 | |
60 | #endif // TRACK_H |