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

Contents of /navit/navit/transform.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations) (download)
Fri Oct 28 21:19:04 2011 UTC (12 years, 5 months ago) by zoff99
File MIME type: text/plain
File size: 7043 byte(s)
import files
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
76 struct transformation *transform_new(void);
77 int transform_get_hog(struct transformation *this_);
78 void transform_set_hog(struct transformation *this_, int hog);
79 int transform_get_attr(struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
80 int transform_set_attr(struct transformation *this_, struct attr *attr);
81 int transformation_get_order_base(struct transformation *this_);
82 void transform_set_order_base(struct transformation *this_, int order_base);
83 struct transformation *transform_dup(struct transformation *t);
84 void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g);
85 void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c);
86 void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count);
87 void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to);
88 void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart);
89 void transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo);
90 void transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere, struct coord_geo *geo);
91 void transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum);
92 int transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int mindist, int width, int *width_return);
93 int transform_reverse(struct transformation *t, struct point *p, struct coord *c);
94 enum projection transform_get_projection(struct transformation *this_);
95 void transform_set_projection(struct transformation *this_, enum projection pro);
96 struct map_selection *transform_get_selection(struct transformation *this_, enum projection pro, int order);
97 struct coord *transform_center(struct transformation *this_);
98 struct coord *transform_get_center(struct transformation *this_);
99 void transform_set_center(struct transformation *this_, struct coord *c);
100 void transform_set_yaw(struct transformation *t, int yaw);
101 int transform_get_yaw(struct transformation *this_);
102 void transform_set_pitch(struct transformation *this_, int pitch);
103 int transform_get_pitch(struct transformation *this_);
104 void transform_set_roll(struct transformation *this_, int roll);
105 int transform_get_roll(struct transformation *this_);
106 void transform_set_distance(struct transformation *this_, int distance);
107 int transform_get_distance(struct transformation *this_);
108 void transform_set_scales(struct transformation *this_, int xscale, int yscale, int wscale);
109 void transform_set_screen_selection(struct transformation *t, struct map_selection *sel);
110 void transform_set_screen_center(struct transformation *t, struct point *p);
111 void transform_get_size(struct transformation *t, int *width, int *height);
112 void transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw);
113 void transform_setup_source_rect(struct transformation *t);
114 long transform_get_scale(struct transformation *t);
115 void transform_set_scale(struct transformation *t, long scale);
116 int transform_get_order(struct transformation *t);
117 double transform_scale(int y);
118 double transform_distance(enum projection pro, struct coord *c1, struct coord *c2);
119 void transform_project(enum projection pro, struct coord *c, int distance, int angle, struct coord *res);
120 double transform_polyline_length(enum projection pro, struct coord *c, int count);
121 int transform_distance_sq(struct coord *c1, struct coord *c2);
122 navit_float transform_distance_sq_float(struct coord *c1, struct coord *c2);
123 int transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2);
124 int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
125 navit_float transform_distance_line_sq_float(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
126 int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos);
127 int transform_douglas_peucker(struct coord *in, int count, int dist_sq, struct coord *out);
128 int transform_douglas_peucker_float(struct coord *in, int count, navit_float dist_sq, struct coord *out);
129 void transform_print_deg(double deg);
130 int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir);
131 int transform_within_border(struct transformation *this_, struct point *p, int border);
132 int transform_within_dist_point(struct coord *ref, struct coord *c, int dist);
133 int transform_within_dist_line(struct coord *ref, struct coord *c0, struct coord *c1, int dist);
134 int transform_within_dist_polyline(struct coord *ref, struct coord *c, int count, int close, int dist);
135 int transform_within_dist_polygon(struct coord *ref, struct coord *c, int count, int dist);
136 int transform_within_dist_item(struct coord *ref, enum item_type type, struct coord *c, int count, int dist);
137 void transform_copy(struct transformation *src, struct transformation *dst);
138 void transform_destroy(struct transformation *t);
139 /* end of prototypes */
140 #ifdef __cplusplus
141 }
142 #endif
143
144 #endif

   
Visit the ZANavi Wiki