navit
0.5.3-trunk
|
#include <assert.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <glib.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
#include "coord.h"
#include "debug.h"
#include "item.h"
#include "map.h"
#include "transform.h"
#include "projection.h"
#include "point.h"
Data Structures | |
struct | transformation |
The parameters needed to transform a map for display. More... | |
struct | coord_3d |
struct | z_clip_result |
Macros | |
#define | _USE_MATH_DEFINES 1 |
#define | POST_SHIFT 5 |
Bitshift to apply during coordinate transformation. More... | |
#define | HOG(t) 0 |
#define | TWOPI (M_PI*2) |
#define | GC2RAD(c) ((c) * TWOPI/(1<<24)) |
#define | minf(a, b) ((a) < (b) ? (a) : (b)) |
#define | GMETER 2.3887499999999999 |
Functions | |
static void | transform_set_screen_dist (struct transformation *t, int dist) |
static void | transform_setup_matrix (struct transformation *t) |
struct transformation * | transform_new (struct pcoord *center, int scale, int yaw) |
int | transform_get_hog (struct transformation *this_) |
void | transform_set_hog (struct transformation *this_, int hog) |
int | transform_get_attr (struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
int | transform_set_attr (struct transformation *this_, struct attr *attr) |
int | transformation_get_order_base (struct transformation *this_) |
void | transform_set_order_base (struct transformation *this_, int order_base) |
struct transformation * | transform_dup (struct transformation *t) |
void | transform_to_geo (enum projection pro, struct coord *c, struct coord_geo *g) |
void | transform_from_geo (enum projection pro, struct coord_geo *g, struct coord *c) |
void | transform_from_to_count (struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count) |
void | transform_from_to (struct coord *cfrom, enum projection from, struct coord *cto, enum projection to) |
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. More... | |
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. More... | |
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. More... | |
static struct coord | transform_correct_projection (struct transformation *t, enum projection required_projection, struct coord c) |
static struct coord | transform_shift_by_center_and_scale (struct transformation *t, struct coord c) |
static struct coord_3d | transform_rotate (struct transformation *t, struct coord c) |
static struct coord_3d | transform_z_clip (struct coord_3d c, struct coord_3d c_old, int zlimit) |
static struct point | transform_project_onto_view_plane (struct transformation *t, struct coord_3d c) |
static int | transform_points_too_close (struct point screen_point, struct point screen_point_old, int mindist) |
static struct z_clip_result | transform_z_clip_if_necessary (struct coord_3d coord, int zlimit, struct z_clip_result clip_result_old) |
int | transform (struct transformation *t, enum projection required_projection, struct coord *input, struct point *result, int count, int mindist, int width, int *width_result) |
static void | transform_apply_inverse_matrix (struct transformation *t, struct coord_geo_cart *in, struct coord_geo_cart *out) |
static int | transform_zplane_intersection (struct coord_geo_cart *p1, struct coord_geo_cart *p2, navit_float z, struct coord_geo_cart *result) |
static void | transform_screen_to_3d (struct transformation *t, struct point *p, navit_float z, struct coord_geo_cart *cg) |
static int | transform_reverse_near_far (struct transformation *t, struct point *p, struct coord *c, int near, int far) |
int | transform_reverse (struct transformation *t, struct point *p, struct coord *c) |
double | transform_pixels_to_map_distance (struct transformation *transformation, int pixels) |
enum projection | transform_get_projection (struct transformation *this_) |
void | transform_set_projection (struct transformation *this_, enum projection pro) |
static int | min4 (int v1, int v2, int v3, int v4) |
static int | max4 (int v1, int v2, int v3, int v4) |
struct map_selection * | transform_get_selection (struct transformation *this_, enum projection pro, int order) |
struct coord * | transform_center (struct transformation *this_) |
struct coord * | transform_get_center (struct transformation *this_) |
void | transform_set_center (struct transformation *this_, struct coord *c) |
void | transform_set_yaw (struct transformation *t, int yaw) |
int | transform_get_yaw (struct transformation *this_) |
void | transform_set_pitch (struct transformation *this_, int pitch) |
int | transform_get_pitch (struct transformation *this_) |
void | transform_set_roll (struct transformation *this_, int roll) |
int | transform_get_roll (struct transformation *this_) |
void | transform_set_distance (struct transformation *this_, int distance) |
int | transform_get_distance (struct transformation *this_) |
void | transform_set_scales (struct transformation *this_, int xscale, int yscale, int wscale) |
void | transform_set_screen_selection (struct transformation *t, struct map_selection *sel) |
void | transform_set_screen_center (struct transformation *t, struct point *p) |
void | transform_get_size (struct transformation *t, int *width, int *height) |
void | transform_setup_source_rect (struct transformation *t) |
long | transform_get_scale (struct transformation *t) |
void | transform_set_scale (struct transformation *t, long scale) |
int | transform_get_order (struct transformation *t) |
static double | transform_distance_garmin (struct coord *c1, struct coord *c2) |
double | transform_scale (int y) |
double | transform_distance (enum projection pro, struct coord *c1, struct coord *c2) |
Calculates the distance between two points. More... | |
void | transform_project (enum projection pro, struct coord *c, int distance, int angle, struct coord *res) |
double | transform_polyline_length (enum projection pro, struct coord *c, int count) |
static int | transform_overflow_possible_if_squared (int count,...) |
int | transform_distance_sq (struct coord *c1, struct coord *c2) |
Determines the squared Mercator distance between two points. More... | |
navit_float | transform_distance_sq_float (struct coord *c1, struct coord *c2) |
int | transform_distance_sq_pc (struct pcoord *c1, struct pcoord *c2) |
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 the reference point. More... | |
navit_float | transform_distance_line_sq_float (struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt) |
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 reference point. More... | |
int | transform_douglas_peucker (struct coord *in, int count, int dist_sq, struct coord *out) |
int | transform_douglas_peucker_float (struct coord *in, int count, navit_float dist_sq, struct coord *out) |
void | transform_print_deg (double deg) |
int | transform_get_angle_delta (struct coord *c1, struct coord *c2, int dir) |
Gets the bearing from one point to another. More... | |
int | transform_within_border (struct transformation *this_, struct point *p, int border) |
int | transform_within_dist_point (struct coord *ref, struct coord *c, int dist) |
int | transform_within_dist_line (struct coord *ref, struct coord *c0, struct coord *c1, int dist) |
int | transform_within_dist_polyline (struct coord *ref, struct coord *c, int count, int close, int dist) |
int | transform_within_dist_polygon (struct coord *ref, struct coord *c, int count, int dist) |
int | transform_within_dist_item (struct coord *ref, enum item_type type, struct coord *c, int count, int dist) |
void | transform_copy (struct transformation *src, struct transformation *dst) |
void | transform_destroy (struct transformation *t) |
Variables | |
static const navit_float | gar2geo_units = 360.0/(1<<24) |
static const navit_float | geo2gar_units = 1/(360.0/(1<<24)) |
Coordinate transformations and projections.
#define _USE_MATH_DEFINES 1 |
Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Referenced by transform_distance_garmin().
#define GMETER 2.3887499999999999 |
Referenced by transform_distance_garmin().
#define HOG | ( | t | ) | 0 |
Referenced by transform_get_hog(), transform_reverse_near_far(), transform_rotate(), and transform_setup_source_rect().
#define minf | ( | a, | |
b | |||
) | ((a) < (b) ? (a) : (b)) |
Referenced by transform_distance_garmin().
#define POST_SHIFT 5 |
Bitshift to apply during coordinate transformation.
This bitshift is applied (left shift) during coordinate transformation (and later reversed). The transformation is performed with integer arithmetic, and this shift reduces rounding errors when converting floating point numbers to integers, particularly because some input values are fairly small (for example, the entries in the transformation matrix, struct transformation
).
This works because the transformations involve only multiplications, so the shift can be applied to one factor and removed from the result.
The value is a compromise; if it is too small, rounding errors increase, if it is too large, signed integer calculations will overflow at high zoom levels (which is undefined behavior).
Referenced by transform(), transform_reverse_near_far(), transform_rotate(), transform_screen_to_3d(), transform_set_screen_dist(), and transform_setup_matrix().
#define TWOPI (M_PI*2) |
Referenced by geod_inv().
|
static |
Referenced by transform_setup_source_rect().
|
static |
Referenced by transform_setup_source_rect().
int transform | ( | struct transformation * | t, |
enum projection | required_projection, | ||
struct coord * | input, | ||
struct point * | result, | ||
int | count, | ||
int | mindist, | ||
int | width, | ||
int * | width_result | ||
) |
References z_clip_result::clipped_coord, dbg, transformation::ddd, lvl_debug, transformation::offx, transformation::offy, POST_SHIFT, z_clip_result::process_coord_again, z_clip_result::skip_coord, transform_correct_projection(), transform_points_too_close(), transform_project_onto_view_plane(), transform_rotate(), transform_shift_by_center_and_scale(), transform_z_clip_if_necessary(), width, transformation::wscale, point::x, coord_3d::x, point::y, coord_3d::y, coord_3d::z, and transformation::znear.
Referenced by displayitem_draw(), graphics_displayitem_within_dist(), gui_internal_cmd_position_do(), Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel(), navit_autozoom(), navit_vehicle_draw(), navit_vehicle_update_position(), and navit_zoom_to_rect().
|
static |
References transformation::im00, transformation::im01, transformation::im02, transformation::im10, transformation::im11, transformation::im12, transformation::im20, transformation::im21, transformation::im22, coord_geo_cart::x, coord_geo_cart::y, and coord_geo_cart::z.
Referenced by transform_reverse_near_far(), and transform_setup_source_rect().
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.
This transforms ECEF Cartesian coordinates into geodetic coordinates, consisting of latitude and longitude.
cart | The Cartesian coordinates |
a | Semi-minor axis of the ellipsoid |
b | Semi-minor axis of the ellipsoid |
geo | Points to a structure that will receive the geodetic coordinates |
References coord_geo::lat, lat, coord_geo::lng, M_PI, navit_atan, navit_sin, navit_sqrt, navit_tan, coord_geo_cart::x, coord_geo_cart::y, and coord_geo_cart::z.
struct coord* transform_center | ( | struct transformation * | this_ | ) |
References transformation::map_center.
Referenced by bookmarks_set_center_from_file(), bookmarks_write_center_to_file(), keypress(), navit_projection_set(), navit_scale(), and navit_set_center().
void transform_copy | ( | struct transformation * | src, |
struct transformation * | dst | ||
) |
Referenced by navit_handle_button(), and navit_predraw().
|
static |
References c, transform_from_geo(), and transform_to_geo().
Referenced by transform().
void transform_destroy | ( | struct transformation * | t | ) |
References transformation::map_sel, map_selection_destroy(), and transformation::screen_sel.
Referenced by graphics_displaylist_destroy(), graphics_displaylist_draw(), graphics_load_mapset(), navit_motion_timeout(), and vehicle_destroy().
double transform_distance | ( | enum projection | pro, |
struct coord * | c1, | ||
struct coord * | c2 | ||
) |
Calculates the distance between two points.
pro | The projection used for c1 and c2 . |
c1 | The first point. |
c2 | The second point. |
References dbg, lvl_error, projection_garmin, projection_mg, transformation::scale, transform_distance_garmin(), transform_scale(), coord::x, and coord::y.
Referenced by Backend::get_pois(), NGQPoint::getPOI(), gui_internal_cmd2_route_height_profile(), gui_internal_cmd_pois(), model_poi(), navigation_way_get_max_delta(), osd_compass_draw(), osd_odometer_draw(), osd_route_guard_draw(), osd_speed_cam_draw(), route_destination_reached(), route_graph_add_street(), route_info_distances(), route_path_new(), tracking_update(), traffic_location_get_point_triple(), traffic_location_populate_route_graph(), traffic_message_add_segments(), traffic_route_flood_graph(), transform_pixels_to_map_distance(), transform_polyline_length(), and vehicle_demo_timer().
References c, GC2RAD, GMETER, minf, navit_asin, navit_cos, navit_sin, navit_sqrt, coord::x, and coord::y.
Referenced by transform_distance().
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 the reference point.
l0 | The first coordinate of the line segment |
l1 | The second coordinate of the line segment |
ref | The reference point |
lpnt | Receives the coordinates of the point on the line segment that is closest to ref , can be NULL |
ref
and lpnt
, or INT_MAX
if an overflow occurred References c1, c2, transform_distance_sq(), transform_overflow_possible_if_squared(), coord::x, and coord::y.
Referenced by osd_route_guard_draw(), tracking_update(), tracking_value(), transform_distance_polyline_sq(), and transform_douglas_peucker().
navit_float transform_distance_line_sq_float | ( | struct coord * | l0, |
struct coord * | l1, | ||
struct coord * | ref, | ||
struct coord * | lpnt | ||
) |
References c1, c2, transform_distance_sq_float(), coord::x, and coord::y.
Referenced by transform_douglas_peucker_float().
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 reference point.
c | An array containing the coordinates of the polyline |
count | Number of elements in c |
ref | The reference point |
lpnt | Receives the coordinates of the point on the polyline that is closest to ref , can be NULL |
pos | Receives the index of the line segment containing lpnt , can be NULL |
ref
and lpnt
, or INT_MAX
if an overflow occurred References transform_distance_line_sq().
Referenced by route_find_nearest_street(), and route_path_get_distances().
Determines the squared Mercator distance between two points.
c0 | The first coordinate |
c1 | The second coordinate |
c1
and c2
, or INT_MAX
if an overflow occurs. References transform_overflow_possible_if_squared(), coord::x, and coord::y.
Referenced by osd_speed_cam_draw(), search_house_number_coordinate(), transform_distance_line_sq(), and transform_distance_sq_pc().
navit_float transform_distance_sq_float | ( | struct coord * | c1, |
struct coord * | c2 | ||
) |
References coord::x, and coord::y.
Referenced by transform_distance_line_sq_float().
References transform_distance_sq(), coord::x, pcoord::x, coord::y, and pcoord::y.
References transform_distance_line_sq(), and transform_douglas_peucker().
Referenced by transform_douglas_peucker(), and vehicle_log_binfile().
int transform_douglas_peucker_float | ( | struct coord * | in, |
int | count, | ||
navit_float | dist_sq, | ||
struct coord * | out | ||
) |
References transform_distance_line_sq_float(), and transform_douglas_peucker_float().
Referenced by transform_douglas_peucker_float().
struct transformation* transform_dup | ( | struct transformation * | t | ) |
References transformation::map_sel, map_selection_dup(), and transformation::screen_sel.
Referenced by graphics_displaylist_draw(), graphics_load_mapset(), and navit_motion_timeout().
void transform_from_geo | ( | enum projection | pro, |
struct coord_geo * | g, | ||
struct coord * | c | ||
) |
References geo2gar_units, coord_geo::lat, coord_geo::lng, M_PI, M_PI_4, navit_tan, projection_garmin, projection_mg, coord::x, and coord::y.
Referenced by NGQPoint::_coordName(), coord_parse(), NGQProxyNavit::getPosition(), gui_internal_cmd2_pois(), gui_internal_cmd_map_download_do(), gui_internal_cmd_position_do(), gui_internal_set_position_coord(), Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel(), map_rect_get_item_csv(), navit_cmd_map_add_curr_pos(), navit_new(), navit_projection_set(), navit_set_attr_do(), navit_vehicle_update_position(), osd_compass_draw(), osd_odometer_draw(), osd_route_guard_draw(), osd_speed_cam_draw(), route_find_nearest_street(), route_set_attr(), shapefile_coord(), tracking_doupdate_lines(), tracking_update(), traffic_location_get_point_triple(), traffic_location_open_map_rect(), traffic_message_add_segments(), transform_correct_projection(), transform_from_to(), transform_from_to_count(), transform_get_selection(), and vehicle_log_binfile().
void transform_from_to | ( | struct coord * | cfrom, |
enum projection | from, | ||
struct coord * | cto, | ||
enum projection | to | ||
) |
References transform_from_geo(), and transform_to_geo().
Referenced by bookmarks_append_destinations(), item_coord_get_pro(), map_selection_dup_pro(), navit_set_center(), rm_coord_get(), rp_coord_get(), shapefile_coord(), and tracking_map_item_coord_get().
void transform_from_to_count | ( | struct coord * | cfrom, |
enum projection | from, | ||
struct coord * | cto, | ||
enum projection | to, | ||
int | count | ||
) |
References transform_from_geo(), and transform_to_geo().
Referenced by do_draw().
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.
This transforms geodetic coordinates (consisting of latitude and longitude) into ECEF Cartesian coordinates.
geo | The WGS84 coordinates to convert |
a | Semi-minor axis of the ellipsoid |
b | Semi-minor axis of the ellipsoid |
cart | Points to a structure that will receive the Cartesian coordinates |
References coord_geo::lat, coord_geo::lng, navit_cos, navit_sin, coord_geo_cart::x, coord_geo_cart::y, and coord_geo_cart::z.
Gets the bearing from one point to another.
c1 | The first coordinate |
c2 | The second coordinate |
dir | The direction: if it is -1, the bearing from c2 to c1 is returned, else the bearing from c1 to c2 |
References M_PI, coord::x, and coord::y.
Referenced by NGQPoint::getPOI(), gui_internal_cmd_pois_item(), model_poi(), pedestrian_draw_arrows(), road_angle(), tracking_get_angles(), and vehicle_demo_timer().
int transform_get_attr | ( | struct transformation * | this_, |
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
References attr::num, type, attr::type, and attr::u.
struct coord* transform_get_center | ( | struct transformation * | this_ | ) |
References transformation::map_center.
Referenced by navit_get_attr(), osd_auxmap_draw(), pedestrian_draw_arrows(), and update_transformation().
int transform_get_distance | ( | struct transformation * | this_ | ) |
References transformation::screen_dist.
Referenced by keypress().
int transform_get_hog | ( | struct transformation * | this_ | ) |
References HOG.
Referenced by keypress().
int transform_get_order | ( | struct transformation * | t | ) |
References dbg, lvl_debug, and transformation::order.
Referenced by graphics_displaylist_draw(), and graphics_load_mapset().
int transform_get_pitch | ( | struct transformation * | this_ | ) |
References transformation::pitch.
Referenced by keypress(), and navit_get_attr().
enum projection transform_get_projection | ( | struct transformation * | this_ | ) |
References transformation::pro.
Referenced by NGQPoint::_coordName(), bookmarks_set_center_from_file(), bookmarks_write_center_to_file(), do_draw(), Backend::get_bookmarks(), Backend::get_pois(), NGQProxyNavit::getPosition(), gui_internal_set_click_coord(), gui_internal_set_position_coord(), Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel(), model_poi(), navit_autozoom(), navit_get_attr(), navit_get_coord(), navit_init(), navit_projection_set(), navit_set_attr_do(), navit_set_center(), navit_set_center_screen(), navit_vehicle_draw(), navit_vehicle_update_position(), navit_zoom_to_rect(), NGQPoint::NGQPoint(), osd_auxmap_draw(), popup(), popup_set_destination(), popup_show_item(), NGQPoint::setNewPoint(), Backend::showMenu(), and transform_pixels_to_map_distance().
int transform_get_roll | ( | struct transformation * | this_ | ) |
long transform_get_scale | ( | struct transformation * | t | ) |
References transformation::scale.
Referenced by navit_autozoom(), navit_get_attr(), navit_set_attr_do(), navit_zoom_in(), navit_zoom_out(), pedestrian_cmd_pedestrian_rocket(), and pedestrian_rocket_idle().
struct map_selection* transform_get_selection | ( | struct transformation * | this_, |
enum projection | pro, | ||
int | order | ||
) |
References map_selection::c_rect, dbg, item_range_all, coord_geo::lat, coord_geo::lng, coord_rect::lu, lvl_debug, transformation::map_sel, map_selection_dup(), map_selection::next, map_selection::order, transformation::order, transformation::pro, map_selection::range, coord_rect::rl, transform_from_geo(), transform_to_geo(), map_selection::u, coord::x, and coord::y.
Referenced by displaylist_get_selection().
void transform_get_size | ( | struct transformation * | t, |
int * | width, | ||
int * | height | ||
) |
References point_rect::lu, map_selection::p_rect, point_rect::rl, transformation::screen_sel, map_selection::u, point::x, and point::y.
Referenced by gui_internal_keypress(), gui_internal_set_graphics(), gui_qml_keypress(), gui_qt5_qml_set_graphics(), info_action(), keypress(), navit_autozoom(), navit_get_cursor_pnt(), navit_set_center_coord_screen(), navit_zoom_to_rect(), and WndProc().
int transform_get_yaw | ( | struct transformation * | this_ | ) |
References transformation::yaw.
Referenced by keypress(), navit_vehicle_draw(), and osd_auxmap_draw().
struct transformation* transform_new | ( | struct pcoord * | center, |
int | scale, | ||
int | yaw | ||
) |
References transformation::map_center, transformation::order_base, pcoord::pro, transformation::pro, transformation::scale, transform_set_screen_dist(), transform_set_yaw(), coord::x, pcoord::x, coord::y, and pcoord::y.
Referenced by navit_new(), and vehicle_new().
|
static |
References value.
Referenced by transform_distance_line_sq(), and transform_distance_sq().
double transform_pixels_to_map_distance | ( | struct transformation * | transformation, |
int | pixels | ||
) |
References transformation::screen_center, transform_distance(), transform_get_projection(), transform_reverse(), point::x, and point::y.
Referenced by osd_scale_draw().
|
static |
References point::x, and point::y.
Referenced by transform().
double transform_polyline_length | ( | enum projection | pro, |
struct coord * | c, | ||
int | count | ||
) |
References transform_distance().
Referenced by route_get_coord_dist(), and route_info_distances().
void transform_print_deg | ( | double | deg | ) |
References p.
void transform_project | ( | enum projection | pro, |
struct coord * | c, | ||
int | distance, | ||
int | angle, | ||
struct coord * | res | ||
) |
References dbg, lvl_error, M_PI, projection_mg, transformation::scale, transform_scale(), coord::x, and coord::y.
Referenced by tracking_update().
|
static |
int transform_reverse | ( | struct transformation * | t, |
struct point * | p, | ||
struct coord * | c | ||
) |
References transform_reverse_near_far(), transformation::zfar, and transformation::znear.
Referenced by gui_internal_set_click_coord(), info_action(), Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel(), model_poi(), navit_scale(), navit_set_center_screen(), NGQPoint::NGQPoint(), popup(), Backend::showMenu(), transform_pixels_to_map_distance(), transform_setup_source_rect(), and update_transformation().
|
static |
References dbg, transformation::ddd, HOG, transformation::im00, transformation::im01, transformation::im10, transformation::im11, lvl_debug, transformation::map_center, transformation::offx, transformation::offy, POST_SHIFT, transformation::scale_shift, transform_apply_inverse_matrix(), transform_screen_to_3d(), transform_zplane_intersection(), point::x, coord::x, coord_geo_cart::x, point::y, coord::y, and coord_geo_cart::y.
Referenced by transform_reverse().
|
static |
References c, dbg, HOG, lvl_debug, POST_SHIFT, pcoord::x, coord_3d::x, pcoord::y, coord_3d::y, and coord_3d::z.
Referenced by transform().
double transform_scale | ( | int | y | ) |
References coord_geo::lat, M_PI, navit_cos, projection_mg, size, transform_to_geo(), coord::x, and coord::y.
Referenced by Backend::get_pois(), gui_internal_cmd_pois(), model_poi(), osd_route_guard_draw(), transform_distance(), and transform_project().
|
static |
int transform_set_attr | ( | struct transformation * | this_, |
struct attr * | attr | ||
) |
References attr::num, attr::type, and attr::u.
void transform_set_center | ( | struct transformation * | this_, |
struct coord * | c | ||
) |
References c, and transformation::map_center.
Referenced by navit_set_attr_do(), navit_set_center_coord_screen(), navit_zoom_to_rect(), osd_auxmap_draw(), and update_transformation().
void transform_set_distance | ( | struct transformation * | this_, |
int | distance | ||
) |
References transform_set_screen_dist(), and transform_setup_matrix().
Referenced by keypress(), and pedestrian_navit_init().
void transform_set_hog | ( | struct transformation * | this_, |
int | hog | ||
) |
References dbg, and lvl_error.
Referenced by keypress(), pedestrian_cmd_pedestrian_rocket(), pedestrian_navit_init(), and pedestrian_rocket_idle().
void transform_set_order_base | ( | struct transformation * | this_, |
int | order_base | ||
) |
References transformation::order_base.
Referenced by pedestrian_cmd_pedestrian_rocket(), and pedestrian_rocket_idle().
void transform_set_pitch | ( | struct transformation * | this_, |
int | pitch | ||
) |
References transformation::pitch, and transform_setup_matrix().
Referenced by keypress(), navit_set_attr_do(), pedestrian_log(), pedestrian_navit_init(), pedestrian_read_tilt(), and pedestrian_setup_tilt().
void transform_set_projection | ( | struct transformation * | this_, |
enum projection | pro | ||
) |
References transformation::pro.
Referenced by navit_projection_set(), and osd_auxmap_draw().
void transform_set_roll | ( | struct transformation * | this_, |
int | roll | ||
) |
References dbg, lvl_error, and transform_setup_matrix().
Referenced by pedestrian_navit_init(), and pedestrian_read_tilt().
void transform_set_scale | ( | struct transformation * | t, |
long | scale | ||
) |
void transform_set_scales | ( | struct transformation * | this_, |
int | xscale, | ||
int | yscale, | ||
int | wscale | ||
) |
References transformation::wscale, transformation::wscale3d, transformation::xscale, transformation::xscale3d, transformation::yscale, and transformation::yscale3d.
Referenced by pedestrian_navit_init().
void transform_set_screen_center | ( | struct transformation * | t, |
struct point * | p | ||
) |
References p, and transformation::screen_center.
Referenced by vehicle_set_cursor().
|
static |
References POST_SHIFT, transformation::screen_dist, transformation::wscale3d, transformation::xscale3d, and transformation::yscale3d.
Referenced by transform_new(), and transform_set_distance().
void transform_set_screen_selection | ( | struct transformation * | t, |
struct map_selection * | sel | ||
) |
void transform_set_yaw | ( | struct transformation * | t, |
int | yaw | ||
) |
References transform_setup_matrix(), and transformation::yaw.
Referenced by keypress(), navit_set_attr_do(), navit_set_center_cursor(), navit_zoom_to_route(), osd_auxmap_draw(), pedestrian_log(), transform_new(), and vehicle_draw_do().
|
static |
References dbg, transformation::ddd, transformation::im00, transformation::im01, transformation::im02, transformation::im10, transformation::im11, transformation::im12, transformation::im20, transformation::im21, transformation::im22, lvl_debug, transformation::m00, transformation::m01, transformation::m02, transformation::m10, transformation::m11, transformation::m12, transformation::m20, transformation::m21, transformation::m22, M_PI, transformation::map_center, navit_cos, navit_sin, transformation::offx, transformation::offy, transformation::offz, transformation::order, transformation::order_base, transformation::pitch, POST_SHIFT, transformation::scale, transformation::scale_shift, transformation::screen_center, transformation::screen_dist, transformation::wscale, transformation::wscale3d, point::x, coord::x, transformation::xscale, transformation::xscale3d, point::y, coord::y, transformation::yaw, transformation::yscale, transformation::yscale3d, transformation::zfar, and transformation::znear.
Referenced by transform_set_distance(), transform_set_pitch(), transform_set_roll(), transform_set_scale(), transform_set_screen_selection(), and transform_set_yaw().
void transform_setup_source_rect | ( | struct transformation * | t | ) |
References c, map_selection::c_rect, coord_rect_extend(), dbg, transformation::ddd, HOG, point_rect::lu, coord_rect::lu, lvl_debug, transformation::map_center, transformation::map_sel, max4(), min4(), map_selection::next, next, map_selection::p_rect, point_rect::rl, coord_rect::rl, transformation::scale_shift, transformation::screen_sel, transform_apply_inverse_matrix(), transform_reverse(), transform_screen_to_3d(), transform_zplane_intersection(), map_selection::u, point::x, coord::x, coord_geo_cart::x, point::y, coord::y, coord_geo_cart::y, transformation::zfar, and transformation::znear.
Referenced by navit_draw_async(), navit_zoom_to_rect(), osd_auxmap_draw(), and pedestrian_cmd_pedestrian_rocket().
|
static |
void transform_to_geo | ( | enum projection | pro, |
struct coord * | c, | ||
struct coord_geo * | g | ||
) |
References gar2geo_units, coord_geo::lat, coord_geo::lng, M_PI, navit_atan, projection_garmin, projection_mg, projection_utm, transform_utm_to_geo(), coord::x, and coord::y.
Referenced by android_return_search_result(), attr_new_from_text(), coord_parse(), csv_coord_set(), gui_internal_cmd_position_do(), gui_internal_coordinates(), gui_internal_set_click_coord(), itembin_warning(), map_rect_new_csv(), navit_get_attr(), navit_projection_set(), NGQPoint::NGQPoint(), popup(), popup_set_bookmark(), popup_set_destination(), request_navit_route_export_geojson(), request_navit_route_export_gpx(), request_navit_traffic_export_gpx(), route_find_nearest_street(), NGQPoint::setNewPoint(), Backend::showMenu(), tracking_doupdate_lines(), tracking_get_attr(), traffic_message_add_segments(), transform_correct_projection(), transform_from_to(), transform_from_to_count(), transform_get_selection(), transform_scale(), and vehicle_demo_timer().
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.
Equations from USGS Bulletin 1532.
References D, e1, coord_geo::lat, coord_geo::lng, M, and M_PI.
Referenced by transform_to_geo().
int transform_within_border | ( | struct transformation * | this_, |
struct point * | p, | ||
int | border | ||
) |
References point_rect::lu, map_selection::next, map_selection::p_rect, point_rect::rl, transformation::screen_sel, map_selection::u, point::x, and point::y.
Referenced by navit_handle_button(), and navit_vehicle_update_position().
int transform_within_dist_item | ( | struct coord * | ref, |
enum item_type | type, | ||
struct coord * | c, | ||
int | count, | ||
int | dist | ||
) |
References transform_within_dist_point(), transform_within_dist_polygon(), and transform_within_dist_polyline().
Referenced by NGQPoint::_coordName().
int transform_within_dist_line | ( | struct coord * | ref, |
struct coord * | c0, | ||
struct coord * | c1, | ||
int | dist | ||
) |
References transform_within_dist_point(), coord::x, and coord::y.
Referenced by transform_within_dist_polyline().
References coord::x, and coord::y.
Referenced by transform_within_dist_item(), and transform_within_dist_line().
References transform_within_dist_polyline(), coord::x, and coord::y.
Referenced by transform_within_dist_item().
int transform_within_dist_polyline | ( | struct coord * | ref, |
struct coord * | c, | ||
int | count, | ||
int | close, | ||
int | dist | ||
) |
References transform_within_dist_line().
Referenced by transform_within_dist_item(), and transform_within_dist_polygon().
|
static |
References c, dbg, lvl_debug, pcoord::x, coord_3d::x, pcoord::y, coord_3d::y, and coord_3d::z.
Referenced by transform_z_clip_if_necessary().
|
static |
References z_clip_result::clipped_coord, z_clip_result::process_coord_again, z_clip_result::skip_coord, transform_z_clip(), and z_clip_result::visible.
Referenced by transform().
|
static |
References coord_geo_cart::x, coord_geo_cart::y, and coord_geo_cart::z.
Referenced by transform_reverse_near_far(), and transform_setup_source_rect().
int transformation_get_order_base | ( | struct transformation * | this_ | ) |
References transformation::order_base.
|
static |
Referenced by transform_to_geo().
|
static |
Referenced by transform_from_geo().