GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
view.c File Reference

GIS Library - 3D View functions. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for view.c:

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 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...
 

Detailed Description

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.

Author
Bill Brown - US Army CERL
Date
1992-2008

Definition in file view.c.

Macro Definition Documentation

#define REQ_KEYS   8

Definition at line 24 of file view.c.

Referenced by G_get_3dview().

Function Documentation

void G_3dview_warning ( int  b)

Turns 3D View warnings on and off.

If Suppress_warn is 0, a warning will be printed if less than 95% of the window when the view was saved overlaps the current window.

Parameters
[in]b
Returns

Definition at line 48 of file view.c.

int G_get_3dview ( const char *  fname,
const char *  mapset,
struct G_3dview View 
)
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

Parameters
[in]fnamefile name
[in]mapset
[in]View
[in]Win
Returns
1 on success
-1 on error

Definition at line 170 of file view.c.

References _, G_3dview::ambient, G_3dview::bg_col, G_3dview::colorgrid, Cell_head::cols, G_3dview::display_type, G_3dview::doavg, G_3dview::dozero, Cell_head::east, G_3dview::exag, fclose(), G_3dview::fov, G_3dview::fringe, G_3dview::from_to, G_fopen_new(), G_warning(), G_3dview::grid_col, G_3dview::lightcol, G_3dview::lightpos, G_3dview::lightson, G_3dview::mesh_freq, Cell_head::north, NULL, G_3dview::other_col, G_3dview::pgm_id, G_3dview::poly_freq, Cell_head::rows, G_3dview::shading, G_3dview::shine, Cell_head::south, G_3dview::surfonly, G_3dview::twist, G_3dview::vwin, and Cell_head::west.

Referenced by Gs_save_3dview().