GRASS GIS 8 Programmer's Manual  8.5.0dev(2025)-97d1178de3
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
raster3d/window.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <grass/gis.h>
3 #include <grass/raster3d.h>
4 #include "raster3d_intern.h"
5 
6 /*---------------------------------------------------------------------------*/
7 
9 
10 /*---------------------------------------------------------------------------*/
11 
12 /*!
13  * \brief
14  *
15  * Sets the window for <em>map</em> to <em>window</em>.
16  * Can be used multiple times for the same map.
17  *
18  * \param map
19  * \param window
20  * \return void
21  */
23 {
24  Rast3d_region_copy(&(map->window), window);
26 }
27 
28 /*---------------------------------------------------------------------------*/
29 
30 /*!
31  * \brief
32  *
33  * Sets the default window used for every map opened later in the program.
34  * Can be used multiple times in the same program.
35  *
36  * \param window
37  * \return void
38  */
40 {
43 }
44 
45 /*---------------------------------------------------------------------------*/
46 
47 /*!
48  * \brief
49  *
50  * Stores the current default window in <em>window</em>.
51  *
52  * \param window
53  * \return void
54  */
56 {
58 }
59 
60 /*---------------------------------------------------------------------------*/
61 
63 {
64  return &g3d_window;
65 }
66 
67 /*---------------------------------------------------------------------------*/
68 
69 /*!
70  * \brief
71  *
72  * Returns 1 if window-coordinates <em>(north, east and top)</em> are
73  * inside the window of <em>map</em>. Returns 0 otherwise.
74  *
75  * \param map
76  * \param north
77  * \param east
78  * \param top
79  * \return int
80  */
81 int Rast3d_isValidLocationWindow(RASTER3D_Map *map, double north, double east,
82  double top)
83 {
84  return ((north >= map->window.south) && (north <= map->window.north) &&
85  (east >= map->window.west) && (east <= map->window.east) &&
86  (((top >= map->window.bottom) && (top <= map->window.top)) ||
87  ((top <= map->window.bottom) && (top >= map->window.top))));
88 }
void Rast3d_adjust_region(RASTER3D_Region *)
Computes an adjusts the resolutions in the region structure from the region boundaries and number of ...
Definition: region.c:144
void Rast3d_region_copy(RASTER3D_Region *, RASTER3D_Region *)
Copies the values of regionSrc into regionDst.
Definition: region.c:196
int Rast3d_isValidLocationWindow(RASTER3D_Map *map, double north, double east, double top)
Returns 1 if window-coordinates (north, east and top) are inside the window of map....
void Rast3d_get_window(RASTER3D_Region *window)
Stores the current default window in window.
void Rast3d_set_window(RASTER3D_Region *window)
Sets the default window used for every map opened later in the program. Can be used multiple times in...
RASTER3D_Region * Rast3d_window_ptr(void)
RASTER3D_Region g3d_window
void Rast3d_set_window_map(RASTER3D_Map *map, RASTER3D_Region *window)
Sets the window for map to window. Can be used multiple times for the same map.
RASTER3D_Region window
Definition: raster3d.h:85
double south
Definition: raster3d.h:49
double bottom
Definition: raster3d.h:51
double top
Definition: raster3d.h:51
double west
Definition: raster3d.h:50