GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-602118adcc
cnversions.c File Reference
#include <math.h>
#include <grass/gis.h>
#include <grass/display.h>
Include dependency graph for cnversions.c:

Go to the source code of this file.

Functions

void D_update_conversions (void)
 
void D_fit_d_to_u (void)
 
void D_fit_u_to_d (void)
 
void D_show_conversions (void)
 
void D_do_conversions (const struct Cell_head *window, double t, double b, double l, double r)
 initialize conversions More...
 
int D_is_lat_lon (void)
 
double D_get_d_to_a_xconv (void)
 
double D_get_d_to_a_yconv (void)
 
double D_get_d_to_u_xconv (void)
 
double D_get_d_to_u_yconv (void)
 
double D_get_a_to_u_xconv (void)
 
double D_get_a_to_u_yconv (void)
 
double D_get_a_to_d_xconv (void)
 
double D_get_a_to_d_yconv (void)
 
double D_get_u_to_d_xconv (void)
 
double D_get_u_to_d_yconv (void)
 
double D_get_u_to_a_xconv (void)
 
double D_get_u_to_a_yconv (void)
 
double D_get_ns_resolution (void)
 
double D_get_ew_resolution (void)
 
double D_get_u_west (void)
 
double D_get_u_east (void)
 
double D_get_u_north (void)
 
double D_get_u_south (void)
 
double D_get_a_west (void)
 
double D_get_a_east (void)
 
double D_get_a_north (void)
 
double D_get_a_south (void)
 
double D_get_d_west (void)
 
double D_get_d_east (void)
 
double D_get_d_north (void)
 
double D_get_d_south (void)
 
void D_set_region (const struct Cell_head *window)
 
void D_set_src (double t, double b, double l, double r)
 
void D_get_src (double *t, double *b, double *l, double *r)
 returns frame bounds in source coordinate system More...
 
void D_set_grid (int t, int b, int l, int r)
 
void D_get_grid (int *t, int *b, int *l, int *r)
 
void D_set_dst (double t, double b, double l, double r)
 
void D_get_dst (double *t, double *b, double *l, double *r)
 returns frame bounds in destination coordinate system More...
 
void D_get_u (double x[2][2])
 
void D_get_a (int x[2][2])
 
void D_get_d (double x[2][2])
 
double D_d_to_a_row (double D_row)
 screen to array (y) More...
 
double D_d_to_a_col (double D_col)
 screen to array (x) More...
 
double D_d_to_u_row (double D_row)
 screen to earth (y) More...
 
double D_d_to_u_col (double D_col)
 screen to earth (x) More...
 
double D_a_to_u_row (double A_row)
 array to earth (row) More...
 
double D_a_to_u_col (double A_col)
 array to earth (column) More...
 
double D_a_to_d_row (double A_row)
 array to screen (row) More...
 
double D_a_to_d_col (double A_col)
 array to screen (column) More...
 
double D_u_to_d_row (double U_row)
 earth to screen (north) More...
 
double D_u_to_d_col (double U_col)
 earth to screen (east) More...
 
double D_u_to_a_row (double U_row)
 earth to array (north) More...
 
double D_u_to_a_col (double U_col)
 earth to array (east More...
 

Function Documentation

◆ D_a_to_d_col()

double D_a_to_d_col ( double  A_col)

array to screen (column)

Returns an x value in the screen coordinate system when provided the corresponding column value in the array coordinate system.

Parameters
A_colcolumn
Returns
double

Definition at line 494 of file cnversions.c.

◆ D_a_to_d_row()

double D_a_to_d_row ( double  A_row)

array to screen (row)

Returns a y value in the screen coordinate system when provided the corresponding row value in the array coordinate system.

Parameters
A_rowrow
Returns
double

Definition at line 478 of file cnversions.c.

◆ D_a_to_u_col()

double D_a_to_u_col ( double  A_col)

array to earth (column)

Returns an x value in the earth coordinate system when provided the corresponding column value in the array coordinate system.

Parameters
A_colcolumn
Returns
double

Definition at line 463 of file cnversions.c.

◆ D_a_to_u_row()

double D_a_to_u_row ( double  A_row)

array to earth (row)

Returns a y value in the earth coordinate system when provided the corresponding row value in the array coordinate system.

Parameters
A_rowrow
Returns
double

Definition at line 447 of file cnversions.c.

◆ D_d_to_a_col()

double D_d_to_a_col ( double  D_col)

screen to array (x)

Returns a column value in the array coordinate system when provided the corresponding x value in the screen coordinate system.

Parameters
D_colx
Returns
double

Definition at line 402 of file cnversions.c.

◆ D_d_to_a_row()

double D_d_to_a_row ( double  D_row)

screen to array (y)

Returns a row value in the array coordinate system when provided the corresponding y value in the screen coordinate system.

Parameters
D_rowy
Returns
double

Definition at line 387 of file cnversions.c.

◆ D_d_to_u_col()

double D_d_to_u_col ( double  D_col)

screen to earth (x)

Returns an east value in the earth coordinate system when provided the corresponding x value in the screen coordinate system.

Parameters
D_colx
Returns
double

Definition at line 432 of file cnversions.c.

Referenced by D_get_text_box().

◆ D_d_to_u_row()

double D_d_to_u_row ( double  D_row)

screen to earth (y)

Returns a north value in the earth coordinate system when provided the corresponding y value in the screen coordinate system.

Parameters
D_rowy
Returns
double

Definition at line 417 of file cnversions.c.

Referenced by D_get_text_box().

◆ D_do_conversions()

void D_do_conversions ( const struct Cell_head window,
double  t,
double  b,
double  l,
double  r 
)

initialize conversions

The relationship between the earth region and the top, bottom, left, and right screen coordinates is established, which then allows conversions between all three coordinate systems to be performed. Note this routine is called by D_setup.

Parameters
windowregion
ttop
bbottom
lleft
rright
Returns
none

Definition at line 143 of file cnversions.c.

◆ D_fit_d_to_u()

void D_fit_d_to_u ( void  )

Definition at line 97 of file cnversions.c.

Referenced by D_setup2().

◆ D_fit_u_to_d()

void D_fit_u_to_d ( void  )

Definition at line 102 of file cnversions.c.

◆ D_get_a()

void D_get_a ( int  x[2][2])

Definition at line 361 of file cnversions.c.

References x.

Referenced by D_raster_draw_begin().

◆ D_get_a_east()

double D_get_a_east ( void  )

Definition at line 239 of file cnversions.c.

◆ D_get_a_north()

double D_get_a_north ( void  )

Definition at line 243 of file cnversions.c.

◆ D_get_a_south()

double D_get_a_south ( void  )

Definition at line 247 of file cnversions.c.

◆ D_get_a_to_d_xconv()

double D_get_a_to_d_xconv ( void  )

Definition at line 184 of file cnversions.c.

◆ D_get_a_to_d_yconv()

double D_get_a_to_d_yconv ( void  )

Definition at line 188 of file cnversions.c.

◆ D_get_a_to_u_xconv()

double D_get_a_to_u_xconv ( void  )

Definition at line 176 of file cnversions.c.

Referenced by D_get_ew_resolution().

◆ D_get_a_to_u_yconv()

double D_get_a_to_u_yconv ( void  )

Definition at line 180 of file cnversions.c.

Referenced by D_get_ns_resolution().

◆ D_get_a_west()

double D_get_a_west ( void  )

Definition at line 235 of file cnversions.c.

◆ D_get_d()

void D_get_d ( double  x[2][2])

Definition at line 369 of file cnversions.c.

References x.

Referenced by D_raster_draw_begin().

◆ D_get_d_east()

double D_get_d_east ( void  )

Definition at line 256 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_d_north()

double D_get_d_north ( void  )

Definition at line 260 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_d_south()

double D_get_d_south ( void  )

Definition at line 264 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_d_to_a_xconv()

double D_get_d_to_a_xconv ( void  )

Definition at line 160 of file cnversions.c.

◆ D_get_d_to_a_yconv()

double D_get_d_to_a_yconv ( void  )

Definition at line 164 of file cnversions.c.

◆ D_get_d_to_u_xconv()

double D_get_d_to_u_xconv ( void  )

Definition at line 168 of file cnversions.c.

◆ D_get_d_to_u_yconv()

double D_get_d_to_u_yconv ( void  )

Definition at line 172 of file cnversions.c.

◆ D_get_d_west()

double D_get_d_west ( void  )

Definition at line 252 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_dst()

void D_get_dst ( double *  t,
double *  b,
double *  l,
double *  r 
)

returns frame bounds in destination coordinate system

D_get_dst() returns the frame bounds in the destination coordinate system (used by R_* commands). The various D_setup() commands all set the destination coordinate system to the current frame reported by R_get_window().

Parameters
ttop
bbottom
lleft
rright
Returns
none

Definition at line 345 of file cnversions.c.

References t.

Referenced by D_erase().

◆ D_get_ew_resolution()

double D_get_ew_resolution ( void  )

Definition at line 213 of file cnversions.c.

References D_get_a_to_u_xconv().

◆ D_get_grid()

void D_get_grid ( int *  t,
int *  b,
int *  l,
int *  r 
)

Definition at line 314 of file cnversions.c.

References t.

◆ D_get_ns_resolution()

double D_get_ns_resolution ( void  )

Definition at line 209 of file cnversions.c.

References D_get_a_to_u_yconv().

◆ D_get_src()

void D_get_src ( double *  t,
double *  b,
double *  l,
double *  r 
)

returns frame bounds in source coordinate system

D_get_src() returns the frame bounds in the source coordinate system (used by D_* functions)

Parameters
ttop
bbottom
lleft
rright
Returns
void

Definition at line 297 of file cnversions.c.

References t.

Referenced by D_clip_to_map().

◆ D_get_u()

void D_get_u ( double  x[2][2])

Definition at line 353 of file cnversions.c.

References x.

◆ D_get_u_east()

double D_get_u_east ( void  )

Definition at line 222 of file cnversions.c.

◆ D_get_u_north()

double D_get_u_north ( void  )

Definition at line 226 of file cnversions.c.

◆ D_get_u_south()

double D_get_u_south ( void  )

Definition at line 230 of file cnversions.c.

◆ D_get_u_to_a_xconv()

double D_get_u_to_a_xconv ( void  )

Definition at line 200 of file cnversions.c.

◆ D_get_u_to_a_yconv()

double D_get_u_to_a_yconv ( void  )

Definition at line 204 of file cnversions.c.

◆ D_get_u_to_d_xconv()

double D_get_u_to_d_xconv ( void  )

Definition at line 192 of file cnversions.c.

◆ D_get_u_to_d_yconv()

double D_get_u_to_d_yconv ( void  )

Definition at line 196 of file cnversions.c.

◆ D_get_u_west()

double D_get_u_west ( void  )

Definition at line 218 of file cnversions.c.

◆ D_is_lat_lon()

int D_is_lat_lon ( void  )

Definition at line 155 of file cnversions.c.

◆ D_set_dst()

void D_set_dst ( double  t,
double  b,
double  l,
double  r 
)

Definition at line 322 of file cnversions.c.

Referenced by D_setup2(), and D_setup_unity().

◆ D_set_grid()

void D_set_grid ( int  t,
int  b,
int  l,
int  r 
)

Definition at line 305 of file cnversions.c.

◆ D_set_region()

void D_set_region ( const struct Cell_head window)

Definition at line 269 of file cnversions.c.

◆ D_set_src()

void D_set_src ( double  t,
double  b,
double  l,
double  r 
)

Definition at line 276 of file cnversions.c.

Referenced by D_setup2(), and D_setup_unity().

◆ D_show_conversions()

void D_show_conversions ( void  )

Definition at line 107 of file cnversions.c.

◆ D_u_to_a_col()

double D_u_to_a_col ( double  U_col)

earth to array (east

Returns a column value in the array coordinate system when provided the corresponding east value in the earth coordinate system.

Parameters
U_coleast
Returns
double

Definition at line 554 of file cnversions.c.

◆ D_u_to_a_row()

double D_u_to_a_row ( double  U_row)

earth to array (north)

Returns a row value in the array coordinate system when provided the corresponding north value in the earth coordinate system.

Parameters
U_rownorth
Returns
double

Definition at line 539 of file cnversions.c.

◆ D_u_to_d_col()

double D_u_to_d_col ( double  U_col)

earth to screen (east)

Returns an x value in the screen coordinate system when provided the corresponding east value in the earth coordinate system.

Parameters
U_coleast
Returns
double

Definition at line 524 of file cnversions.c.

◆ D_u_to_d_row()

double D_u_to_d_row ( double  U_row)

earth to screen (north)

Returns a y value in the screen coordinate system when provided the corresponding north value in the earth coordinate system.

Parameters
U_rownorth
Returns
double

Definition at line 509 of file cnversions.c.

◆ D_update_conversions()

void D_update_conversions ( void  )

Definition at line 90 of file cnversions.c.

Referenced by D_setup2(), and D_setup_unity().