GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
gs2.c File Reference

OGSF library - loading and manipulating surfaces (higher level functions) More...

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <grass/config.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/ogsf.h>
#include <grass/glocale.h>
#include "gsget.h"
#include "rowcol.h"
#include "rgbpack.h"
Include dependency graph for gs2.c:

Go to the source code of this file.

Macros

#define NVIZ_HACK   1
 

Functions

int gsd_getViewport (GLint *, GLint *)
 
void void_func (void)
 
void GS_libinit (void)
 Initialize OGSF library. More...
 
int GS_get_longdim (float *dim)
 Get largest dimension. More...
 
int GS_get_region (float *n, float *s, float *w, float *e)
 Get 2D region extent. More...
 
void GS_set_att_defaults (float *defs, float *null_defs)
 Set default attributes for map objects. More...
 
int GS_surf_exists (int id)
 
int GS_new_surface (void)
 Add new surface. More...
 
void GS_set_light_reset (int i)
 
int GS_get_light_reset (void)
 
int GS_new_light (void)
 Add new model light. More...
 
void GS_setlight_position (int num, float xpos, float ypos, float zpos, int local)
 Set light position. More...
 
void GS_getlight_position (int num, float *xpos, float *ypos, float *zpos, int *local)
 Get light position. More...
 
void GS_setlight_color (int num, float red, float green, float blue)
 Set light color. More...
 
void GS_getlight_color (int num, float *red, float *green, float *blue)
 Get light color. More...
 
void GS_setlight_ambient (int num, float red, float green, float blue)
 Set light ambient. More...
 
void GS_getlight_ambient (int num, float *red, float *green, float *blue)
 Get light ambient. More...
 
void GS_lights_off (void)
 Switch off all lights. More...
 
void GS_lights_on (void)
 Switch on all lights. More...
 
void GS_switchlight (int num, int on)
 Switch on/off light. More...
 
int GS_transp_is_set (void)
 Check if transparency is set. More...
 
void GS_get_modelposition1 (float pos[])
 Retrieves coordinates for lighting model position, at center of view. More...
 
void GS_get_modelposition (float *siz, float *pos)
 Retrieves coordinates for lighting model position, at center of view. More...
 
void GS_set_Narrow (int *pt, int id, float *pos2)
 Set decoration, north arrow ?? More...
 
void GS_draw_X (int id, float *pt)
 Draw place marker. More...
 
void GS_draw_line_onsurf (int id, float x1, float y1, float x2, float y2)
 Draw line on surface. More...
 
int GS_draw_nline_onsurf (int id, float x1, float y1, float x2, float y2, float *lasp, int n)
 Draw multiline on surface. More...
 
void GS_draw_flowline_at_xy (int id, float x, float y)
 Draw flow-line on surace. More...
 
void GS_draw_fringe (int id, unsigned long clr, float elev, int *where)
 Draw fringe around data (surface) at selected corners. More...
 
int GS_draw_legend (const char *name, GLuint fontbase, int size, int *flags, float *range, int *pt)
 Draw legend. More...
 
void GS_draw_list (GLuint list_id)
 Draw pre-defined list. More...
 
void GS_draw_all_list (void)
 Draw all glLists. More...
 
void GS_delete_list (GLuint list_id)
 Delete pre-defined list. More...
 
void GS_draw_lighting_model1 (void)
 Draw lighting model. More...
 
void GS_draw_lighting_model (void)
 Draw lighting model. More...
 
int GS_update_curmask (int id)
 Update current mask. More...
 
int GS_is_masked (int id, float *pt)
 Check if point is masked ? More...
 
void GS_unset_SDsurf (void)
 Unset Scaled Difference surface. More...
 
int GS_set_SDsurf (int id)
 Set surface as Scaled Difference surface. More...
 
int GS_set_SDscale (float scale)
 Set ? More...
 
int GS_get_SDsurf (int *id)
 Get ? More...
 
int GS_get_SDscale (float *scale)
 Get ? More...
 
int GS_update_normals (int id)
 Update normals. More...
 
int GS_get_att (int id, int att, int *set, float *constant, char *mapname)
 Get attributes. More...
 
int GS_get_cat_at_xy (int id, int att, char *catstr, float x, float y)
 Get surface category on given position. More...
 
int GS_get_norm_at_xy (int id, float x, float y, float *nv)
 Get surface normal at x,y (real coordinates) More...
 
int GS_get_val_at_xy (int id, int att, char *valstr, float x, float y)
 Get RGB color at given point. More...
 
int GS_unset_att (int id, int att)
 Unset attribute. More...
 
int GS_set_att_const (int id, int att, float constant)
 Set attribute constant. More...
 
int GS_set_maskmode (int id, int mode)
 Set mask mode. More...
 
int GS_get_maskmode (int id, int *mode)
 Get mask mode. More...
 
int GS_Set_ClientData (int id, void *clientd)
 Set client data. More...
 
void * GS_Get_ClientData (int id)
 Get client data. More...
 
int GS_num_surfs (void)
 Get number of surfaces. More...
 
int * GS_get_surf_list (int *numsurfs)
 Get surface list. More...
 
int GS_delete_surface (int id)
 Delete surface. More...
 
int GS_load_att_map (int id, const char *filename, int att)
 Load raster map as attribute. More...
 
void GS_draw_surf (int id)
 Draw surface. More...
 
void GS_draw_wire (int id)
 Draw surface wire. More...
 
void GS_alldraw_wire (void)
 Draw all wires. More...
 
void GS_alldraw_surf (void)
 Draw all surfaces. More...
 
void GS_set_exag (int id, float exag)
 Set Z exag for surface. More...
 
void GS_set_global_exag (float exag)
 Set global z-exag value. More...
 
float GS_global_exag (void)
 Get global z-exag value. More...
 
void GS_set_wire_color (int id, int colr)
 Set wire color. More...
 
int GS_get_wire_color (int id, int *colr)
 Get wire color. More...
 
int GS_setall_drawmode (int mode)
 Set all draw-modes. More...
 
int GS_set_drawmode (int id, int mode)
 Set draw mode. More...
 
int GS_get_drawmode (int id, int *mode)
 Get draw mode. More...
 
void GS_set_nozero (int id, int att, int mode)
 Set no-zero ? More...
 
int GS_get_nozero (int id, int att, int *mode)
 Get no-zero ? More...
 
int GS_setall_drawres (int xres, int yres, int xwire, int ywire)
 Set all draw resolutions. More...
 
int GS_set_drawres (int id, int xres, int yres, int xwire, int ywire)
 Set draw resolution for surface. More...
 
void GS_get_drawres (int id, int *xres, int *yres, int *xwire, int *ywire)
 Get draw resolution of surface. More...
 
void GS_get_dims (int id, int *rows, int *cols)
 Get dimension of surface. More...
 
int GS_get_exag_guess (int id, float *exag)
 Get exag-value guess. More...
 
void GS_get_zrange_nz (float *min, float *max)
 Get Z extents for all loaded surfaces. More...
 
void GS_set_trans (int id, float xtrans, float ytrans, float ztrans)
 Set translation (surface position) More...
 
void GS_get_trans (int id, float *xtrans, float *ytrans, float *ztrans)
 Get translation values (surface position) More...
 
unsigned int GS_default_draw_color (void)
 Get default draw color. More...
 
unsigned int GS_background_color (void)
 Get background color. More...
 
void GS_set_draw (int where)
 Sets which buffer to draw to. More...
 
void GS_ready_draw (void)
 
void GS_done_draw (void)
 Draw done, swap buffers. More...
 
void GS_set_focus (float *realto)
 Set focus. More...
 
void GS_set_focus_real (float *realto)
 Set real focus. More...
 
int GS_get_focus (float *realto)
 Get focus. More...
 
void GS_set_focus_center_map (int id)
 Set focus to map center. More...
 
void GS_moveto (float *pt)
 Move viewpoint. More...
 
void GS_moveto_real (float *pt)
 Move position to (real) More...
 
int GS_get_zextents (int id, float *min, float *max, float *mid)
 Get z-extent for a single surface. More...
 
int GS_get_zrange (float *min, float *max, int doexag)
 Get z-extent for all loaded surfaces. More...
 
void GS_get_from (float *fr)
 Get viewpoint 'from' position. More...
 
void GS_get_from_real (float *fr)
 Get viewpoint 'from' real coordinates. More...
 
void GS_get_to_real (float *to)
 Get 'to' real coordinates. More...
 
void GS_zoom_setup (int *a, int *b, int *c, int *d, int *maxx, int *maxy)
 Get zoom setup. More...
 
void GS_get_to (float *to)
 Get 'to' model coordinates. More...
 
void GS_get_viewdir (float *dir)
 Get viewdir. More...
 
void GS_set_viewdir (float *dir)
 Set viewdir. More...
 
void GS_set_fov (int fov)
 Set field of view. More...
 
int GS_get_fov (void)
 Get fied of view. More...
 
int GS_get_twist (void)
 Get twist value. More...
 
void GS_set_twist (int t)
 Set viewpoint twist value. More...
 
void GS_set_rotation (double angle, double x, double y, double z)
 Set rotation params. More...
 
void GS_unset_rotation (void)
 Stop scene rotation. More...
 
void GS_init_rotation (void)
 Reset scene rotation. More...
 
void GS_get_rotation_matrix (double *matrix)
 Get rotation matrix. More...
 
void GS_set_rotation_matrix (double *matrix)
 Set rotation matrix. More...
 
void GS_set_nofocus (void)
 Unset focus. More...
 
void GS_set_infocus (void)
 Set focus. More...
 
void GS_set_viewport (int left, int right, int bottom, int top)
 Set viewport. More...
 
int GS_look_here (int sx, int sy)
 Send screen coords sx and sy, lib traces through surfaces; sets new center to point of nearest intersection. More...
 
int GS_get_selected_point_on_surface (int sx, int sy, int *id, float *x, float *y, float *z)
 Get selected point of surface. More...
 
void GS_set_cplane_rot (int num, float dx, float dy, float dz)
 Set cplace rotation. More...
 
void GS_set_cplane_trans (int num, float dx, float dy, float dz)
 Set cplace trans. More...
 
void GS_draw_cplane (int num)
 Draw cplace. More...
 
int GS_draw_cplane_fence (int hs1, int hs2, int num)
 Draw cplace fence ? More...
 
void GS_alldraw_cplane_fences (void)
 Draw all cplace fences ? More...
 
void GS_set_cplane (int num)
 Set cplace. More...
 
void GS_unset_cplane (int num)
 Unset clip place (turn off) More...
 
void GS_get_scale (float *sx, float *sy, float *sz, int doexag)
 Get axis scale. More...
 
void GS_set_fencecolor (int mode)
 Set fence color. More...
 
int GS_get_fencecolor (void)
 Get fence color. More...
 
int GS_get_distance_alongsurf (int hs, float x1, float y1, float x2, float y2, float *dist, int use_exag)
 Measure distance "as the ball rolls" between two points on surface. More...
 
int GS_save_3dview (const char *vname, int surfid)
 Save 3d view. More...
 
int GS_load_3dview (const char *vname, int surfid)
 Load 3d view. More...
 
void GS_init_view (void)
 Init viewpoint. More...
 
void GS_clear (int col)
 Clear view. More...
 
double GS_get_aspect (void)
 Get aspect value. More...
 
int GS_has_transparency (void)
 Check for transparency. More...
 

Detailed Description

OGSF library - loading and manipulating surfaces (higher level functions)

GRASS OpenGL gsurf OGSF Library

Plans for handling color maps: NOW: if able to load as unsigned char, make lookup table containing palette otherwise, load directly as packed color, set lookup = NULL MAYBE LATER: if able to load as POSITIVE short, make lookup table containing palette

  • may want to calculate savings first (ie, numcells > 32768) (not exactly, it's Friday & time to go home - figure it later) otherwise, load directly as packed color, set lookup = NULL MESSY! - need to fix up!

(C) 1999-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.

Author
Bill Brown USACERL (1993)
Pierre de Mouveaux <p_de_mouveaux hotmail.com> (updated October 1999)
Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file gs2.c.

Macro Definition Documentation

◆ NVIZ_HACK

#define NVIZ_HACK   1

Definition at line 59 of file gs2.c.

Function Documentation

◆ GS_alldraw_cplane_fences()

void GS_alldraw_cplane_fences ( void  )

Draw all cplace fences ?

Definition at line 3195 of file gs2.c.

References GS_draw_cplane_fence(), gsd_get_cplanes_state(), and MAX_CPLANES.

◆ GS_alldraw_surf()

void GS_alldraw_surf ( void  )

Draw all surfaces.

Definition at line 1936 of file gs2.c.

◆ GS_alldraw_wire()

void GS_alldraw_wire ( void  )

Draw all wires.

Overrides draw_mode for fast display

Definition at line 1919 of file gs2.c.

Referenced by Gs_load_3dview().

◆ GS_background_color()

unsigned int GS_background_color ( void  )

Get background color.

Returns
color value

Definition at line 2452 of file gs2.c.

References geodisplay::bgcol.

◆ GS_clear()

void GS_clear ( int  col)

Clear view.

Parameters
colcolor value

Definition at line 3418 of file gs2.c.

References geodisplay::bgcol, and G_debug().

◆ GS_default_draw_color()

unsigned int GS_default_draw_color ( void  )

Get default draw color.

Returns
color value

Definition at line 2439 of file gs2.c.

References geodisplay::bgcol, and G_debug().

◆ GS_delete_list()

void GS_delete_list ( GLuint  list_id)

Delete pre-defined list.

Parameters
list_idlist id

Definition at line 891 of file gs2.c.

References gsd_deletelist().

◆ GS_delete_surface()

int GS_delete_surface ( int  id)

Delete surface.

Parameters
idsurface id
Returns
1 on success
-1 on error

Definition at line 1566 of file gs2.c.

References FALSE, G_debug(), gs_delete_surf(), and GS_surf_exists().

◆ GS_done_draw()

◆ GS_draw_all_list()

void GS_draw_all_list ( void  )

Draw all glLists.

Uses glFlush() to ensure all drawing is complete before returning

Definition at line 879 of file gs2.c.

References gsd_calllists().

◆ GS_draw_cplane()

void GS_draw_cplane ( int  num)

Draw cplace.

Parameters
numcplace id

Definition at line 3148 of file gs2.c.

References gs_getall_surfaces(), gs_num_surfaces(), gsd_draw_cplane(), gsd_draw_cplane_fence(), and MAX_SURFS.

◆ GS_draw_cplane_fence()

int GS_draw_cplane_fence ( int  hs1,
int  hs2,
int  num 
)

Draw cplace fence ?

Parameters
hs1,hs2
numcplane id
Returns
0 on error
1 on success

Definition at line 3175 of file gs2.c.

References gs_get_surf(), gsd_draw_cplane_fence(), and NULL.

Referenced by GS_alldraw_cplane_fences().

◆ GS_draw_flowline_at_xy()

void GS_draw_flowline_at_xy ( int  id,
float  x,
float  y 
)

Draw flow-line on surace.

This is slow - should be moved to gs_ but GS_ good for testing and useful for app programmer

Parameters
idsurface id
x,ycoordinates of flow-line

Definition at line 756 of file gs2.c.

◆ GS_draw_fringe()

void GS_draw_fringe ( int  id,
unsigned long  clr,
float  elev,
int *  where 
)

Draw fringe around data (surface) at selected corners.

Parameters
idsurface id
clrcolor
elevelevation value
wherenw/ne/sw/se edges - 0 (turn off) 1 (turn on)

Definition at line 823 of file gs2.c.

References G_debug(), gs_get_surf(), and gsd_display_fringe().

◆ GS_draw_legend()

int GS_draw_legend ( const char *  name,
GLuint  fontbase,
int  size,
int *  flags,
float *  range,
int *  pt 
)

Draw legend.

Todo:
add legend from list option make font loading more flexible
Parameters
namelegend name
fontbasefont-base
size?
flagslegend flags
rangevalues range
pt?

Definition at line 848 of file gs2.c.

References gsd_put_legend().

◆ GS_draw_lighting_model()

void GS_draw_lighting_model ( void  )

Draw lighting model.

Just turn off any cutting planes and draw it just outside near clipping plane, since lighting is infinite now

Definition at line 941 of file gs2.c.

References gsd_cplane_off(), gsd_get_cplanes_state(), and MAX_CPLANES.

◆ GS_draw_lighting_model1()

void GS_draw_lighting_model1 ( void  )

Draw lighting model.

Definition at line 901 of file gs2.c.

◆ GS_draw_line_onsurf()

void GS_draw_line_onsurf ( int  id,
float  x1,
float  y1,
float  x2,
float  y2 
)

Draw line on surface.

Parameters
idsurface id
x1,y1,x2,y2line nodes

Definition at line 680 of file gs2.c.

◆ GS_draw_list()

void GS_draw_list ( GLuint  list_id)

Draw pre-defined list.

Uses glFlush() to ensure all drawing is complete before returning

Parameters
list_idlist id

Definition at line 866 of file gs2.c.

References gsd_calllist().

◆ GS_draw_nline_onsurf()

int GS_draw_nline_onsurf ( int  id,
float  x1,
float  y1,
float  x2,
float  y2,
float *  lasp,
int  n 
)

Draw multiline on surface.

Like above but limits points in line to n or points found in segment, whichever is smaller.

Parameters
idsurface id
x1,y1,x2,y2line nodes
Returns
number of points used

Definition at line 718 of file gs2.c.

◆ GS_draw_surf()

void GS_draw_surf ( int  id)

Draw surface.

Parameters
idsurface id

Definition at line 1864 of file gs2.c.

References DM_GOURAUD, DM_POLY, DM_WIRE, DM_WIRE_POLY, g_surf::draw_mode, G_debug(), gs_get_surf(), gsd_shademodel(), gsd_surf(), and gsd_wire_surf().

◆ GS_draw_wire()

void GS_draw_wire ( int  id)

Draw surface wire.

Overrides draw_mode for fast display

Parameters
idsurface id

Definition at line 1899 of file gs2.c.

References G_debug(), gs_get_surf(), and gsd_wire_surf().

◆ GS_draw_X()

void GS_draw_X ( int  id,
float *  pt 
)

◆ GS_get_aspect()

double GS_get_aspect ( void  )

Get aspect value.

Returns
aspect value

Definition at line 3452 of file gs2.c.

References Cell_head::bottom, G_debug(), and Cell_head::top.

Referenced by gsd_set_view().

◆ GS_get_att()

int GS_get_att ( int  id,
int  att,
int *  set,
float *  constant,
char *  mapname 
)

Get attributes.

Parameters
idsurface id
att
[out]set
[out]constant
[out]mapname
Returns
1 on success
-1 on error (invalid surface id)

Definition at line 1140 of file gs2.c.

◆ GS_get_cat_at_xy()

int GS_get_cat_at_xy ( int  id,
int  att,
char *  catstr,
float  x,
float  y 
)

Get surface category on given position.

Prints "no data" or a description (i.e., "coniferous forest") to catstr. Usually call after GS_get_selected_point_on_surface(). Define att as MAP_ATT

Todo:
Allocate catstr using G_store()
Parameters
idsurface id
attattribute id (MAP_ATT)
catstrcat string (must be allocated, dim?)
x,yreal coordinates
Returns
-1 if no category info or point outside of window
1 on success

Definition at line 1183 of file gs2.c.

References _, g_surf::att, DRC2OFF, GET_MAPATT, gs_get_att_src(), gs_get_att_typbuff(), Gs_get_cat_label(), gs_get_surf(), gs_point_is_masked(), gsd_real2surf(), gsds_get_name(), gsurf_att::hdata, in_vregion(), MAP_ATT, NULL, VCOL2DCOL, VROW2DROW, x, X, X2VCOL, Y, and Y2VROW.

◆ GS_Get_ClientData()

void* GS_Get_ClientData ( int  id)

Get client data.

Parameters
idsurface id
Returns
pointer to client data
NULL on error

Definition at line 1507 of file gs2.c.

References g_surf::clientdata, gs_get_surf(), and NULL.

◆ GS_get_dims()

void GS_get_dims ( int  id,
int *  rows,
int *  cols 
)

Get dimension of surface.

Parameters
idsurface id
[out]rows,colsnumber of rows/cols

Definition at line 2279 of file gs2.c.

References g_surf::cols, gs_get_surf(), and g_surf::rows.

◆ GS_get_distance_alongsurf()

int GS_get_distance_alongsurf ( int  hs,
float  x1,
float  y1,
float  x2,
float  y2,
float *  dist,
int  use_exag 
)

Measure distance "as the ball rolls" between two points on surface.

Parameters
hssurface id
x1,y1,x2,y2two points on surface
[out]distmeasured distance
use_exaguse exag. surface
Returns
0 on error or if one or more points is not in region
distance following terrain

Definition at line 3285 of file gs2.c.

◆ GS_get_drawmode()

int GS_get_drawmode ( int  id,
int *  mode 
)

Get draw mode.

Parameters
idsurface id
[out]modemode id
Returns
1 on success
-1 on error (invalid surface id)

Definition at line 2109 of file gs2.c.

◆ GS_get_drawres()

void GS_get_drawres ( int  id,
int *  xres,
int *  yres,
int *  xwire,
int *  ywire 
)

Get draw resolution of surface.

Parameters
idsurface id
[out]xres,yresx/y resolution value
[out]xwire,ywirex/y wire value

Definition at line 2255 of file gs2.c.

References G_debug(), gs_get_surf(), g_surf::x_mod, g_surf::x_modw, g_surf::y_mod, and g_surf::y_modw.

◆ GS_get_exag_guess()

int GS_get_exag_guess ( int  id,
float *  exag 
)

Get exag-value guess.

Use no_zero range because if zero IS data, then range won't be that much off (it's just a GUESS, after all), but if zero is NO data, could drastically affect guess

Parameters
idsurface id
[out]exagexag value
Returns
1 on success
-1 on error

Definition at line 2306 of file gs2.c.

References ATT_TOPO, CONST_ATT, G_debug(), gs_get_att_src(), gs_get_surf(), and g_surf::zrange_nz.

Referenced by Nviz_get_exag(), and Nviz_get_exag_height().

◆ GS_get_fencecolor()

int GS_get_fencecolor ( void  )

Get fence color.

Returns
color value

Definition at line 3268 of file gs2.c.

References gsd_getfc().

◆ GS_get_focus()

int GS_get_focus ( float *  realto)

Get focus.

OK to call with NULL argument if just want to check state

Parameters
realtoreal coordinates to
Returns
?

Definition at line 2563 of file gs2.c.

References G_debug(), GS_v3eq(), geoview::infocus, and geoview::real_to.

◆ GS_get_fov()

int GS_get_fov ( void  )

Get fied of view.

Returns
field of view, in 10ths of degrees

Definition at line 2855 of file gs2.c.

References geoview::fov.

◆ GS_get_from()

void GS_get_from ( float *  fr)

Get viewpoint 'from' position.

Parameters
[out]frfrom model coordinates

Definition at line 2725 of file gs2.c.

References FROM, geoview::from_to, G_debug(), and GS_v3eq().

Referenced by Nviz_get_viewpoint_position(), and Nviz_set_viewpoint_position().

◆ GS_get_from_real()

void GS_get_from_real ( float *  fr)

Get viewpoint 'from' real coordinates.

Parameters
[out]fr'from' real coordinates

Definition at line 2739 of file gs2.c.

References FROM, geoview::from_to, GS_v3eq(), and gsd_model2real().

◆ GS_get_light_reset()

int GS_get_light_reset ( void  )

Definition at line 258 of file gs2.c.

Referenced by GS_new_light().

◆ GS_get_longdim()

int GS_get_longdim ( float *  dim)

Get largest dimension.

Parameters
[out]dimdimension
Returns
1

Definition at line 140 of file gs2.c.

Referenced by gp_set_defaults(), GS_draw_X(), Nviz_get_exag_height(), and Nviz_update_ranges().

◆ GS_get_maskmode()

int GS_get_maskmode ( int  id,
int *  mode 
)

Get mask mode.

Parameters
idsurface id
[out]modeid
Returns
1 on success
-1 on error (invalid surface id)

Definition at line 1461 of file gs2.c.

◆ GS_get_modelposition()

void GS_get_modelposition ( float *  siz,
float *  pos 
)

Retrieves coordinates for lighting model position, at center of view.

Position at nearclip * 2: tried nearclip + siz, but since need to know position to calculate size, have two dependent variables (nearclip * 2) from eye.

Parameters
siz[out]size
pos[out]coordinates (X, Y, Z)

Definition at line 531 of file gs2.c.

References geoview::fov, FROM, geoview::from_to, GS_v3dir(), geodisplay::nearclip, TO, X, Y, and Z.

◆ GS_get_modelposition1()

void GS_get_modelposition1 ( float  pos[])

Retrieves coordinates for lighting model position, at center of view.

Parameters
pos[out]coordinates

Definition at line 502 of file gs2.c.

References G_debug(), gs_get_data_avg_zmax(), gs_get_datacenter(), X, Y, and Z.

◆ GS_get_norm_at_xy()

int GS_get_norm_at_xy ( int  id,
float  x,
float  y,
float *  nv 
)

Get surface normal at x,y (real coordinates)

Usually call after GS_get_selected_point_on_surface()

Parameters
idsurface id
x,yreal coordinates
[out]nvsurface normal
Returns
-1 if point outside of window or masked
1 on success

Definition at line 1246 of file gs2.c.

References DRC2OFF, FNORM, gs_calc_normals(), gs_get_surf(), gs_point_is_masked(), gsd_real2surf(), in_vregion(), g_surf::norm_needupdate, g_surf::norms, NULL, VCOL2DCOL, VROW2DROW, x, X, X2VCOL, Y, and Y2VROW.

◆ GS_get_nozero()

int GS_get_nozero ( int  id,
int  att,
int *  mode 
)

Get no-zero ?

Parameters
idsurface id
attattribute id
[out]modemode id
Returns
-1 on error (invalid surface id)
1 on success

Definition at line 2164 of file gs2.c.

◆ GS_get_region()

int GS_get_region ( float *  n,
float *  s,
float *  w,
float *  e 
)

Get 2D region extent.

Parameters
[out]n,s,w,eextent values
Returns
1

Definition at line 156 of file gs2.c.

Referenced by GP_draw_site().

◆ GS_get_rotation_matrix()

void GS_get_rotation_matrix ( double *  matrix)

Get rotation matrix.

Definition at line 2929 of file gs2.c.

References geoview::rotate, and georot::rotMatrix.

◆ GS_get_scale()

void GS_get_scale ( float *  sx,
float *  sy,
float *  sz,
int  doexag 
)

Get axis scale.

Parameters
sx,sy,szx/y/z scale values
doexaguse vertical exaggeration

Definition at line 3240 of file gs2.c.

References geoview::scale, and geoview::vert_exag.

Referenced by gsd_do_scale(), gsd_model2surf(), gsd_surf2model(), and gsd_wire_arrows().

◆ GS_get_SDscale()

int GS_get_SDscale ( float *  scale)

Get ?

Parameters
[out]scalevalue
Returns
1

Definition at line 1105 of file gs2.c.

◆ GS_get_SDsurf()

int GS_get_SDsurf ( int *  id)

Get ?

Parameters
[out]id?
Returns
1 on success
0 on error

Definition at line 1085 of file gs2.c.

References gsdiff_get_SDref().

◆ GS_get_selected_point_on_surface()

int GS_get_selected_point_on_surface ( int  sx,
int  sy,
int *  id,
float *  x,
float *  y,
float *  z 
)

Get selected point of surface.

Given screen coordinates sx and sy, find closest intersection of view ray with surfaces and return coordinates of intersection in x, y, z, and identifier of surface in id.

Parameters
sx,syscreen coordinates
[out]idsurface id
[out]x,y,zpoint on surface (model coordinates?)
Returns
0 if no intersections found
number of intersections

Definition at line 3054 of file gs2.c.

References MAX_SURFS.

Referenced by GS_look_here(), and GS_set_Narrow().

◆ GS_get_surf_list()

int* GS_get_surf_list ( int *  numsurfs)

Get surface list.

Must be freed when not neeed!

Parameters
[out]numsurfnumber of available surfaces
Returns
pointer to surface array
NULL on error

Definition at line 1539 of file gs2.c.

Referenced by Nviz_draw_all_surf(), Nviz_get_exag(), and Nviz_get_exag_height().

◆ GS_get_to()

void GS_get_to ( float *  to)

Get 'to' model coordinates.

Todo:
need set_to? - just use viewdir?
Parameters
[out]to'to' model coordinates

Definition at line 2795 of file gs2.c.

References geoview::from_to, G_debug(), GS_v3eq(), and TO.

◆ GS_get_to_real()

void GS_get_to_real ( float *  to)

Get 'to' real coordinates.

Parameters
[out]to'to' real coordinates

Definition at line 2752 of file gs2.c.

References G_get_set_window().

◆ GS_get_trans()

void GS_get_trans ( int  id,
float *  xtrans,
float *  ytrans,
float *  ztrans 
)

Get translation values (surface position)

Parameters
idsurface id
[out]xtrans,ytrans,ztranstrans values

Definition at line 2415 of file gs2.c.

References G_debug(), gs_get_surf(), g_surf::x_trans, g_surf::y_trans, and g_surf::z_trans.

◆ GS_get_twist()

int GS_get_twist ( void  )

Get twist value.

10ths of degrees off twelve o'clock

Definition at line 2865 of file gs2.c.

References geoview::twist.

◆ GS_get_val_at_xy()

int GS_get_val_at_xy ( int  id,
int  att,
char *  valstr,
float  x,
float  y 
)

Get RGB color at given point.

Colors are translated to rgb and returned as Rxxx Gxxx Bxxx Usually call after GS_get_selected_point_on_surface().

Prints NULL or the value (i.e., "921.5") to valstr

Parameters
idsurface id
attattribute id
[out]valstrvalue string (allocated, dim?)
x,yreal coordinates
Returns
-1 if point outside of window or masked
1 on success

Definition at line 1310 of file gs2.c.

References g_surf::att, ATT_COLOR, b, CONST_ATT, gsurf_att::constant, DRC2OFF, g, GET_MAPATT, gs_get_att_src(), gs_get_att_typbuff(), gs_get_surf(), gs_mapcolor(), gs_point_is_masked(), gsd_real2surf(), in_vregion(), INT_TO_BLU, INT_TO_GRN, INT_TO_RED, MAP_ATT, NULL, r, VCOL2DCOL, VROW2DROW, x, X, X2VCOL, Y, and Y2VROW.

◆ GS_get_viewdir()

void GS_get_viewdir ( float *  dir)

Get viewdir.

Parameters
[out]dirviewdir value

Definition at line 2809 of file gs2.c.

References FROM, geoview::from_to, GS_v3dir(), and TO.

◆ GS_get_wire_color()

int GS_get_wire_color ( int  id,
int *  colr 
)

Get wire color.

Parameters
idsurface id
[out]colrcolor value
Returns
1 on success
-1 on error

Definition at line 2038 of file gs2.c.

References gs_get_surf(), and g_surf::wire_color.

◆ GS_get_zextents()

int GS_get_zextents ( int  id,
float *  min,
float *  max,
float *  mid 
)

Get z-extent for a single surface.

Parameters
idsurface id
[out]minmin z-value
[out]maxmax z-value
[out]midmiddle z-value
Returns
-1 on error (invalid surface id)
?

Definition at line 2666 of file gs2.c.

References G_debug(), gs_get_surf(), gs_get_zextents(), and NULL.

◆ GS_get_zrange()

int GS_get_zrange ( float *  min,
float *  max,
int  doexag 
)

Get z-extent for all loaded surfaces.

Parameters
[out]minmin z-value
[out]maxmax z-value
doexaguse z-exaggeration
Returns
1 on success
-1 on error

Definition at line 2689 of file gs2.c.

References G_debug(), gs_get_zrange(), gvl_get_zrange(), and geoview::vert_exag.

Referenced by Gs_save_3dview(), gsd_check_focus(), gsd_do_scale(), gsd_model2surf(), and gsd_surf2model().

◆ GS_get_zrange_nz()

void GS_get_zrange_nz ( float *  min,
float *  max 
)

Get Z extents for all loaded surfaces.

Treating zeros as "no data"

Parameters
[out]minmin value
[out]maxmax value

Definition at line 2357 of file gs2.c.

Referenced by Nviz_get_exag_height(), and Nviz_update_ranges().

◆ GS_getlight_ambient()

void GS_getlight_ambient ( int  num,
float *  red,
float *  green,
float *  blue 
)

Get light ambient.

Parameters
numlight id (starts at 1)
[out]red,green,bluecolor values

Definition at line 424 of file gs2.c.

◆ GS_getlight_color()

void GS_getlight_color ( int  num,
float *  red,
float *  green,
float *  blue 
)

Get light color.

Parameters
numlight id (starts at 1)
[out]red,green,bluecolor values

Definition at line 380 of file gs2.c.

◆ GS_getlight_position()

void GS_getlight_position ( int  num,
float *  xpos,
float *  ypos,
float *  zpos,
int *  local 
)

Get light position.

Parameters
numlight id (starts at 1)
[out]xpos,ypos,zposcoordinates
[out]local?

Definition at line 335 of file gs2.c.

◆ GS_global_exag()

float GS_global_exag ( void  )

Get global z-exag value.

Returns
value

Definition at line 1999 of file gs2.c.

References G_debug(), and geoview::vert_exag.

Referenced by gpd_obj(), gsd_wire_arrows(), and Nviz_update_ranges().

◆ GS_has_transparency()

int GS_has_transparency ( void  )

Check for transparency.

Disabled.

Returns
1

Definition at line 3480 of file gs2.c.

◆ GS_init_rotation()

void GS_init_rotation ( void  )

Reset scene rotation.

Definition at line 2909 of file gs2.c.

References georot::do_rot, georot::rot_angle, georot::rot_axes, geoview::rotate, and georot::rotMatrix.

Referenced by Nviz_init_rotation().

◆ GS_init_view()

void GS_init_view ( void  )

Init viewpoint.

Todo:
allow setting center?

Definition at line 3347 of file gs2.c.

◆ GS_is_masked()

int GS_is_masked ( int  id,
float *  pt 
)

Check if point is masked ?

Parameters
idsurface id
ptpoint
Returns
1 masked
0 not masked
-1 on error, invalid surface id

Definition at line 1015 of file gs2.c.

◆ GS_libinit()

void GS_libinit ( void  )

Initialize OGSF library.

Get region settings - wind

Set Region (NSWE array) and compute scale

Definition at line 97 of file gs2.c.

◆ GS_lights_off()

void GS_lights_off ( void  )

Switch off all lights.

Definition at line 442 of file gs2.c.

◆ GS_lights_on()

void GS_lights_on ( void  )

Switch on all lights.

Definition at line 456 of file gs2.c.

◆ GS_load_3dview()

int GS_load_3dview ( const char *  vname,
int  surfid 
)

Load 3d view.

Parameters
vnameview file name
surfidsurface id
Returns
?

Definition at line 3329 of file gs2.c.

References Gs_load_3dview().

◆ GS_load_att_map()

int GS_load_att_map ( int  id,
const char *  filename,
int  att 
)

Load raster map as attribute.

Parameters
idsurface id
filenamefilename
attattribute descriptor
Returns
-1 on error (invalid surface id)
?

Definition at line 1608 of file gs2.c.

◆ GS_look_here()

int GS_look_here ( int  sx,
int  sy 
)

Send screen coords sx and sy, lib traces through surfaces; sets new center to point of nearest intersection.

If no intersection, uses line of sight with length of current view ray (eye to center) to set new center.

Reset center of view to screen coordinates sx, sy.

Parameters
sx,syscreen coordinates
Returns
1 on success
0 on error (invalid surface id)

Definition at line 3005 of file gs2.c.

References FROM, geoview::from_to, GS_distance(), GS_get_selected_point_on_surface(), gs_get_surf(), GS_set_focus(), GS_v3dir(), GS_v3mult(), gsd_get_los(), g_surf::ox, g_surf::oy, geoview::real_to, TO, x, X, g_surf::x_trans, Y, g_surf::y_trans, Z, and g_surf::z_trans.

Referenced by Nviz_look_here().

◆ GS_moveto()

void GS_moveto ( float *  pt)

Move viewpoint.

Parameters
pt'from' model coordinates

Definition at line 2617 of file gs2.c.

References FROM, geoview::from_to, G_debug(), GS_v3add(), GS_v3eq(), GS_v3normalize(), GS_v3sub(), geoview::infocus, and TO.

Referenced by GS_moveto_real(), and Nviz_set_viewpoint_position().

◆ GS_moveto_real()

void GS_moveto_real ( float *  pt)

Move position to (real)

Parameters
ptpoint real coordinates

Definition at line 2647 of file gs2.c.

References GS_moveto(), and gsd_real2model().

Referenced by Gs_load_3dview().

◆ GS_new_light()

int GS_new_light ( void  )

Add new model light.

Returns
light model id
-1 on error (MAX_LIGHTS exceded)

Definition at line 268 of file gs2.c.

References lightdefs::ambient, lightdefs::color, GS_get_light_reset(), GS_set_light_reset(), gsd_init_lightmodel(), geoview::lights, MAX_LIGHTS, lightdefs::position, lightdefs::shine, W, X, Y, and Z.

◆ GS_new_surface()

int GS_new_surface ( void  )

Add new surface.

Note that origin has 1/2 cell added to represent center of cells because library assumes that east - west = (cols - 1) * ew_res, since left and right columns are on the edges.

Returns
surface id
-1 on error (MAX_SURFS exceded)

Definition at line 224 of file gs2.c.

References G_debug().

◆ GS_num_surfs()

int GS_num_surfs ( void  )

Get number of surfaces.

Returns
number of surfaces

Definition at line 1524 of file gs2.c.

References gs_num_surfaces().

◆ GS_ready_draw()

void GS_ready_draw ( void  )

◆ GS_save_3dview()

int GS_save_3dview ( const char *  vname,
int  surfid 
)

Save 3d view.

Parameters
vnameview file name
surfidsurface id
Returns
?

Definition at line 3316 of file gs2.c.

References Gs_save_3dview().

◆ GS_set_att_const()

int GS_set_att_const ( int  id,
int  att,
float  constant 
)

Set attribute constant.

Parameters
idsurface id
attattribute id
constantvalue
Returns
?

Definition at line 1412 of file gs2.c.

References gs_get_surf(), gs_set_att_const(), and Gs_update_attrange().

◆ GS_set_att_defaults()

void GS_set_att_defaults ( float *  defs,
float *  null_defs 
)

Set default attributes for map objects.

Parameters
defsattributes array (dim MAX_ATTS)
null_defsnull attributes array (dim MAX_ATTS)

Definition at line 172 of file gs2.c.

References G_debug(), and MAX_ATTS.

Referenced by Nviz_set_surface_attr_default().

◆ GS_Set_ClientData()

int GS_Set_ClientData ( int  id,
void *  clientd 
)

Set client data.

Parameters
idsurface id
clientdpointer to client data struct
Returns
1 on success
-1 on error (invalid surface id)

Definition at line 1485 of file gs2.c.

References g_surf::clientdata, and gs_get_surf().

◆ GS_set_cplane()

void GS_set_cplane ( int  num)

Set cplace.

Parameters
numcplane id

Definition at line 3215 of file gs2.c.

References gsd_cplane_on().

◆ GS_set_cplane_rot()

void GS_set_cplane_rot ( int  num,
float  dx,
float  dy,
float  dz 
)

Set cplace rotation.

Parameters
numcplace id
dx,dy,dzrotation values

Definition at line 3122 of file gs2.c.

References gsd_cplane_setrot().

Referenced by Nviz_set_cplane_rotation().

◆ GS_set_cplane_trans()

void GS_set_cplane_trans ( int  num,
float  dx,
float  dy,
float  dz 
)

Set cplace trans.

Parameters
numcplace id
dx,dy,dzrotation values

Definition at line 3135 of file gs2.c.

References gsd_cplane_settrans().

Referenced by Nviz_set_cplane_translation().

◆ GS_set_draw()

◆ GS_set_drawmode()

int GS_set_drawmode ( int  id,
int  mode 
)

Set draw mode.

Parameters
idsurface id
modemode type(s)
Returns
0 on success
-1 on error (invalid surface id)

Definition at line 2083 of file gs2.c.

◆ GS_set_drawres()

int GS_set_drawres ( int  id,
int  xres,
int  yres,
int  xwire,
int  ywire 
)

Set draw resolution for surface.

Parameters
idsurface id
xres,yresx/y resolution value
xwire,ywirex/y wire value
Returns
-1 on error
0 on success

Definition at line 2221 of file gs2.c.

References G_debug(), gs_get_surf(), g_surf::norm_needupdate, g_surf::x_mod, g_surf::x_modw, g_surf::y_mod, and g_surf::y_modw.

◆ GS_set_exag()

void GS_set_exag ( int  id,
float  exag 
)

Set Z exag for surface.

Parameters
idsurface id
exagz-exag value

Definition at line 1953 of file gs2.c.

References G_debug(), gs_get_surf(), g_surf::norm_needupdate, and g_surf::z_exag.

◆ GS_set_fencecolor()

void GS_set_fencecolor ( int  mode)

Set fence color.

Parameters
modemode id

Definition at line 3256 of file gs2.c.

◆ GS_set_focus()

void GS_set_focus ( float *  realto)

Set focus.

Parameters
realtoreal coordinates to

Definition at line 2520 of file gs2.c.

References G_debug(), GS_v3eq(), gsd_set_view(), geoview::infocus, and geoview::real_to.

Referenced by Gs_load_3dview(), GS_look_here(), GS_set_focus_center_map(), and GVL_set_focus_center_map().

◆ GS_set_focus_center_map()

void GS_set_focus_center_map ( int  id)

Set focus to map center.

Parameters
idsurface id

Definition at line 2582 of file gs2.c.

References G_debug(), gs_get_surf(), GS_set_focus(), X, g_surf::xmax, g_surf::xmin, Y, g_surf::ymax, g_surf::ymin, Z, g_surf::zmax_nz, and g_surf::zmin_nz.

◆ GS_set_focus_real()

void GS_set_focus_real ( float *  realto)

Set real focus.

Parameters
realtoreal coordinates to

Definition at line 2538 of file gs2.c.

References G_get_set_window().

◆ GS_set_fov()

void GS_set_fov ( int  fov)

Set field of view.

Parameters
fovfov value

Definition at line 2843 of file gs2.c.

References geoview::fov.

Referenced by Gs_load_3dview(), and Nviz_set_viewpoint_persp().

◆ GS_set_global_exag()

void GS_set_global_exag ( float  exag)

Set global z-exag value.

Parameters
exagexag value to be set up

Definition at line 1977 of file gs2.c.

References G_debug(), and geoview::vert_exag.

Referenced by Gs_load_3dview().

◆ GS_set_infocus()

void GS_set_infocus ( void  )

Set focus.

Make sure that the center of view is set

Definition at line 2967 of file gs2.c.

References G_debug(), and geoview::infocus.

Referenced by Nviz_set_focus_state().

◆ GS_set_light_reset()

void GS_set_light_reset ( int  i)

Definition at line 252 of file gs2.c.

Referenced by GS_new_light().

◆ GS_set_maskmode()

int GS_set_maskmode ( int  id,
int  mode 
)

Set mask mode.

Mask attribute special: constant is set to indicate invert or no

Parameters
idsurface id
modeid
Returns
mode id
-1 on error (invalid surface id)

Definition at line 1436 of file gs2.c.

◆ GS_set_Narrow()

void GS_set_Narrow ( int *  pt,
int  id,
float *  pos2 
)

Set decoration, north arrow ??

Todo:
scale used to calculate len of arrow still needs work needs go function that returns center / eye distance gsd_get_los function is not working correctly ??
Parameters
ptpoint value in true world coordinates (?)
idsurface id
[out]pos2output coordinates

Definition at line 568 of file gs2.c.

References GS_get_selected_point_on_surface(), gs_get_surf(), gsd_do_scale(), gsd_pushmatrix(), g_surf::ox, g_surf::oy, x, X, g_surf::x_trans, Y, g_surf::y_trans, Z, g_surf::z_trans, and g_surf::zmax.

◆ GS_set_nofocus()

void GS_set_nofocus ( void  )

Unset focus.

Definition at line 2953 of file gs2.c.

References G_debug(), and geoview::infocus.

Referenced by Nviz_set_focus_state().

◆ GS_set_nozero()

void GS_set_nozero ( int  id,
int  att,
int  mode 
)

Set no-zero ?

Parameters
idsurface id
attattribute id
modemode id

Definition at line 2131 of file gs2.c.

◆ GS_set_rotation()

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

Set rotation params.

Definition at line 2887 of file gs2.c.

References georot::do_rot, georot::rot_angle, georot::rot_axes, geoview::rotate, and x.

Referenced by Nviz_set_rotation().

◆ GS_set_rotation_matrix()

void GS_set_rotation_matrix ( double *  matrix)

Set rotation matrix.

Definition at line 2941 of file gs2.c.

References geoview::rotate, and georot::rotMatrix.

◆ GS_set_SDscale()

int GS_set_SDscale ( float  scale)

Set ?

Parameters
scalescale value
Returns
1

Definition at line 1070 of file gs2.c.

◆ GS_set_SDsurf()

int GS_set_SDsurf ( int  id)

Set surface as Scaled Difference surface.

Parameters
idsurface id
Returns
1 on success
0 on error, invalid surface id

Definition at line 1049 of file gs2.c.

References gs_get_surf(), and gsdiff_set_SDref().

◆ GS_set_trans()

void GS_set_trans ( int  id,
float  xtrans,
float  ytrans,
float  ztrans 
)

Set translation (surface position)

Parameters
idsurface id
xtrans,ytrans,ztranstranslation values

Definition at line 2391 of file gs2.c.

References G_debug(), gs_get_surf(), g_surf::x_trans, g_surf::y_trans, and g_surf::z_trans.

◆ GS_set_twist()

void GS_set_twist ( int  t)

Set viewpoint twist value.

10ths of degrees off twelve o'clock

Parameters
ttenths of degrees clockwise from 12:00.

Definition at line 2877 of file gs2.c.

References t, and geoview::twist.

Referenced by Gs_load_3dview(), and Nviz_set_viewpoint_twist().

◆ GS_set_viewdir()

void GS_set_viewdir ( float *  dir)

Set viewdir.

Automatically turns off focus

Parameters
dirviewdir value

Definition at line 2823 of file gs2.c.

◆ GS_set_viewport()

void GS_set_viewport ( int  left,
int  right,
int  bottom,
int  top 
)

Set viewport.

Parameters
left,right,bottom,topviewport extent values

Definition at line 2981 of file gs2.c.

References G_debug(), and gsd_viewport().

◆ GS_set_wire_color()

void GS_set_wire_color ( int  id,
int  colr 
)

Set wire color.

Todo:
error-handling
Parameters
idsurface id
colrcolor value

Definition at line 2014 of file gs2.c.

References G_debug(), gs_get_surf(), and g_surf::wire_color.

◆ GS_setall_drawmode()

int GS_setall_drawmode ( int  mode)

Set all draw-modes.

Parameters
modemode id
Returns
0 on success
-1 on error

Definition at line 2061 of file gs2.c.

Referenced by Gs_load_3dview().

◆ GS_setall_drawres()

int GS_setall_drawres ( int  xres,
int  yres,
int  xwire,
int  ywire 
)

Set all draw resolutions.

Parameters
xres,yresx/y resolution value
xwire,ywirex/y wire value
Returns
0 on success
-1 on error

Definition at line 2198 of file gs2.c.

Referenced by Gs_load_3dview().

◆ GS_setlight_ambient()

void GS_setlight_ambient ( int  num,
float  red,
float  green,
float  blue 
)

Set light ambient.

Red, green, blue from 0.0 to 1.0

Parameters
numlight id (starts at 1)
red,green,bluecolor values

Definition at line 402 of file gs2.c.

◆ GS_setlight_color()

void GS_setlight_color ( int  num,
float  red,
float  green,
float  blue 
)

Set light color.

Parameters
numlight id (starts at 1)
red,green,bluecolor values (from 0.0 to 1.0)

Definition at line 358 of file gs2.c.

◆ GS_setlight_position()

void GS_setlight_position ( int  num,
float  xpos,
float  ypos,
float  zpos,
int  local 
)

Set light position.

Bug:
I think lights array doesnt match sgi_light array
Parameters
numlight id (starts with 1)
xpos,ypos,zposcoordinates (model)
locallocal coordinate (for viewport)

Definition at line 309 of file gs2.c.

◆ GS_surf_exists()

int GS_surf_exists ( int  id)

Check if surface exists

Parameters
idsurface id
Returns
0 not found
1 found

Definition at line 194 of file gs2.c.

References G_debug(), gs_get_surf(), and NULL.

Referenced by GP_select_surf(), GS_delete_surface(), and GV_select_surf().

◆ GS_switchlight()

void GS_switchlight ( int  num,
int  on 
)

Switch on/off light.

Parameters
numlight id (starts at 1)
onnon-zero for 'on' otherwise 'off'

Definition at line 473 of file gs2.c.

◆ GS_transp_is_set()

int GS_transp_is_set ( void  )

Check if transparency is set.

Returns
0 transparency not set
1 transparency is set

Definition at line 492 of file gs2.c.

References ATT_TRANSP, FC_GREY, gs_att_is_set(), gsd_getfc(), and NULL.

◆ GS_unset_att()

int GS_unset_att ( int  id,
int  att 
)

Unset attribute.

Parameters
idsurface id
attattribute id
Returns
?

Definition at line 1393 of file gs2.c.

References gs_get_surf(), gs_set_att_src(), g_surf::mask_needupdate, and NOTSET_ATT.

◆ GS_unset_cplane()

void GS_unset_cplane ( int  num)

Unset clip place (turn off)

Parameters
numcplane id

Definition at line 3227 of file gs2.c.

References gsd_cplane_off().

◆ GS_unset_rotation()

void GS_unset_rotation ( void  )

Stop scene rotation.

Definition at line 2901 of file gs2.c.

References georot::do_rot, and geoview::rotate.

Referenced by Nviz_unset_rotation().

◆ GS_unset_SDsurf()

void GS_unset_SDsurf ( void  )

Unset Scaled Difference surface.

Definition at line 1033 of file gs2.c.

References gsdiff_set_SDref(), and NULL.

◆ GS_update_curmask()

int GS_update_curmask ( int  id)

Update current mask.

May be called to update total mask for a surface at convenient times instead of waiting until ready to redraw surface

Parameters
idsurface id
Returns
?

Definition at line 997 of file gs2.c.

References gs_get_surf(), and gs_update_curmask().

◆ GS_update_normals()

int GS_update_normals ( int  id)

Update normals.

Parameters
idsurface id
Returns
?

Definition at line 1119 of file gs2.c.

References gs_calc_normals(), and gs_get_surf().

◆ GS_zoom_setup()

void GS_zoom_setup ( int *  a,
int *  b,
int *  c,
int *  d,
int *  maxx,
int *  maxy 
)

Get zoom setup.

Parameters
[out]a,b,c,dcurrent viewport settings
[out]maxx,maxymax viewport size

Definition at line 2772 of file gs2.c.

◆ gsd_getViewport()

int gsd_getViewport ( GLint *  ,
GLint *   
)

◆ void_func()

void void_func ( void  )

Definition at line 85 of file gs2.c.