GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
display/setup.c File Reference

Display Driver - setup. More...

#include <string.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/display.h>
#include "driver.h"
Include dependency graph for display/setup.c:

Go to the source code of this file.

Functions

void D_setup (int clear)
 Graphics frame setup. More...
 
void D_setup_unity (int clear)
 Graphics frame setup. More...
 
void D_setup2 (int clear, int fit, double st, double sb, double sl, double sr)
 Sets source coordinate system. More...
 
const char * D_get_file (void)
 Get driver output file. More...
 

Detailed Description

Display Driver - setup.

(C) 2006-2011 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Glynn Clements <glynn gclements.plus.com> (original contributor)
Huidae Cho <grass4u gmail.com>

Definition in file display/setup.c.

Function Documentation

◆ D_get_file()

const char* D_get_file ( void  )

Get driver output file.

Returns
file name or NULL if not defined

Definition at line 141 of file display/setup.c.

References COM_Graph_get_file().

◆ D_setup()

void D_setup ( int  clear)

Graphics frame setup.

This is a high level D call. It does a full setup for the current graphics frame.

Note: Connection to driver must already be made.

Sets the source coordinate system to the current region, and adjusts the destination coordinate system to preserve the aspect ratio.

Performs a full setup for the current graphics frame:

  • Makes sure there is a current graphics frame (will create a full-screen one, if not);
  • Sets the region coordinates so that the graphics frame and the active module region agree (may change active module region to do this); and
  • Performs graphic frame/region coordinate conversion initialization.

If clear is true, the frame is cleared (same as running d.erase.) Otherwise, it is not cleared.

Parameters
clear1 to clear frame (visually and coordinates)

Definition at line 46 of file display/setup.c.

References D_do_conversions(), D_erase(), D_get_frame(), D_set_clip_window_to_map_window(), D_set_clip_window_to_screen_window(), DEFAULT_BG_COLOR, G_get_set_window(), and Rast_set_window().

◆ D_setup2()

void D_setup2 ( int  clear,
int  fit,
double  st,
double  sb,
double  sl,
double  sr 
)

Sets source coordinate system.

Sets the source coordinate system to its arguments, and if the fit argument is non-zero, adjusts the destination coordinate system to preserve the aspect ratio.

If clear is true, the frame is cleared (same as running d.erase). Otherwise, it is not cleared.

Parameters
clearnon-zero code to clear the frame
fitnon-zero code to adjust destination coordinate system
s_top
s_bottom
s_left
s_right

Definition at line 114 of file display/setup.c.

References D_erase(), D_fit_d_to_u(), D_get_frame(), D_set_clip_window_to_map_window(), D_set_clip_window_to_screen_window(), D_set_dst(), D_set_src(), D_update_conversions(), and DEFAULT_BG_COLOR.

◆ D_setup_unity()

void D_setup_unity ( int  clear)

Graphics frame setup.

Sets the source coordinate system to match the destination coordinate system, so that D_* functions use the same coordinate system as R_* functions.

If clear is true, the frame is cleared (same as running d.erase). Otherwise, it is not cleared.

Parameters
clearnon-zero code to clear the frame

Definition at line 78 of file display/setup.c.

References D_erase(), D_get_frame(), D_set_clip_window_to_map_window(), D_set_clip_window_to_screen_window(), D_set_dst(), D_set_src(), D_update_conversions(), and DEFAULT_BG_COLOR.