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

Contents of /navit/navit/transform.h

Parent Directory Parent Directory | Revision Log Revision Log


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

   
Visit the ZANavi Wiki