navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
transform.h
Go to the documentation of this file.
1 
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 attr_type;
30 enum item_type;
31 enum map_datum;
32 enum projection;
33 struct attr;
34 struct attr_iter;
35 struct coord;
36 struct coord_geo;
37 struct coord_geo_cart;
38 struct map_selection;
39 struct pcoord;
40 struct point;
41 struct transformation;
42 struct transformation *transform_new(struct pcoord *center, int scale, int yaw);
43 int transform_get_hog(struct transformation *this_);
44 void transform_set_hog(struct transformation *this_, int hog);
45 int transform_get_attr(struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
46 int transform_set_attr(struct transformation *this_, struct attr *attr);
48 void transform_set_order_base(struct transformation *this_, int order_base);
50 void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g);
51 void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c);
52 void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count);
53 void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to);
54 void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart);
55 void transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo);
56 void transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere, struct coord_geo *geo);
57 void transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum);
58 int transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int mindist, int width, int *width_return);
59 int transform_reverse(struct transformation *t, struct point *p, struct coord *c);
62 void transform_set_projection(struct transformation *this_, enum projection pro);
63 struct map_selection *transform_get_selection(struct transformation *this_, enum projection pro, int order);
64 struct coord *transform_center(struct transformation *this_);
65 struct coord *transform_get_center(struct transformation *this_);
66 void transform_set_center(struct transformation *this_, struct coord *c);
67 void transform_set_yaw(struct transformation *t, int yaw);
68 int transform_get_yaw(struct transformation *this_);
69 void transform_set_pitch(struct transformation *this_, int pitch);
70 int transform_get_pitch(struct transformation *this_);
71 void transform_set_roll(struct transformation *this_, int roll);
72 int transform_get_roll(struct transformation *this_);
73 void transform_set_distance(struct transformation *this_, int distance);
74 int transform_get_distance(struct transformation *this_);
75 void transform_set_scales(struct transformation *this_, int xscale, int yscale, int wscale);
77 void transform_set_screen_center(struct transformation *t, struct point *p);
78 void transform_get_size(struct transformation *t, int *width, int *height);
79 void transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw);
81 long transform_get_scale(struct transformation *t);
82 void transform_set_scale(struct transformation *t, long scale);
83 int transform_get_order(struct transformation *t);
84 double transform_scale(int y);
85 double transform_distance(enum projection pro, struct coord *c1, struct coord *c2);
86 void transform_project(enum projection pro, struct coord *c, int distance, int angle, struct coord *res);
87 double transform_polyline_length(enum projection pro, struct coord *c, int count);
88 int transform_distance_sq(struct coord *c1, struct coord *c2);
90 int transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2);
91 int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
92 navit_float transform_distance_line_sq_float(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
93 int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos);
94 int transform_douglas_peucker(struct coord *in, int count, int dist_sq, struct coord *out);
95 int transform_douglas_peucker_float(struct coord *in, int count, navit_float dist_sq, struct coord *out);
96 void transform_print_deg(double deg);
97 int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir);
98 int transform_within_border(struct transformation *this_, struct point *p, int border);
99 int transform_within_dist_point(struct coord *ref, struct coord *c, int dist);
100 int transform_within_dist_line(struct coord *ref, struct coord *c0, struct coord *c1, int dist);
101 int transform_within_dist_polyline(struct coord *ref, struct coord *c, int count, int close, int dist);
102 int transform_within_dist_polygon(struct coord *ref, struct coord *c, int count, int dist);
103 int transform_within_dist_item(struct coord *ref, enum item_type type, struct coord *c, int count, int dist);
104 void transform_copy(struct transformation *src, struct transformation *dst);
105 void transform_destroy(struct transformation *t);
106 /* end of prototypes */
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif
void transform_set_order_base(struct transformation *this_, int order_base)
Definition: transform.c:263
int transform_get_hog(struct transformation *this_)
Definition: transform.c:210
attr_type
Definition: attr.h:34
int transform_douglas_peucker(struct coord *in, int count, int dist_sq, struct coord *out)
Definition: transform.c:1345
void transform_get_size(struct transformation *t, int *width, int *height)
Definition: transform.c:906
unsigned char p[5]
Definition: mg.h:48
int transform_within_border(struct transformation *this_, struct point *p, int border)
Definition: transform.c:1483
void transform_print_deg(double deg)
Definition: transform.c:1395
void transform_set_screen_center(struct transformation *t, struct point *p)
Definition: transform.c:900
int transform_reverse(struct transformation *t, struct point *p, struct coord *c)
Definition: transform.c:706
tuple iter
Definition: eval.py:8
int y
Definition: coord.h:36
long transform_get_scale(struct transformation *t)
Definition: transform.c:1004
struct transformation * transform_dup(struct transformation *t)
Definition: transform.c:270
void transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere, struct coord_geo *geo)
Converts UTM coords to lat/long.
Definition: transform.c:412
struct map_selection * transform_get_selection(struct transformation *this_, enum projection pro, int order)
Definition: transform.c:768
void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c)
Definition: transform.c:312
void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart)
Transforms geodetic to Cartesian coordinates.
Definition: transform.c:363
struct coord * transform_center(struct transformation *this_)
Definition: transform.c:802
void transform_set_scales(struct transformation *this_, int xscale, int yscale, int wscale)
Definition: transform.c:880
void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g)
Definition: transform.c:283
unsigned short height
Definition: garmin_img.c:525
void transform_setup_source_rect(struct transformation *t)
Definition: transform.c:917
void transform_set_distance(struct transformation *this_, int distance)
Definition: transform.c:867
item_type
Definition: item.h:29
void transform_set_hog(struct transformation *this_, int hog)
Definition: transform.c:216
void transform_set_yaw(struct transformation *t, int yaw)
Definition: transform.c:821
int transform_distance_sq(struct coord *c1, struct coord *c2)
Determines the squared Mercator distance between two points.
Definition: transform.c:1199
void transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw)
navit_float scale
Definition: transform.c:88
void transform_set_roll(struct transformation *this_, int roll)
Definition: transform.c:846
void transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo)
Transforms Cartesian to geodetic coordinates.
Definition: transform.c:385
int transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2)
Definition: transform.c:1219
navit_float transform_distance_sq_float(struct coord *c1, struct coord *c2)
Definition: transform.c:1211
int transform_within_dist_polygon(struct coord *ref, struct coord *c, int count, int dist)
Definition: transform.c:1573
static double dist_sq(double x1, double y1, double x2, double y2)
Definition: quadtree.c:62
int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir)
Gets the bearing from one point to another.
Definition: transform.c:1463
enum projection pro
Definition: transform.c:87
int transform_douglas_peucker_float(struct coord *in, int count, navit_float dist_sq, struct coord *out)
Definition: transform.c:1369
int transform_get_pitch(struct transformation *this_)
Definition: transform.c:840
void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count)
Definition: transform.c:329
static double c2
Definition: geod_for.c:27
struct coord * transform_get_center(struct transformation *this_)
Definition: transform.c:808
A cartesian coordinate.
Definition: coord.h:91
map_datum
Definition: projection.h:31
int transformation_get_order_base(struct transformation *this_)
Definition: transform.c:257
double transform_distance(enum projection pro, struct coord *c1, struct coord *c2)
Definition: transform.c:1100
int transform_get_order(struct transformation *t)
Definition: transform.c:1018
projection
Definition: projection.h:23
struct tcoord center
Definition: garmin_img.c:523
Definition: config_.c:48
void transform_copy(struct transformation *src, struct transformation *dst)
Definition: transform.c:1602
int transform_get_yaw(struct transformation *this_)
Definition: transform.c:828
int transform_get_distance(struct transformation *this_)
Definition: transform.c:874
Definition: attr.h:156
Used to select data from a map.
Definition: map.h:57
void transform_destroy(struct transformation *t)
Definition: transform.c:1608
double transform_scale(int y)
Definition: transform.c:1070
void transform_project(enum projection pro, struct coord *c, int distance, int angle, struct coord *res)
Definition: transform.c:1146
int yaw
Definition: transform.c:65
int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos)
Determines the point on a polyline that is closest to a reference point, and its distance from the re...
Definition: transform.c:1322
navit_float transform_distance_line_sq_float(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt)
Definition: transform.c:1279
int transform_set_attr(struct transformation *this_, struct attr *attr)
Definition: transform.c:243
Definition: point.h:23
int order
Definition: map.h:63
void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to)
Definition: transform.c:343
double navit_float
Definition: coord.h:67
void transform_set_screen_selection(struct transformation *t, struct map_selection *sel)
Definition: transform.c:888
int transform_get_roll(struct transformation *this_)
Definition: transform.c:857
void transform_set_projection(struct transformation *this_, enum projection pro)
Definition: transform.c:736
static double c1
Definition: geod_for.c:27
void transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum)
int transform_within_dist_line(struct coord *ref, struct coord *c0, struct coord *c1, int dist)
Definition: transform.c:1513
tuple pos
Definition: startup.py:3
char type[3]
Definition: garmin_img.c:130
Definition: coord.h:34
int transform_get_attr(struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: transform.c:227
int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt)
Determines the point on a line segment that is closest to a reference point, and its distance from th...
Definition: transform.c:1239
void transform_set_pitch(struct transformation *this_, int pitch)
Definition: transform.c:834
Definition: coord.h:40
enum projection transform_get_projection(struct transformation *this_)
Definition: transform.c:730
double transform_pixels_to_map_distance(struct transformation *transformation, int pixels)
Definition: transform.c:712
double transform_polyline_length(enum projection pro, struct coord *c, int count)
Definition: transform.c:1164
void transform_set_scale(struct transformation *t, long scale)
Definition: transform.c:1010
int transform_within_dist_polyline(struct coord *ref, struct coord *c, int count, int close, int dist)
Definition: transform.c:1559
A WGS84 coordinate.
Definition: coord.h:85
The parameters needed to transform a map for display.
Definition: transform.c:64
int transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int mindist, int width, int *width_return)
Definition: transform.c:575
int transform_within_dist_point(struct coord *ref, struct coord *c, int dist)
Definition: transform.c:1497
int order_base
Definition: transform.c:91
void transform_set_center(struct transformation *this_, struct coord *c)
Definition: transform.c:814
unsigned short width
Definition: garmin_img.c:524
int transform_within_dist_item(struct coord *ref, enum item_type type, struct coord *c, int count, int dist)
Definition: transform.c:1592
struct transformation * transform_new(struct pcoord *center, int scale, int yaw)
Definition: transform.c:194