| GRASS 8 Programmer's Manual
    8.5.0dev(2025)-9d806b45d8
    | 
OGSF library - loading and manipulating volumes (lower level functions) More...

Go to the source code of this file.
| Macros | |
| #define | FIRST_VOL_ID 81721 | 
| Functions | |
| geovol * | gvl_get_vol (int id) | 
| Get volume set structure.  More... | |
| geovol * | gvl_get_prev_vol (int id) | 
| Get previous volume.  More... | |
| int | gvl_getall_vols (geovol **gvols) | 
| Get all volumes.  More... | |
| int | gvl_num_vols (void) | 
| Get number of loaded volume sets.  More... | |
| geovol * | gvl_get_last_vol (void) | 
| Get last volume set from the list.  More... | |
| geovol * | gvl_get_new_vol (void) | 
| Allocate new volume set and add it to the list.  More... | |
| int | gvl_init_vol (geovol *gvl, double ox, double oy, double oz, int rows, int cols, int depths, double xres, double yres, double zres) | 
| Initialize geovol structure.  More... | |
| void | gvl_delete_vol (int id) | 
| Remove volume set from list.  More... | |
| int | gvl_free_vol (geovol *fvl) | 
| Free geovol struct.  More... | |
| void | gvl_free_volmem (geovol *fvl) | 
| Free geovol struct memory.  More... | |
| void | print_vol_fields (geovol *gvl) | 
| Debug volume fields.  More... | |
| int | gvl_get_xextents (geovol *gvl, float *min, float *max) | 
| Get volume x-extent value.  More... | |
| int | gvl_get_yextents (geovol *gvl, float *min, float *max) | 
| Get volume y-extent value.  More... | |
| int | gvl_get_zextents (geovol *gvl, float *min, float *max) | 
| Get volume z-extent value.  More... | |
| int | gvl_get_xrange (float *min, float *max) | 
| Get volume x-range value.  More... | |
| int | gvl_get_yrange (float *min, float *max) | 
| Get volume y-range value.  More... | |
| int | gvl_get_zrange (float *min, float *max) | 
| Get volume z-range value.  More... | |
| int | gvl_isosurf_init (geovol_isosurf *isosurf) | 
| Initialize geovol_isosurf struct.  More... | |
| int | gvl_isosurf_freemem (geovol_isosurf *isosurf) | 
| Free geovol_isosurf struct.  More... | |
| geovol_isosurf * | gvl_isosurf_get_isosurf (int id, int isosurf_id) | 
| Get isosurface of given volume set.  More... | |
| int | gvl_isosurf_get_att_src (geovol_isosurf *isosurf, int desc) | 
| Get attribute source.  More... | |
| int | gvl_isosurf_set_att_src (geovol_isosurf *isosurf, int desc, int src) | 
| Set attribute source.  More... | |
| int | gvl_isosurf_set_att_const (geovol_isosurf *isosurf, int desc, float constant) | 
| Set isosurface attribute constant.  More... | |
| int | gvl_isosurf_set_att_map (geovol_isosurf *isosurf, int desc, const char *filename) | 
| Set attribute map.  More... | |
| int | gvl_isosurf_set_att_changed (geovol_isosurf *isosurf, int desc) | 
| Set attribute changed.  More... | |
| int | gvl_slice_init (geovol_slice *slice) | 
| Initialize geovol_slice struct.  More... | |
| int | gvl_slice_freemem (geovol_slice *slice) | 
| Free geovol_slice struct.  More... | |
| geovol_slice * | gvl_slice_get_slice (int id, int slice_id) | 
| Get geovol_slice struct.  More... | |
OGSF library - loading and manipulating volumes (lower level functions)
GRASS OpenGL gsurf OGSF Library
(C) 1999-2008 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file gvl.c.
| void gvl_delete_vol | ( | int | id | ) | 
Remove volume set from list.
| id | volume 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().
| int gvl_free_vol | ( | geovol * | fvl | ) | 
Free geovol struct.
| fvl | pointer to geovol struct | 
Definition at line 267 of file gvl.c.
References G_debug().
Referenced by gvl_delete_vol().
| void gvl_free_volmem | ( | geovol * | fvl | ) | 
Free geovol struct memory.
| fvl | pointer to geovol struct | 
Definition at line 316 of file gvl.c.
References gvl_file_free_datah(), and g_vol::hfile.
| geovol* gvl_get_last_vol | ( | void | ) | 
Get last volume set from the list.
Definition at line 124 of file gvl.c.
References G_debug().
Referenced by gvl_get_new_vol().
| geovol* gvl_get_new_vol | ( | void | ) | 
Allocate new volume set and add it to the list.
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.
| geovol* gvl_get_prev_vol | ( | int | id | ) | 
| geovol* gvl_get_vol | ( | int | id | ) | 
Get volume set structure.
| id | volume set id | 
Definition at line 40 of file gvl.c.
References G_debug().
Referenced by gvl_delete_vol(), GVL_draw_vol(), GVL_draw_wire(), GVL_Get_ClientData(), GVL_get_dims(), GVL_get_trans(), GVL_isosurf_add(), GVL_isosurf_del(), GVL_isosurf_get_drawres(), gvl_isosurf_get_isosurf(), GVL_isosurf_num_isosurfs(), GVL_isosurf_set_drawres(), GVL_Set_ClientData(), GVL_set_draw_wire(), GVL_set_focus_center_map(), GVL_set_trans(), GVL_slice_get_drawres(), gvl_slice_get_slice(), GVL_slice_num_slices(), GVL_slice_set_drawres(), and GVL_vol_exists().
| int gvl_get_xextents | ( | geovol * | gvl, | 
| float * | min, | ||
| float * | max | ||
| ) | 
Get volume x-extent value.
| gvl | pointer to geovol struct | |
| [out] | min | x-min value | 
| [out] | max | y-max value | 
Definition at line 354 of file gvl.c.
References max, min, g_vol::x_trans, g_vol::xmax, and g_vol::xmin.
| int gvl_get_xrange | ( | float * | min, | 
| float * | max | ||
| ) | 
| int gvl_get_yextents | ( | geovol * | gvl, | 
| float * | min, | ||
| float * | max | ||
| ) | 
Get volume y-extent value.
| gvl | pointer to geovol struct | |
| [out] | min | y-min value | 
| [out] | max | y-max value | 
Definition at line 371 of file gvl.c.
References max, min, g_vol::y_trans, g_vol::ymax, and g_vol::ymin.
| int gvl_get_yrange | ( | float * | min, | 
| float * | max | ||
| ) | 
| int gvl_get_zextents | ( | geovol * | gvl, | 
| float * | min, | ||
| float * | max | ||
| ) | 
Get volume z-extent value.
| gvl | pointer to geovol struct | |
| [out] | min | z-min value | 
| [out] | max | z-max value | 
Definition at line 388 of file gvl.c.
References max, min, g_vol::z_trans, g_vol::zmax, and g_vol::zmin.
| int gvl_get_zrange | ( | float * | min, | 
| float * | max | ||
| ) | 
Get volume z-range value.
| [out] | min | z-min value | 
| [out] | max | z-max value | 
Definition at line 478 of file gvl.c.
Referenced by GS_get_zrange().
| int gvl_getall_vols | ( | geovol ** | gvols | ) | 
| int gvl_init_vol | ( | geovol * | gvl, | 
| double | ox, | ||
| double | oy, | ||
| double | oz, | ||
| int | rows, | ||
| int | cols, | ||
| int | depths, | ||
| double | xres, | ||
| double | yres, | ||
| double | zres | ||
| ) | 
Initialize geovol structure.
| gvl | pointer to geovol struct | 
| ox,oy,oz | |
| rows | number of rows | 
| cols | number of cols | 
| xres,yres,zres | x/y/z resolution value | 
Definition at line 187 of file gvl.c.
References g_vol::clientdata, g_vol::cols, g_vol::depths, DM_GOURAUD, g_vol::draw_wire, G_debug(), G_zero(), g_vol::gvol_id, g_vol::hfile, g_vol::isosurf, g_vol::isosurf_draw_mode, g_vol::isosurf_x_mod, g_vol::isosurf_y_mod, g_vol::isosurf_z_mod, MAX_ISOSURFS, MAX_SLICES, g_vol::n_isosurfs, g_vol::n_slices, NULL, g_vol::ox, g_vol::oy, g_vol::oz, g_vol::rows, g_vol::slice, g_vol::slice_draw_mode, g_vol::slice_x_mod, g_vol::slice_y_mod, g_vol::slice_z_mod, g_vol::x_trans, g_vol::xmax, g_vol::xmin, g_vol::xrange, g_vol::xres, g_vol::y_trans, g_vol::ymax, g_vol::ymin, g_vol::yrange, g_vol::yres, g_vol::z_trans, g_vol::zmax, g_vol::zmin, g_vol::zrange, and g_vol::zres.
| int gvl_isosurf_freemem | ( | geovol_isosurf * | isosurf | ) | 
Free geovol_isosurf struct.
| isosurf | pointer to geovol_isosurf struct | 
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().
| int gvl_isosurf_get_att_src | ( | geovol_isosurf * | isosurf, | 
| int | desc | ||
| ) | 
Get attribute source.
| isosurf | pointer to geovol_isosurf struct | 
| desc | attribute id | 
Definition at line 607 of file gvl.c.
References geovol_isosurf::att, geovol_isosurf_att::att_src, G_debug(), and LEGAL_ATT.
| geovol_isosurf* gvl_isosurf_get_isosurf | ( | int | id, | 
| int | isosurf_id | ||
| ) | 
Get isosurface of given volume set.
| id | volume set id | 
| isosurf_id | isosurface id (0 - MAX_ISOSURFS) | 
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().
| int gvl_isosurf_init | ( | geovol_isosurf * | isosurf | ) | 
Initialize geovol_isosurf struct.
| isosurf | pointer to geovol_isosurf struct | 
Definition at line 520 of file gvl.c.
References geovol_isosurf::att, geovol_isosurf_att::att_data, geovol_isosurf_att::att_src, geovol_isosurf_att::changed, geovol_isosurf_att::constant, geovol_isosurf::data, geovol_isosurf::data_desc, G_debug(), geovol_isosurf_att::hfile, geovol_isosurf::inout_mode, MAX_ATTS, NOTSET_ATT, NULL, and geovol_isosurf_att::user_func.
Referenced by GVL_isosurf_add().
| int gvl_isosurf_set_att_changed | ( | geovol_isosurf * | isosurf, | 
| int | desc | ||
| ) | 
Set attribute changed.
| isosurf | pointer to geovol_isosurf struct | 
| desc | attribute id | 
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().
| int gvl_isosurf_set_att_const | ( | geovol_isosurf * | isosurf, | 
| int | desc, | ||
| float | constant | ||
| ) | 
Set isosurface attribute constant.
| isosurf | pointer to geovol_isosurf struct | 
| desc | attribute descriptor | 
| constant | attribute value | 
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().
| int gvl_isosurf_set_att_map | ( | geovol_isosurf * | isosurf, | 
| int | desc, | ||
| const char * | filename | ||
| ) | 
Set attribute map.
| isosurf | pointer to geovol_isosurf struct | 
| desc | attribute id | 
| filename | filename | 
| int gvl_isosurf_set_att_src | ( | geovol_isosurf * | isosurf, | 
| int | desc, | ||
| int | src | ||
| ) | 
Set attribute source.
| isosurf | pointer to geovol_isosurf struct | 
| desc | attribute id | 
| src | attribute value | 
Definition at line 632 of file gvl.c.
Referenced by gvl_isosurf_freemem(), gvl_isosurf_set_att_const(), and GVL_isosurf_unset_att().
| int gvl_num_vols | ( | void | ) | 
Get number of loaded volume sets.
Definition at line 105 of file gvl.c.
Referenced by GVL_num_vols().
| int gvl_slice_freemem | ( | geovol_slice * | slice | ) | 
Free geovol_slice struct.
| slice | pointer to geovol_slice struct | 
| geovol_slice* gvl_slice_get_slice | ( | int | id, | 
| int | slice_id | ||
| ) | 
Get geovol_slice struct.
| id | volume set id | 
| slice_id | slice id | 
Definition at line 803 of file gvl.c.
References gvl_get_vol(), g_vol::n_slices, NULL, and g_vol::slice.
| int gvl_slice_init | ( | geovol_slice * | slice | ) | 
Initialize geovol_slice struct.
| slice | pointer to geovol_slice struct | 
| void print_vol_fields | ( | geovol * | gvl | ) | 
Debug volume fields.
| gvl | pointer to geovol struct | 
Definition at line 329 of file gvl.c.
References g_vol::cols, g_vol::depths, G_debug(), g_vol::gvol_id, g_vol::ox, g_vol::oy, g_vol::oz, g_vol::rows, g_vol::x_trans, g_vol::xmax, g_vol::xmin, g_vol::xres, g_vol::y_trans, g_vol::ymax, g_vol::ymin, g_vol::yres, g_vol::z_trans, g_vol::zmax, g_vol::zmin, and g_vol::zres.