GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
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 | |
int | 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 char *mapset, const struct G_3dview *View, const struct Cell_head *Win) |
Saves info to a 3d.view file. 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-2008 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.
#define REQ_KEYS 8 |
Definition at line 24 of file view.c.
Referenced by G_get_3dview().
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 252 of file view.c.
References fclose(), G_find_file2(), G_fopen_old(), G_format_easting(), G_format_northing(), G_get_3dview_defaults(), G_get_set_window(), G_projection(), G_warning(), NULL, and REQ_KEYS.
Referenced by Gs_load_3dview().
int G_get_3dview_defaults | ( | struct G_3dview * | v, |
struct Cell_head * | w | ||
) |
Sets default for v based on w.
[in,out] | v | |
[in] | w |
Definition at line 63 of file view.c.
Referenced by G_get_3dview(), and Gs_save_3dview().
int G_put_3dview | ( | const char * | fname, |
const char * | mapset, | ||
const struct G_3dview * | View, | ||
const struct Cell_head * | Win | ||
) |
Saves info to a 3d.view file.
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] | mapset | |
[in] | View | |
[in] | Win |
Definition at line 171 of file view.c.
References fclose(), G_fopen_new(), G_warning(), and NULL.
Referenced by Gs_save_3dview().