GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
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.

Functions

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 UNUSED, float *x, float *y, float *z)
 Get focus. More...
 
int Nviz_set_focus (nv_data *data UNUSED, float x, float y, float z)
 Set focus. More...
 
int Nviz_has_focus (nv_data *data UNUSED)
 Test focus. More...
 
float Nviz_get_xyrange (nv_data *data)
 Get xy range. More...
 
int Nviz_get_zrange (nv_data *data UNUSED, float *min, float *max)
 Get z range. More...
 
float Nviz_get_longdim (nv_data *data UNUSED)
 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.

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

Definition in file position.c.

Function Documentation

◆ Nviz_get_focus()

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

Get focus.

Parameters
datanviz data [unused]
x,y,zfocus coordinates

Definition at line 120 of file position.c.

◆ Nviz_get_longdim()

float Nviz_get_longdim ( nv_data *data  UNUSED)

Get largest dimension.

Parameters
datanviz data [unused]

Definition at line 197 of file position.c.

◆ Nviz_get_xyrange()

float Nviz_get_xyrange ( nv_data data)

Get xy range.

Parameters
datanviz data

Definition at line 175 of file position.c.

◆ Nviz_get_zrange()

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

Get z range.

Parameters
datanviz data [unused]
min,maxz range

Definition at line 186 of file position.c.

◆ Nviz_has_focus()

int Nviz_has_focus ( nv_data *data  UNUSED)

Test focus.

Parameters
datanviz data [unused]

Definition at line 160 of file position.c.

◆ 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 24 of file position.c.

◆ Nviz_set_focus()

int Nviz_set_focus ( nv_data *data  UNUSED,
float  x,
float  y,
float  z 
)

Set focus.

Parameters
datanviz data [unused]
x,y,zfocus coordinates

Definition at line 141 of file position.c.

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

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

Definition at line 76 of file position.c.

◆ Nviz_set_focus_state()

int Nviz_set_focus_state ( int  state_flag)

Set focus state.

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

Definition at line 50 of file position.c.

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