|
GRASS 8 Programmer's Manual
8.5.0dev(2025)-9d806b45d8
|
OGSF library - loading and manipulating volumes. More...
#include <string.h>#include <grass/gis.h>#include <grass/raster3d.h>#include <grass/ogsf.h>#include <grass/glocale.h>#include "gsget.h"
Go to the source code of this file.
Functions | |
| void | GVL_libinit (void) |
| Library initialization for volumes. More... | |
| void | GVL_init_region (void) |
| Initialize 3D region. More... | |
| int | GVL_get_region (float *n, float *s, float *w, float *e, float *t, float *b) |
| Get region extent settings. More... | |
| void * | GVL_get_window (void) |
| Get window. More... | |
| int | GVL_vol_exists (int id) |
| 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 *numvols) |
| Get list of loaded volume sets. More... | |
| int | GVL_delete_vol (int id) |
| Delete volume set from list. More... | |
| int | GVL_load_vol (int id, const char *filename) |
| Load 3d raster map to volume set. More... | |
| int | GVL_get_volname (int id, char *filename) |
| Get volume set name. More... | |
| void | GVL_get_dims (int id, int *rows, int *cols, int *depths) |
| Get volume dimensions. More... | |
| void | GVL_set_trans (int id, float xtrans, float ytrans, float ztrans) |
| Set trans ? More... | |
| int | GVL_get_trans (int id, float *xtrans, float *ytrans, float *ztrans) |
| Get trans ? More... | |
| void | GVL_set_draw_wire (int id, int draw_wire) |
| Set drawing wire box. More... | |
| void | GVL_draw_vol (int vid) |
| Draw volume set. More... | |
| void | GVL_draw_wire (int id) |
| 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 id, void *clientd) |
| Set client data for volume set. More... | |
| void * | GVL_Get_ClientData (int id) |
| Get client data. More... | |
| void | GVL_set_focus_center_map (int id) |
| Set focus on map center. More... | |
| void | GVL_isosurf_get_drawres (int id, int *xres, int *yres, int *zres) |
| Get draw resolution for isosurface. More... | |
| int | GVL_isosurf_set_drawres (int id, int xres, int yres, int zres) |
| Set isosurface draw resolution. More... | |
| int | GVL_isosurf_get_drawmode (int id, int *mode) |
| Get isosurface draw mode. More... | |
| int | GVL_isosurf_set_drawmode (int id, int mode) |
| Set isosurface draw mode. More... | |
| int | GVL_isosurf_add (int id) |
| Add isosurface. More... | |
| int | GVL_isosurf_del (int id, int isosurf_id) |
| Delete isosurface. More... | |
| int | GVL_isosurf_move_up (int id, int isosurf_id) |
| Move up isosurface in list. More... | |
| int | GVL_isosurf_move_down (int id, int isosurf_id) |
| Move down isosurface in list. More... | |
| int | GVL_isosurf_get_att (int id, int isosurf_id, int att, int *set, float *constant, char *mapname) |
| Get isosurface attributes. More... | |
| int | GVL_isosurf_unset_att (int id, int isosurf_id, int att) |
| Unset isosurface attributes. More... | |
| int | GVL_isosurf_set_att_const (int id, int isosurf_id, int att, float constant) |
| Set constant isosurface attribute. More... | |
| int | GVL_isosurf_set_att_map (int id, int isosurf_id, int att, const char *filename) |
| Set isosurface map attribute. More... | |
| int | GVL_isosurf_get_flags (int id, int isosurf_id, int *inout) |
| Get isosurface flags. More... | |
| int | GVL_isosurf_set_flags (int id, int isosurf_id, int inout) |
| Set isosurface flags. More... | |
| int | GVL_isosurf_num_isosurfs (int id) |
| Get number of available isosurfaces. More... | |
| int | GVL_isosurf_set_maskmode (int id, int isosurf_id, int mode) |
| Set mask attribute mode. More... | |
| int | GVL_isosurf_get_maskmode (int id, int isosurf_id, int *mode) |
| Get isosurface mask mode. More... | |
| void | GVL_slice_get_drawres (int id, int *xres, int *yres, int *zres) |
| Get draw resolution of slice. More... | |
| int | GVL_slice_set_drawres (int id, int xres, int yres, int zres) |
| Set slice draw resolution. More... | |
| int | GVL_slice_get_drawmode (int id, int *mode) |
| Get slice draw mode. More... | |
| int | GVL_slice_set_drawmode (int id, int mode) |
| Set slice draw mode. More... | |
| int | GVL_slice_add (int id) |
| Add slice. More... | |
| int | GVL_slice_del (int id, int slice_id) |
| Delete slice. More... | |
| int | GVL_slice_move_up (int id, int slice_id) |
| Move up slice. More... | |
| int | GVL_slice_move_down (int id, int slice_id) |
| Move down slice. More... | |
| int | GVL_slice_num_slices (int id) |
| Get number or slices. More... | |
| 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. More... | |
| 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. More... | |
| int | GVL_slice_get_transp (int id, int slice_id, int *transp) |
| Get slice trans ? More... | |
| int | GVL_slice_set_transp (int id, int slice_id, int transp) |
| Set slice trans ? More... | |
OGSF library - loading and manipulating volumes.
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 gvl2.c.
| void GVL_alldraw_wire | ( | void | ) |
| int GVL_delete_vol | ( | int | id | ) |
Delete volume set from list.
| id | 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().
| void GVL_draw_vol | ( | int | vid | ) |
Draw volume set.
| vid | volume set id |
Definition at line 408 of file gvl2.c.
References g_vol::draw_wire, gvl_get_vol(), gvld_vol(), and gvld_wind3_box().
Referenced by Nviz_draw_all_vol().
| void GVL_draw_wire | ( | int | id | ) |
Draw volume in wire mode.
| id | volume set id |
Definition at line 429 of file gvl2.c.
References G_debug(), gvl_get_vol(), and gvld_wire_vol().
| void* GVL_Get_ClientData | ( | int | id | ) |
Get client data.
| id | volume set id |
Definition at line 504 of file gvl2.c.
References g_vol::clientdata, gvl_get_vol(), and NULL.
| void GVL_get_dims | ( | int | id, |
| int * | rows, | ||
| int * | cols, | ||
| int * | depths | ||
| ) |
Get volume dimensions.
| id | volume set id | |
| [out] | rows,cols,depths | number 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().
| int GVL_get_region | ( | float * | n, |
| float * | s, | ||
| float * | w, | ||
| float * | e, | ||
| float * | t, | ||
| float * | b | ||
| ) |
| int GVL_get_trans | ( | int | id, |
| float * | xtrans, | ||
| float * | ytrans, | ||
| float * | ztrans | ||
| ) |
Get trans ?
| id | volume set id | |
| [out] | xtrans,ytrans,ztrans | x/y/z trans values |
Definition at line 365 of file gvl2.c.
References gvl_get_vol(), g_vol::x_trans, g_vol::y_trans, and g_vol::z_trans.
| int* GVL_get_vol_list | ( | int * | numvols | ) |
Get list of loaded volume sets.
Must be freed if not needed!
| [out] | numvols | number of volume sets |
Definition at line 181 of file gvl2.c.
Referenced by Nviz_draw_all_vol().
| int GVL_get_volname | ( | int | id, |
| char * | filename | ||
| ) |
| void* GVL_get_window | ( | void | ) |
| 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().
| int GVL_isosurf_add | ( | int | id | ) |
Add isosurface.
| id | volume set id |
Definition at line 667 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.
| int GVL_isosurf_del | ( | int | id, |
| int | isosurf_id | ||
| ) |
Delete isosurface.
| id | volume set id |
| isosurf_id | isosurface id |
Definition at line 704 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().
| int GVL_isosurf_get_att | ( | int | id, |
| int | isosurf_id, | ||
| int | att, | ||
| int * | set, | ||
| float * | constant, | ||
| char * | mapname | ||
| ) |
| int GVL_isosurf_get_drawmode | ( | int | id, |
| int * | mode | ||
| ) |
| void GVL_isosurf_get_drawres | ( | int | id, |
| int * | xres, | ||
| int * | yres, | ||
| int * | zres | ||
| ) |
Get draw resolution for isosurface.
| id | volume set id | |
| [out] | xres,yres,zres | x/y/z resolution value |
Definition at line 555 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.
| int GVL_isosurf_get_flags | ( | int | id, |
| int | isosurf_id, | ||
| int * | inout | ||
| ) |
Get isosurface flags.
| id | volume set id | |
| isosurf_id | isosurface id | |
| [out] | inout | map name |
Definition at line 957 of file gvl2.c.
References G_debug(), gvl_isosurf_get_isosurf(), and geovol_isosurf::inout_mode.
| int GVL_isosurf_get_maskmode | ( | int | id, |
| int | isosurf_id, | ||
| int * | mode | ||
| ) |
| int GVL_isosurf_move_down | ( | int | id, |
| int | isosurf_id | ||
| ) |
| int GVL_isosurf_move_up | ( | int | id, |
| int | isosurf_id | ||
| ) |
| int GVL_isosurf_num_isosurfs | ( | int | id | ) |
Get number of available isosurfaces.
| id | volume set id |
Definition at line 1008 of file gvl2.c.
References G_debug(), gvl_get_vol(), and g_vol::n_isosurfs.
Referenced by GVL_delete_vol().
| int GVL_isosurf_set_att_const | ( | int | id, |
| int | isosurf_id, | ||
| int | att, | ||
| float | constant | ||
| ) |
Set constant isosurface attribute.
Attributes:
| id | volume set id |
| isosurf_id | isosurface id (0 - MAX_ISOSURFS) |
| att | attribute descriptor |
| constant | constant value |
Definition at line 890 of file gvl2.c.
References G_debug(), gvl_isosurf_get_isosurf(), and gvl_isosurf_set_att_const().
| int GVL_isosurf_set_att_map | ( | int | id, |
| int | isosurf_id, | ||
| int | att, | ||
| const char * | filename | ||
| ) |
Set isosurface map attribute.
Attributes:
| id | volume set id |
| isosurf_id | isosurface id (0 - MAX_ISOSURFS) |
| att | attribute descriptor |
| filename | map name |
| int GVL_isosurf_set_drawmode | ( | int | id, |
| int | mode | ||
| ) |
Set isosurface draw mode.
| id | volume set id |
| mode | draw mode |
Definition at line 642 of file gvl2.c.
Referenced by Nviz_set_volume_attr_default().
| int GVL_isosurf_set_drawres | ( | int | id, |
| int | xres, | ||
| int | yres, | ||
| int | zres | ||
| ) |
Set isosurface draw resolution.
| id | volume set id |
| xres,yres,zres | x/y/z resolution value |
Definition at line 581 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().
| int GVL_isosurf_set_flags | ( | int | id, |
| int | isosurf_id, | ||
| int | inout | ||
| ) |
Set isosurface flags.
| id | volume set id |
| isosurf_id | isosurface id |
| inout | map name |
Definition at line 983 of file gvl2.c.
References G_debug(), gvl_isosurf_get_isosurf(), and geovol_isosurf::inout_mode.
| int GVL_isosurf_set_maskmode | ( | int | id, |
| int | isosurf_id, | ||
| int | mode | ||
| ) |
| int GVL_isosurf_unset_att | ( | int | id, |
| int | isosurf_id, | ||
| int | att | ||
| ) |
Unset isosurface attributes.
| id | volume set id |
| isosurf_id | isosurface id |
| att | attribute id |
Definition at line 855 of file gvl2.c.
References G_debug(), gvl_isosurf_get_isosurf(), gvl_isosurf_set_att_src(), and NOTSET_ATT.
| 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().
| int GVL_load_vol | ( | int | id, |
| const char * | filename | ||
| ) |
| int GVL_new_vol | ( | void | ) |
| int GVL_num_vols | ( | void | ) |
Get number of loaded volume sets.
Definition at line 166 of file gvl2.c.
References gvl_num_vols().
| int GVL_Set_ClientData | ( | int | id, |
| void * | clientd | ||
| ) |
Set client data for volume set.
| id | volume set id |
| clientd | pointer to client data |
Definition at line 481 of file gvl2.c.
References g_vol::clientdata, and gvl_get_vol().
| void GVL_set_draw_wire | ( | int | id, |
| int | draw_wire | ||
| ) |
Set drawing wire box.
| id | volume set id |
| draw_wire | 1 for drawing wire, 0 otherwise |
Definition at line 388 of file gvl2.c.
References g_vol::draw_wire, G_debug(), and gvl_get_vol().
| void GVL_set_focus_center_map | ( | int | id | ) |
Set focus on map center.
| id | volume set id |
Definition at line 522 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.
| void GVL_set_trans | ( | int | id, |
| float | xtrans, | ||
| float | ytrans, | ||
| float | ztrans | ||
| ) |
Set trans ?
| id | volume set id |
| xtrans,ytrans,ztrans | x/y/z trans values |
Definition at line 339 of file gvl2.c.
References G_debug(), gvl_get_vol(), g_vol::x_trans, g_vol::y_trans, and g_vol::z_trans.
| int GVL_slice_add | ( | int | id | ) |
| int GVL_slice_del | ( | int | id, |
| int | slice_id | ||
| ) |
Delete slice.
| id | volume set id |
| slice_id | slice id |
Definition at line 1236 of file gvl2.c.
Referenced by GVL_delete_vol().
| int GVL_slice_get_drawmode | ( | int | id, |
| int * | mode | ||
| ) |
| void GVL_slice_get_drawres | ( | int | id, |
| int * | xres, | ||
| int * | yres, | ||
| int * | zres | ||
| ) |
Get draw resolution of slice.
| id | volume set id | |
| [out] | xres,yres,zres | x/y/z resolution value |
Definition at line 1088 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.
| int GVL_slice_get_pos | ( | int | id, |
| int | slice_id, | ||
| float * | x1, | ||
| float * | x2, | ||
| float * | y1, | ||
| float * | y2, | ||
| float * | z1, | ||
| float * | z2, | ||
| int * | dir | ||
| ) |
| int GVL_slice_get_transp | ( | int | id, |
| int | slice_id, | ||
| int * | transp | ||
| ) |
| int GVL_slice_move_down | ( | int | id, |
| int | slice_id | ||
| ) |
| int GVL_slice_move_up | ( | int | id, |
| int | slice_id | ||
| ) |
| int GVL_slice_num_slices | ( | int | id | ) |
Get number or slices.
| id | volume set id |
Definition at line 1342 of file gvl2.c.
References G_debug(), gvl_get_vol(), and g_vol::n_slices.
Referenced by GVL_delete_vol().
| int GVL_slice_set_drawmode | ( | int | id, |
| int | mode | ||
| ) |
Set slice draw mode.
| id | volume set id |
| mode | draw mode |
Definition at line 1175 of file gvl2.c.
Referenced by Nviz_set_volume_attr_default().
| int GVL_slice_set_drawres | ( | int | id, |
| int | xres, | ||
| int | yres, | ||
| int | zres | ||
| ) |
Set slice draw resolution.
| id | volume set id |
| xres,yres,zres | x/y/z resolution value |
Definition at line 1114 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().
| int GVL_slice_set_pos | ( | int | id, |
| int | slice_id, | ||
| float | x1, | ||
| float | x2, | ||
| float | y1, | ||
| float | y2, | ||
| float | z1, | ||
| float | z2, | ||
| int | dir | ||
| ) |
| int GVL_slice_set_transp | ( | int | id, |
| int | slice_id, | ||
| int | transp | ||
| ) |
| int GVL_vol_exists | ( | int | id | ) |
Check if volume set exists.
| id | volume set id |
Definition at line 111 of file gvl2.c.
References G_debug(), gvl_get_vol(), and NULL.
Referenced by GVL_delete_vol().