GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-535c39c9fc
defs/ogsf.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int GK_set_interpmode (int)
 Set interpolation mode. More...
 
void GK_set_tension (float)
 Set value for tension when interpmode is KF_SPLINE. More...
 
void GK_showtension_start (void)
 
void GK_showtension_stop (void)
 Show tension stop ? More...
 
void GK_update_tension (void)
 Update tension. More...
 
void GK_update_frames (void)
 Recalculate path using the current number of frames requested. More...
 
void GK_set_numsteps (int)
 Set the number of frames to be interpolated from keyframes. More...
 
void GK_clear_keys (void)
 Deletes all keyframes, resets field masks. More...
 
void GK_print_keys (const char *)
 Print keyframe info. More...
 
int GK_move_key (float, float, float)
 Move keyframe. More...
 
int GK_delete_key (float, float, int)
 
int GK_add_key (float, unsigned long, int, float)
 Add keyframe. More...
 
void GK_do_framestep (int, int)
 Moves the animation to frame number "step". More...
 
void GK_show_path (int)
 Draw the current path. More...
 
void GK_show_vect (int)
 Show vector sets. More...
 
void GK_show_site (int)
 Show point sets. More...
 
void GK_show_vol (int)
 Show volumes. More...
 
void GK_show_list (int)
 Show list. More...
 
int GP_site_exists (int)
 Check if point set exists. More...
 
int GP_new_site (void)
 Create new point set. More...
 
int GP_num_sites (void)
 Get number of loaded point sets. More...
 
int * GP_get_site_list (int *)
 Get list of point sets. More...
 
int GP_delete_site (int)
 Delete registrated point set. More...
 
int GP_load_site (int, const char *)
 Load point set from file. More...
 
int GP_get_sitename (int, char **)
 Get point set filename. More...
 
int GP_get_style (int, int *, int *, float *, int *)
 Get point set style. More...
 
int GP_set_style (int, int, int, float, int)
 Set point style. More...
 
int GP_set_style_thematic (int, int, const char *, const char *, const char *, const char *, struct Colors *)
 Set point set style for thematic mapping. More...
 
int GP_unset_style_thematic (int)
 Make style for thematic mapping inactive. More...
 
int GP_attmode_color (int, const char *)
 
int GP_attmode_none (int)
 
int GP_set_zmode (int, int)
 Set z mode for point set. More...
 
int GP_get_zmode (int, int *)
 Get z-mode. More...
 
void GP_set_trans (int, float, float, float)
 Set transformation params. More...
 
void GP_get_trans (int, float *, float *, float *)
 Get transformation params. More...
 
int GP_select_surf (int, int)
 Select surface for given point set. More...
 
int GP_unselect_surf (int, int)
 Unselect surface. More...
 
int GP_surf_is_selected (int, int)
 Check if surface is selected. More...
 
void GP_draw_site (int)
 Draw point set. More...
 
void GP_alldraw_site (void)
 Draw all available point sets. More...
 
int GP_Set_ClientData (int, void *)
 Set client data. More...
 
void * GP_Get_ClientData (int)
 Get client data. More...
 
int GP_str_to_marker (const char *)
 Determine point marker symbol for string. More...
 
void void_func (void)
 
void GS_libinit (void)
 Initialize OGSF library. More...
 
int GS_get_longdim (float *)
 Get largest dimension. More...
 
int GS_get_region (float *, float *, float *, float *)
 Get 2D region extent. More...
 
void GS_set_att_defaults (float *, float *)
 Set default attributes for map objects. More...
 
int GS_surf_exists (int)
 
int GS_new_surface (void)
 Add new surface. More...
 
int GS_new_light (void)
 Add new model light. More...
 
void GS_set_light_reset (int)
 
int GS_get_light_reset (void)
 
void GS_setlight_position (int, float, float, float, int)
 Set light position. More...
 
void GS_setlight_color (int, float, float, float)
 Set light color. More...
 
void GS_setlight_ambient (int, float, float, float)
 Set 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, int)
 Switch on/off light. More...
 
int GS_transp_is_set (void)
 Check if transparency is set. More...
 
void GS_get_modelposition1 (float *)
 
void GS_get_modelposition (float *, float *)
 Retrieves coordinates for lighting model position, at center of view. More...
 
void GS_draw_X (int, float *)
 Draw place marker. More...
 
void GS_set_Narrow (int *, int, float *)
 Set decoration, north arrow ?? More...
 
void GS_draw_line_onsurf (int, float, float, float, float)
 Draw line on surface. More...
 
int GS_draw_nline_onsurf (int, float, float, float, float, float *, int)
 Draw multiline on surface. More...
 
void GS_draw_flowline_at_xy (int, float, float)
 Draw flow-line on surace. 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)
 Update current mask. More...
 
int GS_is_masked (int, float *)
 Check if point is masked ? More...
 
void GS_unset_SDsurf (void)
 Unset Scaled Difference surface. More...
 
int GS_set_SDsurf (int)
 Set surface as Scaled Difference surface. More...
 
int GS_set_SDscale (float)
 Set ? More...
 
int GS_get_SDsurf (int *)
 Get ? More...
 
int GS_get_SDscale (float *)
 Get ? More...
 
int GS_update_normals (int)
 Update normals. More...
 
int GS_get_att (int, int, int *, float *, char *)
 Get attributes. More...
 
int GS_get_cat_at_xy (int, int, char *, float, float)
 Get surface category on given position. More...
 
int GS_get_norm_at_xy (int, float, float, float *)
 Get surface normal at x,y (real coordinates) More...
 
int GS_get_val_at_xy (int, int, char *, float, float)
 Get RGB color at given point. More...
 
int GS_unset_att (int, int)
 Unset attribute. More...
 
int GS_set_att_const (int, int, float)
 Set attribute constant. More...
 
int GS_set_maskmode (int, int)
 Set mask mode. More...
 
int GS_get_maskmode (int, int *)
 Get mask mode. More...
 
int GS_Set_ClientData (int, void *)
 Set client data. More...
 
void * GS_Get_ClientData (int)
 Get client data. More...
 
int GS_num_surfs (void)
 Get number of surfaces. More...
 
int * GS_get_surf_list (int *)
 Get surface list. More...
 
int GS_delete_surface (int)
 Delete surface. More...
 
int GS_load_att_map (int, const char *, int)
 Load raster map as attribute. More...
 
void GS_draw_surf (int)
 Draw surface. More...
 
void GS_draw_wire (int)
 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, float)
 Set Z exag for surface. More...
 
void GS_set_global_exag (float)
 Set global z-exag value. More...
 
float GS_global_exag (void)
 Get global z-exag value. More...
 
void GS_set_wire_color (int, int)
 Set wire color. More...
 
int GS_get_wire_color (int, int *)
 Get wire color. More...
 
int GS_setall_drawmode (int)
 Set all draw-modes. More...
 
int GS_set_drawmode (int, int)
 Set draw mode. More...
 
int GS_get_drawmode (int, int *)
 Get draw mode. More...
 
void GS_set_nozero (int, int, int)
 Set no-zero ? More...
 
int GS_get_nozero (int, int, int *)
 Get no-zero ? More...
 
int GS_setall_drawres (int, int, int, int)
 Set all draw resolutions. More...
 
int GS_set_drawres (int, int, int, int, int)
 Set draw resolution for surface. More...
 
void GS_get_drawres (int, int *, int *, int *, int *)
 Get draw resolution of surface. More...
 
void GS_get_dims (int, int *, int *)
 Get dimension of surface. More...
 
int GS_get_exag_guess (int, float *)
 Get exag-value guess. More...
 
void GS_get_zrange_nz (float *, float *)
 Get Z extents for all loaded surfaces. More...
 
void GS_set_trans (int, float, float, float)
 Set translation (surface position) More...
 
void GS_get_trans (int, float *, float *, float *)
 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)
 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 *)
 Set focus. More...
 
int GS_get_focus (float *)
 Get focus. More...
 
void GS_set_focus_center_map (int)
 Set focus to map center. More...
 
void GS_moveto (float *)
 Move viewpoint. More...
 
void GS_moveto_real (float *)
 Move position to (real) More...
 
void GS_set_focus_real (float *)
 Set real focus. More...
 
void GS_get_to_real (float *)
 Get 'to' real coordinates. More...
 
int GS_get_zextents (int, float *, float *, float *)
 Get z-extent for a single surface. More...
 
int GS_get_zrange (float *, float *, int)
 Get z-extent for all loaded surfaces. More...
 
void GS_get_from (float *)
 Get viewpoint 'from' position. More...
 
void GS_get_from_real (float *)
 Get viewpoint 'from' real coordinates. More...
 
void GS_get_to (float *)
 Get 'to' model coordinates. More...
 
void GS_get_viewdir (float *)
 Get viewdir. More...
 
void GS_set_viewdir (float *)
 Set viewdir. More...
 
void GS_set_fov (int)
 Set field of view. More...
 
void GS_set_rotation (double, double, double, double)
 Set rotation params. More...
 
void GS_get_rotation_matrix (double *)
 Get rotation matrix. More...
 
void GS_set_rotation_matrix (double *)
 Set rotation matrix. More...
 
void GS_init_rotation (void)
 Reset scene rotation. More...
 
void GS_unset_rotation (void)
 Stop scene rotation. More...
 
int GS_get_fov (void)
 Get field of view. More...
 
int GS_get_twist (void)
 Get twist value. More...
 
void GS_set_twist (int)
 Set viewpoint twist value. More...
 
void GS_set_nofocus (void)
 Unset focus. More...
 
void GS_set_infocus (void)
 Set focus. More...
 
void GS_set_viewport (int, int, int, int)
 Set viewport. More...
 
int GS_look_here (int, int)
 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, int, int *, float *, float *, float *)
 Get selected point of surface. More...
 
void GS_set_cplane_rot (int, float, float, float)
 Set cplace rotation. More...
 
void GS_set_cplane_trans (int, float, float, float)
 Set cplace trans. More...
 
void GS_draw_cplane (int)
 Draw cplace. More...
 
int GS_draw_cplane_fence (int, int, int)
 Draw cplace fence ? More...
 
void GS_alldraw_cplane_fences (void)
 Draw all cplace fences ? More...
 
void GS_set_cplane (int)
 Set cplace. More...
 
void GS_unset_cplane (int)
 Unset clip place (turn off) More...
 
void GS_get_scale (float *, float *, float *, int)
 Get axis scale. More...
 
void GS_set_fencecolor (int)
 Set fence color. More...
 
int GS_get_fencecolor (void)
 Get fence color. More...
 
int GS_get_distance_alongsurf (int, float, float, float, float, float *, int)
 Measure distance "as the ball rolls" between two points on surface. More...
 
int GS_save_3dview (const char *, int)
 Save 3d view. More...
 
int GS_load_3dview (const char *, int)
 Load 3d view. More...
 
void GS_init_view (void)
 Init viewpoint. More...
 
void GS_clear (int)
 Clear view. More...
 
double GS_get_aspect (void)
 Get aspect value. More...
 
int GS_has_transparency (void)
 Check for transparency. More...
 
void GS_zoom_setup (int *, int *, int *, int *, int *, int *)
 Get zoom setup. More...
 
int GS_write_zoom (const char *, unsigned int, unsigned int)
 Write zoom to file. More...
 
void GS_draw_all_list (void)
 Draw all glLists. More...
 
void GS_delete_list (GLuint)
 Delete pre-defined list. More...
 
int GS_draw_legend (const char *, GLuint, int, int *, float *, int *)
 Draw legend. More...
 
void GS_draw_fringe (int, unsigned long, float, int *)
 Draw fringe around data (surface) at selected corners. More...
 
void GS_getlight_position (int, float *, float *, float *, int *)
 Get light position. More...
 
void GS_getlight_color (int, float *, float *, float *)
 Get light color. More...
 
void GS_getlight_ambient (int, float *, float *, float *)
 Get light ambient. More...
 
int GS_check_cancel (void)
 Check for cancel. More...
 
void GS_set_cancel (int)
 Set cancel. More...
 
void GS_set_cxl_func (void(*)(void))
 Set cxl function. More...
 
double GS_geodistance (double *, double *, const char *)
 Calculate distance between 2 coordinates. More...
 
float GS_distance (float *, float *)
 Calculate distance. More...
 
float GS_P2distance (float *, float *)
 Calculate distance in plane. More...
 
void GS_v3eq (float *, float *)
 Copy vector values. More...
 
void GS_v3add (float *, float *)
 Sum vectors. More...
 
void GS_v3sub (float *, float *)
 Subtract vectors. More...
 
void GS_v3mult (float *, float)
 Multiple vectors. More...
 
int GS_v3norm (float *)
 Change v1 so that it is a unit vector (2D) More...
 
int GS_v2norm (float *)
 Change v1 so that it is a unit vector (3D) More...
 
int GS_dv3norm (double *)
 Changes v1 so that it is a unit vector. More...
 
int GS_v3normalize (float *, float *)
 Change v2 so that v1v2 is a unit vector. More...
 
int GS_v3dir (float *, float *, float *)
 Get a normalized direction from v1 to v2, store in v3. More...
 
void GS_v2dir (float *, float *, float *)
 Get a normalized direction from v1 to v2, store in v3 (2D) More...
 
void GS_v3cross (float *, float *, float *)
 Get the cross product v3 = v1 cross v2. More...
 
void GS_v3mag (float *, float *)
 Magnitude of vector. More...
 
int GS_coordpair_repeats (float *, float *, int)
 ADD. More...
 
int GV_vect_exists (int)
 Check if vector set exists. More...
 
int GV_new_vector (void)
 Register new vector set. More...
 
int GV_num_vects (void)
 Get number of available vector sets. More...
 
int * GV_get_vect_list (int *)
 Get list of vector sets. More...
 
int GV_delete_vector (int)
 Delete vector set from list. More...
 
int GV_load_vector (int, const char *)
 Load vector set. More...
 
int GV_get_vectname (int, char **)
 Get vector map name. More...
 
int GV_set_style (int, int, int, int, int)
 Set vector style. More...
 
int GV_get_style (int, int *, int *, int *, int *)
 Get vector style. More...
 
int GV_set_style_thematic (int, int, const char *, const char *, struct Colors *)
 Set vector set style for thematic mapping. More...
 
int GV_unset_style_thematic (int)
 Make style for thematic mapping inactive. More...
 
void GV_set_trans (int, float, float, float)
 Set trans ? More...
 
int GV_get_trans (int, float *, float *, float *)
 Get trans ? More...
 
int GV_select_surf (int, int)
 Select surface identified by hs to have vector identified by hv draped over it. More...
 
int GV_unselect_surf (int, int)
 Unselect surface. More...
 
int GV_surf_is_selected (int, int)
 Check if surface is selected. More...
 
void GV_draw_vect (int)
 Draw vector set. More...
 
void GV_alldraw_vect (void)
 Draw all loaded vector sets. More...
 
void GV_alldraw_fastvect (void)
 Draw all loaded vector sets (fast mode) More...
 
void GV_draw_fastvect (int)
 Draw vector set (fast mode) More...
 
int GV_Set_ClientData (int, void *)
 Set client data. More...
 
void * GV_Get_ClientData (int)
 Get client data. More...
 
void GVL_libinit (void)
 Library initialization for volumes. More...
 
void GVL_init_region (void)
 Initialize 3D region. More...
 
int GVL_get_region (float *, float *, float *, float *, float *, float *)
 Get region extent settings. More...
 
void * GVL_get_window (void)
 Get window. More...
 
int GVL_vol_exists (int)
 Check if volume set exists. More...
 
int GVL_new_vol (void)
 Create new volume set. More...
 
int GVL_num_vols (void)
 Get number of loaded volume sets. More...
 
int * GVL_get_vol_list (int *)
 Get list of loaded volume sets. More...
 
int GVL_delete_vol (int)
 Delete volume set from list. More...
 
int GVL_load_vol (int, const char *)
 Load 3d raster map to volume set. More...
 
int GVL_get_volname (int, char *)
 Get volume set name. More...
 
void GVL_set_trans (int, float, float, float)
 Set trans ? More...
 
int GVL_get_trans (int, float *, float *, float *)
 Get trans ? More...
 
void GVL_set_draw_wire (int, int)
 Set drawing wire box. More...
 
void GVL_draw_vol (int)
 Draw volume set. More...
 
void GVL_draw_wire (int)
 Draw volume in wire mode. More...
 
void GVL_alldraw_vol (void)
 Draw all volume sets. More...
 
void GVL_alldraw_wire (void)
 Draw all volume sets in wire mode. More...
 
int GVL_Set_ClientData (int, void *)
 Set client data for volume set. More...
 
void * GVL_Get_ClientData (int)
 Get client data. More...
 
void GVL_get_dims (int, int *, int *, int *)
 Get volume dimensions. More...
 
void GVL_set_focus_center_map (int)
 Set focus on map center. More...
 
int GVL_isosurf_move_up (int, int)
 Move up isosurface in list. More...
 
int GVL_isosurf_move_down (int, int)
 Move down isosurface in list. More...
 
void GVL_isosurf_get_drawres (int, int *, int *, int *)
 Get draw resolution for isosurface. More...
 
int GVL_isosurf_set_drawres (int, int, int, int)
 Set isosurface draw resolution. More...
 
int GVL_isosurf_get_drawmode (int, int *)
 Get isosurface draw mode. More...
 
int GVL_isosurf_set_drawmode (int, int)
 Set isosurface draw mode. More...
 
int GVL_isosurf_add (int)
 Add isosurface. More...
 
int GVL_isosurf_del (int, int)
 Delete isosurface. More...
 
int GVL_isosurf_get_att (int, int, int, int *, float *, char *)
 Get isosurface attributes. More...
 
int GVL_isosurf_unset_att (int, int, int)
 Unset isosurface attributes. More...
 
int GVL_isosurf_set_att_const (int, int, int, float)
 Set constant isosurface attribute. More...
 
int GVL_isosurf_set_att_map (int, int, int, const char *)
 Set isosurface map attribute. More...
 
int GVL_isosurf_get_flags (int, int, int *)
 Get isosurface flags. More...
 
int GVL_isosurf_set_flags (int, int, int)
 Set isosurface flags. More...
 
int GVL_isosurf_num_isosurfs (int)
 Get number of available isosurfaces. More...
 
int GVL_isosurf_set_maskmode (int, int, int)
 Set mask attribute mode. More...
 
int GVL_isosurf_get_maskmode (int, int, int *)
 Get isosurface mask mode. More...
 
int GVL_slice_move_up (int, int)
 Move up slice. More...
 
int GVL_slice_move_down (int, int)
 Move down slice. More...
 
void GVL_slice_get_drawres (int, int *, int *, int *)
 Get draw resolution of slice. More...
 
int GVL_slice_get_transp (int, int, int *)
 Get slice trans ? More...
 
int GVL_slice_set_transp (int, int, int)
 Set slice trans ? More...
 
int GVL_slice_set_drawres (int, int, int, int)
 Set slice draw resolution. More...
 
int GVL_slice_get_drawmode (int, int *)
 Get slice draw mode. More...
 
int GVL_slice_set_drawmode (int, int)
 Set slice draw mode. More...
 
int GVL_slice_add (int)
 Add slice. More...
 
int GVL_slice_del (int, int)
 Delete slice. More...
 
int GVL_slice_num_slices (int)
 Get number or slices. More...
 
int GVL_slice_get_pos (int, int, float *, float *, float *, float *, float *, float *, int *)
 Get slice position. More...
 
int GVL_slice_set_pos (int, int, float, float, float, float, float, float, int)
 Get slice position. More...
 
int Gp_set_color (const char *, geopoint *)
 
geopointGp_load_sites (const char *, int *, int *)
 Load to points to memory. More...
 
int Gp_load_sites_thematic (geosite *, struct Colors *)
 Load styles for geopoints based on thematic mapping. More...
 
double Gs_distance (double *, double *)
 Calculates distance in METERS between two points in current projection (2D) More...
 
int Gs_loadmap_as_float (struct Cell_head *, const char *, float *, struct BM *, int *)
 Load raster map as floating point map. More...
 
int Gs_loadmap_as_int (struct Cell_head *, const char *, int *, struct BM *, int *)
 Load raster map as integer map. More...
 
int Gs_numtype (const char *, int *)
 Get map data type. More...
 
int Gs_loadmap_as_short (struct Cell_head *, const char *, short *, struct BM *, int *)
 Load raster map as integer map. More...
 
int Gs_loadmap_as_char (struct Cell_head *, const char *, unsigned char *, struct BM *, int *)
 Load raster map as integer map. More...
 
int Gs_loadmap_as_bitmap (struct Cell_head *, const char *, struct BM *)
 Load raster map as integer map. More...
 
int Gs_build_256lookup (const char *, int *)
 Build color table (256) More...
 
void Gs_pack_colors (const char *, int *, int, int)
 Pack color table. More...
 
void Gs_pack_colors_float (const char *, float *, int *, int, int)
 Pack color table (floating-point map) More...
 
int Gs_get_cat_label (const char *, int, int, char *)
 Get categories/labels. More...
 
int Gs_save_3dview (const char *, geoview *, geodisplay *, struct Cell_head *, geosurf *)
 
int Gs_load_3dview (const char *, geoview *, geodisplay *, struct Cell_head *, const geosurf *)
 
int Gs_update_attrange (geosurf *, int)
 Update no_zero ranges for attribute (actually no_null now) More...
 
geolineGv_load_vect (const char *, int *)
 Load vector map to memory. More...
 
int Gv_load_vect_thematic (geovect *, struct Colors *)
 Load styles for geolines based on thematic mapping. More...
 
void sub_Vectmem (int)
 Tracking memory. More...
 
Keylistgk_copy_key (Keylist *)
 Copy keyframes. More...
 
unsigned long gk_get_mask_sofar (float, Keylist *)
 Get mask value. More...
 
int gk_viable_keys_for_mask (unsigned long, Keylist *, Keylist **)
 ADD. More...
 
void gk_follow_frames (Viewnode *, int, Keylist *, int, int, int, unsigned long)
 Checks key masks. More...
 
void gk_free_key (Keylist *)
 Free keyframe list. More...
 
Viewnodegk_make_framesfromkeys (Keylist *, int, int, int, float)
 Generate viewnode from keyframes. More...
 
double get_key_neighbors (int, double, double, int, Keylist **, Keylist **, Keylist **, Keylist **, Keylist **, double *, double *)
 
double lin_interp (float, float, float)
 Linear interpolation. More...
 
double get_2key_neighbors (int, float, float, int, Keylist **, Keylist **, Keylist **)
 
Viewnodegk_make_linear_framesfromkeys (Keylist *, int, int, int)
 Generate viewnode from keyframe list (linear interpolation) More...
 
void correct_twist (Keylist *)
 Correct twist value. More...
 
int gk_draw_path (Viewnode *, int, Keylist *)
 Draw path. More...
 
geositegp_get_site (int)
 Get geosite struct. More...
 
geositegp_get_prev_site (int)
 Get previous geosite struct from list. More...
 
int gp_num_sites (void)
 Get number of loaded point sets. More...
 
geositegp_get_last_site (void)
 Get last point set. More...
 
geositegp_get_new_site (void)
 Create new geosite instance and add it to list. More...
 
void gp_update_drapesurfs (void)
 Update drape surfaces. More...
 
int gp_set_defaults (geosite *)
 Set default value for geosite struct. More...
 
void print_site_fields (geosite *)
 
int gp_init_site (geosite *)
 Initialize geosite struct. More...
 
void gp_delete_site (int)
 Delete point set and remove from list. More...
 
int gp_free_site (geosite *)
 Free allocated geosite struct. More...
 
void gp_free_sitemem (geosite *)
 Free geosite (lower level) More...
 
void gp_set_drapesurfs (geosite *, int *, int)
 
int gs_point_in_region (geosurf *, float *, float *)
 Check if point is in region. More...
 
void gpd_obj (geosurf *, gvstyle *, Point3)
 Draw point representing object. More...
 
int gpd_2dsite (geosite *, geosurf *, int)
 
int gpd_3dsite (geosite *, float, float, int)
 
void gs_err (const char *)
 
void gs_init (void)
 Initialize library. More...
 
geosurfgs_get_surf (int)
 Get geosurf struct. More...
 
geosurfgs_get_prev_surface (int)
 Get previous geosurf struct. More...
 
int gs_getall_surfaces (geosurf **)
 Get array of geosurf structs. More...
 
int gs_num_surfaces (void)
 Get number of surfaces. More...
 
int gs_att_is_set (geosurf *, IFLAG)
 Check if attribute is set. More...
 
geosurfgs_get_last_surface (void)
 Get last allocated geosurf struct from list. More...
 
geosurfgs_get_new_surface (void)
 Allocate new geosurf struct. More...
 
int gs_init_surf (geosurf *, double, double, int, int, double, double)
 Initialize allocated geosurf struct. More...
 
int gs_init_normbuff (geosurf *)
 Init geosurf normbuff. More...
 
void print_frto (float(*)[4])
 Debugging, print 'from/to' model coordinates to stderr. More...
 
void print_realto (float *)
 Debugging, print 'to' real coordinates to stderr. More...
 
void print_256lookup (int *)
 Debugging, 256 integer values from buffer. More...
 
void print_surf_fields (geosurf *)
 Debugging, print geosurf fields to stderr. More...
 
void print_view_fields (geoview *)
 Debugging, print geoview fields to stderr. More...
 
void gs_set_defaults (geosurf *, float *, float *)
 Set default attribute values. More...
 
void gs_delete_surf (int)
 Remove geosurf struct from list. More...
 
int gs_free_surf (geosurf *)
 Free geosurf struct. More...
 
void gs_free_unshared_buffs (geosurf *)
 Free unshared buffers of geosurf struct. More...
 
int gs_num_datah_reused (int)
 Get number of reused values. More...
 
int gs_get_att_type (geosurf *, int)
 Get attribute type. More...
 
int gs_get_att_src (geosurf *, int)
 Get attribute source. More...
 
typbuffgs_get_att_typbuff (geosurf *, int, int)
 Get attribute data buffer. More...
 
size_t gs_malloc_att_buff (geosurf *, int, int)
 Allocate attribute buffer. More...
 
int gs_malloc_lookup (geosurf *, int)
 Allocate attribute lookup. More...
 
int gs_set_att_type (geosurf *, int, int)
 Set attribute type. More...
 
int gs_set_att_src (geosurf *, int, int)
 Set attribute source. More...
 
int gs_set_att_const (geosurf *, int, float)
 Set attribute constant value. More...
 
void gs_set_maskmode (int)
 Set geosurf mask mode. More...
 
int gs_mask_defined (geosurf *)
 Check if mask is defined. More...
 
int gs_masked (typbuff *, int, int, int)
 Should only be called when setting up the current mask (gs_bm.c) More...
 
int gs_mapcolor (typbuff *, gsurf_att *, int)
 Call this one when you already know att_src is MAP_ATT. More...
 
int gs_get_zextents (geosurf *, float *, float *, float *)
 Get z-extent values. More...
 
int gs_get_xextents (geosurf *, float *, float *)
 Get x-extent values. More...
 
int gs_get_yextents (geosurf *, float *, float *)
 Get y-extent values. More...
 
int gs_get_zrange0 (float *, float *)
 Get z-range. More...
 
int gs_get_zrange (float *, float *)
 Get z-range. More...
 
int gs_get_xrange (float *, float *)
 Get x-range. More...
 
int gs_get_yrange (float *, float *)
 Get y-range. More...
 
int gs_get_data_avg_zmax (float *)
 Get average z-max value. More...
 
int gs_get_datacenter (float *)
 Get data center point. More...
 
int gs_setall_norm_needupdate (void)
 Set for geosurf need-to-update mark. More...
 
int gs_point_is_masked (geosurf *, float *)
 Check if point is masked. More...
 
int gs_distance_onsurf (geosurf *, float *, float *, float *, int)
 Calculate distance on surface. More...
 
struct BMgsbm_make_mask (typbuff *, float, int, int)
 Do combining of bitmaps, make bitmaps from other data w/maskval. More...
 
void gsbm_zero_mask (struct BM *)
 Zero mask. More...
 
int gsbm_or_masks (struct BM *, struct BM *)
 Mask bitmap (mask type OR) More...
 
int gsbm_ornot_masks (struct BM *, struct BM *)
 Mask bitmap (mask type ORNOT) More...
 
int gsbm_and_masks (struct BM *, struct BM *)
 Mask bitmap (mask type ADD) More...
 
int gsbm_xor_masks (struct BM *, struct BM *)
 Mask bitmap (mask type XOR) More...
 
int gs_update_curmask (geosurf *)
 Update current maps. More...
 
void print_bm (struct BM *)
 Print bitmap to stderr. More...
 
void init_vars (geosurf *)
 Init variables. More...
 
int gs_calc_normals (geosurf *)
 Calculate normals. More...
 
int calc_norm (geosurf *, int, int, unsigned int)
 Calculate normals. More...
 
int gs_los_intersect1 (int, float(*)[3], float *)
 Crude method of intersecting line of sight with closest part of surface. More...
 
int gs_los_intersect (int, float **, float *)
 Crude method of intersecting line of sight with closest part of surface. More...
 
int RayCvxPolyhedronInt (Point3, Point3, double, Point4 *, int, double *, int *)
 Ray-Convex Polyhedron Intersection Test. More...
 
void gs_get_databounds_planes (Point4 *)
 Get data bounds for plane. More...
 
int gs_setlos_enterdata (Point3 *)
 
void gsd_def_cplane (int, float *, float *)
 Define cplace. More...
 
void gsd_update_cplanes (void)
 Update cplaces. More...
 
void gsd_cplane_on (int)
 ADD. More...
 
void gsd_cplane_off (int)
 Turn off clip plane. More...
 
void gsd_get_cplanes_state (int *)
 Get cplane state. More...
 
int gsd_get_cplanes (Point4 *)
 Get cplaces. More...
 
void gsd_update_cpnorm (int)
 ADD. More...
 
void gsd_cplane_setrot (int, float, float, float)
 ADD. More...
 
void gsd_cplane_settrans (int, float, float, float)
 ADD. More...
 
void gsd_draw_cplane_fence (geosurf *, geosurf *, int)
 
void gsd_draw_cplane (int)
 Draw cplane. More...
 
GLuint gsd_set_font (const char *)
 
int gsd_get_txtwidth (const char *, int)
 Get text width. More...
 
int gsd_get_txtheight (int size)
 Get text height. More...
 
void do_label_display (GLuint, float *, const char *)
 Display label. More...
 
int get_txtdescender (void)
 Get text descender. More...
 
int get_txtxoffset (void)
 Get text offset. More...
 
int GS_write_ppm (const char *)
 Save current GL screen to ppm file. More...
 
int GS_write_tif (const char *)
 Write data to tif file. More...
 
void gs_put_label (const char *, GLuint, int, unsigned long, int *)
 Put label. More...
 
void gsd_remove_curr (void)
 Remove current label. More...
 
void gsd_remove_all (void)
 Remove all labels from display list. More...
 
void gsd_call_label (void)
 Call display list and draw defined labels – called from gsd_prim (gsd_call_lists) More...
 
void gsd_box (float *, int, float *)
 Draw box. More...
 
void gsd_plus (float *, int, float)
 ADD. More...
 
void gsd_line_onsurf (geosurf *, float *, float *)
 Line on surface, fix z-values. More...
 
int gsd_nline_onsurf (geosurf *, float *, float *, float *, int)
 Multiline on surface, fix z-values. More...
 
void gsd_x (geosurf *, float *, int, float)
 Draw X symbol. More...
 
void gsd_diamond (float *, unsigned long, float)
 Draw diamond symbol. More...
 
void gsd_diamond_lines (void)
 Draw diamond lines. More...
 
void gsd_cube (float *, unsigned long, float)
 Draw cube. More...
 
void gsd_draw_box (float *, unsigned long, float)
 Draw box. More...
 
void gsd_drawsphere (float *, unsigned long, float)
 Draw sphere. More...
 
void gsd_draw_asterisk (float *, unsigned long, float)
 Draw asterisk. More...
 
void gsd_draw_gyro (float *, unsigned long, float)
 Draw gyro. More...
 
void gsd_3dcursor (float *)
 Draw 3d cursor. More...
 
void dir_to_slope_aspect (float *, float *, float *, int)
 ADD. More...
 
int gsd_north_arrow (float *, float, GLuint, unsigned long, unsigned long)
 Draw North Arrow takes OpenGL coords and size. More...
 
int gsd_arrow (float *, unsigned long, float, float *, float, geosurf *)
 ADD. More...
 
int gsd_arrow_onsurf (float *, float *, unsigned long, int, geosurf *)
 Draw north arrow on surface. More...
 
void gsd_3darrow (float *, unsigned long, float, float, float *, float)
 Draw 3d north arrow. More...
 
int gsd_scalebar (float *, float, GLuint, unsigned long, unsigned long)
 Draw Scalebar takes OpenGL coords and size. More...
 
int gsd_scalebar_v2 (float *, float, GLuint, unsigned long, unsigned long)
 
void primitive_cone (unsigned long)
 Primitives only called after transforms. More...
 
void primitive_cylinder (unsigned long, int)
 Primitives only called after transforms. More...
 
void gsd_flush (void)
 Mostly for flushing drawing commands across a network. More...
 
void gsd_colormode (int)
 Set color mode. More...
 
void show_colormode (void)
 Print color mode to stderr. More...
 
void gsd_circ (float, float, float)
 ADD. More...
 
void gsd_disc (float, float, float, float)
 ADD. More...
 
void gsd_sphere (float *, float)
 ADD. More...
 
void gsd_zwritemask (unsigned long)
 Write out z-mask. More...
 
void gsd_backface (int)
 ADD. More...
 
void gsd_linewidth (short)
 Set width of rasterized lines. More...
 
void gsd_bgnqstrip (void)
 ADD. More...
 
void gsd_endqstrip (void)
 ADD. More...
 
void gsd_bgntmesh (void)
 ADD. More...
 
void gsd_endtmesh (void)
 ADD. More...
 
void gsd_bgntstrip (void)
 ADD. More...
 
void gsd_endtstrip (void)
 ADD. More...
 
void gsd_bgntfan (void)
 ADD. More...
 
void gsd_endtfan (void)
 ADD. More...
 
void gsd_swaptmesh (void)
 ADD. More...
 
void gsd_bgnpolygon (void)
 Delimit the vertices of a primitive or a group of like primitives. More...
 
void gsd_endpolygon (void)
 Delimit the vertices of a primitive or a group of like primitives. More...
 
void gsd_bgnline (void)
 Begin line. More...
 
void gsd_endline (void)
 End line. More...
 
void gsd_shademodel (int)
 Set shaded model. More...
 
int gsd_getshademodel (void)
 Get shaded model. More...
 
void gsd_bothbuffers (void)
 Draw to the front and back buffers. More...
 
void gsd_frontbuffer (void)
 Draw to the front buffer. More...
 
void gsd_backbuffer (void)
 Draw to the back buffer. More...
 
void gsd_swapbuffers (void)
 Swap buffers. More...
 
void gsd_popmatrix (void)
 Pop the current matrix stack. More...
 
void gsd_pushmatrix (void)
 Push the current matrix stack. More...
 
void gsd_scale (float, float, float)
 Multiply the current matrix by a general scaling matrix. More...
 
void gsd_translate (float, float, float)
 Multiply the current matrix by a translation matrix. More...
 
void gsd_rot (float, char)
 ADD. More...
 
void gsd_checkwindow (int *, int *, double *, double *)
 
int gsd_checkpoint (float[4], int[4], int[4], double[16], double[16])
 ADD. More...
 
void gsd_litvert_func (float *, unsigned long, float *)
 Set the current normal vector & specify vertex. More...
 
void gsd_litvert_func2 (float *, unsigned long, float *)
 
void gsd_vert_func (float *)
 ADD. More...
 
void gsd_color_func (unsigned int)
 Set current color. More...
 
void gsd_init_lightmodel (void)
 Initialize model light. More...
 
void gsd_set_material (int, int, float, float, int)
 Set material. More...
 
void gsd_deflight (int, struct lightdefs *)
 Define light. More...
 
void gsd_switchlight (int, int)
 Switch light on/off. More...
 
int gsd_getimage (unsigned char **, unsigned int *, unsigned int *)
 Get image of current GL screen. More...
 
void gsd_blend (int)
 Specify pixel arithmetic. More...
 
void gsd_def_clipplane (int, double *)
 Define clip plane. More...
 
void gsd_set_clipplane (int, int)
 Set clip plane. More...
 
void gsd_finish (void)
 Finish. More...
 
void gsd_viewport (int, int, int, int)
 Set the viewport. More...
 
int gsd_makelist (void)
 ADD. More...
 
void gsd_bgnlist (int, int)
 ADD. More...
 
void gsd_endlist (void)
 End list. More...
 
void gsd_calllist (int)
 ADD. More...
 
void gsd_deletelist (GLuint, int)
 
void gsd_calllists (int)
 
void gsd_getwindow (int *, int *, double *, double *)
 Get viewport. More...
 
int gsd_writeView (unsigned char **, unsigned int, unsigned int)
 Write view. More...
 
int gsd_surf (geosurf *)
 ADD. More...
 
int gsd_surf_map (geosurf *)
 Draw surface using triangle fan instead of strip. More...
 
int gsd_surf_const (geosurf *, float)
 Using tmesh - not confident with qstrips portability. More...
 
int gsd_surf_func (geosurf *, int(*)(void))
 
int gsd_triangulated_wall (int, int, geosurf *, geosurf *, Point3 *, Point3 *, float *)
 ADD. More...
 
void gsd_setfc (int)
 ADD. More...
 
int gsd_getfc (void)
 ADD. More...
 
int gsd_ortho_wall (int, int, geosurf **, Point3 **, float *)
 ADD. More...
 
int gsd_wall (float *, float *, float *)
 ADD. More...
 
int gsd_norm_arrows (geosurf *)
 ADD. More...
 
int gsd_get_los (float(*)[3], short, short)
 ADD. More...
 
void gsd_set_view (geoview *, geodisplay *)
 Set view. More...
 
void gsd_check_focus (geoview *)
 Check focus. More...
 
void gsd_get_zup (geoview *, double *)
 Get z-up vector (z-direction) More...
 
int gsd_zup_twist (geoview *)
 ADD. More...
 
void gsd_do_scale (int)
 Set current scale. More...
 
void gsd_real2model (Point3)
 Convert real to model coordinates. More...
 
void gsd_model2real (Point3)
 Convert model to real coordinates. More...
 
void gsd_model2surf (geosurf *, Point3)
 Convert model to surface coordinates. More...
 
void gsd_surf2model (Point3)
 Convert surface to model coordinates. More...
 
void gsd_surf2real (geosurf *, Point3)
 Convert surface to real coordinates. More...
 
void gsd_real2surf (geosurf *, Point3)
 Convert real to surface coordinates. More...
 
int gsd_wire_surf (geosurf *)
 Draw surface wire. More...
 
int gsd_wire_surf_map (geosurf *)
 ADD. More...
 
int gsd_coarse_surf_map (geosurf *)
 Draw coarse surface. More...
 
int gsd_wire_surf_const (geosurf *, float)
 ADD. More...
 
int gsd_wire_surf_func (geosurf *, int(*)(void))
 
int gsd_wire_arrows (geosurf *)
 ADD. More...
 
void gsdiff_set_SDscale (float)
 Set scale. More...
 
float gsdiff_get_SDscale (void)
 Get scale. More...
 
void gsdiff_set_SDref (geosurf *)
 ADD. More...
 
geosurfgsdiff_get_SDref (void)
 ADD. More...
 
float gsdiff_do_SD (float, int)
 ADD. More...
 
int gsdrape_set_surface (geosurf *)
 ADD. More...
 
int seg_intersect_vregion (geosurf *, float *, float *)
 Check if segment intersect vector region. More...
 
Point3gsdrape_get_segments (geosurf *, float *, float *, int *)
 ADD. More...
 
Point3gsdrape_get_allsegments (geosurf *, float *, float *, int *)
 Get all segments. More...
 
void interp_first_last (geosurf *, float *, float *, Point3, Point3)
 ADD. More...
 
int _viewcell_tri_interp (geosurf *, Point3)
 ADD. More...
 
int viewcell_tri_interp (geosurf *, typbuff *, Point3, int)
 ADD. More...
 
int in_vregion (geosurf *, float *)
 ADD. More...
 
int order_intersects (geosurf *, Point3, Point3, int, int, int)
 ADD. More...
 
int get_vert_intersects (geosurf *, float *, float *, float *)
 ADD. More...
 
int get_horz_intersects (geosurf *, float *, float *, float *)
 Get horizontal intersects. More...
 
int get_diag_intersects (geosurf *, float *, float *, float *)
 
int segs_intersect (float, float, float, float, float, float, float, float, float *, float *)
 Line intersect. More...
 
int Point_on_plane (Point3, Point3, Point3, Point3)
 Check if point is on plane. More...
 
int XY_intersect_plane (float *, float *)
 Check for intersection (point and plane) More...
 
int P3toPlane (Point3, Point3, Point3, float *)
 Define plane. More...
 
int V3Cross (Point3, Point3, Point3)
 Get cross product. More...
 
int gsds_findh (const char *, IFLAG *, IFLAG *, int)
 Get handle to gsds. More...
 
int gsds_newh (const char *)
 Get handle to gsds. More...
 
typbuffgsds_get_typbuff (int, IFLAG)
 Get data buffer. More...
 
char * gsds_get_name (int)
 Get name. More...
 
int gsds_free_datah (int)
 Free allocated dataset. More...
 
int gsds_free_data_buff (int, int)
 Free allocated buffer. More...
 
size_t free_data_buffs (dataset *, int)
 Free data buffer. More...
 
size_t gsds_alloc_typbuff (int, int *, int, int)
 Allocates correct buffer according to type, keeps track of total mem. More...
 
int gsds_get_changed (int)
 ADD. More...
 
int gsds_set_changed (int, IFLAG)
 ADD. More...
 
int gsds_get_type (int)
 ADD. More...
 
int get_mapatt (typbuff *, int, float *)
 Get map attributes. More...
 
geovectgv_get_vect (int)
 Get vector set. More...
 
geovectgv_get_prev_vect (int)
 Get previous vector set. More...
 
int gv_num_vects (void)
 Get number of loaded vector sets. More...
 
geovectgv_get_last_vect (void)
 Get last loaded vector set. More...
 
geovectgv_get_new_vect (void)
 Allocate memory for new vector set. More...
 
void gv_update_drapesurfs (void)
 Update drape surfaces. More...
 
int gv_set_defaults (geovect *)
 Set attributes of vector set to default values. More...
 
int gv_init_vect (geovect *)
 Initialize geovect struct. More...
 
void gv_delete_vect (int)
 Delete vector set (unload) More...
 
int gv_free_vect (geovect *)
 Free allocated memory for geovect struct. More...
 
void gv_free_vectmem (geovect *)
 Free allocated memory. More...
 
void gv_set_drapesurfs (geovect *, int *, int)
 Set drape surfaces for vector set. More...
 
float gv_line_length (geoline *)
 Get line width. More...
 
int gln_num_points (geoline *)
 Get number of line vertices. More...
 
int gv_num_points (geovect *)
 Get number of points in vector. More...
 
int gv_decimate_lines (geovect *)
 Decimate line. More...
 
int gs_clip_segment (geosurf *, float *, float *, float *)
 Clip segment. More...
 
int gvd_vect (geovect *, geosurf *, int)
 Draw vector set. More...
 
void gvd_draw_lineonsurf (geosurf *, float *, float *, int)
 Draw line on surface. More...
 
geovolgvl_get_vol (int)
 Get volume set structure. More...
 
geovolgvl_get_prev_vol (int)
 Get previous volume. More...
 
int gvl_getall_vols (geovol **)
 Get all volumes. More...
 
int gvl_num_vols (void)
 Get number of loaded volume sets. More...
 
geovolgvl_get_last_vol (void)
 Get last volume set from the list. More...
 
geovolgvl_get_new_vol (void)
 Allocate new volume set and add it to the list. More...
 
int gvl_init_vol (geovol *, double, double, double, int, int, int, double, double, double)
 Initialize geovol structure. More...
 
void gvl_delete_vol (int)
 Remove volume set from list. More...
 
int gvl_free_vol (geovol *)
 Free geovol struct. More...
 
void gvl_free_volmem (geovol *)
 Free geovol struct memory. More...
 
void print_vol_fields (geovol *)
 Debug volume fields. More...
 
int gvl_get_xextents (geovol *, float *, float *)
 Get volume x-extent value. More...
 
int gvl_get_yextents (geovol *, float *, float *)
 Get volume y-extent value. More...
 
int gvl_get_zextents (geovol *, float *, float *)
 Get volume z-extent value. More...
 
int gvl_get_xrange (float *, float *)
 Get volume x-range value. More...
 
int gvl_get_yrange (float *, float *)
 Get volume y-range value. More...
 
int gvl_get_zrange (float *, float *)
 Get volume z-range value. More...
 
int gvl_isosurf_init (geovol_isosurf *)
 Initialize geovol_isosurf struct. More...
 
int gvl_isosurf_freemem (geovol_isosurf *)
 Free geovol_isosurf struct. More...
 
geovol_isosurfgvl_isosurf_get_isosurf (int, int)
 Get isosurface of given volume set. More...
 
int gvl_isosurf_get_att_src (geovol_isosurf *, int)
 Get attribute source. More...
 
int gvl_isosurf_set_att_src (geovol_isosurf *, int, int)
 Set attribute source. More...
 
int gvl_isosurf_set_att_const (geovol_isosurf *, int, float)
 Set isosurface attribute constant. More...
 
int gvl_isosurf_set_att_map (geovol_isosurf *, int, const char *)
 Set attribute map. More...
 
int gvl_isosurf_set_att_changed (geovol_isosurf *, int)
 Set attribute changed. More...
 
int gvl_slice_init (geovol_slice *)
 Initialize geovol_slice struct. More...
 
geovol_slicegvl_slice_get_slice (int, int)
 Get geovol_slice struct. More...
 
int gvl_slice_freemem (geovol_slice *)
 Free geovol_slice struct. More...
 
void P_scale (float, float, float)
 ADD. More...
 
void P_transform (int, float(*)[4], float(*)[4])
 Transform array of vectors using current T matrix. More...
 
int P_pushmatrix (void)
 Push current transformation matrix onto matrix stack. More...
 
int P_popmatrix (void)
 Pop top of matrix stack, placing it into the current transformation matrix. More...
 
void P_rot (float, char)
 Rotate matrix. More...
 
geovol_filegvl_file_get_volfile (int)
 Get geovol_file structure for given handle. More...
 
char * gvl_file_get_name (int)
 Get file name for given handle. More...
 
int gvl_file_get_file_type (geovol_file *)
 Get file type for given handle. More...
 
int gvl_file_get_data_type (geovol_file *)
 Get data type for given handle. More...
 
int gvl_file_newh (const char *, IFLAG)
 Get handle for given file name and type. More...
 
int gvl_file_free_datah (int)
 Free geovol_file structure for given handle. More...
 
int gvl_file_start_read (geovol_file *)
 Start read - allocate memory buffer a read first data into buffer. More...
 
int gvl_file_end_read (geovol_file *)
 End read - free buffer memory. More...
 
int gvl_file_get_value (geovol_file *, int, int, int, void *)
 Get value for volume file at x, y, z. More...
 
int gvl_file_is_null_value (geovol_file *, void *)
 Check for null value. More...
 
int gvl_file_set_mode (geovol_file *, IFLAG)
 Set read mode. More...
 
int gvl_file_set_slices_param (geovol_file *, int, int)
 Set parameters for slice reading. More...
 
void gvl_file_get_min_max (geovol_file *, double *, double *)
 Get minimum and maximum value in volume file. More...
 
int Gvl_load_colors_data (void **, const char *)
 Load color table. More...
 
int Gvl_unload_colors_data (void *)
 Unload color table. More...
 
int Gvl_get_color_for_value (void *, float *)
 Get color for value. More...
 
int gvl_isosurf_calc (geovol *)
 Fill data structure with computed isosurfaces polygons. More...
 
int gvl_slices_calc (geovol *)
 Calculate slices for given volume set. More...
 
void gvl_write_char (int, unsigned char **, unsigned char)
 ADD. More...
 
unsigned char gvl_read_char (int, const unsigned char *)
 Read char. More...
 
void gvl_align_data (int, unsigned char **)
 Append data to buffer. More...
 
int gvld_vol (geovol *)
 Draw volume set (slices and isosurfaces) More...
 
int gvld_wire_vol (geovol *)
 Draw volume in wire mode (bounding box) More...
 
int gvld_isosurf (geovol *)
 Draw volume isosurfaces. More...
 
int gvld_wire_isosurf (geovol *)
 
int gvld_slices (geovol *)
 Draw slices. More...
 
int gvld_slice (geovol *, int)
 Draw slice. More...
 
int gvld_wire_slices (geovol *)
 Draw wire slices. More...
 
int gvld_wind3_box (geovol *)
 Draw volume bounding box. More...
 
void gsd_display_fringe (geosurf *, unsigned long, float, int[4])
 Display fridge. More...
 
void gsd_fringe_horiz_poly (float, geosurf *, int, int)
 Draw fringe polygon in x direction. More...
 
void gsd_fringe_horiz_line (float, geosurf *, int, int)
 Draw fringe outline in x direction. More...
 
void gsd_fringe_vert_poly (float, geosurf *, int, int)
 Draw fringe outline in y direction. More...
 
void gsd_fringe_vert_line (float, geosurf *, int, int)
 Draw fringe outline in y direction. More...
 
GLuint gsd_put_legend (const char *, GLuint, int, int *, float *, int *)
 Put legend. More...
 
void gsd_bgn_legend_viewport (GLint, GLint, GLint, GLint)
 ADD. More...
 
void gsd_end_legend_viewport (void)
 ADD. More...
 
int gsd_make_nice_number (float *)
 ADD. More...
 

Function Documentation

◆ _viewcell_tri_interp()

int _viewcell_tri_interp ( geosurf gs,
Point3  pt 
)

ADD.

Parameters
gssurface (geosurf)
pt

Definition at line 463 of file gsdrape.c.

References ATT_TOPO, gs_get_att_typbuff(), and viewcell_tri_interp().

Referenced by GS_draw_X().

◆ calc_norm()

int calc_norm ( geosurf gs,
int  drow,
int  dcol,
unsigned int  neighbors 
)

Calculate normals.

Need either four neighbors or two non-linear neighbors passed initial state of neighbors known from array position and data row & col

Parameters
gssurface (geosurf)
drowdata row
dcoldata col
neighborsneighbors id
Returns
0 no normals
1 on success

Definition at line 206 of file gs_norms.c.

References BM_get(), g_surf::curmask, DRC2OFF, GET_MAPATT, NBOT, NLFT, NRGT, NTOP, g_surf::x_mod, and g_surf::y_mod.

Referenced by gs_calc_normals().

◆ correct_twist()

void correct_twist ( Keylist k)

Correct twist value.

Parameters
kkeyframe list

Definition at line 711 of file gk.c.

Referenced by gk_make_linear_framesfromkeys().

◆ dir_to_slope_aspect()

void dir_to_slope_aspect ( float *  dir,
float *  slope,
float *  aspect,
int  degrees 
)

ADD.

Parameters
dir
slope
ascpect
degrees

Definition at line 732 of file gsd_objs.c.

References Pi, X, Y, and Z.

◆ do_label_display()

void do_label_display ( GLuint  fontbase,
float *  lab_pos,
const char *  txt 
)

Display label.

Parameters
fontbasefont-base
lab_poslabel position
txttext string

Definition at line 97 of file gsd_fonts.c.

References X, and Y.

◆ free_data_buffs()

size_t free_data_buffs ( dataset ds,
int  typ 
)

Free data buffer.

Parameters
dspointer to dataset struct
typdata type
Returns
freed size

Definition at line 393 of file gsds.c.

◆ get_2key_neighbors()

double get_2key_neighbors ( int  ,
float  ,
float  ,
int  ,
Keylist **  ,
Keylist **  ,
Keylist **   
)

◆ get_diag_intersects()

int get_diag_intersects ( geosurf ,
float *  ,
float *  ,
float *   
)

◆ get_horz_intersects()

int get_horz_intersects ( geosurf gs,
float *  bgn,
float *  end,
float *  dir 
)

Get horizontal intersects.

Parameters
gssurface (geosurf)
bgnbegin point
endend point
dir
Returns
number of intersects

Definition at line 971 of file gsdrape.c.

References EPSILON, segs_intersect(), VCOLS, VROW2Y, VROWS, VXRES, X, Y, and Y2VROW.

◆ get_key_neighbors()

double get_key_neighbors ( int  ,
double  ,
double  ,
int  ,
Keylist **  ,
Keylist **  ,
Keylist **  ,
Keylist **  ,
Keylist **  ,
double *  ,
double *   
)

◆ get_mapatt()

int get_mapatt ( typbuff buff,
int  offset,
float *  att 
)

Get map attributes.

Parameters
buff
offset
[out]att
Returns
0 on failure
1 on success

Definition at line 31 of file gsget.c.

References BM_get(), typbuff::cb, BM::cols, typbuff::fb, typbuff::ib, typbuff::k, typbuff::nm, typbuff::sb, and typbuff::tfunc.

◆ get_txtdescender()

int get_txtdescender ( void  )

Get text descender.

yorig ??

Is this defined somewhere ?

Returns
2

Definition at line 71 of file gsd_fonts.c.

◆ get_txtxoffset()

int get_txtxoffset ( void  )

Get text offset.

xorig ??

Is this defined somewhere ?

Returns
0

Definition at line 85 of file gsd_fonts.c.

◆ get_vert_intersects()

int get_vert_intersects ( geosurf gs,
float *  bgn,
float *  end,
float *  dir 
)

ADD.

Todo:
For consistency, need to decide how last row & last column are displayed - would it look funny to always draw last row/col with finer resolution if necessary, or would it be better to only show full rows/cols?

Colinear already eliminated

Parameters
gssurface (geosurf)
bgnbegin point
endend point
dirdirection
Returns

Definition at line 877 of file gsdrape.c.

References EPSILON, segs_intersect(), VCOL2X, VCOLS, VROWS, VYRES, X, X2VCOL, Y, and g_surf::yrange.

◆ GK_add_key()

int GK_add_key ( float  pos,
unsigned long  fmask,
int  force_replace,
float  precis 
)

Add keyframe.

The pos value is the relative position in the animation for this particular keyframe - used to compare relative distance to neighboring keyframes, it can be any floating point value.

The fmask value can be any of the following or'd together:

  • KF_FROMX_MASK
  • KF_FROMY_MASK
  • KF_FROMZ_MASK
  • KF_FROM_MASK (KF_FROMX_MASK | KF_FROMY_MASK | KF_FROMZ_MASK)
  • KF_DIRX_MASK
  • KF_DIRY_MASK
  • KF_DIRZ_MASK
  • KF_DIR_MASK (KF_DIRX_MASK | KF_DIRY_MASK | KF_DIRZ_MASK)
  • KF_FOV_MASK
  • KF_TWIST_MASK
  • KF_ALL_MASK (KF_FROM_MASK | KF_DIR_MASK | KF_FOV_MASK | KF_TWIST_MASK)

Other fields will be added later.

The value precis and the boolean force_replace are used to determine if a keyframe should be considered to be at the same position as a pre-existing keyframe. e.g., if anykey.pos - newkey.pos <= precis, GK_add_key() will fail unless force_replace is TRUE.

Parameters
posposition
fmaks
force_replace
precisprecision value
Returns
1 if key is added
-1 key not added

Definition at line 431 of file gk2.c.

◆ GK_clear_keys()

void GK_clear_keys ( void  )

Deletes all keyframes, resets field masks.

Doesn't change number of frames requested.

Definition at line 312 of file gk2.c.

References gk_free_key().

◆ gk_copy_key()

Keylist* gk_copy_key ( Keylist k)

Copy keyframes.

Parameters
ksource keyframes
Returns
pointer to Keylist struct (target)

Definition at line 45 of file gk.c.

References key_node::fieldmask, key_node::fields, G_malloc, KF_NUMFIELDS, key_node::look_ahead, key_node::next, NULL, key_node::pos, and key_node::prior.

◆ GK_delete_key()

int GK_delete_key ( float  pos,
float  precis,
int  justone 
)

Delete keyframe

The values pos and precis are used to determine which keyframes to delete. Any keyframes with their position within precis of pos will be deleted if justone is zero. If justone is non-zero, only the first (lowest pos) keyframe in the range will be deleted.

Parameters
posposition
precisprecision
justonedelete only one keyframe
Returns
number of keys deleted.

Definition at line 369 of file gk2.c.

◆ GK_do_framestep()

void GK_do_framestep ( int  step,
int  render 
)

Moves the animation to frame number "step".

Step should be a value between 1 and the number of frames. If render is non-zero, calls draw_all.

Parameters
stepstep value
render

Definition at line 487 of file gk2.c.

◆ gk_draw_path()

int gk_draw_path ( Viewnode views,
int  steps,
Keylist keys 
)

Draw path.

Parameters
viewsViewnode struct
stepsstep value
keyskeyframe list
Returns
0 on failure
1 on success

Definition at line 749 of file gk.c.

◆ gk_follow_frames()

void gk_follow_frames ( Viewnode view,
int  numsteps,
Keylist keys,
int  step,
int  onestep,
int  render,
unsigned long  mode 
)

Checks key masks.

Because if they're masked up until the current position, pre-existing (or current) field should be used.

Parameters
viewpointer to Viewmode struct
numstepsnumber of steps
keyslist of keyframes
stepstep value
onestep
render
mode

Definition at line 141 of file gk.c.

◆ gk_free_key()

void gk_free_key ( Keylist ok)

Free keyframe list.

Parameters
okpointer to Keylist struct

Definition at line 271 of file gk.c.

References G_free(), and key_node::next.

Referenced by GK_clear_keys().

◆ gk_get_mask_sofar()

unsigned long gk_get_mask_sofar ( float  time,
Keylist keys 
)

Get mask value.

Get begin & end pos, AND all masks in keys <= pos

Time must be between 0.0 & 1.0

Parameters
timetimestamp
keyslist of keyframes
Returns
mask value

Definition at line 79 of file gk.c.

References key_node::fieldmask, key_node::next, and key_node::pos.

◆ gk_make_framesfromkeys()

Viewnode* gk_make_framesfromkeys ( Keylist keys,
int  keysteps,
int  newsteps,
int  loop,
float  t 
)

Generate viewnode from keyframes.

Here we use a cardinal cubic spline

Parameters
keyslist of keyframes
keystepskeyframe step
newstepsnew step value
looploop indicator
t
Returns
pointer to Viewnode
NULL on failure

Definition at line 301 of file gk.c.

References x.

◆ gk_make_linear_framesfromkeys()

Viewnode* gk_make_linear_framesfromkeys ( Keylist keys,
int  keysteps,
int  newsteps,
int  loop 
)

Generate viewnode from keyframe list (linear interpolation)

Here we use linear interpolation. Loop variable isn't used, but left in for use in possible "linear interp with smoothing" version.

Parameters
kesykeyframe list
keystepsstep value
newstepsnew step value
looploop indicator
pointerto viewnode struct
NULLon failure

Definition at line 611 of file gk.c.

References _, correct_twist(), view_node::fields, key_node::fields, G_free(), G_malloc, G_warning(), get_2key_neighbors(), gk_viable_keys_for_mask(), KF_NUMFIELDS, lin_interp(), key_node::next, NULL, and key_node::pos.

◆ GK_move_key()

int GK_move_key ( float  oldpos,
float  precis,
float  newpos 
)

Move keyframe.

Precis works as in other functions - to identify keyframe to move. Only the first keyframe in the precis range will be moved.

Parameters
oldposold position
precisprecision value
newposnew position
Returns
number of keys moved (1 or 0)

Definition at line 338 of file gk2.c.

◆ GK_print_keys()

void GK_print_keys ( const char *  name)

Print keyframe info.

Parameters
namefilename

Definition at line 209 of file gk2.c.

References _, G_fatal_error(), name, and NULL.

◆ GK_set_interpmode()

int GK_set_interpmode ( int  mode)

Set interpolation mode.

Parameters
modeinterpolation mode (KF_LINEAR or KF_SPLINE)
Returns
1 on success
-1 on error (invalid interpolation mode)

Definition at line 140 of file gk2.c.

◆ GK_set_numsteps()

void GK_set_numsteps ( int  newsteps)

Set the number of frames to be interpolated from keyframes.

Parameters
newstepsnumber of frames

Definition at line 299 of file gk2.c.

◆ GK_set_tension()

void GK_set_tension ( float  tens)

Set value for tension when interpmode is KF_SPLINE.

Parameters
tensvalue tens should be between 0.0; 1.0.

Definition at line 155 of file gk2.c.

◆ GK_show_list()

void GK_show_list ( int  flag)

Show list.

Parameters
flag

Definition at line 609 of file gk2.c.

◆ GK_show_path()

void GK_show_path ( int  flag)

Draw the current path.

Parameters
flag

Definition at line 503 of file gk2.c.

◆ GK_show_site()

void GK_show_site ( int  flag)

Show point sets.

Parameters
flag

Definition at line 555 of file gk2.c.

◆ GK_show_vect()

void GK_show_vect ( int  flag)

Show vector sets.

Parameters
flag

Definition at line 529 of file gk2.c.

◆ GK_show_vol()

void GK_show_vol ( int  flag)

Show volumes.

Parameters
flag

Definition at line 582 of file gk2.c.

◆ GK_showtension_start()

void GK_showtension_start ( void  )

Definition at line 175 of file gk2.c.

◆ GK_showtension_stop()

void GK_showtension_stop ( void  )

Show tension stop ?

Use GK_showtension_start/GK_update_tension/GK_showtension_stop to initialize and stop multi-view display of path when changing tension.

Definition at line 187 of file gk2.c.

◆ GK_update_frames()

void GK_update_frames ( void  )

Recalculate path using the current number of frames requested.

Call after changing number of frames or when Keyframes change.

Definition at line 245 of file gk2.c.

◆ GK_update_tension()

void GK_update_tension ( void  )

Update tension.

Definition at line 195 of file gk2.c.

◆ gk_viable_keys_for_mask()

int gk_viable_keys_for_mask ( unsigned long  mask,
Keylist keys,
Keylist **  keyret 
)

ADD.

Parameters
maskmask value
keyslist of keyframes
[out]keyretoutput list of keyframes
Returns
number of output keyframes

Definition at line 113 of file gk.c.

References key_node::fieldmask, and key_node::next.

Referenced by gk_make_linear_framesfromkeys().

◆ gln_num_points()

int gln_num_points ( geoline gln)

Get number of line vertices.

Parameters
glnline (geoline)
Returns
number of vertices

Definition at line 197 of file gv_quick.c.

References g_line::next, and g_line::npts.

Referenced by gv_num_points().

◆ GP_alldraw_site()

void GP_alldraw_site ( void  )

Draw all available point sets.

Definition at line 611 of file gp2.c.

◆ GP_attmode_color()

int GP_attmode_color ( int  ,
const char *   
)

◆ GP_attmode_none()

int GP_attmode_none ( int  )

◆ GP_delete_site()

int GP_delete_site ( int  id)

Delete registrated point set.

Parameters
idpoint set id
Returns
1 on success
-1 on error (point sets not available)

Definition at line 132 of file gp2.c.

References G_debug(), gp_delete_site(), and GP_site_exists().

◆ gp_delete_site()

void gp_delete_site ( int  id)

Delete point set and remove from list.

Parameters
idpoint set id

Definition at line 238 of file gp.c.

References G_debug(), gp_free_site(), and gp_get_site().

Referenced by GP_delete_site().

◆ GP_draw_site()

void GP_draw_site ( int  id)

Draw point set.

Parameters
idpoint set id

Definition at line 577 of file gp2.c.

References g_site::drape_surf_id, G_debug(), gp_get_site(), gpd_2dsite(), gpd_3dsite(), GS_get_region(), gs_get_surf(), g_site::has_z, g_site::n_surfs, and g_site::use_z.

Referenced by Nviz_draw_all_site().

◆ gp_free_site()

int gp_free_site ( geosite fp)

Free allocated geosite struct.

Parameters
fppointer to geosite struct
Returns
1 on success
-1 on failure

Definition at line 261 of file gp.c.

References G_debug(), and g_site::gsite_id.

Referenced by gp_delete_site().

◆ gp_free_sitemem()

void gp_free_sitemem ( geosite fp)

Free geosite (lower level)

Parameters
fppointer to geosite struct

Definition at line 310 of file gp.c.

◆ GP_Get_ClientData()

void* GP_Get_ClientData ( int  id)

Get client data.

Parameters
idpoint set id
Returns
pointer to client data
NULL on error

Definition at line 653 of file gp2.c.

References g_site::clientdata, gp_get_site(), and NULL.

◆ gp_get_last_site()

geosite* gp_get_last_site ( void  )

Get last point set.

Returns
pointer to geosite struct
NULL if no point set is available

Definition at line 95 of file gp.c.

References G_debug().

Referenced by gp_get_new_site().

◆ gp_get_new_site()

geosite* gp_get_new_site ( void  )

Create new geosite instance and add it to list.

Returns
pointer to geosite struct
NULL on error

Definition at line 119 of file gp.c.

References G_malloc, G_zero(), gp_get_last_site(), g_site::gsite_id, g_site::next, and NULL.

◆ gp_get_prev_site()

geosite* gp_get_prev_site ( int  id)

Get previous geosite struct from list.

Parameters
idpoint set id
Returns
pointer to geosite struct
NULL on failure

Definition at line 56 of file gp.c.

References G_debug().

◆ gp_get_site()

geosite* gp_get_site ( int  id)

Get geosite struct.

Parameters
idpoint set id
Returns
pointer to geosite struct
NULL on failure

Definition at line 33 of file gp.c.

References G_debug().

Referenced by gp_delete_site(), GP_draw_site(), GP_Get_ClientData(), GP_get_trans(), GP_get_zmode(), GP_select_surf(), GP_Set_ClientData(), GP_set_trans(), GP_set_zmode(), GP_site_exists(), GP_surf_is_selected(), GP_unselect_surf(), GP_unset_style_thematic(), and Nviz_set_vpoint_attr_default().

◆ GP_get_site_list()

int* GP_get_site_list ( int *  numsites)

Get list of point sets.

Must freed when no longer needed!

Parameters
numsitesnumber of point sets
Returns
pointer to list of points sets
NULL on error

Definition at line 102 of file gp2.c.

Referenced by Nviz_draw_all_site().

◆ GP_get_sitename()

int GP_get_sitename ( int  id,
char **  filename 
)

Get point set filename.

Note: char array is allocated by G_store()

Parameters
idpoint set id
[out]filenamepoint set filename
Returns
-1 on error (point set not found)
1 on success

Definition at line 209 of file gp2.c.

◆ GP_get_style()

int GP_get_style ( int  id,
int *  color,
int *  width,
float *  size,
int *  symbol 
)

Get point set style.

Parameters
idpoint set id
Returns
1 on success
-1 on error (point set not found)

Definition at line 232 of file gp2.c.

◆ GP_get_trans()

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

Get transformation params.

Parameters
idpoint set id
[out]xtrans,ytrans,ztransx/y/z values

Definition at line 457 of file gp2.c.

References G_debug(), gp_get_site(), g_site::x_trans, g_site::y_trans, and g_site::z_trans.

◆ GP_get_zmode()

int GP_get_zmode ( int  id,
int *  use_z 
)

Get z-mode.

Todo:
Who's using this?
Parameters
idpoint set id
[out]use_znon-zero code to use z
Returns
-1 on error (invalid point set id)
1 on success

Definition at line 414 of file gp2.c.

References G_debug(), gp_get_site(), NULL, and g_site::use_z.

◆ gp_init_site()

int gp_init_site ( geosite gp)

Initialize geosite struct.

Todo:
Currently does nothing
Parameters
gppointer to geosite struct
Returns
-1 on failure
0 on success

Definition at line 222 of file gp.c.

References G_debug().

◆ GP_load_site()

int GP_load_site ( int  id,
const char *  filename 
)

Load point set from file.

Check to see if handle already loaded, if so - free before loading new for now, always load to memory.

Todo:
load file handle & ready for reading instead of using memory
Parameters
idpoint set id
filenamepoint set filename
Returns
-1 on error
1 on success

Definition at line 173 of file gp2.c.

◆ Gp_load_sites()

geopoint* Gp_load_sites ( const char *  name,
int *  nsites,
int *  has_z 
)

Load to points to memory.

The other alternative may be to load to a tmp file.

Parameters
namename of vector map to be loaded
[out]nsitesnumber of loaded points
[out]has_z2D or 3D points data loaded?
Returns
pointer to geopoint struct (array)
NULL on failure

Definition at line 40 of file gp3.c.

◆ Gp_load_sites_thematic()

int Gp_load_sites_thematic ( geosite gp,
struct Colors colors 
)

Load styles for geopoints based on thematic mapping.

Parameters
gppointer to geosite structure
colorspointer to Colors structure or NULL
Returns
number of points defined by thematic mapping
-1 on error

Definition at line 171 of file gp3.c.

◆ GP_new_site()

int GP_new_site ( void  )

Create new point set.

Returns
point set id
-1 on error (number of point sets exceeded)

Definition at line 64 of file gp2.c.

◆ GP_num_sites()

int GP_num_sites ( void  )

Get number of loaded point sets.

Returns
number of point sets

Definition at line 87 of file gp2.c.

References gp_num_sites().

◆ gp_num_sites()

int gp_num_sites ( void  )

Get number of loaded point sets.

Returns
number of point sets

Definition at line 76 of file gp.c.

Referenced by GP_num_sites().

◆ GP_select_surf()

int GP_select_surf ( int  hp,
int  hs 
)

Select surface for given point set.

Parameters
hppoint set id
hssurface id
Returns
1 surface selected
-1 on error

Definition at line 484 of file gp2.c.

References g_site::drape_surf_id, G_debug(), gp_get_site(), GP_surf_is_selected(), GS_surf_exists(), and g_site::n_surfs.

◆ GP_Set_ClientData()

int GP_Set_ClientData ( int  id,
void *  clientd 
)

Set client data.

Parameters
idpoint set id
clientdclient data
Returns
1 on success
-1 on error (invalid point set id)

Definition at line 631 of file gp2.c.

References g_site::clientdata, and gp_get_site().

◆ Gp_set_color()

int Gp_set_color ( const char *  ,
geopoint  
)

◆ gp_set_defaults()

int gp_set_defaults ( geosite gp)

Set default value for geosite struct.

Parameters
gppointer to geosite struct
Returns
1 on success
-1 on failure

Definition at line 189 of file gp.c.

References g_vect_style::color, G_debug(), GS_get_longdim(), g_site::gsite_id, g_site::hstyle, NULL, g_vect_style::size, ST_X, g_site::style, g_vect_style::symbol, g_site::tstyle, and g_vect_style::width.

◆ gp_set_drapesurfs()

void gp_set_drapesurfs ( geosite ,
int *  ,
int   
)

◆ GP_set_style()

int GP_set_style ( int  id,
int  color,
int  width,
float  size,
int  symbol 
)

Set point style.

Supported icon symbols (markers):

  • ST_X
  • ST_BOX
  • ST_SPHERE
  • ST_CUBE
  • ST_DIAMOND
  • ST_DEC_TREE
  • ST_CON_TREE
  • ST_ASTER
  • ST_GYRO
  • ST_HISTOGRAM
Parameters
idpoint set id
coloricon color
widthicon line width
sizeicon size
symbolicon symbol
Returns
1 on success
-1 on error (point set not found)

Definition at line 274 of file gp2.c.

◆ GP_set_style_thematic()

int GP_set_style_thematic ( int  id,
int  layer,
const char *  color,
const char *  width,
const char *  size,
const char *  symbol,
struct Colors color_rules 
)

Set point set style for thematic mapping.

Updates also style for each geopoint.

Parameters
idpoint set id
layerlayer number for thematic mapping (-1 for undefined)
coloricon color column name
widthicon line width column name
sizeicon size column name
symbolicon symbol column name
colorspointer to Colors structure or NULL
Returns
1 on success
-1 on error (point set not found)

Definition at line 309 of file gp2.c.

◆ GP_set_trans()

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

Set transformation params.

Parameters
idpoint set id
xtrans,ytrans,ztransx/y/z values

Definition at line 434 of file gp2.c.

References G_debug(), gp_get_site(), g_site::x_trans, g_site::y_trans, and g_site::z_trans.

◆ GP_set_zmode()

int GP_set_zmode ( int  id,
int  use_z 
)

Set z mode for point set.

Parameters
idpoint set id
use_zTRUE to use z-coordinaces when vector map is 3D
Returns
1 on success
0 vector map is not 3D
-1 on error (invalid point set id)

Definition at line 380 of file gp2.c.

References G_debug(), gp_get_site(), g_site::has_z, NULL, and g_site::use_z.

◆ GP_site_exists()

int GP_site_exists ( int  id)

Check if point set exists.

Parameters
idpoint set id
Returns
1 found
0 not found

Definition at line 37 of file gp2.c.

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

Referenced by GP_delete_site().

◆ GP_str_to_marker()

int GP_str_to_marker ( const char *  str)

Determine point marker symbol for string.

Supported markers:

  • ST_X
  • ST_BOX
  • ST_SPHERE
  • ST_CUBE
  • ST_DIAMOND
  • ST_DEC_TREE
  • ST_CON_TREE
  • ST_ASTER
  • ST_GYRO
  • ST_HISTOGRAM
Parameters
strstring buffer
Returns
marker code (default: ST_SPHERE)

Definition at line 684 of file gp2.c.

References _, G_warning(), ST_ASTER, ST_BOX, ST_CON_TREE, ST_CUBE, ST_DEC_TREE, ST_DIAMOND, ST_GYRO, ST_HISTOGRAM, ST_SPHERE, and ST_X.

◆ GP_surf_is_selected()

int GP_surf_is_selected ( int  hp,
int  hs 
)

Check if surface is selected.

Parameters
hppoint set id
hssurface id
Returns
1 selected
0 not selected

Definition at line 552 of file gp2.c.

References g_site::drape_surf_id, G_debug(), gp_get_site(), and g_site::n_surfs.

Referenced by GP_select_surf(), and GP_unselect_surf().

◆ GP_unselect_surf()

int GP_unselect_surf ( int  hp,
int  hs 
)

Unselect surface.

Parameters
hppoint set id
hssurface id
Returns
1 surface unselected
-1 on error

Definition at line 514 of file gp2.c.

References g_site::drape_surf_id, G_debug(), gp_get_site(), GP_surf_is_selected(), and g_site::n_surfs.

◆ GP_unset_style_thematic()

int GP_unset_style_thematic ( int  id)

Make style for thematic mapping inactive.

Parameters
idpoint set id
Returns
1 on success
-1 on error (point set not found)

Definition at line 352 of file gp2.c.

References g_vect_style_thematic::active, G_debug(), gp_get_site(), NULL, and g_site::tstyle.

◆ gp_update_drapesurfs()

void gp_update_drapesurfs ( void  )

Update drape surfaces.

Call after surface is deleted

Definition at line 157 of file gp.c.

◆ gpd_2dsite()

int gpd_2dsite ( geosite ,
geosurf ,
int   
)

Referenced by GP_draw_site().

◆ gpd_3dsite()

int gpd_3dsite ( geosite ,
float  ,
float  ,
int   
)

Referenced by GP_draw_site().

◆ gpd_obj()

void gpd_obj ( geosurf gs,
gvstyle style,
Point3  pt 
)

Draw point representing object.

Do normal transforms before calling

Note gs: NULL if 3d obj or const elev surface

Parameters
gssurface (geosurf)
styleobject displaying style (highlighted or not)
pt3d point (Point3)

Definition at line 70 of file gpd.c.

References CM_COLOR, CM_DIFFUSE, g_vect_style::color, GS_global_exag(), GS_v3eq(), gsd_box(), gsd_color_func(), gsd_colormode(), gsd_cube(), gsd_diamond(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_gyro(), gsd_popmatrix(), gsd_pushmatrix(), gsd_scale(), gsd_sphere(), gsd_x(), g_vect_style::size, ST_ASTER, ST_BOX, ST_CUBE, ST_DIAMOND, ST_GYRO, ST_HISTOGRAM, ST_SPHERE, ST_X, g_vect_style::symbol, and Z.

◆ GS_alldraw_cplane_fences()

void GS_alldraw_cplane_fences ( void  )

Draw all cplace fences ?

Definition at line 3191 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 1934 of file gs2.c.

◆ GS_alldraw_wire()

void GS_alldraw_wire ( void  )

Draw all wires.

Overrides draw_mode for fast display

Definition at line 1917 of file gs2.c.

Referenced by Gs_load_3dview().

◆ gs_att_is_set()

int gs_att_is_set ( geosurf surf,
IFLAG  att 
)

Check if attribute is set.

Parameters
surfpointer to gsurf or NULL to look at all geosurfs
attattribute id
Returns
1 attribute is set up
0 attribute is not set up

Definition at line 150 of file gs.c.

References g_surf::att, gsurf_att::att_src, and NOTSET_ATT.

Referenced by GS_transp_is_set().

◆ GS_background_color()

unsigned int GS_background_color ( void  )

Get background color.

Returns
color value

Definition at line 2449 of file gs2.c.

◆ Gs_build_256lookup()

int Gs_build_256lookup ( const char *  filename,
int *  buff 
)

Build color table (256)

Calling function must have already allocated space in buff for range of data (256 for now) - simply calls get_color for each cat in color range

Parameters
filenameraster map name
[out]buffdata buffer
Returns
1 on success
0 on failure

Definition at line 571 of file gs3.c.

◆ gs_calc_normals()

int gs_calc_normals ( geosurf gs)

Calculate normals.

OPTIMIZED for constant dy & dx

The norm array is always the same size, but diff resolutions force resampled data points to have their normals recalculated, then only those norms are passed to n3f during drawing. Norms are converted to a packed unsigned int for storage, must be converted back at time of use.

Todo:
fix to correctly calculate norms when mapped to sphere!

Uses the previous and next cells (when available) for normal calculations to produce smoother normals

Parameters
gssurface (geosurf)
Returns
1 on success
0 on failure

Definition at line 124 of file gs_norms.c.

References calc_norm(), G_debug(), gs_update_curmask(), g_surf::gsurf_id, init_vars(), NALL, NBL, NBOT, NBR, NLFT, g_surf::norm_needupdate, g_surf::norms, NRGT, NTL, NTOP, NTR, VCOLS, VROWS, g_surf::x_mod, and g_surf::y_mod.

Referenced by GS_get_norm_at_xy(), GS_update_normals(), and gsd_surf().

◆ GS_check_cancel()

int GS_check_cancel ( void  )

Check for cancel.

Returns
code

Definition at line 30 of file gsx.c.

References Cxl_func.

◆ GS_clear()

void GS_clear ( int  col)

Clear view.

Parameters
colcolor value

Definition at line 3414 of file gs2.c.

References G_debug().

◆ gs_clip_segment()

int gs_clip_segment ( geosurf gs,
float *  bgn,
float *  end,
float *  region 
)

Clip segment.

Todo:
to use fast clipping and move to gs.c
Parameters
gssurface
bgnbegin point
endend point
regionregion settings
Returns
1 segment inside region
0 segment outside region

Definition at line 40 of file gvd.c.

◆ GS_coordpair_repeats()

int GS_coordpair_repeats ( float *  p1,
float *  p2,
int  nhist 
)

ADD.

Initialize by calling with a number nhist to represent number of previous entries to check, then call with zero as nhist

Parameters
p1first point
p2second point
nhist?
Returns
-1 on error
-2
1
9

Definition at line 440 of file gs_util.c.

References NULL.

◆ GS_default_draw_color()

unsigned int GS_default_draw_color ( void  )

Get default draw color.

Returns
color value

Definition at line 2436 of file gs2.c.

References G_debug().

◆ GS_delete_list()

void GS_delete_list ( GLuint  list_id)

Delete pre-defined list.

Parameters
list_idlist id

Definition at line 884 of file gs2.c.

References gsd_deletelist().

◆ gs_delete_surf()

void gs_delete_surf ( int  id)

Remove geosurf struct from list.

Parameters
idsurface id

Definition at line 463 of file gs.c.

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

Referenced by GS_delete_surface().

◆ GS_delete_surface()

int GS_delete_surface ( int  id)

Delete surface.

Parameters
idsurface id
Returns
1 on success
-1 on error

Definition at line 1557 of file gs2.c.

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

◆ Gs_distance()

double Gs_distance ( double *  from,
double *  to 
)

Calculates distance in METERS between two points in current projection (2D)

Uses G_distance().

Parameters
from'from' point (X, Y)
to'to' point (X, Y)
Returns
distance

Definition at line 79 of file gs3.c.

Referenced by GS_geodistance().

◆ GS_distance()

float GS_distance ( float *  from,
float *  to 
)

Calculate distance.

Parameters
from'from' point (X,Y,Z)
to'to' point (X,Y,Z)
Returns
distance

Definition at line 141 of file gs_util.c.

References X, x, Y, and Z.

Referenced by GS_look_here(), gs_setlos_enterdata(), gsd_zup_twist(), and gv_line_length().

◆ gs_distance_onsurf()

int gs_distance_onsurf ( geosurf gs,
float *  p1,
float *  p2,
float *  dist,
int  use_exag 
)

Calculate distance on surface.

Parameters
gspointer to geosurf struct
p1from point
p2to point
[out]distdistance
use_exaguse exag for calculation
Returns
0 on error (points not in region)
1 on success

Definition at line 1414 of file gs.c.

◆ 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 872 of file gs2.c.

References gsd_calllists().

◆ GS_draw_cplane()

void GS_draw_cplane ( int  num)

Draw cplace.

Parameters
numcplace id

Definition at line 3144 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 3171 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 751 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 818 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 841 of file gs2.c.

References gsd_put_legend(), and name.

◆ 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 934 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 894 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 675 of file gs2.c.

◆ 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 713 of file gs2.c.

◆ GS_draw_surf()

void GS_draw_surf ( int  id)

Draw surface.

Parameters
idsurface id

Definition at line 1862 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 1897 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 
)

Draw place marker.

Used to display query point for raster queries.

Parameters
idsurface id
ptpoint, X, Y value in true world coordinates

Definition at line 634 of file gs2.c.

References _viewcell_tri_interp(), g_surf::att, ATT_TOPO, g_vect_style::color, CONST_ATT, gsurf_att::constant, gs_get_att_src(), GS_get_longdim(), gs_get_surf(), gsd_do_scale(), gsd_linewidth(), gsd_pushmatrix(), gsd_translate(), NULL, g_surf::ox, g_surf::oy, g_vect_style::size, X, g_surf::x_trans, Y, g_surf::y_trans, Z, and g_surf::z_trans.

◆ GS_dv3norm()

int GS_dv3norm ( double *  dv1)

Changes v1 so that it is a unit vector.

Parameters
dv1vector
Returns
0 if magnitude of dv1 is zero
1 if magnitude of dv1 > 0

Definition at line 295 of file gs_util.c.

References X, Y, and Z.

◆ gs_err()

void gs_err ( const char *  msg)

Definition at line 35 of file gs.c.

References G_warning().

◆ gs_free_surf()

int gs_free_surf ( geosurf fs)

Free geosurf struct.

Parameters
fspointer to geosurf struct
Returns
1 found
0 not found
-1 on error

Definition at line 487 of file gs.c.

References G_debug().

Referenced by gs_delete_surf().

◆ gs_free_unshared_buffs()

void gs_free_unshared_buffs ( geosurf fs)

Free unshared buffers of geosurf struct.

fs has already been taken out of the list

This function is fairly revealing about how shared datasets work

Parameters
fspointer to geosurf struct

Definition at line 557 of file gs.c.

◆ GS_geodistance()

double GS_geodistance ( double *  from,
double *  to,
const char *  units 
)

Calculate distance between 2 coordinates.

Units is one of:

  • "meters",
  • "miles",
  • "kilometers",
  • "feet",
  • "yards",
  • "nmiles" (nautical miles),
  • "rods",
  • "inches",
  • "centimeters",
  • "millimeters",
  • "micron",
  • "nanometers",
  • "cubits",
  • "hands",
  • "furlongs",
  • "chains"

Default is meters.

Parameters
fromstarting point
toending point
unitsmap units
Returns
distance between two geographic coordinates in current projection

Definition at line 55 of file gs_util.c.

References Gs_distance().

◆ GS_get_aspect()

double GS_get_aspect ( void  )

Get aspect value.

Returns
aspect value

Definition at line 3447 of file gs2.c.

References Cell_head::bottom, 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 1132 of file gs2.c.

◆ gs_get_att_src()

int gs_get_att_src ( geosurf gs,
int  desc 
)

Get attribute source.

Parameters
gspointer to geosurf struct
descattribute id (descriptor)
Returns
-1 on error
attribute source id

Definition at line 656 of file gs.c.

References g_surf::att, gsurf_att::att_src, G_debug(), g_surf::gsurf_id, and LEGAL_ATT.

Referenced by GS_draw_X(), GS_get_cat_at_xy(), GS_get_exag_guess(), GS_get_val_at_xy(), Gs_update_attrange(), gsd_surf(), gsd_wire_surf(), gsdrape_get_segments(), and viewcell_tri_interp().

◆ gs_get_att_typbuff()

typbuff* gs_get_att_typbuff ( geosurf gs,
int  desc,
int  to_write 
)

Get attribute data buffer.

Parameters
gspointer to geosurf struct
descattribute id (descriptor)
to_writenon-zero value for 'write'
Returns
NULL on error
pointer to typbuff

Definition at line 681 of file gs.c.

References g_surf::att, ATT_TOPO, G_debug(), gsdiff_do_SD(), gsdiff_get_SDref(), gsds_get_typbuff(), g_surf::gsurf_id, gsurf_att::hdata, NULL, and typbuff::tfunc.

Referenced by _viewcell_tri_interp(), GS_get_cat_at_xy(), GS_get_val_at_xy(), gs_update_curmask(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_wire_arrows(), gsd_wire_surf_const(), and gsd_wire_surf_map().

◆ gs_get_att_type()

int gs_get_att_type ( geosurf gs,
int  desc 
)

Get attribute type.

Parameters
gspointer to geosurf struct
descattribute id
Returns
-1 on error
attribute type

Definition at line 630 of file gs.c.

References g_surf::att, gsurf_att::att_src, gsurf_att::att_type, G_debug(), LEGAL_ATT, and NOTSET_ATT.

◆ 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 1175 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_cat_label()

int Gs_get_cat_label ( const char *  filename,
int  drow,
int  dcol,
char *  catstr 
)

Get categories/labels.

Formats label as in d.what.rast -> (catval) catlabel

Parameters
filenameraster map name
drow
dcol
catstrcategory string
Returns
1 on success
0 on failure

Definition at line 770 of file gs3.c.

Referenced by GS_get_cat_at_xy().

◆ 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 1498 of file gs2.c.

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

◆ gs_get_data_avg_zmax()

int gs_get_data_avg_zmax ( float *  azmax)

Get average z-max value.

Useful for setting position of cplane, lighting ball, etc.

Parameters
[out]azmaxaverage z-max value
Returns
-1 on error
1 on success

Definition at line 1201 of file gs.c.

Referenced by GS_get_modelposition1().

◆ gs_get_databounds_planes()

void gs_get_databounds_planes ( Point4 planes)

Get data bounds for plane.

Parameters
[out]planes

Definition at line 469 of file gs_query.c.

Referenced by gs_setlos_enterdata().

◆ gs_get_datacenter()

int gs_get_datacenter ( float *  cen)

Get data center point.

Parameters
[out]center(array X,Y,Z)
Returns
-1 on error
1 on success

Definition at line 1230 of file gs.c.

Referenced by GS_get_modelposition1(), and gsd_set_view().

◆ 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 2277 of file gs2.c.

References Cell_head::cols, g_surf::cols, gs_get_surf(), Cell_head::rows, 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 3281 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 2107 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 2253 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 2304 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 3264 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 2559 of file gs2.c.

References G_debug().

◆ GS_get_fov()

int GS_get_fov ( void  )

Get field of view.

Returns
field of view, in 10ths of degrees

Definition at line 2850 of file gs2.c.

◆ GS_get_from()

void GS_get_from ( float *  fr)

Get viewpoint 'from' position.

Parameters
[out]frfrom model coordinates

Definition at line 2721 of file gs2.c.

References 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 2735 of file gs2.c.

References GS_v3eq().

◆ gs_get_last_surface()

geosurf* gs_get_last_surface ( void  )

Get last allocated geosurf struct from list.

Returns
pointer to geosurf struct

Definition at line 173 of file gs.c.

Referenced by gs_get_new_surface().

◆ GS_get_light_reset()

int GS_get_light_reset ( void  )

Definition at line 257 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 1452 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 528 of file gs2.c.

◆ GS_get_modelposition1()

void GS_get_modelposition1 ( float *  )

◆ gs_get_new_surface()

geosurf* gs_get_new_surface ( void  )

Allocate new geosurf struct.

Returns
pointer to geosurf struct

Definition at line 194 of file gs.c.

References G_malloc, gs_get_last_surface(), g_surf::gsurf_id, g_surf::next, and NULL.

◆ 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 1237 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 2162 of file gs2.c.

◆ gs_get_prev_surface()

geosurf* gs_get_prev_surface ( int  id)

Get previous geosurf struct.

Parameters
idcurrent surface id
Returns
pointer to geosurf struct
NULL if not found

Definition at line 87 of file gs.c.

References G_debug(), and ps.

Referenced by gs_init_surf().

◆ 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 2924 of file gs2.c.

◆ 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 3236 of file gs2.c.

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 1097 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 1077 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 3051 of file gs2.c.

References MAX_SURFS.

Referenced by GS_look_here(), and GS_set_Narrow().

◆ gs_get_surf()

◆ GS_get_surf_list()

int* GS_get_surf_list ( int *  numsurfs)

Get surface list.

Must be freed when not needed!

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

Definition at line 1530 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 2790 of file gs2.c.

References G_debug(), and GS_v3eq().

◆ GS_get_to_real()

void GS_get_to_real ( float *  to)

Get 'to' real coordinates.

Parameters
[out]to'to' real coordinates

Definition at line 2748 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 2413 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 2860 of file gs2.c.

◆ 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 1301 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 2804 of file gs2.c.

References GS_v3dir().

◆ 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 2036 of file gs2.c.

References gs_get_surf(), and g_surf::wire_color.

◆ gs_get_xextents()

int gs_get_xextents ( geosurf gs,
float *  min,
float *  max 
)

Get x-extent values.

Parameters
gspointer to geosurf struct
[out]minx-min value
[out]maxx-max value
Returns
1

Definition at line 1015 of file gs.c.

References max, min, g_surf::x_trans, g_surf::xmax, and g_surf::xmin.

◆ gs_get_xrange()

int gs_get_xrange ( float *  min,
float *  max 
)

Get x-range.

Parameters
[out]minx-min value
[out]maxx-max value
Returns
-1 on error (no surface)
1 on success

Definition at line 1124 of file gs.c.

◆ gs_get_yextents()

int gs_get_yextents ( geosurf gs,
float *  min,
float *  max 
)

Get y-extent values.

Parameters
gspointer to geosurf struct
[out]miny-min value
[out]maxy-max value
Returns
1

Definition at line 1032 of file gs.c.

References max, min, g_surf::y_trans, g_surf::ymax, and g_surf::ymin.

◆ gs_get_yrange()

int gs_get_yrange ( float *  min,
float *  max 
)

Get y-range.

Parameters
[out]miny-min value
[out]maxy-max value
Returns
-1 on error (no surface)
1 on success

Definition at line 1162 of file gs.c.

◆ gs_get_zextents()

int gs_get_zextents ( geosurf gs,
float *  min,
float *  max,
float *  mid 
)

Get z-extent values.

Todo:
pass flag to use zminmasked instead of zmin
Parameters
gspointer to geosurf struct
[out]minz-min value
[out]maxz-max value
[out]midz-middle value
Returns
1

Definition at line 997 of file gs.c.

References max, min, g_surf::z_trans, g_surf::zmax, and g_surf::zmin.

Referenced by GS_get_zextents().

◆ 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 2662 of file gs2.c.

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

◆ gs_get_zrange()

int gs_get_zrange ( float *  min,
float *  max 
)

Get z-range.

Parameters
[out]minz-min value
[out]maxz-max value
Returns
-1 on error (no surface)
1 on success

Definition at line 1086 of file gs.c.

Referenced by GS_get_zrange().

◆ 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 2685 of file gs2.c.

References gs_get_zrange(), gvl_get_zrange(), max, and min.

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

◆ gs_get_zrange0()

int gs_get_zrange0 ( float *  min,
float *  max 
)

Get z-range.

Todo:
pass flag to use zminmasked instead of zmin could also have this return a weighted average for vertical "centroid"
Parameters
[out]minz-min value
[out]maxz-max value
Returns
-1 on error (no surface)
1 on success

Definition at line 1052 of file gs.c.

◆ 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 2355 of file gs2.c.

Referenced by Nviz_get_exag_height(), and Nviz_update_ranges().

◆ gs_getall_surfaces()

int gs_getall_surfaces ( geosurf **  gsurfs)

Get array of geosurf structs.

Parameters
gsurfspointer to array
Returns
number of geosurfs

Definition at line 109 of file gs.c.

Referenced by GS_draw_cplane().

◆ 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 422 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 378 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 334 of file gs2.c.

◆ GS_global_exag()

float GS_global_exag ( void  )

Get global z-exag value.

Returns
value

Definition at line 1997 of file gs2.c.

References G_debug().

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 3475 of file gs2.c.

◆ gs_init()

void gs_init ( void  )

Initialize library.

Still need to take care of library initialization, probably want to define a Surf_top of constant value (i.e., 0)

Definition at line 48 of file gs.c.

◆ gs_init_normbuff()

int gs_init_normbuff ( geosurf gs)

Init geosurf normbuff.

Parameters
gspointer to geosurf struct
Returns
0 on error
1 on success

Definition at line 308 of file gs.c.

References g_surf::cols, G_free(), G_malloc, g_surf::norm_needupdate, g_surf::norms, and g_surf::rows.

◆ GS_init_rotation()

void GS_init_rotation ( void  )

Reset scene rotation.

Definition at line 2904 of file gs2.c.

Referenced by Nviz_init_rotation().

◆ gs_init_surf()

int gs_init_surf ( geosurf gs,
double  ox,
double  oy,
int  rows,
int  cols,
double  xres,
double  yres 
)

◆ GS_init_view()

void GS_init_view ( void  )

Init viewpoint.

Todo:
allow setting center?

Definition at line 3343 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 1007 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 98 of file gs2.c.

◆ GS_lights_off()

void GS_lights_off ( void  )

Switch off all lights.

Definition at line 439 of file gs2.c.

◆ GS_lights_on()

void GS_lights_on ( void  )

Switch on all lights.

Definition at line 453 of file gs2.c.

◆ Gs_load_3dview()

int Gs_load_3dview ( const char *  ,
geoview ,
geodisplay ,
struct Cell_head ,
const geosurf  
)

Referenced by GS_load_3dview().

◆ 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 3325 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 1598 of file gs2.c.

◆ Gs_loadmap_as_bitmap()

int Gs_loadmap_as_bitmap ( struct Cell_head wind,
const char *  map_name,
struct BM buff 
)

Load raster map as integer map.

Calling function must have already allocated space in buff for struct BM of wind->rows & wind->cols.

This routine simply loads the map into the bitmap by repetitve calls to get_map_row. Any value other than 0 in the map will set the bitmap. (may want to change later to allow specific value to set)

Changed to use null.

Parameters
windcurrent window
map_nameraster map name
[out]buffdata buffer
Returns
1 on success
-1 on failure

Definition at line 512 of file gs3.c.

◆ Gs_loadmap_as_char()

int Gs_loadmap_as_char ( struct Cell_head wind,
const char *  map_name,
unsigned char *  buff,
struct BM nullmap,
int *  has_null 
)

Load raster map as integer map.

Calling function must have already allocated space in buff for wind->rows * wind->cols unsigned chars.

This routine simply loads the map into a 2d array by repetitve calls to get_map_row.

Since signs of chars can be tricky, we only load positive chars between 0-255.

Todo:
fn body Gs_loadmap_as_float()
Parameters
windcurrent window
map_nameraster map name
[out]buffdata buffer
[out]nullmapnull map buffer
[out]has_nullindicates if raster map contains null-data
Returns
1 on success
-1 on failure
-2 if read ok, but 1 or more values were too large (small) to fit into an unsigned char. (in which case the max (min) char is used)

Definition at line 412 of file gs3.c.

◆ Gs_loadmap_as_float()

int Gs_loadmap_as_float ( struct Cell_head wind,
const char *  map_name,
float *  buff,
struct BM nullmap,
int *  has_null 
)

Load raster map as floating point map.

Calling function must have already allocated space in buff for wind->rows * wind->cols floats.

This routine simply loads the map into a 2d array by repetitve calls to get_f_raster_row.

Parameters
windcurrent window
map_nameraster map name
[out]buffdata buffer
[out]nullmapnull map buffer
[out]has_nullindicates if raster map contains null-data
Returns
1 on success
0 on failure

Definition at line 109 of file gs3.c.

◆ Gs_loadmap_as_int()

int Gs_loadmap_as_int ( struct Cell_head wind,
const char *  map_name,
int *  buff,
struct BM nullmap,
int *  has_null 
)

Load raster map as integer map.

Calling function must have already allocated space in buff for wind->rows * wind->cols floats.

This routine simply loads the map into a 2d array by repetitve calls to get_f_raster_row.

Todo:
fn body of Gs_loadmap_as_float()
Parameters
windcurrent window
map_nameraster map name
[out]buffdata buffer
[out]nullmapnull map buffer
[out]has_nullindicates if raster map contains null-data
Returns
1 on success
0 on failure

Definition at line 173 of file gs3.c.

◆ Gs_loadmap_as_short()

int Gs_loadmap_as_short ( struct Cell_head wind,
const char *  map_name,
short *  buff,
struct BM nullmap,
int *  has_null 
)

Load raster map as integer map.

Calling function must have already allocated space in buff for wind->rows * wind->cols shorts.

This routine simply loads the map into a 2d array by repetitve calls to get_map_row.

Parameters
windcurrent window
map_nameraster map name
[out]buffdata buffer
[out]nullmapnull map buffer
[out]has_nullindicates if raster map contains null-data
Returns
1 on success
-1 on failure,
-2 if read ok, but 1 or more values were too large (small) to fit into a short (in which case the max (min) short is used)

Definition at line 307 of file gs3.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 3002 of file gs2.c.

References GS_distance(), GS_get_selected_point_on_surface(), gs_get_surf(), GS_set_focus(), gsd_get_los(), g_surf::ox, g_surf::oy, X, x, g_surf::x_trans, Y, g_surf::y_trans, Z, and g_surf::z_trans.

Referenced by Nviz_look_here().

◆ gs_los_intersect()

int gs_los_intersect ( int  surfid,
float **  los,
float *  point 
)

Crude method of intersecting line of sight with closest part of surface.

This version uses the shadow of the los projected down to the surface to generate a line_on_surf, then follows each point in that line until the los intersects it.

Parameters
surfidsurface id
losshould be in surf-world coordinates
[out]pointintersect point (real)
Returns
0 on failure
1 on success

Definition at line 192 of file gs_query.c.

◆ gs_los_intersect1()

int gs_los_intersect1 ( int  surfid,
float(*)  los[3],
float *  point 
)

Crude method of intersecting line of sight with closest part of surface.

Uses los vector to determine the point of first intersection which is returned in point. Returns 0 if los doesn't intersect.

Parameters
surfidsurface id
losshould be in surf-world coordinates
[out]pointintersect point (real)
Returns
0 on failure
1 on success

Definition at line 52 of file gs_query.c.

◆ gs_malloc_att_buff()

size_t gs_malloc_att_buff ( geosurf gs,
int  desc,
int  type 
)

Allocate attribute buffer.

Parameters
gspointer to geosurf struct
descattribute id (descriptor)
typebuffer type (based on raster map type)
Returns
-1 on error
amount of allocated memory

Definition at line 717 of file gs.c.

◆ gs_malloc_lookup()

int gs_malloc_lookup ( geosurf gs,
int  desc 
)

Allocate attribute lookup.

Parameters
gspointer to geosurf struct
descattribute id
Returns
-1 on error
pointer to typbuff (casted)

Definition at line 746 of file gs.c.

References g_surf::att, gsurf_att::att_type, ATTY_CHAR, ATTY_SHORT, G_debug(), G_free(), G_malloc, G_warning(), gsurf_att::lookup, and NULL.

◆ gs_mapcolor()

int gs_mapcolor ( typbuff cobuff,
gsurf_att coloratt,
int  offset 
)

Call this one when you already know att_src is MAP_ATT.

Parameters
cobuff
colorattcolor attribute
offsetoffset value
Returns
packed color for category at offset

Definition at line 968 of file gs.c.

References typbuff::cb, typbuff::ib, and gsurf_att::lookup.

Referenced by GS_get_val_at_xy(), gs_update_curmask(), gsd_wire_arrows(), gsd_wire_surf_const(), and gsd_wire_surf_map().

◆ gs_mask_defined()

int gs_mask_defined ( geosurf gs)

Check if mask is defined.

Parameters
gspointer to geosurf struct
Returns
1 if defined
0 not defined

Definition at line 914 of file gs.c.

References g_surf::att, ATT_MASK, gsurf_att::att_src, and NOTSET_ATT.

Referenced by gs_update_curmask().

◆ gs_masked()

int gs_masked ( typbuff tb,
int  col,
int  row,
int  offset 
)

Should only be called when setting up the current mask (gs_bm.c)

Parameters
tbpointer to typbuff
colnumber of cols
rownumber of rows
offsetoffset value
Returns
1
0

Definition at line 932 of file gs.c.

References typbuff::bm, BM_get(), typbuff::cb, typbuff::fb, typbuff::ib, and typbuff::sb.

Referenced by gs_update_curmask().

◆ GS_moveto()

void GS_moveto ( float *  pt)

Move viewpoint.

Parameters
pt'from' model coordinates

Definition at line 2613 of file gs2.c.

References G_debug().

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 2643 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 exceeded)

Definition at line 268 of file gs2.c.

References GS_get_light_reset(), GS_set_light_reset(), and MAX_LIGHTS.

◆ 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 exceeded)

Definition at line 223 of file gs2.c.

References G_debug().

◆ gs_num_datah_reused()

int gs_num_datah_reused ( int  dh)

Get number of reused values.

Parameters
dhvalue
Returns
number of reused values

Definition at line 597 of file gs.c.

References G_debug().

◆ gs_num_surfaces()

int gs_num_surfaces ( void  )

Get number of surfaces.

Returns
number of surfaces

Definition at line 128 of file gs.c.

Referenced by GS_draw_cplane(), and GS_num_surfs().

◆ GS_num_surfs()

int GS_num_surfs ( void  )

Get number of surfaces.

Returns
number of surfaces

Definition at line 1515 of file gs2.c.

References gs_num_surfaces().

◆ Gs_numtype()

int Gs_numtype ( const char *  filename,
int *  negflag 
)

Get map data type.

Parameters
filenameraster map name
negflag
Returns
-1 if map is integer and Rast_read_range() fails
data type (ARRY_*)

Definition at line 225 of file gs3.c.

◆ GS_P2distance()

float GS_P2distance ( float *  from,
float *  to 
)

Calculate distance in plane.

Parameters
from'from' point (X,Y)
to'to' point (X,Y)
Returns
distance

Definition at line 160 of file gs_util.c.

References X, x, and Y.

Referenced by gv_line_length(), and seg_intersect_vregion().

◆ Gs_pack_colors()

void Gs_pack_colors ( const char *  filename,
int *  buff,
int  rows,
int  cols 
)

Pack color table.

Passed an array of 32 bit ints that is converted from cell values to packed colors (0xbbggrr)

Parameters
filenameraster map name
buff
rowsnumber of rows
colsnumber of cols

Definition at line 632 of file gs3.c.

◆ Gs_pack_colors_float()

void Gs_pack_colors_float ( const char *  filename,
float *  fbuf,
int *  ibuf,
int  rows,
int  cols 
)

Pack color table (floating-point map)

Passed a array of floats that will be converted from cell values to packed colors (0xbbggrr) and float to int Floating point data not freed here, use: gsds_free_data_buff(id, ATTY_FLOAT)

Parameters
filenameraster map name
fbuf
ibuf
rowsnumber of rows
colsnumber of cols

Definition at line 700 of file gs3.c.

◆ gs_point_in_region()

int gs_point_in_region ( geosurf gs,
float *  pt,
float *  region 
)

Check if point is in region.

Check for cancel every CHK_FREQ points

Parameters
gssurface (geosurf)
ptpoint (array(X,Y,Z))
regionregion settings (array (top,bottom,left,right))
Returns
0 point outside of region
1 point inside region

Definition at line 39 of file gpd.c.

◆ gs_point_is_masked()

int gs_point_is_masked ( geosurf gs,
float *  pt 
)

Check if point is masked.

Parameters
gspointer to geosurf struct
ptpoint coordinates (X,Y,Z)
Returns
1 masked
0 not masked

Definition at line 1314 of file gs.c.

References BM_get(), g_surf::curmask, MASK_BL, MASK_BR, MASK_TL, MASK_TR, VCOL2DCOL, VCOL2X, VCOLS, VROW2DROW, VROW2Y, VROWS, VXRES, VYRES, X, X2VCOL, Y, and Y2VROW.

Referenced by GS_get_cat_at_xy(), GS_get_norm_at_xy(), GS_get_val_at_xy(), gvd_draw_lineonsurf(), and viewcell_tri_interp().

◆ gs_put_label()

void gs_put_label ( const char *  text,
GLuint  fontbase,
int  size,
unsigned long  color,
int *  pt 
)

Put label.

Todo:
Allocate label dynamically
Parameters
fontbasefontbase settings
sizefont size
colorfont color
pt

Definition at line 41 of file gsd_label.c.

◆ GS_ready_draw()

void GS_ready_draw ( void  )

◆ Gs_save_3dview()

int Gs_save_3dview ( const char *  ,
geoview ,
geodisplay ,
struct Cell_head ,
geosurf  
)

Referenced by GS_save_3dview().

◆ 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 3312 of file gs2.c.

References Gs_save_3dview().

◆ gs_set_att_const()

int gs_set_att_const ( geosurf gs,
int  desc,
float  constant 
)

Set attribute constant value.

Todo:
set typbuf constant
Parameters
gspointer to geosurf struct
descattribute id
constantconstant value
Returns
0 on success
-1 on error

Definition at line 871 of file gs.c.

References g_surf::att, ATT_MASK, CONST_ATT, gsurf_att::constant, G_debug(), gs_set_att_src(), Gs_update_attrange(), g_surf::gsurf_id, and g_surf::mask_needupdate.

Referenced by GS_set_att_const().

◆ 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 1403 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_att_src()

int gs_set_att_src ( geosurf gs,
int  desc,
int  src 
)

Set attribute source.

Parameters
gspointer to geosurf struct
descattribute id (descriptor)
srcsource id
Returns
-1 on error
0 on success

Definition at line 826 of file gs.c.

Referenced by gs_set_att_const(), and GS_unset_att().

◆ gs_set_att_type()

int gs_set_att_type ( geosurf gs,
int  desc,
int  type 
)

Set attribute type.

Parameters
gspointer to geosurf struct
descattribute id
typeattribute type
Returns
-1 on error
0 on success

Definition at line 802 of file gs.c.

◆ GS_set_cancel()

void GS_set_cancel ( int  c)

Set cancel.

Definition at line 40 of file gsx.c.

◆ 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 1476 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 3211 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 3119 of file gs2.c.

References gsd_cplane_setrot().

◆ 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 3132 of file gs2.c.

References gsd_cplane_settrans().

◆ GS_set_cxl_func()

void GS_set_cxl_func ( void(*)(void)  f)

Set cxl function.

Parameters
pointerto function

Definition at line 52 of file gsx.c.

References Cxl_func.

◆ gs_set_defaults()

void gs_set_defaults ( geosurf gs,
float *  defs,
float *  null_defs 
)

Set default attribute values.

Parameters
gspointer to geosurf struct
defsarray of default values (dim MAX_ATTRS)
null_defsarray of null default values (dim MAX_ATTRS)

Definition at line 441 of file gs.c.

References g_surf::att, gsurf_att::att_src, gsurf_att::constant, gsurf_att::default_null, G_debug(), g_surf::gsurf_id, gsurf_att::hdata, gsurf_att::lookup, MAX_ATTS, NOTSET_ATT, and NULL.

◆ 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 2081 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 2219 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 1951 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 3252 of file gs2.c.

◆ GS_set_focus()

void GS_set_focus ( float *  realto)

Set focus.

Parameters
realtoreal coordinates to

Definition at line 2517 of file gs2.c.

References G_debug().

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 2578 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 2535 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 2838 of file gs2.c.

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 1975 of file gs2.c.

References G_debug().

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 2962 of file gs2.c.

References G_debug().

Referenced by Nviz_set_focus_state().

◆ GS_set_light_reset()

void GS_set_light_reset ( int  i)

Definition at line 250 of file gs2.c.

Referenced by GS_new_light().

◆ gs_set_maskmode()

void gs_set_maskmode ( int  invert)

Set geosurf mask mode.

Parameters
invertinvert mask

Definition at line 899 of file gs.c.

Referenced by gs_update_curmask().

◆ 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 1427 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 564 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 2948 of file gs2.c.

References G_debug().

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 2129 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 2882 of file gs2.c.

Referenced by Nviz_set_rotation().

◆ GS_set_rotation_matrix()

void GS_set_rotation_matrix ( double *  matrix)

Set rotation matrix.

Definition at line 2936 of file gs2.c.

◆ GS_set_SDscale()

int GS_set_SDscale ( float  scale)

Set ?

Parameters
scalescale value
Returns
1

Definition at line 1062 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 1041 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 2389 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 2872 of file gs2.c.

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 2818 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 2976 of file gs2.c.

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

◆ 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 2012 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 2059 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 2196 of file gs2.c.

Referenced by Gs_load_3dview().

◆ gs_setall_norm_needupdate()

int gs_setall_norm_needupdate ( void  )

Set for geosurf need-to-update mark.

Returns
-1 no surface available
1 on success

Definition at line 1287 of file gs.c.

◆ 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 400 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 356 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_setlos_enterdata()

int gs_setlos_enterdata ( Point3 los)

Gets all current cutting planes & data bounding planes

Intersects los with resulting convex polyhedron, then replaces los[FROM] with first point on ray inside data.

Parameters
[out]los
Returns
0 on failure
1 on success

Definition at line 529 of file gs_query.c.

References FROM, FRONTFACE, GS_distance(), gs_get_databounds_planes(), GS_v3add(), GS_v3dir(), GS_v3mult(), gsd_get_cplanes(), MISSED, RayCvxPolyhedronInt(), and TO.

◆ 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 470 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 489 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 1384 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 3223 of file gs2.c.

References gsd_cplane_off().

◆ GS_unset_rotation()

void GS_unset_rotation ( void  )

Stop scene rotation.

Definition at line 2896 of file gs2.c.

Referenced by Nviz_unset_rotation().

◆ GS_unset_SDsurf()

void GS_unset_SDsurf ( void  )

Unset Scaled Difference surface.

Definition at line 1025 of file gs2.c.

References gsdiff_set_SDref(), and NULL.

◆ Gs_update_attrange()

int Gs_update_attrange ( geosurf gs,
int  desc 
)

◆ gs_update_curmask()

◆ 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 989 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 1111 of file gs2.c.

References gs_calc_normals(), and gs_get_surf().

◆ GS_v2dir()

void GS_v2dir ( float *  v1,
float *  v2,
float *  v3 
)

Get a normalized direction from v1 to v2, store in v3 (2D)

Parameters
v1first vector
v2second vector
[out]v3output vector
Returns
0 if magnitude of dx is zero
1 if magnitude of dx > 0

Definition at line 382 of file gs_util.c.

References X, and Y.

◆ GS_v2norm()

int GS_v2norm ( float *  v1)

Change v1 so that it is a unit vector (3D)

Parameters
[in,out]v1vector
Returns
0 if magnitude of v1 is zero
1 if magnitude of v1 > 0

Definition at line 271 of file gs_util.c.

References X, and Y.

◆ GS_v3add()

void GS_v3add ( float *  v1,
float *  v2 
)

Sum vectors.

v1 += v2

Parameters
[in,out]v1first vector
v2second vector

Definition at line 195 of file gs_util.c.

References X, Y, and Z.

Referenced by gs_setlos_enterdata().

◆ GS_v3cross()

void GS_v3cross ( float *  v1,
float *  v2,
float *  v3 
)

Get the cross product v3 = v1 cross v2.

Parameters
v1first vector
v2second vector
[out]v3output vector

Definition at line 403 of file gs_util.c.

References X, Y, and Z.

◆ GS_v3dir()

int GS_v3dir ( float *  v1,
float *  v2,
float *  v3 
)

Get a normalized direction from v1 to v2, store in v3.

Parameters
v1first vector
v2second vector
[out]v3output vector
Returns
0 if magnitude of dx is zero
1 if magnitude of dx > 0

Definition at line 351 of file gs_util.c.

References X, Y, and Z.

Referenced by GS_get_viewdir(), gs_setlos_enterdata(), and gsd_get_zup().

◆ GS_v3eq()

void GS_v3eq ( float *  v1,
float *  v2 
)

Copy vector values.

v1 = v2

Parameters
[out]v1first vector
v2second vector

Definition at line 178 of file gs_util.c.

References X, Y, and Z.

Referenced by gpd_obj(), GS_get_from(), GS_get_from_real(), GS_get_to(), Gs_save_3dview(), gsd_check_focus(), gsd_zup_twist(), and gsdrape_get_allsegments().

◆ GS_v3mag()

void GS_v3mag ( float *  v1,
float *  mag 
)

Magnitude of vector.

Parameters
v1vector
[out]magmagnitude value

Definition at line 418 of file gs_util.c.

References X, Y, and Z.

◆ GS_v3mult()

void GS_v3mult ( float *  v1,
float  k 
)

Multiple vectors.

v1 *= k

Parameters
[in,out]v1vector
kmultiplicator

Definition at line 229 of file gs_util.c.

References X, Y, and Z.

Referenced by Gs_save_3dview(), gs_setlos_enterdata(), and gsd_check_focus().

◆ GS_v3norm()

int GS_v3norm ( float *  v1)

Change v1 so that it is a unit vector (2D)

Parameters
[in,out]v1vector
Returns
0 if magnitude of v1 is zero
1 if magnitude of v1 > 0

Definition at line 246 of file gs_util.c.

References X, Y, and Z.

◆ GS_v3normalize()

int GS_v3normalize ( float *  v1,
float *  v2 
)

Change v2 so that v1v2 is a unit vector.

Parameters
v1first vector
v2[in,out]second vector
Returns
0 if magnitude of dx is zero
1 if magnitude of dx > 0

Definition at line 321 of file gs_util.c.

References X, Y, and Z.

Referenced by gsd_check_focus().

◆ GS_v3sub()

void GS_v3sub ( float *  v1,
float *  v2 
)

Subtract vectors.

v1 -= v2

Parameters
[in,out]v1first vector
v2second vector

Definition at line 212 of file gs_util.c.

References X, Y, and Z.

◆ GS_write_ppm()

int GS_write_ppm ( const char *  name)

Save current GL screen to ppm file.

Parameters
namefile name
Returns
1 on failure
0 on success

Definition at line 41 of file gsd_img_ppm.c.

References _, b, g, G_free(), G_warning(), gsd_getimage(), name, NULL, r, and x.

◆ GS_write_tif()

int GS_write_tif ( const char *  name)

Write data to tif file.

Parameters
namefilename
Returns
1 on error
0 on success

Definition at line 53 of file gsd_img_tif.c.

References _, config, G_free(), G_malloc, G_warning(), gsd_getimage(), name, NULL, rowsperstrip, and x.

◆ GS_write_zoom()

int GS_write_zoom ( const char *  name,
unsigned int  xsize,
unsigned int  ysize 
)

Write zoom to file.

Parameters
namefile name
xsize,ysize
Returns
1 on failure
0 on success

Definition at line 87 of file gsd_img_ppm.c.

References _, b, free(), g, G_warning(), gsd_writeView(), name, NULL, r, and x.

◆ 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 2767 of file gs2.c.

◆ gsbm_and_masks()

int gsbm_and_masks ( struct BM bmvar,
struct BM bmcon 
)

Mask bitmap (mask type ADD)

Must be same size, ADDs bitmaps & stores in bmvar

Parameters
bmvarbitmap (BM) to changed
bmcombitmap (BM)
mask_typemask type (see mask types macros)
Returns
-1 on failure (bitmap mispatch)
0 on success

Definition at line 201 of file gs_bm.c.

◆ gsbm_make_mask()

struct BM* gsbm_make_mask ( typbuff frombuff,
float  maskval,
int  rows,
int  cols 
)

Do combining of bitmaps, make bitmaps from other data w/maskval.

Parameters
frombuffdata buffer
maskvalmask type
rowsnumber of rows
colsnumber of cols
Returns
pointer to BM struct

Definition at line 35 of file gs_bm.c.

References typbuff::bm, BM_create(), BM_get(), BM_set(), BM::cols, GET_MAPATT, and BM::rows.

Referenced by gs_update_curmask().

◆ gsbm_or_masks()

int gsbm_or_masks ( struct BM bmvar,
struct BM bmcon 
)

Mask bitmap (mask type OR)

Must be same size, ORs bitmaps & stores in bmvar

Parameters
bmvarbitmap (BM) to changed
bmcombitmap (BM)
mask_typemask type (see mask types macros)
Returns
-1 on failure (bitmap mispatch)
0 on success

Definition at line 167 of file gs_bm.c.

Referenced by gs_update_curmask().

◆ gsbm_ornot_masks()

int gsbm_ornot_masks ( struct BM bmvar,
struct BM bmcon 
)

Mask bitmap (mask type ORNOT)

Must be same size, ORNOTs bitmaps & stores in bmvar

Parameters
bmvarbitmap (BM) to changed
bmcombitmap (BM)
mask_typemask type (see mask types macros)
Returns
-1 on failure (bitmap mispatch)
0 on success

Definition at line 184 of file gs_bm.c.

Referenced by gs_update_curmask().

◆ gsbm_xor_masks()

int gsbm_xor_masks ( struct BM bmvar,
struct BM bmcon 
)

Mask bitmap (mask type XOR)

Must be same size, XORs bitmaps & stores in bmvar

Parameters
bmvarbitmap (BM) to changed
bmcombitmap (BM)
mask_typemask type (see mask types macros)
Returns
-1 on failure (bitmap mispatch)
0 on success

Definition at line 218 of file gs_bm.c.

◆ gsbm_zero_mask()

void gsbm_zero_mask ( struct BM map)

Zero mask.

Parameters
mappointer to BM struct

Definition at line 77 of file gs_bm.c.

References BM::bytes, BM::data, and BM::rows.

Referenced by gs_update_curmask().

◆ gsd_3darrow()

void gsd_3darrow ( float *  center,
unsigned long  colr,
float  siz1,
float  siz2,
float *  dir,
float  sz 
)

Draw 3d north arrow.

Parameters
centercenter point
colrcolor value
siz1height
siz2is diameter
dir
sz

Definition at line 1057 of file gsd_objs.c.

◆ gsd_3dcursor()

void gsd_3dcursor ( float *  pt)

Draw 3d cursor.

Parameters
ptpoint

Definition at line 688 of file gsd_objs.c.

References gsd_bgnline(), gsd_endline(), gsd_vert_func(), X, Y, and Z.

◆ gsd_arrow()

int gsd_arrow ( float *  center,
unsigned long  colr,
float  siz,
float *  dir,
float  sz,
geosurf onsurf 
)

ADD.

siz is height, sz is global exag to correct for.

If onsurf in non-null, z component of dir is dropped and line-on-suf is used, resulting in length of arrow being proportional to slope

Parameters
centercenter point
colrcolor value
sizsize value
dir
sz
onsurfsurface (geosurf)
Returns
1 no surface given
0 on surface

Definition at line 898 of file gsd_objs.c.

Referenced by gsd_wire_arrows().

◆ gsd_arrow_onsurf()

int gsd_arrow_onsurf ( float *  base,
float *  tip,
unsigned long  colr,
int  wid,
geosurf gs 
)

Draw north arrow on surface.

Parameters
base
tip
colr
wid
gssurface (geosurf)
Returns
0

Definition at line 970 of file gsd_objs.c.

◆ gsd_backbuffer()

void gsd_backbuffer ( void  )

Draw to the back buffer.

Definition at line 470 of file gsd_prim.c.

◆ gsd_backface()

void gsd_backface ( int  n)

ADD.

Parameters
n

Definition at line 254 of file gsd_prim.c.

◆ gsd_bgn_legend_viewport()

void gsd_bgn_legend_viewport ( GLint  wl,
GLint  wb,
GLint  wr,
GLint  wt 
)

ADD.

Parameters
wl
wb
wr
wt

Definition at line 61 of file gsd_legend.c.

References CM_COLOR, GS_ready_draw(), GS_set_draw(), gsd_colormode(), GSD_FRONT, gsd_linewidth(), gsd_popmatrix(), and gsd_pushmatrix().

◆ gsd_bgnline()

◆ gsd_bgnlist()

void gsd_bgnlist ( int  listno,
int  do_draw 
)

ADD.

Parameters
listno
do_draw

Definition at line 1125 of file gsd_prim.c.

◆ gsd_bgnpolygon()

void gsd_bgnpolygon ( void  )

Delimit the vertices of a primitive or a group of like primitives.

Definition at line 372 of file gsd_prim.c.

Referenced by gsd_box(), gsd_cube(), gsd_diamond(), gsd_north_arrow(), and gsd_scalebar().

◆ gsd_bgnqstrip()

void gsd_bgnqstrip ( void  )

ADD.

Definition at line 277 of file gsd_prim.c.

Referenced by gsd_fringe_horiz_poly(), and gsd_fringe_vert_poly().

◆ gsd_bgntfan()

void gsd_bgntfan ( void  )

ADD.

Definition at line 337 of file gsd_prim.c.

◆ gsd_bgntmesh()

void gsd_bgntmesh ( void  )

ADD.

Definition at line 297 of file gsd_prim.c.

Referenced by gsd_diamond().

◆ gsd_bgntstrip()

void gsd_bgntstrip ( void  )

ADD.

Definition at line 317 of file gsd_prim.c.

◆ gsd_blend()

void gsd_blend ( int  yesno)

Specify pixel arithmetic.

Parameters
yesnoturn on/off

Definition at line 994 of file gsd_prim.c.

◆ gsd_bothbuffers()

void gsd_bothbuffers ( void  )

Draw to the front and back buffers.

Definition at line 446 of file gsd_prim.c.

◆ gsd_box()

void gsd_box ( float *  center,
int  colr,
float *  siz 
)

Draw box.

Warning siz is an array (we need it for scale only Z in histograms)

Parameters
centercenter point
colrcolor value
sizsize value

Definition at line 1411 of file gsd_objs.c.

References Box, BoxN, gsd_bgnpolygon(), gsd_endpolygon(), gsd_getshademodel(), gsd_litvert_func(), gsd_popmatrix(), gsd_pushmatrix(), gsd_scale(), gsd_shademodel(), gsd_translate(), X, Y, and Z.

Referenced by gpd_obj().

◆ gsd_call_label()

void gsd_call_label ( void  )

Call display list and draw defined labels – called from gsd_prim (gsd_call_lists)

Definition at line 119 of file gsd_label.c.

References label_base, and MAX_LIST.

◆ gsd_calllist()

void gsd_calllist ( int  listno)

ADD.

Parameters
listno

Definition at line 1173 of file gsd_prim.c.

Referenced by GS_draw_list().

◆ gsd_calllists()

void gsd_calllists ( int  )

Referenced by GS_draw_all_list().

◆ gsd_check_focus()

void gsd_check_focus ( geoview gv)

Check focus.

Parameters
gvview (geoview)

Definition at line 216 of file gsd_views.c.

References FROM, geoview::from_to, GS_get_zrange(), GS_v3eq(), GS_v3mult(), GS_v3normalize(), geoview::infocus, geoview::real_to, geoview::scale, TO, geoview::vert_exag, and Z.

Referenced by gsd_set_view().

◆ gsd_checkpoint()

int gsd_checkpoint ( float  pt[4],
int  window[4],
int  viewport[4],
double  modelMatrix[16],
double  projMatrix[16] 
)

ADD.

Parameters
pt
widnow
viewport
doubleMatrix
projMatrix
Returns
0
1

Definition at line 585 of file gsd_prim.c.

◆ gsd_checkwindow()

void gsd_checkwindow ( int *  ,
int *  ,
double *  ,
double *   
)

◆ gsd_circ()

void gsd_circ ( float  x,
float  y,
float  rad 
)

ADD.

Parameters
x,y
rad

Definition at line 167 of file gsd_prim.c.

References x.

Referenced by gsd_draw_gyro().

◆ gsd_coarse_surf_map()

int gsd_coarse_surf_map ( geosurf surf)

Draw coarse surface.

New (TEST) wire routine that draws low res surface Based on new Trinagle Fan routine Resolution is a function of current surface resolution times wire resolution

Todo:
normals have to be recalculated before proper low res surface can be drawn

In window optimization has been removed

Parameters
surfsurface (geosurf)
Returns

Definition at line 572 of file gsd_wire.c.

Referenced by gsd_wire_surf().

◆ gsd_color_func()

void gsd_color_func ( unsigned int  col)

◆ gsd_colormode()

void gsd_colormode ( int  cm)

Set color mode.

Call glColorMaterial before enabling the GL_COLOR_MATERIAL

Parameters
cmcolor mode value

Definition at line 98 of file gsd_prim.c.

References CM_AD, CM_COLOR, CM_DIFFUSE, CM_EMISSION, and CM_NULL.

Referenced by gpd_obj(), gsd_bgn_legend_viewport(), gsd_display_fringe(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), and gvld_wind3_box().

◆ gsd_cplane_off()

void gsd_cplane_off ( int  num)

Turn off clip plane.

Parameters
numcplane id

Definition at line 126 of file gsd_cplane.c.

References gsd_set_clipplane().

Referenced by GS_draw_lighting_model(), and GS_unset_cplane().

◆ gsd_cplane_on()

void gsd_cplane_on ( int  num)

ADD.

Parameters
num

Definition at line 104 of file gsd_cplane.c.

Referenced by GS_set_cplane().

◆ gsd_cplane_setrot()

void gsd_cplane_setrot ( int  num,
float  rx,
float  ry,
float  rz 
)

ADD.

Parameters
num
rx,ry,rz

Definition at line 211 of file gsd_cplane.c.

Referenced by GS_set_cplane_rot().

◆ gsd_cplane_settrans()

void gsd_cplane_settrans ( int  num,
float  tx,
float  ty,
float  tz 
)

ADD.

Parameters
num
tx,ty,tz

Definition at line 229 of file gsd_cplane.c.

Referenced by GS_set_cplane_trans().

◆ gsd_cube()

void gsd_cube ( float *  center,
unsigned long  colr,
float  siz 
)

Draw cube.

Added by Hamish Bowman Nov 2005

Parameters
centercenter point
colrcolor value
sizsize value

Definition at line 407 of file gsd_objs.c.

References CubeNormals, CubeVertices, gsd_bgnpolygon(), gsd_endpolygon(), gsd_getshademodel(), gsd_litvert_func(), gsd_popmatrix(), gsd_pushmatrix(), gsd_scale(), gsd_shademodel(), gsd_translate(), X, Y, and Z.

Referenced by gpd_obj().

◆ gsd_def_clipplane()

void gsd_def_clipplane ( int  num,
double *  params 
)

Define clip plane.

Parameters
num
params

Definition at line 1014 of file gsd_prim.c.

◆ gsd_def_cplane()

void gsd_def_cplane ( int  num,
float *  pt,
float *  norm 
)

Define cplace.

Parameters
num
pt
norm

Definition at line 55 of file gsd_cplane.c.

◆ gsd_deflight()

void gsd_deflight ( int  num,
struct lightdefs vals 
)

Define light.

Parameters
numlight id (starts with 1)
valsposition(x,y,z,w), color, ambientm, emission

Definition at line 836 of file gsd_prim.c.

References MAX_LIGHTS.

◆ gsd_deletelist()

void gsd_deletelist ( GLuint  ,
int   
)

Referenced by GS_delete_list().

◆ gsd_diamond()

void gsd_diamond ( float *  center,
unsigned long  colr,
float  siz 
)

Draw diamond symbol.

Parameters
centercenter point
colrcolor value
sizesize value

Definition at line 305 of file gsd_objs.c.

References gsd_bgnpolygon(), gsd_bgntmesh(), gsd_endpolygon(), gsd_endtmesh(), gsd_getshademodel(), gsd_litvert_func(), gsd_popmatrix(), gsd_pushmatrix(), gsd_scale(), gsd_shademodel(), gsd_swaptmesh(), gsd_translate(), Octo, OctoN, X, Y, and Z.

Referenced by gpd_obj().

◆ gsd_diamond_lines()

void gsd_diamond_lines ( void  )

Draw diamond lines.

Definition at line 554 of file gsd_objs.c.

References gsd_bgnline(), gsd_endline(), gsd_vert_func(), and Octo.

Referenced by gsd_draw_asterisk().

◆ gsd_disc()

void gsd_disc ( float  x,
float  y,
float  z,
float  rad 
)

ADD.

Parameters
x,y,z
rad

Definition at line 187 of file gsd_prim.c.

References x.

◆ gsd_display_fringe()

void gsd_display_fringe ( geosurf surf,
unsigned long  clr,
float  elev,
int  where[4] 
)

Display fridge.

Todo:
add elevation for bottom add color option add ruler grid lines
Parameters
surfsurface (geosurf)
clr
elev
where

Definition at line 51 of file gsd_fringe.c.

References CM_COLOR, FRINGE_FORE, FRINGE_WIDTH, gsd_color_func(), gsd_colormode(), gsd_fringe_horiz_line(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_linewidth(), gsd_zwritemask(), Neast, Nnorth, Nsouth, Nwest, VCOLS, VROWS, g_surf::z_exag, and g_surf::zrange.

Referenced by GS_draw_fringe().

◆ gsd_do_scale()

◆ gsd_draw_asterisk()

void gsd_draw_asterisk ( float *  center,
unsigned long  colr,
float  siz 
)

Draw asterisk.

Parameters
centercenter point
colrcolor value
sizsize value

Definition at line 581 of file gsd_objs.c.

References gsd_color_func(), gsd_diamond_lines(), gsd_popmatrix(), gsd_pushmatrix(), gsd_rot(), gsd_scale(), gsd_translate(), X, Y, and Z.

Referenced by gpd_obj().

◆ gsd_draw_box()

void gsd_draw_box ( float *  center,
unsigned long  colr,
float  siz 
)

Draw box.

Added by Hamish Bowman Nov 2005

Parameters
centercenter point
colrcolor value
sizsize value

Definition at line 483 of file gsd_objs.c.

References CubeVertices, gsd_bgnline(), gsd_color_func(), gsd_endline(), gsd_popmatrix(), gsd_pushmatrix(), gsd_scale(), gsd_translate(), gsd_vert_func(), X, Y, and Z.

Referenced by gpd_obj().

◆ gsd_draw_cplane()

void gsd_draw_cplane ( int  num)

Draw cplane.

Parameters
num

Definition at line 296 of file gsd_cplane.c.

References MAX_CPLANES.

Referenced by GS_draw_cplane().

◆ gsd_draw_cplane_fence()

void gsd_draw_cplane_fence ( geosurf ,
geosurf ,
int   
)

◆ gsd_draw_gyro()

void gsd_draw_gyro ( float *  center,
unsigned long  colr,
float  siz 
)

Draw gyro.

Parameters
centercenter point
colrcolor value
sizsize value

Definition at line 636 of file gsd_objs.c.

References gsd_bgnline(), gsd_circ(), gsd_color_func(), gsd_endline(), gsd_popmatrix(), gsd_pushmatrix(), gsd_rot(), gsd_scale(), gsd_translate(), gsd_vert_func(), Octo, X, Y, and Z.

Referenced by gpd_obj().

◆ gsd_drawsphere()

void gsd_drawsphere ( float *  center,
unsigned long  colr,
float  siz 
)

Draw sphere.

Parameters
centercenter point
colrcolor value
sizesize value

Definition at line 542 of file gsd_objs.c.

References gsd_color_func(), and gsd_sphere().

◆ gsd_end_legend_viewport()

void gsd_end_legend_viewport ( void  )

ADD.

Definition at line 91 of file gsd_legend.c.

References GS_done_draw(), GS_set_draw(), GSD_BACK, and gsd_popmatrix().

◆ gsd_endline()

◆ gsd_endlist()

void gsd_endlist ( void  )

End list.

Definition at line 1140 of file gsd_prim.c.

◆ gsd_endpolygon()

void gsd_endpolygon ( void  )

Delimit the vertices of a primitive or a group of like primitives.

Definition at line 387 of file gsd_prim.c.

Referenced by gsd_box(), gsd_cube(), gsd_diamond(), gsd_north_arrow(), and gsd_scalebar().

◆ gsd_endqstrip()

void gsd_endqstrip ( void  )

ADD.

Definition at line 287 of file gsd_prim.c.

Referenced by gsd_fringe_horiz_poly(), and gsd_fringe_vert_poly().

◆ gsd_endtfan()

void gsd_endtfan ( void  )

ADD.

Definition at line 347 of file gsd_prim.c.

◆ gsd_endtmesh()

void gsd_endtmesh ( void  )

ADD.

Definition at line 307 of file gsd_prim.c.

Referenced by gsd_diamond().

◆ gsd_endtstrip()

void gsd_endtstrip ( void  )

ADD.

Definition at line 327 of file gsd_prim.c.

◆ gsd_finish()

void gsd_finish ( void  )

Finish.

Does nothing, only called from src.contrib/GMSL/NVIZ2.2/src/glwrappers.c

Definition at line 1059 of file gsd_prim.c.

◆ gsd_flush()

void gsd_flush ( void  )

Mostly for flushing drawing commands across a network.

glFlush doesn't block, so if blocking is desired use glFinish.

Definition at line 84 of file gsd_prim.c.

Referenced by gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_north_arrow(), gsd_scalebar(), and gsd_scalebar_v2().

◆ gsd_fringe_horiz_line()

void gsd_fringe_horiz_line ( float  bot,
geosurf surf,
int  row,
int  side 
)

Draw fringe outline in x direction.

Parameters
botcoordinate of fringe bottom
surfsurface (geosurf)
rowrow along which is fringe drawn
side

Definition at line 227 of file gsd_fringe.c.

References ATT_TOPO, g_surf::cols, GET_MAPATT, GS_done_draw(), gs_get_att_typbuff(), GS_set_draw(), gsd_bgnline(), gsd_do_scale(), gsd_endline(), gsd_flush(), GSD_FRONT, gsd_popmatrix(), gsd_pushmatrix(), gsd_translate(), gsd_vert_func(), g_surf::rows, VCOLS, X, g_surf::x_mod, g_surf::x_trans, g_surf::xres, Y, g_surf::y_mod, g_surf::y_trans, g_surf::yres, Z, g_surf::z_exag, and g_surf::z_trans.

Referenced by gsd_display_fringe().

◆ gsd_fringe_horiz_poly()

void gsd_fringe_horiz_poly ( float  bot,
geosurf surf,
int  row,
int  side 
)

Draw fringe polygon in x direction.

Parameters
botcoordinate of fringe bottom
surfsurface (geosurf)
rowrow along which is fringe drawn
side

Definition at line 141 of file gsd_fringe.c.

References ATT_TOPO, g_surf::cols, GET_MAPATT, GS_done_draw(), gs_get_att_typbuff(), GS_set_draw(), gsd_bgnqstrip(), gsd_do_scale(), gsd_endqstrip(), gsd_flush(), GSD_FRONT, gsd_popmatrix(), gsd_pushmatrix(), gsd_translate(), gsd_vert_func(), g_surf::rows, VCOLS, X, g_surf::x_mod, g_surf::x_trans, g_surf::xres, Y, g_surf::y_mod, g_surf::y_trans, g_surf::yres, Z, g_surf::z_exag, and g_surf::z_trans.

Referenced by gsd_display_fringe().

◆ gsd_fringe_vert_line()

void gsd_fringe_vert_line ( float  bot,
geosurf surf,
int  col,
int  side 
)

Draw fringe outline in y direction.

Parameters
botcoordinate of fringe bottom
surfsurface (geosurf)
colcolumn along which is fringe drawn
side

Definition at line 407 of file gsd_fringe.c.

References ATT_TOPO, g_surf::cols, GET_MAPATT, GS_done_draw(), gs_get_att_typbuff(), GS_set_draw(), gsd_bgnline(), gsd_do_scale(), gsd_endline(), gsd_flush(), GSD_FRONT, gsd_popmatrix(), gsd_pushmatrix(), gsd_translate(), gsd_vert_func(), g_surf::rows, VROWS, X, g_surf::x_mod, g_surf::x_trans, g_surf::xres, Y, g_surf::y_mod, g_surf::y_trans, g_surf::yres, Z, g_surf::z_exag, and g_surf::z_trans.

Referenced by gsd_display_fringe().

◆ gsd_fringe_vert_poly()

void gsd_fringe_vert_poly ( float  bot,
geosurf surf,
int  col,
int  side 
)

Draw fringe outline in y direction.

Parameters
botcoordinate of fringe bottom
surfsurface (geosurf)
colcolumn along which is fringe drawn
side

Definition at line 322 of file gsd_fringe.c.

References ATT_TOPO, g_surf::cols, GET_MAPATT, GS_done_draw(), gs_get_att_typbuff(), GS_set_draw(), gsd_bgnqstrip(), gsd_do_scale(), gsd_endqstrip(), gsd_flush(), GSD_FRONT, gsd_popmatrix(), gsd_pushmatrix(), gsd_translate(), gsd_vert_func(), g_surf::rows, VROWS, X, g_surf::x_mod, g_surf::x_trans, g_surf::xres, Y, g_surf::y_mod, g_surf::y_trans, g_surf::yres, Z, g_surf::z_exag, and g_surf::z_trans.

Referenced by gsd_display_fringe().

◆ gsd_frontbuffer()

void gsd_frontbuffer ( void  )

Draw to the front buffer.

Definition at line 458 of file gsd_prim.c.

◆ gsd_get_cplanes()

int gsd_get_cplanes ( Point4 planes)

Get cplaces.

Planes MUST be big enough to hold MAX_CPLANES Point4s

Parameters
placessurface coordinates, normal pointing away from visible side
Returns
ADD

Definition at line 162 of file gsd_cplane.c.

References MAX_CPLANES.

Referenced by gs_setlos_enterdata().

◆ gsd_get_cplanes_state()

void gsd_get_cplanes_state ( int *  onstate)

Get cplane state.

onstate MUST be big enough to hold MAX_CPLANES ints

Parameters
onstate

Definition at line 142 of file gsd_cplane.c.

References MAX_CPLANES.

Referenced by GS_alldraw_cplane_fences(), and GS_draw_lighting_model().

◆ gsd_get_los()

int gsd_get_los ( float(*)  vect[3],
short  sx,
short  sy 
)

ADD.

Parameters
vect
sx,syscreen coordinates
Returns
1

Definition at line 40 of file gsd_views.c.

Referenced by GS_look_here().

◆ gsd_get_txtheight()

int gsd_get_txtheight ( int  size)

Get text height.

Parameters
sizesize
Returns
text height

Definition at line 53 of file gsd_fonts.c.

Referenced by gsd_north_arrow(), and gsd_scalebar().

◆ gsd_get_txtwidth()

int gsd_get_txtwidth ( const char *  s,
int  size 
)

Get text width.

Parameters
stext string
sizesize
Returns
text width

Definition at line 36 of file gsd_fonts.c.

Referenced by gsd_north_arrow(), and gsd_scalebar().

◆ gsd_get_zup()

void gsd_get_zup ( geoview gv,
double *  up 
)

Get z-up vector (z-direction)

Parameters
gvview (geoview)
upup vector

Definition at line 240 of file gsd_views.c.

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

Referenced by gsd_set_view().

◆ gsd_getfc()

int gsd_getfc ( void  )

ADD.

Returns

Definition at line 1217 of file gsd_surf.c.

Referenced by GS_get_fencecolor(), and GS_transp_is_set().

◆ gsd_getimage()

int gsd_getimage ( unsigned char **  pixbuf,
unsigned int *  xsize,
unsigned int *  ysize 
)

Get image of current GL screen.

Parameters
pixbufdata buffer
[out]xsize,ysizepicture dimension
Returns
0 on failure
1 on success

Definition at line 902 of file gsd_prim.c.

References b, l, r, and t.

Referenced by GS_write_ppm(), and GS_write_tif().

◆ gsd_getshademodel()

int gsd_getshademodel ( void  )

Get shaded model.

Returns
shade

Definition at line 438 of file gsd_prim.c.

Referenced by gsd_box(), gsd_cube(), and gsd_diamond().

◆ gsd_getwindow()

void gsd_getwindow ( int *  window,
int *  viewport,
double *  modelMatrix,
double *  projMatrix 
)

Get viewport.

Parameters
[out]window
viewport
modelMatrixmodel matrix
projMatrixprojection matrix

Definition at line 554 of file gsd_prim.c.

◆ gsd_init_lightmodel()

void gsd_init_lightmodel ( void  )

Initialize model light.

Definition at line 719 of file gsd_prim.c.

◆ gsd_line_onsurf()

void gsd_line_onsurf ( geosurf gs,
float *  v1,
float *  v2 
)

Line on surface, fix z-values.

Todo:
remove fudge, instead fudge the Z buffer
Parameters
gssurface (geosurf)
v1first point
v2second point

Definition at line 167 of file gsd_objs.c.

References FUDGE, gsd_bgnline(), gsd_endline(), gsd_vert_func(), gsdrape_get_segments(), and Z.

Referenced by gsd_x().

◆ gsd_linewidth()

void gsd_linewidth ( short  n)

Set width of rasterized lines.

Parameters
nline width

Definition at line 267 of file gsd_prim.c.

Referenced by GS_draw_X(), gsd_bgn_legend_viewport(), gsd_display_fringe(), gsd_scalebar_v2(), and gvld_wind3_box().

◆ gsd_litvert_func()

void gsd_litvert_func ( float *  norm,
unsigned long  col,
float *  pt 
)

Set the current normal vector & specify vertex.

Parameters
normnormal vector
colcolor value
ptpoint (model coordinates)

Definition at line 657 of file gsd_prim.c.

Referenced by gsd_box(), gsd_cube(), and gsd_diamond().

◆ gsd_litvert_func2()

void gsd_litvert_func2 ( float *  ,
unsigned long  ,
float *   
)

◆ gsd_make_nice_number()

int gsd_make_nice_number ( float *  num)

ADD.

Parameters
num
Returns
0 on error
1 on success

Definition at line 153 of file gsd_legend.c.

Referenced by gsd_get_nice_range().

◆ gsd_makelist()

int gsd_makelist ( void  )

ADD.

First time called, gets a bunch of objects, then hands them back when needed

Returns
-1 on failure
number of objects

Definition at line 1094 of file gsd_prim.c.

◆ gsd_model2real()

void gsd_model2real ( Point3  point)

Convert model to real coordinates.

Parameters
point[in,out]3d point (x,y,z)

Definition at line 393 of file gsd_views.c.

References max, and min.

Referenced by Gs_save_3dview().

◆ gsd_model2surf()

void gsd_model2surf ( geosurf gs,
Point3  point 
)

Convert model to surface coordinates.

Parameters
gssurface (geosurf)
point3d point (Point3)

Definition at line 414 of file gsd_views.c.

References GS_get_scale(), GS_get_zrange(), max, min, X, Y, and Z.

◆ gsd_nline_onsurf()

int gsd_nline_onsurf ( geosurf gs,
float *  v1,
float *  v2,
float *  pt,
int  n 
)

Multiline on surface, fix z-values.

Todo:
remove fudge, instead fudge the Z buffer

Like above, except only draws first n points of line, or np, whichever is less. Returns number of points used. Fills pt with last pt drawn.

Parameters
gssurface (geosurf)
v1first point
v2second point
pt
nnumber of segments
numberof vertices

Definition at line 213 of file gsd_objs.c.

References FUDGE, gsd_bgnline(), gsd_endline(), gsd_vert_func(), gsdrape_get_segments(), X, Y, and Z.

◆ gsd_norm_arrows()

int gsd_norm_arrows ( geosurf surf)

ADD.

Need to do Zexag scale of normal for arrow direction, drawing routine unexags z for arrow

Parameters
surfsurface (geosurf)
Returns

Definition at line 1805 of file gsd_surf.c.

Referenced by gsd_surf().

◆ gsd_north_arrow()

int gsd_north_arrow ( float *  pos2,
float  len,
GLuint  fontbase,
unsigned long  arw_clr,
unsigned long  text_clr 
)

Draw North Arrow takes OpenGL coords and size.

Parameters
pos2
len
fontbase
arw_clrnorth arrow color
text_clrtext color
Returns
1

Definition at line 803 of file gsd_objs.c.

References GS_done_draw(), GS_set_draw(), gsd_bgnpolygon(), gsd_color_func(), gsd_do_scale(), gsd_endpolygon(), gsd_flush(), GSD_FRONT, gsd_get_txtheight(), gsd_get_txtwidth(), gsd_popmatrix(), gsd_pushmatrix(), Ntop, X, Y, and Z.

◆ gsd_ortho_wall()

int gsd_ortho_wall ( int  np,
int  ns,
geosurf **  gsurfs,
Point3 **  points,
float *  norm 
)

ADD.

Parameters
np
ns
gsurfs
points
norm
Returns

Definition at line 1323 of file gsd_surf.c.

◆ gsd_plus()

void gsd_plus ( float *  center,
int  colr,
float  siz 
)

ADD.

Parameters
centercenter point
colrcolor value
sizsize value

Definition at line 130 of file gsd_objs.c.

References gsd_bgnline(), gsd_color_func(), gsd_endline(), gsd_vert_func(), X, Y, and Z.

◆ gsd_popmatrix()

◆ gsd_pushmatrix()

◆ gsd_put_legend()

GLuint gsd_put_legend ( const char *  name,
GLuint  fontbase,
int  size,
int *  flags,
float *  rangef,
int *  pt 
)

Put legend.

Parameters
name
fontbasefont-base
size
flags
rangef
pt
Returns

???

Definition at line 201 of file gsd_legend.c.

References st.

Referenced by GS_draw_legend().

◆ gsd_real2model()

void gsd_real2model ( Point3  point)

Convert real to model coordinates.

Parameters
point[in,out]3d point (Point3)

Definition at line 373 of file gsd_views.c.

References max, and min.

Referenced by GS_moveto_real().

◆ gsd_real2surf()

void gsd_real2surf ( geosurf gs,
Point3  point 
)

Convert real to surface coordinates.

Parameters
gssurface (geosurf)
[in,out]point3d point (Point3)

Definition at line 481 of file gsd_views.c.

References g_surf::ox, g_surf::oy, X, and Y.

Referenced by GS_get_cat_at_xy(), GS_get_norm_at_xy(), and GS_get_val_at_xy().

◆ gsd_remove_all()

void gsd_remove_all ( void  )

Remove all labels from display list.

Definition at line 107 of file gsd_label.c.

References label_base, label_id, and MAX_LIST.

◆ gsd_remove_curr()

void gsd_remove_curr ( void  )

Remove current label.

Definition at line 94 of file gsd_label.c.

References label_id.

◆ gsd_rot()

void gsd_rot ( float  angle,
char  axis 
)

ADD.

Parameters
angle
axis

Definition at line 605 of file gsd_prim.c.

References _, G_warning(), and x.

Referenced by gsd_draw_asterisk(), and gsd_draw_gyro().

◆ gsd_scale()

void gsd_scale ( float  xs,
float  ys,
float  zs 
)

Multiply the current matrix by a general scaling matrix.

Parameters
xsx scale value
ysy scale value
zsz scale value

Definition at line 525 of file gsd_prim.c.

Referenced by gpd_obj(), gsd_box(), gsd_cube(), gsd_diamond(), gsd_do_scale(), gsd_draw_asterisk(), gsd_draw_box(), and gsd_draw_gyro().

◆ gsd_scalebar()

int gsd_scalebar ( float *  pos2,
float  len,
GLuint  fontbase,
unsigned long  bar_clr,
unsigned long  text_clr 
)

Draw Scalebar takes OpenGL coords and size.

Adapted from gsd_north_arrow Hamish Bowman Dec 2006

Parameters
pos2
fontbasefont-base
bar_clrbarscale color
text_clrtext color
Returns
1

Definition at line 1136 of file gsd_objs.c.

References G_database_unit_name(), GS_done_draw(), GS_set_draw(), gsd_bgnpolygon(), gsd_color_func(), gsd_do_scale(), gsd_endpolygon(), gsd_flush(), GSD_FRONT, gsd_get_txtheight(), gsd_get_txtwidth(), gsd_popmatrix(), gsd_pushmatrix(), Ntop, TRUE, X, Y, and Z.

◆ gsd_scalebar_v2()

int gsd_scalebar_v2 ( float *  ,
float  ,
GLuint  ,
unsigned long  ,
unsigned long   
)

◆ gsd_set_clipplane()

void gsd_set_clipplane ( int  num,
int  able 
)

Set clip plane.

Parameters
num
able

Definition at line 1041 of file gsd_prim.c.

Referenced by gsd_cplane_off().

◆ gsd_set_font()

GLuint gsd_set_font ( const char *  )

◆ gsd_set_material()

void gsd_set_material ( int  set_shin,
int  set_emis,
float  sh,
float  em,
int  emcolor 
)

Set material.

Parameters
set_shin,set_emisflags
sh,emshould be 0. - 1.
emcolorpacked colors to use for emission

Definition at line 803 of file gsd_prim.c.

◆ gsd_set_view()

void gsd_set_view ( geoview gv,
geodisplay gd 
)

◆ gsd_setfc()

void gsd_setfc ( int  mode)

ADD.

Parameters
mode

Definition at line 1205 of file gsd_surf.c.

◆ gsd_shademodel()

void gsd_shademodel ( int  shade)

Set shaded model.

Parameters
shadenon-zero for GL_SMOOTH otherwise GL_FLAT

Definition at line 419 of file gsd_prim.c.

Referenced by GS_draw_surf(), gsd_box(), gsd_cube(), gsd_diamond(), and gvld_wind3_box().

◆ gsd_sphere()

void gsd_sphere ( float *  center,
float  siz 
)

ADD.

Parameters
centercenter-point
sizsize value

Definition at line 207 of file gsd_prim.c.

Referenced by gpd_obj(), and gsd_drawsphere().

◆ gsd_surf()

int gsd_surf ( geosurf surf)

◆ gsd_surf2model()

void gsd_surf2model ( Point3  point)

Convert surface to model coordinates.

Parameters
point3d point (Point3)

Definition at line 442 of file gsd_views.c.

References GS_get_scale(), GS_get_zrange(), max, min, X, Y, and Z.

Referenced by gsd_set_view().

◆ gsd_surf2real()

void gsd_surf2real ( geosurf gs,
Point3  point 
)

Convert surface to real coordinates.

Parameters
gssurface (geosurf)
[in,out]point3d point (Point3)

Definition at line 465 of file gsd_views.c.

References g_surf::ox, g_surf::oy, X, and Y.

◆ gsd_surf_const()

int gsd_surf_const ( geosurf surf,
float  k 
)

Using tmesh - not confident with qstrips portability.

Todo:
FIX: do_diff won't work right - needs normals - maybe calculate on the fly
Parameters
surfsurface (geosurf)
k
Returns

Definition at line 729 of file gsd_surf.c.

Referenced by gsd_surf().

◆ gsd_surf_func()

int gsd_surf_func ( geosurf ,
int(*)(void)   
)

◆ gsd_surf_map()

int gsd_surf_map ( geosurf surf)

Draw surface using triangle fan instead of strip.

Optimized by getting rid of BM_get mask check - GET_MAPPATT does same and returns zero if masked

Only do in window check on Fan center(v0) to further optimize – this runs the risk of trimming points in view !!

Parameters
surfsurface (geosurf)
Returns

Definition at line 2061 of file gsd_surf.c.

Referenced by gsd_surf().

◆ gsd_swapbuffers()

void gsd_swapbuffers ( void  )

Swap buffers.

Definition at line 482 of file gsd_prim.c.

◆ gsd_swaptmesh()

void gsd_swaptmesh ( void  )

ADD.

Definition at line 357 of file gsd_prim.c.

Referenced by gsd_diamond().

◆ gsd_switchlight()

void gsd_switchlight ( int  num,
int  on 
)

Switch light on/off.

Parameters
num
on1 for 'on', 0 turns them off

Definition at line 877 of file gsd_prim.c.

◆ gsd_translate()

void gsd_translate ( float  dx,
float  dy,
float  dz 
)

Multiply the current matrix by a translation matrix.

Parameters
dxx translation value
dyy translation value
dzz translation value

Definition at line 539 of file gsd_prim.c.

Referenced by GS_draw_X(), gsd_box(), gsd_cube(), gsd_diamond(), gsd_do_scale(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), and gvld_wind3_box().

◆ gsd_triangulated_wall()

int gsd_triangulated_wall ( int  npts1,
int  npts2,
geosurf surf1,
geosurf surf2,
Point3 points1,
Point3 points2,
float *  norm 
)

ADD.

Parameters
npts1
npts2
surf1first surface (geosurf)
surf2second surface (geosurf)
points1
points2
norm
Returns
1

Definition at line 1109 of file gsd_surf.c.

◆ gsd_update_cplanes()

void gsd_update_cplanes ( void  )

Update cplaces.

Called when viewing matrix changes

Definition at line 86 of file gsd_cplane.c.

References MAX_CPLANES.

Referenced by gsd_set_view().

◆ gsd_update_cpnorm()

void gsd_update_cpnorm ( int  num)

ADD.

Parameters
num

Definition at line 188 of file gsd_cplane.c.

References P_pushmatrix(), P_rot(), W, X, Y, and Z.

◆ gsd_vert_func()

◆ gsd_viewport()

void gsd_viewport ( int  l,
int  r,
int  b,
int  t 
)

Set the viewport.

l, b specify the lower left corner of the viewport rectangle, in pixels.

r, t specify the width and height of the viewport.

Parameters
lleft
rright
bbottom
ttop

Definition at line 1077 of file gsd_prim.c.

References b, l, r, and t.

Referenced by GS_set_viewport().

◆ gsd_wall()

int gsd_wall ( float *  bgn,
float *  end,
float *  norm 
)

ADD.

bgn,end should already be in world modeling coords, but have to be reverse-translated to apply to each surface

Parameters
bgn,end2d line for cutting plane
normindicates which way wall faces
Returns

Definition at line 1710 of file gsd_surf.c.

◆ gsd_wire_arrows()

◆ gsd_wire_surf()

◆ gsd_wire_surf_const()

◆ gsd_wire_surf_func()

int gsd_wire_surf_func ( geosurf ,
int(*)(void)   
)

◆ gsd_wire_surf_map()

◆ gsd_writeView()

int gsd_writeView ( unsigned char **  pixbuf,
unsigned int  xsize,
unsigned int  ysize 
)

Write view.

Parameters
pixbufdata buffer
xsize,ysizepicture dimension
Returns
0 on failure
1 on success

Definition at line 969 of file gsd_prim.c.

References G_malloc.

Referenced by GS_write_zoom().

◆ gsd_x()

void gsd_x ( geosurf gs,
float *  center,
int  colr,
float  siz 
)

Draw X symbol.

Note gs: NULL if flat

Parameters
gssurface (geosurf)
center
colrcolor value
sizsize value

Definition at line 256 of file gsd_objs.c.

References gsd_bgnline(), gsd_color_func(), gsd_endline(), gsd_line_onsurf(), gsd_vert_func(), X, Y, and Z.

Referenced by gpd_obj().

◆ gsd_zup_twist()

int gsd_zup_twist ( geoview gv)

ADD.

Parameters
gvview (geoview)
Returns
?

Definition at line 274 of file gsd_views.c.

References FROM, geoview::from_to, GS_distance(), GS_v3eq(), TO, geoview::twist, X, Y, and Z.

◆ gsd_zwritemask()

void gsd_zwritemask ( unsigned long  n)

Write out z-mask.

Enable or disable writing into the depth buffer

Parameters
nSpecifies whether the depth buffer is enabled for writing

Definition at line 241 of file gsd_prim.c.

Referenced by gsd_display_fringe().

◆ gsdiff_do_SD()

float gsdiff_do_SD ( float  val,
int  offset 
)

ADD.

Parameters
val
offset
Returns
value

Definition at line 94 of file gsdiff.c.

Referenced by gs_get_att_typbuff(), and gsd_wire_surf_const().

◆ gsdiff_get_SDref()

geosurf* gsdiff_get_SDref ( void  )

ADD.

Returns
pointer to geosurf struct

Definition at line 77 of file gsdiff.c.

Referenced by gs_get_att_typbuff(), GS_get_SDsurf(), and gsd_wire_surf_const().

◆ gsdiff_get_SDscale()

float gsdiff_get_SDscale ( void  )

Get scale.

Returns
scale value

Definition at line 54 of file gsdiff.c.

◆ gsdiff_set_SDref()

void gsdiff_set_SDref ( geosurf gsref)

ADD.

Parameters
gsref

Definition at line 64 of file gsdiff.c.

Referenced by GS_set_SDsurf(), and GS_unset_SDsurf().

◆ gsdiff_set_SDscale()

void gsdiff_set_SDscale ( float  scale)

Set scale.

Parameters
scalevalue

Definition at line 42 of file gsdiff.c.

◆ gsdrape_get_allsegments()

Point3* gsdrape_get_allsegments ( geosurf gs,
float *  bgn,
float *  end,
int *  num 
)

Get all segments.

Parameters
gssurface (geosurf)
bgnbegin point
endend point
num
Returns
pointer to Point3 struct

Definition at line 399 of file gsdrape.c.

References GS_v3eq(), gsdrape_set_surface(), interp_first_last(), l, NULL, seg_intersect_vregion(), X, and Y.

◆ gsdrape_get_segments()

Point3* gsdrape_get_segments ( geosurf gs,
float *  bgn,
float *  end,
int *  num 
)

ADD.

Parameters
gssurface (geosurf)
bgnbegin point (x,y)
endend point (x,y)
num
Returns
pointer to Point3 struct

Definition at line 349 of file gsdrape.c.

References ATT_TOPO, CONST_ATT, gs_get_att_src(), gsdrape_set_surface(), NULL, and seg_intersect_vregion().

Referenced by gsd_line_onsurf(), gsd_nline_onsurf(), and gvd_draw_lineonsurf().

◆ gsdrape_set_surface()

int gsdrape_set_surface ( geosurf gs)

ADD.

Parameters
gssurface (geosurf)
Returns
-1 on failure
1 on success

Definition at line 198 of file gsdrape.c.

Referenced by gsdrape_get_allsegments(), and gsdrape_get_segments().

◆ gsds_alloc_typbuff()

size_t gsds_alloc_typbuff ( int  id,
int *  dims,
int  ndims,
int  type 
)

Allocates correct buffer according to type, keeps track of total mem.

Todo:
add ATTY_CONST
Parameters
iddataset id
dimsarray of dimensions
ndimsnumber of dimensions
typedata type
Returns
amount of allocated memory

Definition at line 480 of file gsds.c.

◆ gsds_findh()

int gsds_findh ( const char *  name,
IFLAG changes,
IFLAG types,
int  begin 
)

Get handle to gsds.

Successive calls will continue search until "begin" is set (problem here is, unique_name no longer uniquely identifies dataset, since changes may be made; but unique_name should still be useful for reloading dataset) changes & types are set to actual for dataset if found.

Parameters
name
changes,typesacceptable changes & types, flags may be or'd not changed is assumed to always be acceptable
beginflag to indicate search from beginning
Returns
data id
-1 not found

Definition at line 188 of file gsds.c.

◆ gsds_free_data_buff()

int gsds_free_data_buff ( int  id,
int  typ 
)

Free allocated buffer.

Parameters
iddataset id
typdata type
Returns
0 not found
1 found

Definition at line 369 of file gsds.c.

◆ gsds_free_datah()

int gsds_free_datah ( int  id)

Free allocated dataset.

Parameters
id
Returns
0 not found
1 found

Definition at line 329 of file gsds.c.

References G_debug().

◆ gsds_get_changed()

int gsds_get_changed ( int  id)

ADD.

Parameters
id
Returns
-1 on error

Definition at line 613 of file gsds.c.

Referenced by Gs_update_attrange().

◆ gsds_get_name()

char* gsds_get_name ( int  id)

Get name.

Parameters
id
Returns
name
NULL on failure

Definition at line 303 of file gsds.c.

References GPATH_MAX.

Referenced by GS_get_cat_at_xy().

◆ gsds_get_typbuff()

typbuff* gsds_get_typbuff ( int  id,
IFLAG  change_flag 
)

Get data buffer.

Doesn't prevent writing a buff thats's been gotten with change_flag == 0 (could return a copy, but willing to trust calling func for now)

Parameters
iddataset id
change_flagset changed flag
Returns
pointer to typbuff struct
NULL on failure

Definition at line 281 of file gsds.c.

Referenced by gs_get_att_typbuff(), and Gs_update_attrange().

◆ gsds_get_type()

int gsds_get_type ( int  id)

ADD.

Parameters
id
Returns

Definition at line 651 of file gsds.c.

◆ gsds_newh()

int gsds_newh ( const char *  name)

Get handle to gsds.

Parameters
nameraster map name
Returns
-1 on failure
data id

Definition at line 219 of file gsds.c.

◆ gsds_set_changed()

int gsds_set_changed ( int  id,
IFLAG  reason 
)

ADD.

Parameters
id
reason
Returns
-1 on error

Definition at line 633 of file gsds.c.

◆ GV_alldraw_fastvect()

void GV_alldraw_fastvect ( void  )

Draw all loaded vector sets (fast mode)

Definition at line 548 of file gv2.c.

◆ GV_alldraw_vect()

void GV_alldraw_vect ( void  )

Draw all loaded vector sets.

Definition at line 506 of file gv2.c.

Referenced by Nviz_draw_all_vect().

◆ gv_decimate_lines()

int gv_decimate_lines ( geovect gv)

Decimate line.

strategy here: if line has more than average number of points, decimate by eliminating points, otherwise decimate by eliminating shorter lines

Parameters
gvvector (geovect)
Returns

Definition at line 231 of file gv_quick.c.

References g_vect::fastlines, gv_num_points(), g_vect::lines, MFAST_LNS, g_vect::n_lines, g_line::next, g_line::npts, NULL, and TFAST_PTS.

◆ gv_delete_vect()

void gv_delete_vect ( int  id)

Delete vector set (unload)

Parameters
idvector set id

Definition at line 242 of file gv.c.

References G_debug(), gv_free_vect(), and gv_get_vect().

Referenced by GV_delete_vector().

◆ GV_delete_vector()

int GV_delete_vector ( int  id)

Delete vector set from list.

Parameters
idvector set id
Returns
1 on success
-1 on error

Definition at line 129 of file gv2.c.

References G_debug(), gv_delete_vect(), and GV_vect_exists().

◆ GV_draw_fastvect()

void GV_draw_fastvect ( int  vid)

Draw vector set (fast mode)

Todo:
Seems to be broken, nothing is drawn
Parameters
vidvector set id

Definition at line 524 of file gv2.c.

References g_vect::drape_surf_id, gs_get_surf(), gv_get_vect(), gvd_vect(), and g_vect::n_surfs.

◆ GV_draw_vect()

void GV_draw_vect ( int  vid)

Draw vector set.

Parameters
vidvector set id

Definition at line 482 of file gv2.c.

References g_vect::drape_surf_id, gs_get_surf(), gv_get_vect(), gvd_vect(), and g_vect::n_surfs.

◆ gv_free_vect()

int gv_free_vect ( geovect fv)

Free allocated memory for geovect struct.

Parameters
fvpointer to geovect struct
Returns
-1 on failure
1 on success

Definition at line 265 of file gv.c.

Referenced by gv_delete_vect().

◆ gv_free_vectmem()

◆ GV_Get_ClientData()

void* GV_Get_ClientData ( int  id)

Get client data.

Parameters
idvector set id
Returns
pointer to client data
NULL on error

Definition at line 590 of file gv2.c.

References g_vect::clientdata, gv_get_vect(), and NULL.

◆ gv_get_last_vect()

geovect* gv_get_last_vect ( void  )

Get last loaded vector set.

Returns
pointer to geovect struct
NULL on failure (no vector set available)

Definition at line 96 of file gv.c.

Referenced by gv_get_new_vect().

◆ gv_get_new_vect()

geovect* gv_get_new_vect ( void  )

Allocate memory for new vector set.

Returns
pointer to geovect struct
NULL on failure

Definition at line 118 of file gv.c.

References G_malloc, G_zero(), gv_get_last_vect(), g_vect::gvect_id, g_vect::next, and NULL.

◆ gv_get_prev_vect()

geovect* gv_get_prev_vect ( int  id)

Get previous vector set.

Parameters
idvector set id
Returns
pointer to geovect struct
NULL on failure

Definition at line 57 of file gv.c.

References G_debug().

◆ GV_get_style()

int GV_get_style ( int  id,
int *  mem,
int *  color,
int *  width,
int *  use_z 
)

Get vector style.

Parameters
idvector set id
[out]memnon-zero for use memory
[out]colorcolor value
[out]widthline width
[out]use_znon-zero for 3d mode
Returns
-1 on error (invalid vector set id)
1 on success

Definition at line 257 of file gv2.c.

◆ GV_get_trans()

int GV_get_trans ( int  id,
float *  xtrans,
float *  ytrans,
float *  ztrans 
)

Get trans ?

Parameters
idvector set id
[out]xtrans,ytrans,ztransx/y/z trans values

Definition at line 366 of file gv2.c.

References gv_get_vect(), g_vect::x_trans, g_vect::y_trans, and g_vect::z_trans.

◆ gv_get_vect()

geovect* gv_get_vect ( int  id)

Get vector set.

Parameters
idvector set id
Returns
pointer to geovect struct
NULL on failure

Definition at line 34 of file gv.c.

References G_debug().

Referenced by gv_delete_vect(), GV_draw_fastvect(), GV_draw_vect(), GV_Get_ClientData(), GV_get_trans(), GV_select_surf(), GV_Set_ClientData(), GV_set_trans(), GV_surf_is_selected(), GV_unselect_surf(), GV_unset_style_thematic(), and GV_vect_exists().

◆ GV_get_vect_list()

int* GV_get_vect_list ( int *  numvects)

Get list of vector sets.

Must free when no longer needed!

Parameters
numvectsnumber of vector sets
Returns
pointer to list of point sets
NULL on error

Definition at line 99 of file gv2.c.

◆ GV_get_vectname()

int GV_get_vectname ( int  id,
char **  filename 
)

Get vector map name.

Note: char array is allocated by G_store()

Parameters
idvector set id
filename&filename
Returns
-1 on error (invalid vector set id)
1 on success

Definition at line 204 of file gv2.c.

◆ gv_init_vect()

int gv_init_vect ( geovect gv)

Initialize geovect struct.

Parameters
gvpointer to geovect struct
Returns
-1 on failure
0 on success

Definition at line 226 of file gv.c.

References G_debug(), and g_vect::gvect_id.

◆ gv_line_length()

float gv_line_length ( geoline gln)

Get line width.

Parameters
glnline (geoline)
Returns
line width

Definition at line 173 of file gv_quick.c.

References GS_distance(), GS_P2distance(), g_line::npts, g_line::p2, and g_line::p3.

◆ Gv_load_vect()

geoline* Gv_load_vect ( const char *  grassname,
int *  nlines 
)

Load vector map to memory.

The other alternative may be to load to a tmp file

Parameters
grassnamevector map name
[out]numberof loaded features
Returns
pointer to geoline struct
NULL on failure

Definition at line 47 of file gv3.c.

References NULL.

◆ Gv_load_vect_thematic()

int Gv_load_vect_thematic ( geovect gv,
struct Colors colors 
)

Load styles for geolines based on thematic mapping.

Parameters
gvpointer to geovect structure
colorspointer to Colors structure or NULL
Returns
number of features defined by thematic mapping
-1 on error

Definition at line 319 of file gv3.c.

◆ GV_load_vector()

int GV_load_vector ( int  id,
const char *  filename 
)

Load vector set.

Check to see if handle already loaded, if so - free before loading new for now, always load to memory

Todo:
Load file handle & ready for reading instead of using memory
Parameters
idvector set id
filenamefilename
Returns
-1 on error (invalid vector set id)
1 on success

Definition at line 172 of file gv2.c.

◆ GV_new_vector()

int GV_new_vector ( void  )

Register new vector set.

Returns
vector set id
-1 on error

Definition at line 61 of file gv2.c.

◆ gv_num_points()

int gv_num_points ( geovect gv)

Get number of points in vector.

Parameters
gvvector (geovect)
Returns
number of points

Definition at line 216 of file gv_quick.c.

References gln_num_points(), and g_vect::lines.

Referenced by gv_decimate_lines().

◆ GV_num_vects()

int GV_num_vects ( void  )

Get number of available vector sets.

Returns
number of vector sets

Definition at line 84 of file gv2.c.

References gv_num_vects().

◆ gv_num_vects()

int gv_num_vects ( void  )

Get number of loaded vector sets.

Returns
number of vector sets

Definition at line 77 of file gv.c.

Referenced by GV_num_vects().

◆ GV_select_surf()

int GV_select_surf ( int  hv,
int  hs 
)

Select surface identified by hs to have vector identified by hv draped over it.

Parameters
hvvector set id
hssurface id
Returns
1 on success
-1 on error

Definition at line 393 of file gv2.c.

References g_vect::drape_surf_id, GS_surf_exists(), gv_get_vect(), GV_surf_is_selected(), and g_vect::n_surfs.

◆ GV_Set_ClientData()

int GV_Set_ClientData ( int  id,
void *  clientd 
)

Set client data.

Parameters
idvector set id
clientdpointer to client data
Returns
1 on success
-1 on error

Definition at line 568 of file gv2.c.

References g_vect::clientdata, and gv_get_vect().

◆ gv_set_defaults()

int gv_set_defaults ( geovect gv)

◆ gv_set_drapesurfs()

void gv_set_drapesurfs ( geovect gv,
int *  hsurfs,
int  nsurfs 
)

Set drape surfaces for vector set.

Parameters
gvpointer to geovect struct
hsurfsarray of surfaces (id)
nsurfsnumber of surfaces

Definition at line 364 of file gv.c.

References g_vect::drape_surf_id, and MAX_SURFS.

◆ GV_set_style()

int GV_set_style ( int  id,
int  mem,
int  color,
int  width,
int  use_z 
)

Set vector style.

Parameters
idvector set id
memnon-zero for use memory
colorcolor value
widthline width
use_znon-zero for 3d mode
Returns
-1 on error (invalid vector set id)
1 on success

Definition at line 229 of file gv2.c.

◆ GV_set_style_thematic()

int GV_set_style_thematic ( int  id,
int  layer,
const char *  color,
const char *  width,
struct Colors color_rules 
)

Set vector set style for thematic mapping.

Updates also style for each geoline.

Parameters
idvector set id
layerlayer number for thematic mapping
colorcolor column name
widthwidth column name
colorspointer to Colors structure or NULL
Returns
1 on success
-1 on error (point set not found)

Definition at line 287 of file gv2.c.

◆ GV_set_trans()

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

Set trans ?

Parameters
idvector set id
xtrans,ytrans,ztransx/y/z trans values

Definition at line 343 of file gv2.c.

References G_debug(), gv_get_vect(), g_vect::x_trans, g_vect::y_trans, and g_vect::z_trans.

◆ GV_surf_is_selected()

int GV_surf_is_selected ( int  hv,
int  hs 
)

Check if surface is selected.

Parameters
hvvector set id
hssurface id
Returns
1 selected
0 not selected

Definition at line 459 of file gv2.c.

References g_vect::drape_surf_id, gv_get_vect(), and g_vect::n_surfs.

Referenced by GV_select_surf(), and GV_unselect_surf().

◆ GV_unselect_surf()

int GV_unselect_surf ( int  hv,
int  hs 
)

Unselect surface.

Parameters
hvvector set id
hssurface id
Returns
1 on success
-1 on error

Definition at line 422 of file gv2.c.

References g_vect::drape_surf_id, gv_get_vect(), GV_surf_is_selected(), and g_vect::n_surfs.

◆ GV_unset_style_thematic()

int GV_unset_style_thematic ( int  id)

Make style for thematic mapping inactive.

Parameters
idvector set id
Returns
1 on success
-1 on error (point set not found)

Definition at line 320 of file gv2.c.

References g_vect_style_thematic::active, G_debug(), gv_get_vect(), NULL, and g_vect::tstyle.

◆ gv_update_drapesurfs()

void gv_update_drapesurfs ( void  )

Update drape surfaces.

Call after surface is deleted

Definition at line 157 of file gv.c.

◆ GV_vect_exists()

int GV_vect_exists ( int  id)

Check if vector set exists.

Parameters
idvector set id
Returns
0 not found
1 found

Definition at line 36 of file gv2.c.

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

Referenced by GV_delete_vector().

◆ gvd_draw_lineonsurf()

void gvd_draw_lineonsurf ( geosurf gs,
float *  bgn,
float *  end,
int  color 
)

Draw line on surface.

Parameters
gssurface
bgnfirst line point
endend line point
colorcolor value

Definition at line 299 of file gvd.c.

References gs_point_is_masked(), gsd_bgnline(), gsd_color_func(), gsd_endline(), gsd_vert_func(), and gsdrape_get_segments().

◆ gvd_vect()

int gvd_vect ( geovect gv,
geosurf gs,
int  do_fast 
)

Draw vector set.

Need to think about translations - If user translates surface, vector should automatically go with it, but translating vector should translate it relative to surface on which it's displayed?

Handling mask checking here, but may be more appropriate to handle in get_drape_segments?

Parameters
gvvector set
gssurface
do_fastnon-zero for fast mode
Returns

Definition at line 79 of file gvd.c.

Referenced by GV_draw_fastvect(), and GV_draw_vect().

◆ gvl_align_data()

void gvl_align_data ( int  pos,
unsigned char **  data 
)

Append data to buffer.

Parameters
posposition index
datadata buffer

Definition at line 776 of file gvl_calc.c.

◆ GVL_alldraw_vol()

void GVL_alldraw_vol ( void  )

Draw all volume sets.

Definition at line 441 of file gvl2.c.

◆ GVL_alldraw_wire()

void GVL_alldraw_wire ( void  )

Draw all volume sets in wire mode.

Definition at line 455 of file gvl2.c.

◆ GVL_delete_vol()

int GVL_delete_vol ( int  id)

Delete volume set from list.

Parameters
idvolume set id
Returns
1 on success
-1 on error (invalid volume set id)

Definition at line 210 of file gvl2.c.

References G_debug(), gvl_delete_vol(), GVL_isosurf_del(), GVL_isosurf_num_isosurfs(), GVL_slice_del(), GVL_slice_num_slices(), and GVL_vol_exists().

◆ gvl_delete_vol()

void gvl_delete_vol ( int  id)

Remove volume set from list.

Parameters
idvolume set id

Definition at line 244 of file gvl.c.

References G_debug(), gvl_free_vol(), and gvl_get_vol().

Referenced by GVL_delete_vol().

◆ GVL_draw_vol()

void GVL_draw_vol ( int  vid)

Draw volume set.

Parameters
vidvolume set id

Definition at line 402 of file gvl2.c.

References g_vol::draw_wire, gvl_get_vol(), gvld_vol(), and gvld_wind3_box().

Referenced by Nviz_draw_all_vol().

◆ GVL_draw_wire()

void GVL_draw_wire ( int  id)

Draw volume in wire mode.

Parameters
idvolume set id

Definition at line 423 of file gvl2.c.

References G_debug(), gvl_get_vol(), and gvld_wire_vol().

◆ gvl_file_end_read()

int gvl_file_end_read ( geovol_file vf)

End read - free buffer memory.

Parameters
vfpointer to geovol_file struct
Returns
-1 on failure
1 on success

Definition at line 1016 of file gvl_file.c.

References free_slice_buff(), free_vol_buff(), geovol_file::mode, MODE_FULL, MODE_SLICE, geovol_file::status, and STATUS_READY.

◆ gvl_file_free_datah()

int gvl_file_free_datah ( int  id)

Free geovol_file structure for given handle.

Parameters
id
Returns

Definition at line 364 of file gvl_file.c.

References G_debug().

Referenced by gvl_free_volmem().

◆ gvl_file_get_data_type()

int gvl_file_get_data_type ( geovol_file vf)

Get data type for given handle.

Parameters
vfpointer to geovol_file struct
Returns
data type

Definition at line 202 of file gvl_file.c.

References geovol_file::data_type.

◆ gvl_file_get_file_type()

int gvl_file_get_file_type ( geovol_file vf)

Get file type for given handle.

Parameters
vfpointer to geovol_file struct
Returns
file type

Definition at line 190 of file gvl_file.c.

References geovol_file::file_type.

◆ gvl_file_get_min_max()

void gvl_file_get_min_max ( geovol_file vf,
double *  min,
double *  max 
)

Get minimum and maximum value in volume file.

Parameters
vfpointer to geovol_file struct
[out]minmin value
[out]maxmax value

Definition at line 214 of file gvl_file.c.

References geovol_file::max, max, geovol_file::min, and min.

Referenced by iso_get_range().

◆ gvl_file_get_name()

char* gvl_file_get_name ( int  id)

Get file name for given handle.

Parameters
idhandle id
Returns
file name
NULL on failure

Definition at line 165 of file gvl_file.c.

References GPATH_MAX.

◆ gvl_file_get_value()

int gvl_file_get_value ( geovol_file vf,
int  x,
int  y,
int  z,
void *  value 
)

Get value for volume file at x, y, z.

Parameters
vfpointer to geovol_file struct
Returns
-1 on failure
1 on success

Definition at line 1048 of file gvl_file.c.

References get_direct_value(), get_slice_value(), get_vol_value(), geovol_file::mode, MODE_DIRECT, MODE_FULL, MODE_PRELOAD, MODE_SLICE, geovol_file::status, STATUS_BUSY, and x.

◆ gvl_file_get_volfile()

geovol_file* gvl_file_get_volfile ( int  id)

Get geovol_file structure for given handle.

Parameters
id
Returns
pointer to geovol_file struct
NULL on failure

Definition at line 117 of file gvl_file.c.

Referenced by iso_get_range().

◆ gvl_file_is_null_value()

int gvl_file_is_null_value ( geovol_file vf,
void *  value 
)

Check for null value.

Parameters
vfpointer to geovol_file struct
valuedata value
Returns
-1 on failure
1 on success

Definition at line 1085 of file gvl_file.c.

References geovol_file::file_type, is_null_g3d_value(), and VOL_FTYPE_RASTER3D.

◆ gvl_file_newh()

int gvl_file_newh ( const char *  name,
IFLAG  file_type 
)

Get handle for given file name and type.

Parameters
namevolume filename
file_typefile type
Returns
data id
-1 on failure

Definition at line 269 of file gvl_file.c.

◆ gvl_file_set_mode()

int gvl_file_set_mode ( geovol_file vf,
IFLAG  mode 
)

Set read mode.

Parameters
vfpointer to geovol_file struct
moderead mode
Returns
-1 on failure
1 on success

Definition at line 1114 of file gvl_file.c.

◆ gvl_file_set_slices_param()

int gvl_file_set_slices_param ( geovol_file vf,
int  n,
int  b 
)

Set parameters for slice reading.

Parameters
vfpointer to geovol_file struct
n
b
Returns
-1 on failure
1 on success

Definition at line 1164 of file gvl_file.c.

References b, geovol_file::buff, geovol_file::mode, MODE_SLICE, return(), geovol_file::status, and STATUS_BUSY.

◆ gvl_file_start_read()

int gvl_file_start_read ( geovol_file vf)

Start read - allocate memory buffer a read first data into buffer.

Parameters
vfpointer to geovol_file struct
Returns
-1 on failure
1 on success

Definition at line 965 of file gvl_file.c.

References alloc_slice_buff(), alloc_vol_buff(), geovol_file::buff, geovol_file::mode, MODE_FULL, MODE_SLICE, read_slice(), read_vol(), geovol_file::status, and STATUS_BUSY.

◆ gvl_free_vol()

int gvl_free_vol ( geovol fvl)

Free geovol struct.

Parameters
fvlpointer to geovol struct
Returns
-1 on failure
1 on success

Definition at line 267 of file gvl.c.

References G_debug().

Referenced by gvl_delete_vol().

◆ gvl_free_volmem()

void gvl_free_volmem ( geovol fvl)

Free geovol struct memory.

Parameters
fvlpointer to geovol struct

Definition at line 316 of file gvl.c.

References gvl_file_free_datah(), and g_vol::hfile.

◆ GVL_Get_ClientData()

void* GVL_Get_ClientData ( int  id)

Get client data.

Parameters
idvolume set id
Returns
pointer to client data
NULL on error

Definition at line 498 of file gvl2.c.

References g_vol::clientdata, gvl_get_vol(), and NULL.

◆ Gvl_get_color_for_value()

int Gvl_get_color_for_value ( void *  color_data,
float *  value 
)

Get color for value.

Parameters
color_datacolor data value
valuedata value
Returns
color value

Definition at line 82 of file gvl3.c.

References b, g, r, and Rast_get_f_color().

◆ GVL_get_dims()

void GVL_get_dims ( int  id,
int *  rows,
int *  cols,
int *  depths 
)

Get volume dimensions.

Parameters
idvolume set id
[out]rows,cols,depthsnumber of rows, cols, depths

Definition at line 309 of file gvl2.c.

References g_vol::cols, g_vol::depths, G_debug(), gvl_get_vol(), g_vol::gvol_id, and g_vol::rows.

Referenced by Nviz_set_volume_attr_default().

◆ gvl_get_last_vol()

geovol* gvl_get_last_vol ( void  )

Get last volume set from the list.

Returns
pointer to geovol struct
NULL on failure

Definition at line 124 of file gvl.c.

References G_debug().

Referenced by gvl_get_new_vol().

◆ gvl_get_new_vol()

geovol* gvl_get_new_vol ( void  )

Allocate new volume set and add it to the list.

Returns
pointer to geovol struct
NULL on failure

Definition at line 148 of file gvl.c.

References G_debug(), G_malloc, gvl_get_last_vol(), g_vol::gvol_id, g_vol::next, and NULL.

◆ gvl_get_prev_vol()

geovol* gvl_get_prev_vol ( int  id)

Get previous volume.

Parameters
idcurrent volume set id
Returns
pointer to geovol struct
NULL on failure

Definition at line 64 of file gvl.c.

References G_debug().

◆ GVL_get_region()

int GVL_get_region ( float *  n,
float *  s,
float *  w,
float *  e,
float *  t,
float *  b 
)

Get region extent settings.

Parameters
[out]n,s,w,enorth, south, west, east
[out]t,btop, bottom
Returns
1

Definition at line 79 of file gvl2.c.

◆ GVL_get_trans()

int GVL_get_trans ( int  id,
float *  xtrans,
float *  ytrans,
float *  ztrans 
)

Get trans ?

Parameters
idvolume set id
[out]xtrans,ytrans,ztransx/y/z trans values
Returns
1 on success
-1 on error

Definition at line 359 of file gvl2.c.

References gvl_get_vol(), g_vol::x_trans, g_vol::y_trans, and g_vol::z_trans.

◆ gvl_get_vol()

◆ GVL_get_vol_list()

int* GVL_get_vol_list ( int *  numvols)

Get list of loaded volume sets.

Must be freed if not needed!

Parameters
[out]numvolsnumber of volume sets
Returns
pointer to list of volume sets
NULL on error

Definition at line 181 of file gvl2.c.

Referenced by Nviz_draw_all_vol().

◆ GVL_get_volname()

int GVL_get_volname ( int  id,
char *  filename 
)

Get volume set name.

Parameters
idvolume set id
[out]filenamename (must be allocated)
Returns
-1 on error
1 on success

Definition at line 286 of file gvl2.c.

◆ GVL_get_window()

void* GVL_get_window ( void  )

Get window.

Todo:
gvl_file.c use this - change
Returns
pointer to RASTER3D_Region struct (static)

Definition at line 98 of file gvl2.c.

◆ gvl_get_xextents()

int gvl_get_xextents ( geovol gvl,
float *  min,
float *  max 
)

Get volume x-extent value.

Parameters
gvlpointer to geovol struct
[out]minx-min value
[out]maxy-max value
Returns
1

Definition at line 354 of file gvl.c.

References max, min, g_vol::x_trans, g_vol::xmax, and g_vol::xmin.

◆ gvl_get_xrange()

int gvl_get_xrange ( float *  min,
float *  max 
)

Get volume x-range value.

Parameters
[out]minx-min value
[out]maxx-max value
Returns
1

Definition at line 404 of file gvl.c.

◆ gvl_get_yextents()

int gvl_get_yextents ( geovol gvl,
float *  min,
float *  max 
)

Get volume y-extent value.

Parameters
gvlpointer to geovol struct
[out]miny-min value
[out]maxy-max value
Returns
1

Definition at line 371 of file gvl.c.

References max, min, g_vol::y_trans, g_vol::ymax, and g_vol::ymin.

◆ gvl_get_yrange()

int gvl_get_yrange ( float *  min,
float *  max 
)

Get volume y-range value.

Parameters
[out]miny-min value
[out]maxy-max value
Returns
1

Definition at line 441 of file gvl.c.

◆ gvl_get_zextents()

int gvl_get_zextents ( geovol gvl,
float *  min,
float *  max 
)

Get volume z-extent value.

Parameters
gvlpointer to geovol struct
[out]minz-min value
[out]maxz-max value
Returns
1

Definition at line 388 of file gvl.c.

References max, min, g_vol::z_trans, g_vol::zmax, and g_vol::zmin.

◆ gvl_get_zrange()

int gvl_get_zrange ( float *  min,
float *  max 
)

Get volume z-range value.

Parameters
[out]minz-min value
[out]maxz-max value
Returns
1

Definition at line 478 of file gvl.c.

Referenced by GS_get_zrange().

◆ gvl_getall_vols()

int gvl_getall_vols ( geovol **  gvols)

Get all volumes.

Parameters
[out]listof geovol structs
Returns
number of available volume sets

Definition at line 86 of file gvl.c.

References G_debug().

◆ GVL_init_region()

void GVL_init_region ( void  )

Initialize 3D region.

Set region extent (N,S,W,E,T,B)

Definition at line 57 of file gvl2.c.

References Rast3d_read_window().

◆ gvl_init_vol()

int gvl_init_vol ( geovol gvl,
double  ox,
double  oy,
double  oz,
int  rows,
int  cols,
int  depths,
double  xres,
double  yres,
double  zres 
)

◆ GVL_isosurf_add()

int GVL_isosurf_add ( int  id)

Add isosurface.

Parameters
idvolume set id
Returns
-1 on error (invalid volume set id
1 on success

Definition at line 661 of file gvl2.c.

References G_debug(), G_malloc, gvl_get_vol(), gvl_isosurf_init(), g_vol::isosurf, MAX_ISOSURFS, and g_vol::n_isosurfs.

◆ gvl_isosurf_calc()

int gvl_isosurf_calc ( geovol gvol)

Fill data structure with computed isosurfaces polygons.

Parameters
gvolpointer to geovol struct
Returns
1

Definition at line 585 of file gvl_calc.c.

References x.

Referenced by gvld_vol().

◆ GVL_isosurf_del()

int GVL_isosurf_del ( int  id,
int  isosurf_id 
)

Delete isosurface.

Parameters
idvolume set id
isosurf_idisosurface id
Returns
-1 on error
1 on success

Definition at line 698 of file gvl2.c.

References G_debug(), G_free(), gvl_get_vol(), gvl_isosurf_freemem(), gvl_isosurf_get_isosurf(), g_vol::isosurf, and g_vol::n_isosurfs.

Referenced by GVL_delete_vol().

◆ gvl_isosurf_freemem()

int gvl_isosurf_freemem ( geovol_isosurf isosurf)

Free geovol_isosurf struct.

Parameters
isosurfpointer to geovol_isosurf struct
Returns
-1 on failure
1 on success

Definition at line 553 of file gvl.c.

References geovol_isosurf::data, G_debug(), G_free(), gvl_isosurf_set_att_src(), MAX_ATTS, and NOTSET_ATT.

Referenced by GVL_isosurf_del().

◆ GVL_isosurf_get_att()

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

Get isosurface attributes.

Parameters
idvolume set id
isosurf_idsurface id
attattribute id
[out]set
[out]constant
[out]mapname
Returns
-1 on error
1 on success

Definition at line 809 of file gvl2.c.

◆ gvl_isosurf_get_att_src()

int gvl_isosurf_get_att_src ( geovol_isosurf isosurf,
int  desc 
)

Get attribute source.

Parameters
isosurfpointer to geovol_isosurf struct
descattribute id
Returns
-1 on failure
attribute value

Definition at line 607 of file gvl.c.

References geovol_isosurf::att, geovol_isosurf_att::att_src, G_debug(), and LEGAL_ATT.

◆ GVL_isosurf_get_drawmode()

int GVL_isosurf_get_drawmode ( int  id,
int *  mode 
)

Get isosurface draw mode.

Parameters
idvolume set id
[out]modedraw-mode
Returns
1 on success
-1 on error

Definition at line 612 of file gvl2.c.

◆ GVL_isosurf_get_drawres()

void GVL_isosurf_get_drawres ( int  id,
int *  xres,
int *  yres,
int *  zres 
)

Get draw resolution for isosurface.

Todo:
error handling
Parameters
idvolume set id
[out]xres,yres,zresx/y/z resolution value

Definition at line 549 of file gvl2.c.

References G_debug(), gvl_get_vol(), g_vol::isosurf_x_mod, g_vol::isosurf_y_mod, and g_vol::isosurf_z_mod.

◆ GVL_isosurf_get_flags()

int GVL_isosurf_get_flags ( int  id,
int  isosurf_id,
int *  inout 
)

Get isosurface flags.

Parameters
idvolume set id
isosurf_idisosurface id
[out]inoutmap name
Returns
1 on success
-1 on error

Definition at line 951 of file gvl2.c.

References G_debug(), gvl_isosurf_get_isosurf(), and geovol_isosurf::inout_mode.

◆ gvl_isosurf_get_isosurf()

geovol_isosurf* gvl_isosurf_get_isosurf ( int  id,
int  isosurf_id 
)

Get isosurface of given volume set.

Parameters
idvolume set id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
Returns
pointer to geovol_isosurf struct
NULL on failure

Definition at line 580 of file gvl.c.

References G_debug(), gvl_get_vol(), g_vol::isosurf, g_vol::n_isosurfs, and NULL.

Referenced by GVL_isosurf_del(), GVL_isosurf_get_flags(), GVL_isosurf_set_att_const(), GVL_isosurf_set_flags(), and GVL_isosurf_unset_att().

◆ GVL_isosurf_get_maskmode()

int GVL_isosurf_get_maskmode ( int  id,
int  isosurf_id,
int *  mode 
)

Get isosurface mask mode.

Parameters
idvolume set id
isosurf_idisosurface id
modeattribute mode
Returns
1 on success
-1 on error

Definition at line 1056 of file gvl2.c.

◆ gvl_isosurf_init()

◆ GVL_isosurf_move_down()

int GVL_isosurf_move_down ( int  id,
int  isosurf_id 
)

Move down isosurface in list.

Parameters
idvolume set id
isosurf_idisosurface id
Returns
-1 on error
1 on success

Definition at line 771 of file gvl2.c.

◆ GVL_isosurf_move_up()

int GVL_isosurf_move_up ( int  id,
int  isosurf_id 
)

Move up isosurface in list.

Parameters
idvolume set id
isosurf_idisosurface id
Returns
-1 on error
1 on success

Definition at line 737 of file gvl2.c.

◆ GVL_isosurf_num_isosurfs()

int GVL_isosurf_num_isosurfs ( int  id)

Get number of available isosurfaces.

Parameters
idvolume set id
Returns
number of isosurfaces
-1 on error

Definition at line 1002 of file gvl2.c.

References G_debug(), gvl_get_vol(), and g_vol::n_isosurfs.

Referenced by GVL_delete_vol().

◆ gvl_isosurf_set_att_changed()

int gvl_isosurf_set_att_changed ( geovol_isosurf isosurf,
int  desc 
)

Set attribute changed.

Parameters
isosurfpointer to geovol_isosurf struct
descattribute id
Returns
-1 on failure
1 on success

Definition at line 723 of file gvl.c.

References geovol_isosurf::att, ATT_MASK, ATT_TOPO, geovol_isosurf_att::changed, G_debug(), LEGAL_ATT, and MAX_ATTS.

Referenced by GVL_isosurf_set_drawres().

◆ gvl_isosurf_set_att_const()

int gvl_isosurf_set_att_const ( geovol_isosurf isosurf,
int  desc,
float  constant 
)

Set isosurface attribute constant.

Parameters
isosurfpointer to geovol_isosurf struct
descattribute descriptor
constantattribute value
Returns
-1 on failure
1 on success

Definition at line 665 of file gvl.c.

References geovol_isosurf::att, CONST_ATT, geovol_isosurf_att::constant, G_debug(), and gvl_isosurf_set_att_src().

Referenced by GVL_isosurf_set_att_const().

◆ GVL_isosurf_set_att_const()

int GVL_isosurf_set_att_const ( int  id,
int  isosurf_id,
int  att,
float  constant 
)

Set constant isosurface attribute.

Attributes:

  • ATT_NORM
  • ATT_TOPO topography (level) constant
  • ATT_COLOR color map/constant
  • ATT_MASK mask map
  • ATT_TRANSP transparency map/constant
  • ATT_SHINE shininess map/constant
  • ATT_EMIT emission map/constant
Parameters
idvolume set id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
attattribute descriptor
constantconstant value
Returns
1 on success
-1 on error

Definition at line 884 of file gvl2.c.

References G_debug(), gvl_isosurf_get_isosurf(), and gvl_isosurf_set_att_const().

◆ gvl_isosurf_set_att_map()

int gvl_isosurf_set_att_map ( geovol_isosurf isosurf,
int  desc,
const char *  filename 
)

Set attribute map.

Parameters
isosurfpointer to geovol_isosurf struct
descattribute id
filenamefilename
Returns
-1 on failure
1 on success

Definition at line 690 of file gvl.c.

◆ GVL_isosurf_set_att_map()

int GVL_isosurf_set_att_map ( int  id,
int  isosurf_id,
int  att,
const char *  filename 
)

Set isosurface map attribute.

Attributes:

  • ATT_NORM
  • ATT_TOPO topography (level) constant
  • ATT_COLOR color map/constant
  • ATT_MASK mask map
  • ATT_TRANSP transparency map/constant
  • ATT_SHINE shininess map/constant
  • ATT_EMIT emission map/constant
Parameters
idvolume set id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
attattribute descriptor
filenamemap name
Returns
1 on success
-1 on error

Definition at line 922 of file gvl2.c.

◆ gvl_isosurf_set_att_src()

int gvl_isosurf_set_att_src ( geovol_isosurf isosurf,
int  desc,
int  src 
)

Set attribute source.

Parameters
isosurfpointer to geovol_isosurf struct
descattribute id
srcattribute value
Returns
-1 on failure
1 on success

Definition at line 632 of file gvl.c.

Referenced by gvl_isosurf_freemem(), gvl_isosurf_set_att_const(), and GVL_isosurf_unset_att().

◆ GVL_isosurf_set_drawmode()

int GVL_isosurf_set_drawmode ( int  id,
int  mode 
)

Set isosurface draw mode.

Parameters
idvolume set id
modedraw mode
Returns
0 on success
-1 on error (invalid volume set id)

Definition at line 636 of file gvl2.c.

Referenced by Nviz_set_volume_attr_default().

◆ GVL_isosurf_set_drawres()

int GVL_isosurf_set_drawres ( int  id,
int  xres,
int  yres,
int  zres 
)

Set isosurface draw resolution.

Parameters
idvolume set id
xres,yres,zresx/y/z resolution value
Returns
-1 on error (invalid values/volume set id)
0 on success

Definition at line 575 of file gvl2.c.

References ATT_TOPO, G_debug(), gvl_get_vol(), gvl_isosurf_set_att_changed(), g_vol::isosurf, g_vol::isosurf_x_mod, g_vol::isosurf_y_mod, g_vol::isosurf_z_mod, and g_vol::n_isosurfs.

Referenced by Nviz_set_volume_attr_default().

◆ GVL_isosurf_set_flags()

int GVL_isosurf_set_flags ( int  id,
int  isosurf_id,
int  inout 
)

Set isosurface flags.

Parameters
idvolume set id
isosurf_idisosurface id
inoutmap name
Returns
1 on success
-1 on error

Definition at line 977 of file gvl2.c.

References G_debug(), gvl_isosurf_get_isosurf(), and geovol_isosurf::inout_mode.

◆ GVL_isosurf_set_maskmode()

int GVL_isosurf_set_maskmode ( int  id,
int  isosurf_id,
int  mode 
)

Set mask attribute mode.

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

Parameters
idvolume set id
isosurf_idisosurface id
modeattribute mode
Returns
mode id
-1 on error

Definition at line 1029 of file gvl2.c.

◆ GVL_isosurf_unset_att()

int GVL_isosurf_unset_att ( int  id,
int  isosurf_id,
int  att 
)

Unset isosurface attributes.

Parameters
idvolume set id
isosurface_idisosurface id
attattribute id
Returns
?
-1 on error

Definition at line 849 of file gvl2.c.

References G_debug(), gvl_isosurf_get_isosurf(), gvl_isosurf_set_att_src(), and NOTSET_ATT.

◆ GVL_libinit()

void GVL_libinit ( void  )

Library initialization for volumes.

Set region extent (N,S,W,E,T,B)

Definition at line 37 of file gvl2.c.

References Rast3d_get_window(), and Rast3d_init_defaults().

◆ Gvl_load_colors_data()

int Gvl_load_colors_data ( void **  color_data,
const char *  name 
)

Load color table.

Parameters
[out]color_datacolor data buffer
name3D raster map name
Returns
-1 on failure
1 on success

Definition at line 34 of file gvl3.c.

◆ GVL_load_vol()

int GVL_load_vol ( int  id,
const char *  filename 
)

Load 3d raster map to volume set.

Parameters
idvolume set id
filename3d raster map name
Returns
-1 on error
0 on success

Definition at line 256 of file gvl2.c.

◆ GVL_new_vol()

int GVL_new_vol ( void  )

Create new volume set.

Returns
volume set id
-1 on error

Definition at line 136 of file gvl2.c.

References G_debug().

◆ GVL_num_vols()

int GVL_num_vols ( void  )

Get number of loaded volume sets.

Returns
number of volume sets

Definition at line 166 of file gvl2.c.

References gvl_num_vols().

◆ gvl_num_vols()

int gvl_num_vols ( void  )

Get number of loaded volume sets.

Returns
number of volumes

Definition at line 105 of file gvl.c.

Referenced by GVL_num_vols().

◆ gvl_read_char()

unsigned char gvl_read_char ( int  pos,
const unsigned char *  data 
)

Read char.

Parameters
posposition index
datadata buffer
Returns
char on success
NULL on failure

Definition at line 762 of file gvl_calc.c.

◆ GVL_Set_ClientData()

int GVL_Set_ClientData ( int  id,
void *  clientd 
)

Set client data for volume set.

Parameters
idvolume set id
clientdpointer to client data
Returns
1 on success
-1 on error

Definition at line 475 of file gvl2.c.

References g_vol::clientdata, and gvl_get_vol().

◆ GVL_set_draw_wire()

void GVL_set_draw_wire ( int  id,
int  draw_wire 
)

Set drawing wire box.

Parameters
idvolume set id
draw_wire1 for drawing wire, 0 otherwise

Definition at line 382 of file gvl2.c.

References g_vol::draw_wire, G_debug(), and gvl_get_vol().

◆ GVL_set_focus_center_map()

void GVL_set_focus_center_map ( int  id)

Set focus on map center.

Parameters
idvolume set id

Definition at line 516 of file gvl2.c.

References G_debug(), GS_set_focus(), gvl_get_vol(), X, g_vol::xmax, g_vol::xmin, Y, g_vol::ymax, g_vol::ymin, Z, g_vol::zmax, and g_vol::zmin.

◆ GVL_set_trans()

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

Set trans ?

Parameters
idvolume set id
xtrans,ytrans,ztransx/y/z trans values

Definition at line 333 of file gvl2.c.

References G_debug(), gvl_get_vol(), g_vol::x_trans, g_vol::y_trans, and g_vol::z_trans.

◆ GVL_slice_add()

int GVL_slice_add ( int  id)

Add slice.

Parameters
idvolume set id
Returns
-1 on error
1 on success

Definition at line 1194 of file gvl2.c.

◆ GVL_slice_del()

int GVL_slice_del ( int  id,
int  slice_id 
)

Delete slice.

Parameters
idvolume set id
slice_idslice id
Returns
-1 on error
1 on success

Definition at line 1230 of file gvl2.c.

Referenced by GVL_delete_vol().

◆ gvl_slice_freemem()

int gvl_slice_freemem ( geovol_slice slice)

Free geovol_slice struct.

Parameters
slicepointer to geovol_slice struct
Returns
-1 on failure
1 on success

Definition at line 782 of file gvl.c.

◆ GVL_slice_get_drawmode()

int GVL_slice_get_drawmode ( int  id,
int *  mode 
)

Get slice draw mode.

Parameters
idvolume set id
[out]modedraw mode
Returns
1 on success
-1 on error (invalid id)

Definition at line 1145 of file gvl2.c.

◆ GVL_slice_get_drawres()

void GVL_slice_get_drawres ( int  id,
int *  xres,
int *  yres,
int *  zres 
)

Get draw resolution of slice.

Parameters
idvolume set id
[out]xres,yres,zresx/y/z resolution value

Definition at line 1082 of file gvl2.c.

References G_debug(), gvl_get_vol(), g_vol::slice_x_mod, g_vol::slice_y_mod, and g_vol::slice_z_mod.

◆ GVL_slice_get_pos()

int GVL_slice_get_pos ( int  id,
int  slice_id,
float *  x1,
float *  x2,
float *  y1,
float *  y2,
float *  z1,
float *  z2,
int *  dir 
)

Get slice position.

Parameters
idvolume set id
slice_idslice id
[out]x1,y1,z1coordinates ?
[out]x2,y2,z2coordinates ?
[out]dirdirection
Returns
-1 on error
1 on success

Definition at line 1363 of file gvl2.c.

◆ gvl_slice_get_slice()

geovol_slice* gvl_slice_get_slice ( int  id,
int  slice_id 
)

Get geovol_slice struct.

Parameters
idvolume set id
slice_idslice id
Returns
pointer to geovol_slice struct
NULL on failure

Definition at line 803 of file gvl.c.

References gvl_get_vol(), g_vol::n_slices, NULL, and g_vol::slice.

◆ GVL_slice_get_transp()

int GVL_slice_get_transp ( int  id,
int  slice_id,
int *  transp 
)

Get slice trans ?

Parameters
idvolume set id
slice_idslice id
[out]transptransp value
Returns
-1 on error
1 on success

Definition at line 1483 of file gvl2.c.

◆ gvl_slice_init()

int gvl_slice_init ( geovol_slice slice)

Initialize geovol_slice struct.

Parameters
slicepointer to geovol_slice struct
Returns
-1 on failure
1 on success

Definition at line 756 of file gvl.c.

◆ GVL_slice_move_down()

int GVL_slice_move_down ( int  id,
int  slice_id 
)

Move down slice.

Parameters
idvolume set id
slice_idslice id
Returns
-1 on error
1 on success

Definition at line 1303 of file gvl2.c.

◆ GVL_slice_move_up()

int GVL_slice_move_up ( int  id,
int  slice_id 
)

Move up slice.

Parameters
idvolume set id
slice_idslice id
Returns
-1 on error
1 on success

Definition at line 1269 of file gvl2.c.

◆ GVL_slice_num_slices()

int GVL_slice_num_slices ( int  id)

Get number or slices.

Parameters
idvolume set id
Returns
number of slices
-1 on error

Definition at line 1336 of file gvl2.c.

References G_debug(), gvl_get_vol(), and g_vol::n_slices.

Referenced by GVL_delete_vol().

◆ GVL_slice_set_drawmode()

int GVL_slice_set_drawmode ( int  id,
int  mode 
)

Set slice draw mode.

Parameters
idvolume set id
modedraw mode
Returns
0 on success
-1 on error (invalid id)

Definition at line 1169 of file gvl2.c.

Referenced by Nviz_set_volume_attr_default().

◆ GVL_slice_set_drawres()

int GVL_slice_set_drawres ( int  id,
int  xres,
int  yres,
int  zres 
)

Set slice draw resolution.

Parameters
idvolume set id
xres,yres,zresx/y/z resolution value
Returns
0 on success
-1 on error (invalid value or id)

Definition at line 1108 of file gvl2.c.

References geovol_slice::changed, G_debug(), gvl_get_vol(), g_vol::n_slices, g_vol::slice, g_vol::slice_x_mod, g_vol::slice_y_mod, and g_vol::slice_z_mod.

Referenced by Nviz_set_volume_attr_default().

◆ GVL_slice_set_pos()

int GVL_slice_set_pos ( int  id,
int  slice_id,
float  x1,
float  x2,
float  y1,
float  y2,
float  z1,
float  z2,
int  dir 
)

Get slice position.

Parameters
idvolume set id
slice_idslice id
x1,y1,z1coordinates ?
x2,y2,z2coordinates ?
dirdirection
Returns
-1 on error
1 on success

Definition at line 1423 of file gvl2.c.

◆ GVL_slice_set_transp()

int GVL_slice_set_transp ( int  id,
int  slice_id,
int  transp 
)

Set slice trans ?

Parameters
idvolume set id
slice_idslice id
transptransp value
Returns
-1 on error
1 on success

Definition at line 1509 of file gvl2.c.

◆ gvl_slices_calc()

int gvl_slices_calc ( geovol gvol)

Calculate slices for given volume set.

Parameters
gvolpointer to geovol struct
Returns
1

Definition at line 1034 of file gvl_calc.c.

Referenced by gvld_vol().

◆ Gvl_unload_colors_data()

int Gvl_unload_colors_data ( void *  color_data)

Unload color table.

Parameters
color_datacolor data buffer
Returns
-1 on failure
1 on success

Definition at line 65 of file gvl3.c.

References G_free(), and Rast_free_colors().

◆ GVL_vol_exists()

int GVL_vol_exists ( int  id)

Check if volume set exists.

Parameters
idvolume set id
Returns
1 found
0 not found

Definition at line 111 of file gvl2.c.

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

Referenced by GVL_delete_vol().

◆ gvl_write_char()

void gvl_write_char ( int  pos,
unsigned char **  data,
unsigned char  c 
)

ADD.

Parameters
pos
data
c

Definition at line 735 of file gvl_calc.c.

◆ gvld_isosurf()

int gvld_isosurf ( geovol gvl)

Draw volume isosurfaces.

Parameters
gvlpointer to geovol struct
Returns
-1 on failure
1 on success

Definition at line 92 of file gvld.c.

References b, g, g_vol::n_isosurfs, r, and x.

Referenced by gvld_vol().

◆ gvld_slice()

int gvld_slice ( geovol gvl,
int  ndx 
)

Draw slice.

Parameters
gvlpointer to geovol struct
ndx
Returns
1

Definition at line 487 of file gvld.c.

◆ gvld_slices()

int gvld_slices ( geovol gvl)

Draw slices.

Parameters
gvlpointer to geovol struct
Returns
0

Definition at line 430 of file gvld.c.

Referenced by gvld_vol().

◆ gvld_vol()

int gvld_vol ( geovol gvl)

Draw volume set (slices and isosurfaces)

Parameters
gvlpointer to geovol struct
Returns
-1 on failure
1 on success

Definition at line 38 of file gvld.c.

References G_debug(), gvl_isosurf_calc(), gvl_slices_calc(), gvld_isosurf(), gvld_slices(), and g_vol::gvol_id.

Referenced by GVL_draw_vol().

◆ gvld_wind3_box()

◆ gvld_wire_isosurf()

int gvld_wire_isosurf ( geovol )

◆ gvld_wire_slices()

int gvld_wire_slices ( geovol gvl)

Draw wire slices.

Parameters
gvlpointer to geovol struct
Returns
0

Definition at line 665 of file gvld.c.

Referenced by gvld_wire_vol().

◆ gvld_wire_vol()

int gvld_wire_vol ( geovol gvl)

Draw volume in wire mode (bounding box)

Parameters
gvlpointer to geovol struct
Returns
-1 on failure
1 on success

Definition at line 69 of file gvld.c.

References G_debug(), gvld_wind3_box(), gvld_wire_isosurf(), gvld_wire_slices(), and g_vol::gvol_id.

Referenced by GVL_draw_wire().

◆ in_vregion()

int in_vregion ( geosurf gs,
float *  pt 
)

ADD.

Parameters
gssurface (geosurf)
Returns
1
0

Definition at line 691 of file gsdrape.c.

References VCOL2X, VCOLS, VROW2Y, VROWS, X, Y, and g_surf::yrange.

Referenced by GS_get_cat_at_xy(), GS_get_norm_at_xy(), GS_get_val_at_xy(), and seg_intersect_vregion().

◆ init_vars()

void init_vars ( geosurf gs)

Init variables.

for optimization

Parameters
gssurface (geosurf)

Definition at line 73 of file gs_norms.c.

Referenced by gs_calc_normals().

◆ interp_first_last()

void interp_first_last ( geosurf gs,
float *  bgn,
float *  end,
Point3  f,
Point3  l 
)

ADD.

Parameters
gssurface (geosurf)
bgnbegin point
endend point
ffirst
llast

Definition at line 438 of file gsdrape.c.

References l, X, and Y.

Referenced by gsdrape_get_allsegments().

◆ lin_interp()

double lin_interp ( float  dt,
float  val1,
float  val2 
)

Linear interpolation.

Parameters
dtcoefficient
val2value 2
val1value 1
Returns
val1 + dt * (val2 - val1)

Definition at line 545 of file gk.c.

Referenced by gk_make_linear_framesfromkeys().

◆ order_intersects()

int order_intersects ( geosurf gs,
Point3  first,
Point3  last,
int  vi,
int  hi,
int  di 
)

ADD.

After all the intersections between the segment and triangle edges have been found, they are in three lists. (intersections with vertical, horizontal, and diagonal triangle edges)

Each list is ordered in space from first to last segment points, but now the lists need to be woven together. This routine starts with the first point of the segment and then checks the next point in each list to find the closest, eliminating duplicates along the way and storing the result in I3d.

Parameters
gssurface (geosurf)
firstfirst point
lastlast point
vi
hi
di
Returns

Definition at line 724 of file gsdrape.c.

◆ P3toPlane()

int P3toPlane ( Point3  p1,
Point3  p2,
Point3  p3,
float *  plane 
)

Define plane.

Parameters
p1,p2,p3three point on plane
[out]planeplane definition
Returns
1

Definition at line 1327 of file gsdrape.c.

Referenced by Point_on_plane().

◆ P_popmatrix()

int P_popmatrix ( void  )

Pop top of matrix stack, placing it into the current transformation matrix.

Returns
-1 on failure
0 on success

Definition at line 188 of file trans.c.

◆ P_pushmatrix()

int P_pushmatrix ( void  )

Push current transformation matrix onto matrix stack.

Definition at line 167 of file trans.c.

Referenced by gsd_update_cpnorm().

◆ P_rot()

void P_rot ( float  angle,
char  axis 
)

Rotate matrix.

Parameters
angleangle value
axis('x, 'y', 'z')

Definition at line 208 of file trans.c.

Referenced by gsd_update_cpnorm().

◆ P_scale()

void P_scale ( float  x,
float  y,
float  z 
)

ADD.

Parameters
x,y,z

Definition at line 65 of file trans.c.

◆ P_transform()

void P_transform ( int  num_vert,
float(*)  in[4],
float(*)  out[4] 
)

Transform array of vectors using current T matrix.

Multiply 'in' matrix (homogeneous coordinate generally) by the current transformation matrix, placing the result in 'out'

[in][trans_mat] => [out]

Parameters
num_vert
in
out

Definition at line 107 of file trans.c.

◆ Point_on_plane()

int Point_on_plane ( Point3  p1,
Point3  p2,
Point3  p3,
Point3  unk 
)

Check if point is on plane.

Plane defined by three points here; user fills in unk[X] & unk[Y]

Parameters
p1,p2,p3points defining plane
unkpoint
Returns
1 point on plane
0 point not on plane

Definition at line 1282 of file gsdrape.c.

References P3toPlane(), and XY_intersect_plane().

Referenced by viewcell_tri_interp().

◆ primitive_cone()

void primitive_cone ( unsigned long  col)

Primitives only called after transforms.

Center is actually center at base of 8 sided cone

Parameters
colcolor value

Definition at line 1285 of file gsd_objs.c.

◆ primitive_cylinder()

void primitive_cylinder ( unsigned long  col,
int  caps 
)

Primitives only called after transforms.

Center is actually center at base of 8 sided cylinder

Parameters
colcolor value
caps

Definition at line 1322 of file gsd_objs.c.

◆ print_256lookup()

void print_256lookup ( int *  buff)

Debugging, 256 integer values from buffer.

Todo:
G_debug ?
Parameters
ftpointer to buffer

Definition at line 369 of file gs.c.

◆ print_bm()

void print_bm ( struct BM bm)

Print bitmap to stderr.

Parameters
bmbitmap (BM)

Definition at line 361 of file gs_bm.c.

References BM_get(), BM::cols, and BM::rows.

◆ print_frto()

void print_frto ( float(*)  ft[4])

Debugging, print 'from/to' model coordinates to stderr.

Todo:
G_debug ?
Parameters
ftpointer to coordinates

Definition at line 339 of file gs.c.

References FROM, TO, X, Y, and Z.

Referenced by print_view_fields().

◆ print_realto()

void print_realto ( float *  rt)

Debugging, print 'to' real coordinates to stderr.

Todo:
G_debug ?
Parameters
ftpointer to coordinates

Definition at line 355 of file gs.c.

References X, Y, and Z.

◆ print_site_fields()

void print_site_fields ( geosite )

◆ print_surf_fields()

void print_surf_fields ( geosurf s)

Debugging, print geosurf fields to stderr.

Todo:
G_debug ?
Parameters
spointer to geosurf struct

Definition at line 393 of file gs.c.

◆ print_view_fields()

void print_view_fields ( geoview gv)

Debugging, print geoview fields to stderr.

Todo:
G_debug ?
Parameters
gvpointer to geoview struct

Definition at line 419 of file gs.c.

References geoview::coord_sys, geoview::fov, geoview::from_to, geoview::incl, geoview::infocus, geoview::look, print_frto(), geoview::real_to, geoview::scale, geoview::twist, geoview::vert_exag, geoview::view_proj, X, Y, and Z.

◆ print_vol_fields()

void print_vol_fields ( geovol gvl)

◆ RayCvxPolyhedronInt()

int RayCvxPolyhedronInt ( Point3  org,
Point3  dir,
double  tmax,
Point4 phdrn,
int  ph_num,
double *  tresult,
int *  pn 
)

Ray-Convex Polyhedron Intersection Test.

Originally by Eric Haines, erich.nosp@m.@eye.nosp@m..com

This test checks the ray against each face of a polyhedron, checking whether the set of intersection points found for each ray-plane intersection overlaps the previous intersection results. If there is no overlap (i.e. no line segment along the ray that is inside the polyhedron), then the ray misses and returns 0; else 1 is returned if the ray is entering the polyhedron, -1 if the ray originates inside the polyhedron. If there is an intersection, the distance and the number of the face hit is returned.

Parameters
org,dirorigin and direction of ray
tmaxmaximum useful distance along ray
phdrnlist of planes in convex polyhedron
ph_numnumber of planes in convex polyhedron
[out]tresultdistance of intersection along ray
[out]pnnumber of face hit (0 to ph_num-1)
Returns
FACE code

Definition at line 384 of file gs_query.c.

References BACKFACE, DOT3, FRONTFACE, HUGE_VAL, MISSED, t, and W.

Referenced by gs_setlos_enterdata().

◆ seg_intersect_vregion()

int seg_intersect_vregion ( geosurf gs,
float *  bgn,
float *  end 
)

Check if segment intersect vector region.

Clipping performed:

  • bgn and end are replaced so that both points are within viewregion
  • if seg intersects
Parameters
gssurface (geosurf)
bgnbegin point
endend point
Returns
0 if segment doesn't intersect the viewregion, or intersects only at corner
otherwise returns 1

Definition at line 232 of file gsdrape.c.

References GS_P2distance(), in_vregion(), segs_intersect(), VCOL2X, VCOLS, VROW2Y, VROWS, X, and Y.

Referenced by gsdrape_get_allsegments(), and gsdrape_get_segments().

◆ segs_intersect()

int segs_intersect ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
float  x4,
float  y4,
float *  x,
float *  y 
)

Line intersect.

Author: Mukesh Prasad Modified for floating point: Bill Brown

This function computes whether two line segments, respectively joining the input points (x1,y1) – (x2,y2) and the input points (x3,y3) – (x4,y4) intersect. If the lines intersect, the output variables x, y are set to coordinates of the point of intersection.

Parameters
x1,y1,x2,y2coordinates of endpoints of one segment
x3,y3,x4,y4coordinates of endpoints of other segment
[out]x,ycoordinates of intersection point
Returns
0 no intersection
1 intersect
2 collinear

Definition at line 1202 of file gsdrape.c.

Referenced by get_horz_intersects(), get_vert_intersects(), and seg_intersect_vregion().

◆ show_colormode()

void show_colormode ( void  )

Print color mode to stderr.

Definition at line 151 of file gsd_prim.c.

References _, and G_message().

◆ sub_Vectmem()

void sub_Vectmem ( int  minus)

Tracking memory.

Parameters
minusmimus number

Definition at line 298 of file gv3.c.

References G_debug().

Referenced by gv_free_vectmem().

◆ V3Cross()

int V3Cross ( Point3  a,
Point3  b,
Point3  c 
)

Get cross product.

Parameters
a,b,c
Returns
cross product c = a cross b

Definition at line 1356 of file gsdrape.c.

◆ viewcell_tri_interp()

int viewcell_tri_interp ( geosurf gs,
typbuff buf,
Point3  pt,
int  check_mask 
)

ADD.

In gsd_surf, tmesh draws polys like so:

--------------
|           /|
|          / |
|         /  |
|        /   |
|       /    |
|      /     |
|     /      |
|    /       |
|   /        |
|  /         |
| /          |
|/           |
--------------

UNLESS the top right or bottom left point is masked, in which case a single triangle with the opposite diagonal is drawn. This case is not yet handled here & should only occur on edges. pt has X & Y coordinates in it, we interpolate Z here

This could probably be much shorter, but not much faster.

Returns
1 if point is in view region
otherwise 0 (if masked)

Definition at line 503 of file gsdrape.c.

References g_surf::att, ATT_TOPO, CONST_ATT, gsurf_att::constant, DRC2OFF, GET_MAPATT, gs_get_att_src(), gs_point_is_masked(), LERP, MAP_ATT, Point_on_plane(), VCOL2DCOL, VCOL2X, VCOLS, VROW2DROW, VROW2Y, VROWS, VXRES, VYRES, X, X2VCOL, Y, Y2VROW, g_surf::yrange, and Z.

Referenced by _viewcell_tri_interp().

◆ void_func()

void void_func ( void  )

Definition at line 86 of file gs2.c.

◆ XY_intersect_plane()

int XY_intersect_plane ( float *  intersect,
float *  plane 
)

Check for intersection (point and plane)

Ax + By + Cz + D = 0, so z = (Ax + By + D) / -C

User fills in intersect[X] & intersect[Y]

Parameters
[out]intersectintersect coordinates
planeplane definition
Returns
0 doesn't intersect
1 intesects

Definition at line 1304 of file gsdrape.c.

References W, X, x, Y, and Z.

Referenced by Point_on_plane().