GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
defs/nviz.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int Nviz_resize_window (int, int)
 GL canvas resized. More...
 
int Nviz_update_ranges (nv_data *)
 Update ranges. More...
 
int Nviz_set_viewpoint_position (double, double)
 Change position of view. More...
 
void Nviz_get_viewpoint_position (double *, double *)
 
int Nviz_set_viewpoint_height (double)
 Change viewpoint height. More...
 
void Nviz_get_viewpoint_height (double *)
 
int Nviz_set_viewpoint_persp (int)
 Change viewpoint perspective (field of view) More...
 
int Nviz_set_viewpoint_twist (int)
 Change viewpoint twist. More...
 
int Nviz_change_exag (nv_data *, double)
 Change z-exag value. More...
 
int Nviz_look_here (double, double)
 Change focused point. More...
 
void Nviz_get_modelview (double *)
 Get current modelview matrix. More...
 
void Nviz_set_rotation (double, double, double, double)
 Set rotation parameters. More...
 
void Nviz_unset_rotation (void)
 Stop scene rotation. More...
 
void Nviz_init_rotation (void)
 Stop scene rotation. More...
 
void Nviz_flythrough (nv_data *, float *, int *, int)
 Fly through the scene. More...
 
int Nviz_new_cplane (nv_data *, int)
 Creates a clip plane object. More...
 
int Nviz_on_cplane (nv_data *, int)
 Turn on (make current) the given clip plane. More...
 
int Nviz_off_cplane (nv_data *, int)
 Turn off (make inactive) the given clip plane. More...
 
int Nviz_draw_cplane (nv_data *, int, int)
 Draw the clip plane. More...
 
int Nviz_num_cplanes (nv_data *)
 Return the number of clip planes objects currently allocated. More...
 
int Nviz_get_current_cplane (nv_data *)
 Get the current active cutplane. More...
 
int Nviz_set_cplane_rotation (nv_data *, int, float, float, float)
 Set the rotation for the current clip plane. More...
 
int Nviz_get_cplane_rotation (nv_data *, int, float *, float *, float *)
 Get the rotation values for the current clip plane. More...
 
int Nviz_set_cplane_translation (nv_data *, int, float, float, float)
 Set the translation for the current clip plane. More...
 
int Nviz_get_cplane_translation (nv_data *, int, float *, float *, float *)
 Get the translation values for the current clip plane. More...
 
int Nviz_set_fence_color (nv_data *, int)
 Set appropriate fence color. More...
 
int Nviz_set_cplane_here (nv_data *, int, float, float)
 
int Nviz_draw_all_surf (nv_data *)
 Draw all loaded surfaces. More...
 
int Nviz_draw_all_vect (void)
 Draw all loaded vector sets (lines) More...
 
int Nviz_draw_all_site (void)
 Draw all loaded vector point sets. More...
 
int Nviz_draw_all_vol (void)
 Draw all loaded volume sets. More...
 
int Nviz_draw_all (nv_data *)
 Draw all map objects (in full resolution) and decorations. More...
 
int Nviz_draw_quick (nv_data *, int)
 Draw all surfaces in wireframe (quick mode) More...
 
int Nviz_load_image (GLubyte *, int, int, int)
 Load image into texture. More...
 
void Nviz_draw_image (int, int, int, int, int)
 Draw image as texture. More...
 
void Nviz_set_2D (int, int)
 Set ortho view for drawing images. More...
 
void Nviz_del_texture (int)
 Delete texture. More...
 
void Nviz_get_max_texture (int *)
 Get maximum texture size. More...
 
int Nviz_get_exag_height (double *, double *, double *)
 Get view height. More...
 
double Nviz_get_exag ()
 Get view z-exag value. More...
 
int Nviz_set_light_position (nv_data *, int, double, double, double, double)
 Set light position. More...
 
int Nviz_set_light_bright (nv_data *, int, double)
 Set light brightness. More...
 
int Nviz_set_light_color (nv_data *, int, int, int, int)
 Set light color. More...
 
int Nviz_set_light_ambient (nv_data *, int, double)
 Set light ambient. More...
 
int Nviz_init_light (nv_data *, int)
 Init new light. More...
 
int Nviz_new_light (nv_data *)
 Define new light. More...
 
void Nviz_draw_model (nv_data *)
 Draw lighting model. More...
 
int Nviz_new_map_obj (int, const char *, double, nv_data *)
 Create a new map object which can be one of surf, vect, vol or site. More...
 
int Nviz_set_attr (int, int, int, int, const char *, double, nv_data *)
 
void Nviz_set_surface_attr_default ()
 Set default surface attributes. More...
 
int Nviz_set_vpoint_attr_default ()
 
int Nviz_set_volume_attr_default ()
 
int Nviz_unset_attr (int, int, int)
 
void Nviz_init_data (nv_data *)
 Initialize Nviz data. More...
 
void Nviz_destroy_data (nv_data *)
 Free allocated space by nv_data struct. More...
 
void Nviz_set_bgcolor (nv_data *, int)
 Set background color. More...
 
int Nviz_get_bgcolor (nv_data *)
 Get background color. More...
 
int Nviz_color_from_str (const char *)
 Get color value from color string (name or RGB triplet) More...
 
struct fringe_dataNviz_new_fringe (nv_data *, int, unsigned long, double, int, int, int, int)
 
struct fringe_dataNviz_set_fringe (nv_data *, int, unsigned long, double, int, int, int, int)
 
void Nviz_draw_fringe (nv_data *data)
 
int Nviz_draw_arrow (nv_data *)
 Draws the North Arrow. More...
 
int Nviz_set_arrow (nv_data *, int, int, float, unsigned int)
 Sets the North Arrow position and return world coords. More...
 
void Nviz_delete_arrow (nv_data *)
 Deletes the North Arrow. More...
 
struct scalebar_dataNviz_new_scalebar (nv_data *, int, float *, float, unsigned int)
 
struct scalebar_dataNviz_set_scalebar (nv_data *, int, int, int, float, unsigned int)
 Sets the scale bar position and return world coords. More...
 
void Nviz_draw_scalebar (nv_data *)
 Draws the Scale bar. More...
 
void Nviz_delete_scalebar (nv_data *, int)
 Deletes scale bar. More...
 
void Nviz_init_view (nv_data *)
 
int Nviz_set_focus_state (int)
 Set focus state. More...
 
int Nviz_set_focus_map (int, int)
 Set focus based on loaded map. More...
 
int Nviz_has_focus (nv_data *)
 Test focus. More...
 
int Nviz_set_focus (nv_data *, float, float, float)
 Set focus. More...
 
int Nviz_get_focus (nv_data *, float *, float *, float *)
 Get focus. More...
 
float Nviz_get_xyrange (nv_data *)
 Get xy range. More...
 
int Nviz_get_zrange (nv_data *, float *, float *)
 Get z range. More...
 
float Nviz_get_longdim (nv_data *)
 Get largest dimension. More...
 
struct render_windowNviz_new_render_window ()
 Allocate memory for render window. More...
 
void Nviz_init_render_window (struct render_window *)
 Initialize render window. More...
 
void Nviz_destroy_render_window (struct render_window *)
 Free render window. More...
 
int Nviz_create_render_window (struct render_window *, void *, int, int)
 Create render window. More...
 
int Nviz_make_current_render_window (const struct render_window *)
 Make window current for rendering. More...
 

Function Documentation

◆ Nviz_change_exag()

int Nviz_change_exag ( nv_data data,
double  exag 
)

Change z-exag value.

Parameters
datanviz data
exagexag value
Returns
1

Definition at line 236 of file change_view.c.

◆ Nviz_color_from_str()

int Nviz_color_from_str ( const char *  color_str)

Get color value from color string (name or RGB triplet)

Parameters
color_strcolor string
Returns
color value

Definition at line 123 of file nviz.c.

References _, BLU_MASK, G_str_to_color(), G_warning(), GRN_MASK, and RED_MASK.

◆ Nviz_create_render_window()

int Nviz_create_render_window ( struct render_window rwin,
void *  display,
int  width,
int  height 
)

Create render window.

Parameters
rwinpointer to render_window struct
displaydisplay instance (NULL for offscreen)
widthwindow width
heightwindow height
Returns
0 on success
-1 on error

Definition at line 144 of file nviz/render.c.

◆ Nviz_del_texture()

void Nviz_del_texture ( int  texture_id)

Delete texture.

Parameters
texture_idtexture id

Definition at line 408 of file nviz/draw.c.

References t.

◆ Nviz_delete_arrow()

void Nviz_delete_arrow ( nv_data data)

Deletes the North Arrow.

Parameters
datanviz data

Definition at line 315 of file nviz.c.

◆ Nviz_delete_scalebar()

void Nviz_delete_scalebar ( nv_data data,
int  bar_id 
)

Deletes scale bar.

When scalebar is freed, array then contains NULL, which must be tested during drawing.

Parameters
datanviz data

Definition at line 436 of file nviz.c.

◆ Nviz_destroy_data()

void Nviz_destroy_data ( nv_data data)

Free allocated space by nv_data struct.

Parameters
datanviz data

Definition at line 67 of file nviz.c.

◆ Nviz_destroy_render_window()

void Nviz_destroy_render_window ( struct render_window rwin)

Free render window.

Parameters
winpointer to render_window struct

Definition at line 110 of file nviz/render.c.

References render_window::contextId, render_window::displayId, G_free(), render_window::pixmap, and render_window::windowId.

◆ Nviz_draw_all()

int Nviz_draw_all ( nv_data data)

Draw all map objects (in full resolution) and decorations.

Parameters
datanviz data

Definition at line 204 of file nviz/draw.c.

◆ Nviz_draw_all_site()

int Nviz_draw_all_site ( void  )

Draw all loaded vector point sets.

Returns
1

Definition at line 146 of file nviz/draw.c.

References G_free(), GP_draw_site(), GP_get_site_list(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), GSD_BACK, and GSD_BOTH.

◆ Nviz_draw_all_surf()

int Nviz_draw_all_surf ( nv_data dc)

Draw all loaded surfaces.

Parameters
dcnviz data
Returns
1

Definition at line 32 of file nviz/draw.c.

References GS_get_surf_list(), nv_data::light, MAX_SURFS, x, light_data::x, light_data::y, and light_data::z.

◆ Nviz_draw_all_vect()

int Nviz_draw_all_vect ( void  )

Draw all loaded vector sets (lines)

Returns
1

Definition at line 121 of file nviz/draw.c.

References GS_done_draw(), GS_ready_draw(), GS_set_draw(), GSD_BACK, GSD_BOTH, and GV_alldraw_vect().

◆ Nviz_draw_all_vol()

int Nviz_draw_all_vol ( void  )

Draw all loaded volume sets.

Returns
1

Definition at line 175 of file nviz/draw.c.

References G_free(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), GSD_BACK, GSD_BOTH, GVL_draw_vol(), and GVL_get_vol_list().

◆ Nviz_draw_arrow()

int Nviz_draw_arrow ( nv_data data)

Draws the North Arrow.

Parameters
datanviz data

Definition at line 298 of file nviz.c.

◆ Nviz_draw_cplane()

int Nviz_draw_cplane ( nv_data data,
int  bound1,
int  bound2 
)

Draw the clip plane.

Parameters
datanviz data
bound1
bound2

Definition at line 78 of file cplanes_obj.c.

◆ Nviz_draw_fringe()

void Nviz_draw_fringe ( nv_data data)

Draw fringe

Parameters
datanviz data

Definition at line 233 of file nviz.c.

◆ Nviz_draw_image()

void Nviz_draw_image ( int  x,
int  y,
int  width,
int  height,
int  texture_id 
)

Draw image as texture.

Parameters
x,yimage coordinates
width,heightimage size
texture_idtexture id

Definition at line 379 of file nviz/draw.c.

◆ Nviz_draw_model()

void Nviz_draw_model ( nv_data data)

Draw lighting model.

Parameters
datanviz data

Definition at line 185 of file lights.c.

◆ Nviz_draw_quick()

int Nviz_draw_quick ( nv_data data,
int  draw_mode 
)

Draw all surfaces in wireframe (quick mode)

Draw modes:

  • DRAW_QUICK_SURFACE
  • DRAW_QUICK_VLINES
  • DRAW_QUICK_VPOINTS
  • DRAW_QUICK_VOLUME
Parameters
datanviz data
draw_modedraw mode
Returns
1

Definition at line 279 of file nviz/draw.c.

◆ Nviz_draw_scalebar()

void Nviz_draw_scalebar ( nv_data data)

Draws the Scale bar.

Parameters
datanviz data

Definition at line 413 of file nviz.c.

◆ Nviz_flythrough()

void Nviz_flythrough ( nv_data data,
float *  fly_info,
int *  scale,
int  lateral 
)

Fly through the scene.

Computes parameters needed for moving scene. Changes viewpoint and viewdir. Based on visualization/nviz/src/togl_flythrough.c and simplified.

Parameters
datanviz data
fly_infovalues computed from mouse movement
scalerate of movement
lateraltype of movement

Definition at line 320 of file change_view.c.

◆ Nviz_get_bgcolor()

int Nviz_get_bgcolor ( nv_data data)

Get background color.

Parameters
datanviz data
Returns
color color value

Definition at line 111 of file nviz.c.

◆ Nviz_get_cplane_rotation()

int Nviz_get_cplane_rotation ( nv_data data,
int  id,
float *  dx,
float *  dy,
float *  dz 
)

Get the rotation values for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dzrotation parameters
Returns
1

Definition at line 193 of file cplanes_obj.c.

References nv_data::cp_rot, X, Y, and Z.

◆ Nviz_get_cplane_translation()

int Nviz_get_cplane_translation ( nv_data data,
int  id,
float *  dx,
float *  dy,
float *  dz 
)

Get the translation values for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dztranslation parameters

Definition at line 230 of file cplanes_obj.c.

References nv_data::cp_trans, X, Y, and Z.

◆ Nviz_get_current_cplane()

int Nviz_get_current_cplane ( nv_data data)

Get the current active cutplane.

Parameters
datanviz data

Definition at line 156 of file cplanes_obj.c.

References nv_data::cur_cplane.

◆ Nviz_get_exag()

double Nviz_get_exag ( )

Get view z-exag value.

Call after initial data has been loaded

Returns
value

Definition at line 76 of file exag.c.

References G_debug(), G_free(), GS_get_exag_guess(), and GS_get_surf_list().

◆ Nviz_get_exag_height()

int Nviz_get_exag_height ( double *  val,
double *  min,
double *  max 
)

Get view height.

Call after initial data has been loaded

Parameters
[out]valheight value
[out]minmin value (or NULL)
[out]maxmax value (or NULL)
Returns
1

Definition at line 28 of file exag.c.

References G_debug(), GS_get_exag_guess(), GS_get_longdim(), GS_get_surf_list(), and GS_get_zrange_nz().

◆ Nviz_get_focus()

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

Get focus.

Parameters
datanviz data
x,y,zfocus coordinates

Definition at line 119 of file position.c.

◆ Nviz_get_longdim()

float Nviz_get_longdim ( nv_data data)

Get largest dimension.

Parameters
datanviz data

Definition at line 198 of file position.c.

◆ Nviz_get_max_texture()

void Nviz_get_max_texture ( int *  )

Get maximum texture size.

Definition at line 420 of file nviz/draw.c.

◆ Nviz_get_modelview()

void Nviz_get_modelview ( double *  )

Get current modelview matrix.

Definition at line 269 of file change_view.c.

◆ Nviz_get_viewpoint_height()

void Nviz_get_viewpoint_height ( double *  )

Definition at line 180 of file change_view.c.

◆ Nviz_get_viewpoint_position()

void Nviz_get_viewpoint_position ( double *  ,
double *   
)

Definition at line 130 of file change_view.c.

References G_debug(), GS_get_from(), RANGE, RANGE_OFFSET, X, and Y.

◆ Nviz_get_xyrange()

float Nviz_get_xyrange ( nv_data data)

Get xy range.

Parameters
datanviz data

Definition at line 176 of file position.c.

◆ Nviz_get_zrange()

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

Get z range.

Parameters
datanviz data
min,maxz range

Definition at line 187 of file position.c.

◆ Nviz_has_focus()

int Nviz_has_focus ( nv_data data)

Test focus.

Parameters
datanviz data

Definition at line 161 of file position.c.

◆ Nviz_init_data()

void Nviz_init_data ( nv_data data)

Initialize Nviz data.

Parameters
datanviz data

Definition at line 25 of file nviz.c.

◆ Nviz_init_light()

int Nviz_init_light ( nv_data data,
int  num 
)

Init new light.

Parameters
datanviz data
numlight num (starts at 1)

Definition at line 133 of file lights.c.

◆ Nviz_init_render_window()

void Nviz_init_render_window ( struct render_window rwin)

Initialize render window.

Parameters
winpointer to render_window struct

Definition at line 81 of file nviz/render.c.

References render_window::contextId, render_window::displayId, render_window::height, NULL, render_window::pixmap, render_window::width, and render_window::windowId.

◆ Nviz_init_rotation()

void Nviz_init_rotation ( void  )

Stop scene rotation.

Definition at line 302 of file change_view.c.

References GS_init_rotation().

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

◆ Nviz_load_image()

int Nviz_load_image ( GLubyte *  image_data,
int  width,
int  height,
int  alpha 
)

Load image into texture.

Parameters
image_dataimage data
width,heightimage screen size
alphahas alpha channel

Definition at line 316 of file nviz/draw.c.

◆ Nviz_look_here()

int Nviz_look_here ( double  sx,
double  sy 
)

Change focused point.

Parameters
sx,syscreen coordinates
Returns
1

Definition at line 259 of file change_view.c.

References G_debug(), and GS_look_here().

◆ Nviz_make_current_render_window()

int Nviz_make_current_render_window ( const struct render_window rwin)

Make window current for rendering.

Parameters
winpointer to render_window struct
Returns
1 on success
0 on failure

Definition at line 299 of file nviz/render.c.

References _, render_window::contextId, render_window::displayId, G_warning(), render_window::height, render_window::width, and render_window::windowId.

◆ Nviz_new_cplane()

int Nviz_new_cplane ( nv_data data,
int  id 
)

Creates a clip plane object.

The number of clip planes is fixed (MAX_CPLANES) and we'll create them all ahead of time anyway we just let the user decide on the id for each.

Parameters
datanviz data
id

Definition at line 30 of file cplanes_obj.c.

◆ Nviz_new_fringe()

struct fringe_data* Nviz_new_fringe ( nv_data data,
int  id,
unsigned long  color,
double  elev,
int  nw,
int  ne,
int  sw,
int  se 
)

Add new fringe

Parameters
datanviz data
idsurface id
colorcolor
elevfringe elevation
nw,ne,sw,se1 (turn on) 0 (turn off)
Returns
pointer to allocated fringe_data structure
NULL on error

Definition at line 148 of file nviz.c.

◆ Nviz_new_light()

int Nviz_new_light ( nv_data data)

Define new light.

Parameters
datanviz data
Returns
1 on success
0 on failure

Definition at line 164 of file lights.c.

◆ Nviz_new_map_obj()

int Nviz_new_map_obj ( int  type,
const char *  name,
double  value,
nv_data data 
)

Create a new map object which can be one of surf, vect, vol or site.

This routine creates the object internally in the gsf libraryb. Optionally, a logical name may be specified for the new map object. If no name is specified, a logical name is assigned to the new object automatically. Note that maintaining unique logical names is not the responsibility of the library (currently).

Initially map objects contain no data, use the attribute commands to set attributes such as topology, color, etc.

Parameters
typemap object type
namemap name (NULL for constant)
valueconstant (used if name is NULL)
datanviz data
Returns
map object id
-1 on error

Definition at line 44 of file map_obj.c.

◆ Nviz_new_render_window()

struct render_window* Nviz_new_render_window ( void  )

Allocate memory for render window.

Returns
pointer to render_window struct
NULL on failure

Definition at line 66 of file nviz/render.c.

References G_malloc.

◆ Nviz_new_scalebar()

struct scalebar_data* Nviz_new_scalebar ( nv_data data,
int  bar_id,
float *  coords,
float  size,
unsigned int  color 
)

Add new scalebar

Parameters
datanviz data
bar_idscale bar id
coordsreal(?) coordinates
sizescale bar length
colorscalebar/text color
Returns
pointer to allocated scalebar_data structure
NULL on error

Definition at line 334 of file nviz.c.

◆ Nviz_num_cplanes()

int Nviz_num_cplanes ( nv_data data)

Return the number of clip planes objects currently allocated.

Parameters
datanviz data

Definition at line 146 of file cplanes_obj.c.

References nv_data::num_cplanes.

◆ Nviz_off_cplane()

int Nviz_off_cplane ( nv_data data,
int  id 
)

Turn off (make inactive) the given clip plane.

Parameters
datanviz data
cplaneid

Definition at line 63 of file cplanes_obj.c.

◆ Nviz_on_cplane()

int Nviz_on_cplane ( nv_data data,
int  id 
)

Turn on (make current) the given clip plane.

Parameters
datanviz data
cplaneid

Definition at line 48 of file cplanes_obj.c.

◆ Nviz_resize_window()

int Nviz_resize_window ( int  width,
int  height 
)

GL canvas resized.

Parameters
widthwindow width
heightwindow height
Returns
1 on success
0 on failure (window resized by default to 20x20 px)

Definition at line 29 of file change_view.c.

◆ Nviz_set_2D()

void Nviz_set_2D ( int  width,
int  height 
)

Set ortho view for drawing images.

Parameters
width,heightimage screen size

Definition at line 355 of file nviz/draw.c.

◆ Nviz_set_arrow()

int Nviz_set_arrow ( nv_data data,
int  sx,
int  sy,
float  size,
unsigned int  color 
)

Sets the North Arrow position and return world coords.

Parameters
datanviz data
sx,syscreen coordinates
sizearrow length
colorarrow/text color

Definition at line 251 of file nviz.c.

◆ Nviz_set_attr()

int Nviz_set_attr ( int  id,
int  type,
int  desc,
int  src,
const char *  str_value,
double  num_value,
nv_data data 
)

Set map object attribute

Parameters
idmap object id
typemap object type (MAP_OBJ_SURF, MAP_OBJ_VECT, ...)
descattribute descriptor
srcattribute source
str_valueattribute value as string (if NULL, check for num_value)
num_valueattribute value as double
Returns
1 on success
0 on failure

Definition at line 180 of file map_obj.c.

◆ Nviz_set_bgcolor()

void Nviz_set_bgcolor ( nv_data data,
int  color 
)

Set background color.

Parameters
datanviz data
colorcolor value

Definition at line 97 of file nviz.c.

◆ Nviz_set_cplane_here()

int Nviz_set_cplane_here ( nv_data ,
int  ,
float  ,
float   
)

Definition at line 250 of file cplanes_obj.c.

References x.

◆ Nviz_set_cplane_rotation()

int Nviz_set_cplane_rotation ( nv_data data,
int  id,
float  dx,
float  dy,
float  dz 
)

Set the rotation for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dzrotation parameters
Returns
1

Definition at line 171 of file cplanes_obj.c.

References nv_data::cp_rot, GS_set_cplane_rot(), X, Y, and Z.

◆ Nviz_set_cplane_translation()

int Nviz_set_cplane_translation ( nv_data data,
int  id,
float  dx,
float  dy,
float  dz 
)

Set the translation for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dzvalues for setting translation
Returns
1

Definition at line 211 of file cplanes_obj.c.

References nv_data::cp_trans, GS_set_cplane_trans(), X, Y, and Z.

◆ Nviz_set_fence_color()

int Nviz_set_fence_color ( nv_data data,
int  type 
)

Set appropriate fence color.

Parameters
typetype of fence (FC_ABOVE, FC_BELOW, FC_BLEND, FC_GREY, FC_OFF)

Definition at line 243 of file cplanes_obj.c.

◆ Nviz_set_focus()

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

Set focus.

Parameters
datanviz data
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 75 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 49 of file position.c.

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

◆ Nviz_set_fringe()

struct fringe_data* Nviz_set_fringe ( nv_data data,
int  id,
unsigned long  color,
double  elev,
int  nw,
int  ne,
int  sw,
int  se 
)

Set fringe

Parameters
datanviz data
idsurface id
colorcolor
elevfringe elevation
nw,ne,sw,se1 (turn on) 0 (turn off)
Returns
pointer to allocated fringe_data structure
NULL on error

Definition at line 192 of file nviz.c.

◆ Nviz_set_light_ambient()

int Nviz_set_light_ambient ( nv_data data,
int  num,
double  value 
)

Set light ambient.

Parameters
datanviz data
numlight num (starts at 1)
valueambient value (same for R/G/B) (0-1)

Definition at line 114 of file lights.c.

◆ Nviz_set_light_bright()

int Nviz_set_light_bright ( nv_data data,
int  num,
double  value 
)

Set light brightness.

Parameters
datanviz data
numlight num (starts at 1)
valuebrightness value

Definition at line 63 of file lights.c.

◆ Nviz_set_light_color()

int Nviz_set_light_color ( nv_data data,
int  num,
int  red,
int  green,
int  blue 
)

Set light color.

Parameters
datanviz data
numlight num (starts at 1)
red,green,blueRGB values (0-255)

Definition at line 87 of file lights.c.

◆ Nviz_set_light_position()

int Nviz_set_light_position ( nv_data data,
int  num,
double  x,
double  y,
double  z,
double  w 
)

Set light position.

Parameters
datanviz data
numlight num (starts at 1)
x,y,z,wposition, model coordinates
Returns
1

Definition at line 27 of file lights.c.

◆ Nviz_set_rotation()

void Nviz_set_rotation ( double  angle,
double  x,
double  y,
double  z 
)

Set rotation parameters.

Rotate scene by given parameters related to mouse drag event (difference from current state). Coordinates determine the second point of rotation axis, the first point is (0, 0, 0).

Parameters
angleangle
x,y,zaxis coordinate

Definition at line 285 of file change_view.c.

References G_debug(), and GS_set_rotation().

◆ Nviz_set_scalebar()

struct scalebar_data* Nviz_set_scalebar ( nv_data data,
int  bar_id,
int  sx,
int  sy,
float  size,
unsigned int  color 
)

Sets the scale bar position and return world coords.

Parameters
datanviz data
bar_idscale bar id
sx,syscreen coordinates
sizescale bar length
colorscalebar/text color
Returns
pointer to allocated scalebar_data structure
NULL when there's no surface

Definition at line 368 of file nviz.c.

◆ Nviz_set_surface_attr_default()

void Nviz_set_surface_attr_default ( )

Set default surface attributes.

Definition at line 276 of file map_obj.c.

References ATT_COLOR, ATT_EMIT, ATT_MASK, ATT_SHINE, ATT_TOPO, ATT_TRANSP, DEFAULT_SURF_COLOR, GS_set_att_defaults(), and MAX_ATTS.

◆ Nviz_set_viewpoint_height()

int Nviz_set_viewpoint_height ( double  height)

Change viewpoint height.

Parameters
heightheight value (world coordinates)
Returns
1

Definition at line 156 of file change_view.c.

◆ Nviz_set_viewpoint_persp()

int Nviz_set_viewpoint_persp ( int  persp)

Change viewpoint perspective (field of view)

Parameters
perspperspective value (0-100, in degrees)
Returns
1

Definition at line 197 of file change_view.c.

References G_debug(), and GS_set_fov().

◆ Nviz_set_viewpoint_position()

int Nviz_set_viewpoint_position ( double  x_pos,
double  y_pos 
)

Change position of view.

Parameters
x_posx position (model coordinates)
y_posy position (model coordinates)
Returns
1

Definition at line 96 of file change_view.c.

References G_debug(), GS_get_from(), GS_moveto(), RANGE, RANGE_OFFSET, X, and Y.

◆ Nviz_set_viewpoint_twist()

int Nviz_set_viewpoint_twist ( int  twist)

Change viewpoint twist.

Parameters
twistpersp twist value (-180-180, in degrees)
Returns
1

Definition at line 218 of file change_view.c.

References G_debug(), and GS_set_twist().

◆ Nviz_set_volume_attr_default()

int Nviz_set_volume_attr_default ( )

◆ Nviz_set_vpoint_attr_default()

int Nviz_set_vpoint_attr_default ( )

◆ Nviz_unset_attr()

int Nviz_unset_attr ( int  id,
int  type,
int  desc 
)

Unset map object attribute

Parameters
idmap object id
typemap object type (MAP_OBJ_SURF, MAP_OBJ_VECT, ...)
descattribute descriptor
Returns
1 on success
0 on failure

Definition at line 360 of file map_obj.c.

◆ Nviz_unset_rotation()

void Nviz_unset_rotation ( void  )

Stop scene rotation.

Definition at line 294 of file change_view.c.

References GS_unset_rotation().

◆ Nviz_update_ranges()

int Nviz_update_ranges ( nv_data dc)

Update ranges.

Call whenever a new surface is added, deleted, or exag changes

Returns
1

Definition at line 60 of file change_view.c.

References GS_get_longdim(), GS_get_zrange_nz(), GS_global_exag(), nv_data::xyrange, and nv_data::zrange.