|
GRASS 8 Programmer's Manual
8.5.0dev(2025)-9d806b45d8
|
GIS Library - 3D View functions. More...
#include <stdio.h>#include <string.h>#include <stdlib.h>#include <grass/gis.h>#include <grass/glocale.h>
Go to the source code of this file.
Macros | |
| #define | REQ_KEYS 8 |
Functions | |
| void | G_3dview_warning (int b) |
| Turns 3D View warnings on and off. More... | |
| int | G_get_3dview_defaults (struct G_3dview *v, struct Cell_head *w) |
| Sets default for v based on w. More... | |
| int | G_put_3dview (const char *fname, const struct G_3dview *View, const struct Cell_head *Win) |
| Saves info to a 3d.view file in the current mapset. More... | |
| int | G_get_3dview (const char *fname, const char *mapset, struct G_3dview *View) |
| Gets a 3D View. More... | |
GIS Library - 3D View functions.
(C) 2001-2014 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.
Definition in file view.c.
| void G_3dview_warning | ( | int | b | ) |
| int G_get_3dview | ( | const char * | fname, |
| const char * | mapset, | ||
| struct G_3dview * | View | ||
| ) |
Gets a 3D View.
If reading an old format, the window boundaries are not checked against the current window since boundaries weren't saved.
| [in] | fname | |
| [in] | mapset | |
| [in,out] | View |
Definition at line 239 of file view.c.
Referenced by Gs_load_3dview().
Sets default for v based on w.
| [in,out] | v | |
| [in] | w |
Definition at line 56 of file view.c.
References G_3dview::ambient, G_3dview::bg_col, G_3dview::colorgrid, Cell_head::cols, Cell_head::compressed, G_3dview::display_type, G_3dview::doavg, G_3dview::dozero, Cell_head::east, Cell_head::ew_res, G_3dview::exag, Cell_head::format, G_3dview::fov, G_3dview::fringe, G_3dview::from_to, G_3dview::grid_col, G_3dview::lightcol, G_3dview::lightpos, G_3dview::lightson, G_3dview::mesh_freq, Cell_head::north, Cell_head::ns_res, G_3dview::other_col, G_3dview::poly_freq, Cell_head::proj, Cell_head::rows, G_3dview::shading, G_3dview::shine, Cell_head::south, strcpy, G_3dview::surfonly, G_3dview::twist, G_3dview::vwin, Cell_head::west, and Cell_head::zone.
Referenced by Gs_save_3dview().
Saves info to a 3d.view file in the current mapset.
The address of a window (struct Cell_head *) may be passed, or if NULL is passed, the Cell_head structure inside the G_3dview struct will be used. e.g., if you called G_get_3dview_defaults with the Cell_head you want saved, the G_3dview returned already contains the new Cell_head. But if you're using all the keywords, so didn't need defaults, pass this routine the address of a Cell_head.
User should call G_get_3dview_defaults before filling a G_3dview struct to be written if not using all of the optional keywords.
These keywords are constant in all 3d.view files:
PGM_ID
cell keywords:
north
south
east
west
rows
cols
required keywords:
TO_EASTING
TO_NORTHING
TO_HEIGHT
FROM_EASTING
FROM_NORTHING
FROM_HEIGHT
Z_EXAG
FIELD_VIEW
optional keywords: (defaults provided when reading)
TWIST
MESH_FREQ
POLY_RES
DOAVG
DISPLAY_TYPE
DOZERO
COLORGRID
SHADING
FRINGE
BG_COL
GRID_COL
OTHER_COL
LIGHTS_ON
LIGHTPOS
LIGHTCOL
LIGHTAMBIENT
SHINE
SURFACEONLY
| [in] | fname | file name |
| [in] | View | |
| [in] | Win |
Definition at line 160 of file view.c.
References _, G_fopen_new(), G_warning(), and NULL.
Referenced by Gs_save_3dview().