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

Contents of /navit/navit/transform.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Mon Feb 4 17:41:59 2013 UTC (7 years, 6 months ago) by zoff99
File MIME type: text/plain
File size: 7251 byte(s)
new map version, lots of fixes and experimental new features
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 #include "point.h"
28
29 /* prototypes */
30 enum attr_type;
31 enum item_type;
32 enum map_datum;
33 enum projection;
34 struct attr;
35 struct attr_iter;
36 struct coord;
37 struct coord_geo;
38 struct coord_geo_cart;
39 struct map_selection;
40 struct pcoord;
41 // struct point;
42
43
44
45 struct transformation {
46 int yaw; /* Rotation angle */
47 int pitch;
48 int ddd;
49 int m00,m01,m02; /* 3d transformation matrix */
50 int m10,m11,m12;
51 int m20,m21,m22;
52 int xscale,yscale,wscale;
53 int xscale3d,yscale3d,wscale3d;
54 #ifdef ENABLE_ROLL
55 int roll;
56 int hog;
57 #endif
58 navit_float im00,im01,im02; /* inverse 3d transformation matrix */
59 navit_float im10,im11,im12;
60 navit_float im20,im21,im22;
61 struct map_selection *map_sel;
62 struct map_selection *screen_sel;
63 struct point screen_center;
64 int screen_dist;
65 int offx,offy,offz;
66 int znear,zfar;
67 struct coord map_center; /* Center of source rectangle */
68 enum projection pro;
69 navit_float scale; /* Scale factor */
70 int scale_shift;
71 int order;
72 int order_base;
73 };
74
75 extern GHashTable *global_transform_hash;
76 extern GHashTable *global_transform_hash2;
77
78 struct hash_entry_transform
79 {
80 int id;
81 int x;
82 int y;
83 navit_float lat;
84 navit_float lng;
85 };
86
87
88 void transform_init(void);
89 struct transformation *transform_new(void);
90 int transform_get_hog(struct transformation *this_);
91 void transform_set_hog(struct transformation *this_, int hog);
92 int transform_get_attr(struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
93 int transform_set_attr(struct transformation *this_, struct attr *attr);
94 int transformation_get_order_base(struct transformation *this_);
95 void transform_set_order_base(struct transformation *this_, int order_base);
96 struct transformation *transform_dup(struct transformation *t);
97 void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g);
98 void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c);
99 void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count);
100 void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to);
101 void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart);
102 void transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo);
103 void transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere, struct coord_geo *geo);
104 void transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum);
105 int transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int mindist, int width, int *width_return);
106 int transform_reverse(struct transformation *t, struct point *p, struct coord *c);
107 enum projection transform_get_projection(struct transformation *this_);
108 void transform_set_projection(struct transformation *this_, enum projection pro);
109 struct map_selection *transform_get_selection(struct transformation *this_, enum projection pro, int order);
110 struct coord *transform_center(struct transformation *this_);
111 struct coord *transform_get_center(struct transformation *this_);
112 void transform_set_center(struct transformation *this_, struct coord *c);
113 void transform_set_yaw(struct transformation *t, int yaw);
114 int transform_get_yaw(struct transformation *this_);
115 void transform_set_pitch(struct transformation *this_, int pitch);
116 int transform_get_pitch(struct transformation *this_);
117 void transform_set_roll(struct transformation *this_, int roll);
118 int transform_get_roll(struct transformation *this_);
119 void transform_set_distance(struct transformation *this_, int distance);
120 int transform_get_distance(struct transformation *this_);
121 void transform_set_scales(struct transformation *this_, int xscale, int yscale, int wscale);
122 void transform_set_screen_selection(struct transformation *t, struct map_selection *sel);
123 void transform_set_screen_center(struct transformation *t, struct point *p);
124 void transform_get_size(struct transformation *t, int *width, int *height);
125 void transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw);
126 void transform_setup_source_rect(struct transformation *t);
127 long transform_get_scale(struct transformation *t);
128 void transform_set_scale(struct transformation *t, long scale);
129 int transform_get_order(struct transformation *t);
130 double transform_scale(int y);
131 double transform_distance(enum projection pro, struct coord *c1, struct coord *c2);
132 void transform_project(enum projection pro, struct coord *c, int distance, int angle, struct coord *res);
133 double transform_polyline_length(enum projection pro, struct coord *c, int count);
134 int transform_distance_sq(struct coord *c1, struct coord *c2);
135 navit_float transform_distance_sq_float(struct coord *c1, struct coord *c2);
136 int transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2);
137 int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
138 navit_float transform_distance_line_sq_float(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
139 int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos);
140 int transform_douglas_peucker(struct coord *in, int count, int dist_sq, struct coord *out);
141 int transform_douglas_peucker_float(struct coord *in, int count, navit_float dist_sq, struct coord *out);
142 void transform_print_deg(double deg);
143 int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir);
144 int transform_within_border(struct transformation *this_, struct point *p, int border);
145 int transform_within_dist_point(struct coord *ref, struct coord *c, int dist);
146 int transform_within_dist_line(struct coord *ref, struct coord *c0, struct coord *c1, int dist);
147 int transform_within_dist_polyline(struct coord *ref, struct coord *c, int count, int close, int dist);
148 int transform_within_dist_polygon(struct coord *ref, struct coord *c, int count, int dist);
149 int transform_within_dist_item(struct coord *ref, enum item_type type, struct coord *c, int count, int dist);
150 void transform_copy(struct transformation *src, struct transformation *dst);
151 void transform_destroy(struct transformation *t);
152 /* end of prototypes */
153 #ifdef __cplusplus
154 }
155 #endif
156
157 #endif

   
Visit the ZANavi Wiki