GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-602118adcc
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  */
22 
24 {
25  Rast3d_region_copy(&(map->window), window);
27 }
28 
29 /*---------------------------------------------------------------------------*/
30 
31 /*!
32  * \brief
33  *
34  * Sets the default window used for every map opened later in the program.
35  * Can be used multiple times in the same program.
36  *
37  * \param window
38  * \return void
39  */
40 
42 {
45 }
46 
47 /*---------------------------------------------------------------------------*/
48 
49 /*!
50  * \brief
51  *
52  * Stores the current default window in <em>window</em>.
53  *
54  * \param window
55  * \return void
56  */
57 
59 {
61 }
62 
63 /*---------------------------------------------------------------------------*/
64 
66 {
67  return &g3d_window;
68 }
69 
70 /*---------------------------------------------------------------------------*/
71 
72 /*!
73  * \brief
74  *
75  * Returns 1 if window-coordinates <em>(north, east and top)</em> are
76  * inside the window of <em>map</em>. Returns 0 otherwise.
77  *
78  * \param map
79  * \param north
80  * \param east
81  * \param top
82  * \return int
83  */
84 
85 int Rast3d_isValidLocationWindow(RASTER3D_Map *map, double north, double east,
86  double top)
87 {
88  return ((north >= map->window.south) && (north <= map->window.north) &&
89  (east >= map->window.west) && (east <= map->window.east) &&
90  (((top >= map->window.bottom) && (top <= map->window.top)) ||
91  ((top <= map->window.bottom) && (top >= map->window.top))));
92 }
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:149
void Rast3d_region_copy(RASTER3D_Region *, RASTER3D_Region *)
Copies the values of regionSrc into regionDst.
Definition: region.c:203
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