grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

position.c File Reference

Nviz library – Position, focus settings. More...

#include <grass/glocale.h>
#include <grass/nviz.h>
Include dependency graph for position.c:

Go to the source code of this file.


void Nviz_init_view (nv_data *data)
int Nviz_set_focus_state (int state_flag)
 Set focus state. More...
int Nviz_set_focus_map (int type, int id)
 Set focus based on loaded map. More...
int Nviz_get_focus (nv_data *data, float *x, float *y, float *z)
 Get focus. More...
int Nviz_set_focus (nv_data *data, float x, float y, float z)
 Set focus. More...
int Nviz_has_focus (nv_data *data)
 Test focus. More...
float Nviz_get_xyrange (nv_data *data)
 Get xy range. More...
int Nviz_get_zrange (nv_data *data, float *min, float *max)
 Get z range. More...
float Nviz_get_longdim (nv_data *data)
 Get largest dimension. More...

Detailed Description

Nviz library – Position, focus settings.

Based on visualization/nviz/src/position.c

(C) 2008, 2010 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.

Updated/modified by Martin Landa <landa.martin> (Google SoC 2008/2010)

Definition in file position.c.

Function Documentation

◆ Nviz_get_focus()

int Nviz_get_focus ( nv_data data,
float *  x,
float *  y,
float *  z 

Get focus.

datanviz data
x,y,zfocus coordinates

Definition at line 119 of file position.c.

References GS_get_focus(), and x.

◆ Nviz_get_longdim()

float Nviz_get_longdim ( nv_data data)

Get largest dimension.

datanviz data

Definition at line 198 of file position.c.

References GS_get_longdim().

◆ Nviz_get_xyrange()

float Nviz_get_xyrange ( nv_data data)

Get xy range.

datanviz data

Definition at line 176 of file position.c.

References data.

◆ Nviz_get_zrange()

int Nviz_get_zrange ( nv_data data,
float *  min,
float *  max 

Get z range.

datanviz data
min,maxz range

Definition at line 187 of file position.c.

References GS_get_zrange_nz(), max, and min.

◆ Nviz_has_focus()

int Nviz_has_focus ( nv_data data)

Test focus.

datanviz data

Definition at line 161 of file position.c.

References GS_get_focus().

◆ Nviz_init_view()

void Nviz_init_view ( nv_data data)

Initialize view, position, lighting settings (focus)

Set position to center of view

Definition at line 23 of file position.c.

References data, GS_init_view(), Nviz_set_focus_state(), Nviz_set_light_ambient(), Nviz_set_light_bright(), Nviz_set_light_color(), and Nviz_set_light_position().

◆ Nviz_set_focus()

int Nviz_set_focus ( nv_data data,
float  x,
float  y,
float  z 

Set focus.

datanviz data
x,y,zfocus coordinates

Definition at line 141 of file position.c.

References GS_set_focus(), and x.

◆ Nviz_set_focus_map()

int Nviz_set_focus_map ( int  type,
int  id 

Set focus based on loaded map.

If map is MAP_OBJ_UNDEFINED, set focus from first surface/volume in the list.

typemap object type
idmap object id
0 on no focus
id id of map object used for setting focus

Definition at line 75 of file position.c.

References G_free(), GS_get_surf_list(), GS_num_surfs(), GS_set_focus_center_map(), GS_set_nofocus(), GVL_get_vol_list(), GVL_num_vols(), GVL_set_focus_center_map(), MAP_OBJ_SURF, MAP_OBJ_UNDEFINED, MAP_OBJ_VOL, and type.

◆ Nviz_set_focus_state()

int Nviz_set_focus_state ( int  state_flag)

Set focus state.

state_flag1 for center view, 0 use viewdir
1 on success
0 on failure

Definition at line 49 of file position.c.

References _, G_warning(), GS_set_infocus(), and GS_set_nofocus().

Referenced by Nviz_init_view().