GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72095
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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 430 of file cnversions.c.

References D.

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 413 of file cnversions.c.

References D.

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 397 of file cnversions.c.

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 380 of file cnversions.c.

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 332 of file cnversions.c.

References D.

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 316 of file cnversions.c.

References D.

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 364 of file cnversions.c.

References D.

Referenced by D_get_text_box().

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 348 of file cnversions.c.

References D.

Referenced by D_get_text_box().

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 152 of file cnversions.c.

References D_fit_d_to_u(), D_set_dst(), D_set_region(), D_show_conversions(), and D_update_conversions().

Referenced by D_setup().

void D_fit_d_to_u ( void  )

Definition at line 100 of file cnversions.c.

References D.

Referenced by D_do_conversions(), and D_setup2().

void D_fit_u_to_d ( void  )

Definition at line 105 of file cnversions.c.

References D.

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

Definition at line 290 of file cnversions.c.

References int.

Referenced by D_raster_draw_begin().

double D_get_a_east ( void  )

Definition at line 189 of file cnversions.c.

double D_get_a_north ( void  )

Definition at line 190 of file cnversions.c.

double D_get_a_south ( void  )

Definition at line 191 of file cnversions.c.

double D_get_a_to_d_xconv ( void  )

Definition at line 173 of file cnversions.c.

double D_get_a_to_d_yconv ( void  )

Definition at line 174 of file cnversions.c.

double D_get_a_to_u_xconv ( void  )

Definition at line 171 of file cnversions.c.

Referenced by D_get_ew_resolution().

double D_get_a_to_u_yconv ( void  )

Definition at line 172 of file cnversions.c.

Referenced by D_get_ns_resolution().

double D_get_a_west ( void  )

Definition at line 188 of file cnversions.c.

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

Definition at line 298 of file cnversions.c.

References D.

Referenced by D_raster_draw_begin().

double D_get_d_east ( void  )

Definition at line 194 of file cnversions.c.

References D.

Referenced by D_set_clip_window_to_map_window().

double D_get_d_north ( void  )

Definition at line 195 of file cnversions.c.

References D.

Referenced by D_set_clip_window_to_map_window().

double D_get_d_south ( void  )

Definition at line 196 of file cnversions.c.

References D.

Referenced by D_set_clip_window_to_map_window().

double D_get_d_to_a_xconv ( void  )

Definition at line 167 of file cnversions.c.

double D_get_d_to_a_yconv ( void  )

Definition at line 168 of file cnversions.c.

double D_get_d_to_u_xconv ( void  )

Definition at line 169 of file cnversions.c.

double D_get_d_to_u_yconv ( void  )

Definition at line 170 of file cnversions.c.

double D_get_d_west ( void  )

Definition at line 193 of file cnversions.c.

References D.

Referenced by D_set_clip_window_to_map_window().

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 274 of file cnversions.c.

References D.

Referenced by D_erase().

double D_get_ew_resolution ( void  )

Definition at line 181 of file cnversions.c.

References D_get_a_to_u_xconv().

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

Definition at line 243 of file cnversions.c.

double D_get_ns_resolution ( void  )

Definition at line 180 of file cnversions.c.

References D_get_a_to_u_yconv().

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 226 of file cnversions.c.

Referenced by D_clip_to_map().

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

Definition at line 282 of file cnversions.c.

double D_get_u_east ( void  )

Definition at line 184 of file cnversions.c.

double D_get_u_north ( void  )

Definition at line 185 of file cnversions.c.

double D_get_u_south ( void  )

Definition at line 186 of file cnversions.c.

double D_get_u_to_a_xconv ( void  )

Definition at line 177 of file cnversions.c.

double D_get_u_to_a_yconv ( void  )

Definition at line 178 of file cnversions.c.

double D_get_u_to_d_xconv ( void  )

Definition at line 175 of file cnversions.c.

double D_get_u_to_d_yconv ( void  )

Definition at line 176 of file cnversions.c.

double D_get_u_west ( void  )

Definition at line 183 of file cnversions.c.

int D_is_lat_lon ( void  )

Definition at line 165 of file cnversions.c.

Referenced by D_dots().

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

Definition at line 251 of file cnversions.c.

References b, D, l, r, and t.

Referenced by D_do_conversions(), D_setup2(), and D_setup_unity().

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

Definition at line 234 of file cnversions.c.

References b, l, r, and t.

Referenced by D_set_region().

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

Definition at line 205 of file cnversions.c.

References b, l, r, and t.

Referenced by D_set_region(), D_setup2(), and D_setup_unity().

void D_show_conversions ( void  )

Definition at line 110 of file cnversions.c.

References D.

Referenced by D_do_conversions().

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 494 of file cnversions.c.

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 478 of file cnversions.c.

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 462 of file cnversions.c.

References D.

Referenced by D_dots(), and D_pos_abs().

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 446 of file cnversions.c.

References D.

Referenced by D_dots(), and D_pos_abs().

void D_update_conversions ( void  )

Definition at line 93 of file cnversions.c.

References D.

Referenced by D_do_conversions(), D_setup2(), and D_setup_unity().