Fix:Core:Some cleanups
[navit-package] / navit / transform.h
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_TRANSFORM_H
21 #define NAVIT_TRANSFORM_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 #include "coord.h"
27
28 /* prototypes */
29 enum item_type;
30 enum map_datum;
31 enum projection;
32 struct coord;
33 struct coord_geo;
34 struct coord_geo_cart;
35 struct map_selection;
36 struct pcoord;
37 struct point;
38 struct transformation;
39 struct transformation *transform_new(void);
40 int transform_get_hog(struct transformation *this_);
41 void transform_set_hog(struct transformation *this_, int hog);
42 int transformation_get_order_base(struct transformation *this_);
43 void transform_set_order_base(struct transformation *this_, int order_base);
44 struct transformation *transform_dup(struct transformation *t);
45 void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g);
46 void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c);
47 void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to);
48 void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart);
49 void transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo);
50 void transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere, struct coord_geo *geo);
51 void transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum);
52 int transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int mindist, int width, int *width_return);
53 void transform_reverse(struct transformation *t, struct point *p, struct coord *c);
54 enum projection transform_get_projection(struct transformation *this_);
55 void transform_set_projection(struct transformation *this_, enum projection pro);
56 struct map_selection *transform_get_selection(struct transformation *this_, enum projection pro, int order);
57 struct coord *transform_center(struct transformation *this_);
58 struct coord *transform_get_center(struct transformation *this_);
59 void transform_set_center(struct transformation *this_, struct coord *c);
60 void transform_set_yaw(struct transformation *t, int yaw);
61 int transform_get_yaw(struct transformation *this_);
62 void transform_set_pitch(struct transformation *this_, int pitch);
63 int transform_get_pitch(struct transformation *this_);
64 void transform_set_roll(struct transformation *this_, int roll);
65 int transform_get_roll(struct transformation *this_);
66 void transform_set_distance(struct transformation *this_, int distance);
67 int transform_get_distance(struct transformation *this_);
68 void transform_set_screen_selection(struct transformation *t, struct map_selection *sel);
69 void transform_set_screen_center(struct transformation *t, struct point *p);
70 void transform_get_size(struct transformation *t, int *width, int *height);
71 void transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw);
72 void transform_setup_source_rect(struct transformation *t);
73 long transform_get_scale(struct transformation *t);
74 void transform_set_scale(struct transformation *t, long scale);
75 int transform_get_order(struct transformation *t);
76 double transform_scale(int y);
77 double transform_distance(enum projection pro, struct coord *c1, struct coord *c2);
78 void transform_project(enum projection pro, struct coord *c, int distance, int angle, struct coord *res);
79 double transform_polyline_length(enum projection pro, struct coord *c, int count);
80 int transform_distance_sq(struct coord *c1, struct coord *c2);
81 int transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2);
82 int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
83 int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos);
84 int transform_douglas_peucker(struct coord *in, int count, int dist_sq, struct coord *out);
85 void transform_print_deg(double deg);
86 int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir);
87 int transform_within_border(struct transformation *this_, struct point *p, int border);
88 int transform_within_dist_point(struct coord *ref, struct coord *c, int dist);
89 int transform_within_dist_line(struct coord *ref, struct coord *c0, struct coord *c1, int dist);
90 int transform_within_dist_polyline(struct coord *ref, struct coord *c, int count, int close, int dist);
91 int transform_within_dist_polygon(struct coord *ref, struct coord *c, int count, int dist);
92 int transform_within_dist_item(struct coord *ref, enum item_type type, struct coord *c, int count, int dist);
93 void transform_destroy(struct transformation *t);
94 /* end of prototypes */
95 #ifdef __cplusplus
96 }
97 #endif
98
99 #endif