]> git.street.me.uk Git - andy/viking.git/blame - src/vikcoord.h
Some spelling fixes in a comment
[andy/viking.git] / src / vikcoord.h
CommitLineData
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_VIKCOORD_H
23#define _VIKING_VIKCOORD_H
24
a25c4c50
GB
25#include "coords.h"
26
722b5481
RN
27G_BEGIN_DECLS
28
50a14534
EB
29typedef gshort VikCoordMode;
30#define VIK_COORD_UTM 0
31#define VIK_COORD_LATLON 1
32
33#define VIK_UTM(x) ((struct UTM *)(x))
34#define VIK_LATLON(x) ((struct LatLon *)(x))
35
36typedef struct {
37 gdouble north_south; /* northing or lat */
38 gdouble east_west; /* easting or lon */
39 gchar utm_zone;
40 gchar utm_letter;
41
42 VikCoordMode mode;
43} VikCoord;
44/* notice we can cast to either UTM or LatLon */
45/* possible more modes to come? xy? we'll leave that as an option */
46
50a14534
EB
47void vik_coord_convert(VikCoord *coord, VikCoordMode dest_mode);
48void vik_coord_copy_convert(const VikCoord *coord, VikCoordMode dest_mode, VikCoord *dest);
49gdouble vik_coord_diff(const VikCoord *c1, const VikCoord *c2);
50
51void vik_coord_load_from_latlon ( VikCoord *coord, VikCoordMode mode, const struct LatLon *ll );
52void vik_coord_load_from_utm ( VikCoord *coord, VikCoordMode mode, const struct UTM *utm );
53
54void vik_coord_to_latlon ( const VikCoord *coord, struct LatLon *dest );
55void vik_coord_to_utm ( const VikCoord *coord, struct UTM *dest );
56
57gboolean vik_coord_equals ( const VikCoord *coord1, const VikCoord *coord2 );
58
7114e879
QT
59void vik_coord_set_area(const VikCoord *coord, const struct LatLon *wh, VikCoord *tl, VikCoord *br);
60gboolean vik_coord_inside(const VikCoord *coord, const VikCoord *tl, const VikCoord *br);
50a14534
EB
61/* all coord operations MUST BE ABSTRACTED!!! */
62
722b5481
RN
63G_END_DECLS
64
50a14534 65#endif