]>
Commit | Line | Data |
---|---|---|
50a14534 EB |
1 | /* |
2 | * viking -- GPS Data and Topo Analyzer, Explorer, and Manager | |
3 | * | |
4 | * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net> | |
5 | * | |
6 | * This program 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 2 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * This program 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 this program; if not, write to the Free Software | |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 | * | |
20 | */ | |
21 | ||
22 | #ifndef _VIKING_TRACK_H | |
23 | #define _VIKING_TRACK_H | |
24 | ||
25 | /* todo important: put these in their own header file, maybe.probably also rename */ | |
26 | ||
27 | #define VIK_TRACK(x) ((VikTrack *)(x)) | |
28 | #define VIK_TRACKPOINT(x) ((VikTrackpoint *)(x)) | |
29 | ||
30 | typedef struct _VikTrackpoint VikTrackpoint; | |
31 | struct _VikTrackpoint { | |
32 | VikCoord coord; | |
33 | gboolean newsegment; | |
34 | gboolean has_timestamp; | |
35 | time_t timestamp; | |
36 | gdouble altitude; | |
37 | }; | |
38 | ||
39 | typedef struct _VikTrack VikTrack; | |
40 | struct _VikTrack { | |
41 | GList *trackpoints; | |
42 | gboolean visible; | |
43 | gchar *comment; | |
44 | guint8 ref_count; | |
45 | }; | |
46 | ||
47 | VikTrack *vik_track_new(); | |
48 | void vik_track_set_comment(VikTrack *wp, const gchar *comment); | |
49 | void vik_track_ref(VikTrack *tr); | |
50 | void vik_track_free(VikTrack *tr); | |
51 | VikTrack *vik_track_copy ( const VikTrack *tr ); | |
52 | void vik_track_set_comment_no_copy(VikTrack *tr, gchar *comment); | |
53 | VikTrackpoint *vik_trackpoint_new(); | |
54 | void vik_trackpoint_free(VikTrackpoint *tp); | |
55 | VikTrackpoint *vik_trackpoint_copy(VikTrackpoint *tp); | |
56 | gdouble vik_track_get_length(const VikTrack *tr); | |
57 | gdouble vik_track_get_length_including_gaps(const VikTrack *tr); | |
58 | gulong vik_track_get_tp_count(const VikTrack *tr); | |
59 | guint vik_track_get_segment_count(const VikTrack *tr); | |
60 | VikTrack **vik_track_split_into_segments(VikTrack *tr, guint *ret_len); | |
61 | void vik_track_reverse(VikTrack *tr); | |
62 | ||
63 | gulong vik_track_get_dup_point_count ( const VikTrack *vt ); | |
64 | void vik_track_remove_dup_points ( VikTrack *vt ); | |
65 | ||
66 | gdouble vik_track_get_max_speed(const VikTrack *tr); | |
67 | gdouble vik_track_get_average_speed(const VikTrack *tr); | |
68 | ||
69 | void vik_track_convert ( VikTrack *tr, VikCoordMode dest_mode ); | |
70 | gdouble *vik_track_make_elevation_map ( const VikTrack *tr, guint16 num_chunks ); | |
71 | void vik_track_get_total_elevation_gain(const VikTrack *tr, gdouble *up, gdouble *down); | |
24d5c7e2 | 72 | VikCoord *vik_track_get_closest_tp_by_percentage_dist ( VikTrack *tr, gdouble reldist ); |
25e44eac | 73 | gdouble *vik_track_make_speed_map ( const VikTrack *tr, guint16 num_chunks ); |
b42a25ba | 74 | gboolean vik_track_get_minmax_alt ( const VikTrack *tr, gdouble *min_alt, gdouble *max_alt ); |
24d5c7e2 | 75 | |
50a14534 | 76 | #endif |