23static int Next_vol = 0;
26static double Region[6];
38 Region[0] = wind3.north;
39 Region[1] = wind3.south;
40 Region[2] = wind3.west;
41 Region[3] = wind3.east;
42 Region[4] = wind3.top;
43 Region[5] = wind3.bottom;
57 Region[0] = wind3.north;
58 Region[1] = wind3.south;
59 Region[2] = wind3.west;
60 Region[3] = wind3.east;
61 Region[4] = wind3.top;
62 Region[5] = wind3.bottom;
117 for (i = 0; i < Next_vol && !
found; i++) {
118 if (Vol_ID[i] ==
id) {
142 wind3.south + wind3.ns_res / 2., wind3.bottom, wind3.rows,
143 wind3.cols, wind3.depths, wind3.ew_res, wind3.ns_res,
146 Vol_ID[Next_vol] =
nvl->gvol_id;
151 return (
nvl->gvol_id);
188 for (i = 0; i < Next_vol; i++) {
224 for (i = 0; i < Next_vol && !
found; i++) {
225 if (Vol_ID[i] ==
id) {
227 for (
j = i;
j < Next_vol;
j++) {
228 Vol_ID[
j] = Vol_ID[
j + 1];
257 G_debug(3,
"GVL_load_vol(): id=%d, name=%s",
id, filename);
263 G_message(
_(
"Loading 3d raster map <%s>..."), filename);
290 if (0 >
gvl->hfile) {
314 *depths =
gvl->depths;
316 G_debug(3,
"GVL_get_dims() id=%d, rows=%d, cols=%d, depths=%d",
321 "GVL_get_dims(): Attempted to access a null volume structure "
388 G_debug(3,
"GVL_set_draw_wire");
393 gvl->draw_wire = draw_wire;
412 if (
gvl->draw_wire) {
429 G_debug(3,
"GVL_draw_wire(): id=%d",
id);
447 for (
id = 0;
id < Next_vol;
id++) {
461 for (
id = 0;
id < Next_vol;
id++) {
507 return (
gvl->clientdata);
523 G_debug(3,
"GS_set_focus_center_map");
555 G_debug(3,
"GVL_isosurf_get_drawres");
560 *xres =
gvl->isosurf_x_mod;
561 *yres =
gvl->isosurf_y_mod;
562 *zres =
gvl->isosurf_z_mod;
582 G_debug(3,
"GVL_isosurf_set_drawres(): id=%d",
id);
584 if (xres < 1 || yres < 1 || zres < 1) {
591 gvl->isosurf_x_mod = xres;
592 gvl->isosurf_y_mod = yres;
593 gvl->isosurf_z_mod = zres;
595 for (i = 0; i <
gvl->n_isosurfs; i++) {
621 *mode =
gvl->isosurf_draw_mode;
642 G_debug(3,
"GVL_isosurf_set_drawmode(): id=%d mode=%d",
id, mode);
647 gvl->isosurf_draw_mode = mode;
668 G_debug(3,
"GVL_isosurf_add() id=%d",
id);
722 gvl->isosurf[i - 1] =
gvl->isosurf[i];
744 G_debug(3,
"GVL_isosurf_move_up");
778 G_debug(3,
"GVL_isosurf_move_up");
812 float *constant,
char *
mapname)
817 G_debug(3,
"GVL_isosurf_get_att");
855 G_debug(3,
"GVL_isosurf_unset_att");
891 "GVL_isosurf_set_att_const() id=%d isosurf_id=%d "
925 const char *filename)
930 "GVL_isosurf_set_att_map(): id=%d, isosurf_id=%d "
957 G_debug(3,
"GVL_isosurf_get_flags");
983 G_debug(3,
"GVL_isosurf_get_flags");
1008 G_debug(3,
"GVL_isosurf_num_isosurfs");
1013 return gvl->n_isosurfs;
1035 G_debug(3,
"GVL_isosurf_set_att_const");
1088 G_debug(3,
"GVL_slice_get_drawres");
1093 *xres =
gvl->slice_x_mod;
1094 *yres =
gvl->slice_y_mod;
1095 *zres =
gvl->slice_z_mod;
1115 G_debug(3,
"GVL_slice_set_drawres(): id=%d",
id);
1117 if (xres < 1 || yres < 1 || zres < 1) {
1124 gvl->slice_x_mod = xres;
1125 gvl->slice_y_mod = yres;
1126 gvl->slice_z_mod = zres;
1128 for (i = 0; i <
gvl->n_slices; i++) {
1129 gvl->slice[i]->changed = 1;
1154 *mode =
gvl->slice_draw_mode;
1175 G_debug(3,
"GVL_slice_set_drawmode(): id=%d, mode=%d",
id, mode);
1180 gvl->slice_draw_mode = mode;
1254 gvl->slice[i - 1] =
gvl->slice[i];
1276 G_debug(3,
"GVL_slice_move_up");
1310 G_debug(3,
"GVL_slice_move_up");
1342 G_debug(3,
"GVL_isosurf_num_isosurfs");
1347 return gvl->n_slices;
1366 float *y2,
float *z1,
float *z2,
int *dir)
1370 int cols, rows, depths;
1382 if (slice->
dir ==
X) {
1387 else if (slice->
dir ==
Y) {
1392 else if (slice->
dir ==
Z) {
1395 depths =
gvl->depths;
1401 *x1 = slice->
x1 / (cols - 1);
1402 *x2 = slice->
x2 / (cols - 1);
1403 *y1 = slice->
y1 / (rows - 1);
1404 *y2 = slice->
y2 / (rows - 1);
1405 *z1 = slice->
z1 / (depths - 1);
1406 *z2 = slice->
z2 / (depths - 1);
1426 float y2,
float z1,
float z2,
int dir)
1430 int cols, rows, depths;
1447 else if (dir ==
Y) {
1452 else if (dir ==
Z) {
1455 depths =
gvl->depths;
1461 slice->
x1 = ((x1 < 0.) ? 0. : ((x1 > 1.) ? 1. : x1)) * (cols - 1);
1462 slice->
x2 = ((x2 < 0.) ? 0. : ((x2 > 1.) ? 1. : x2)) * (cols - 1);
1463 slice->
y1 = ((y1 < 0.) ? 0. : ((y1 > 1.) ? 1. : y1)) * (rows - 1);
1464 slice->
y2 = ((y2 < 0.) ? 0. : ((y2 > 1.) ? 1. : y2)) * (rows - 1);
1465 slice->
z1 = ((z1 < 0.) ? 0. : ((z1 > 1.) ? 1. : z1)) * (depths - 1);
1466 slice->
z2 = ((z2 < 0.) ? 0. : ((z2 > 1.) ? 1. : z2)) * (depths - 1);
void G_free(void *)
Free allocated memory.
void G_message(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int gvl_file_newh(const char *, IFLAG)
int gvl_slice_freemem(geovol_slice *)
Free geovol_slice struct.
geovol * gvl_get_new_vol(void)
Allocate new volume set and add it to the list.
geovol * gvl_get_vol(int)
Get volume set structure.
int gvl_isosurf_set_att_map(geovol_isosurf *, int, const char *)
Set attribute map.
int gvl_slice_init(geovol_slice *)
Initialize geovol_slice struct.
int gvld_vol(geovol *)
Draw volume set (slices and isosurfaces)
geovol_isosurf * gvl_isosurf_get_isosurf(int, int)
Get isosurface of given volume set.
int gvl_isosurf_set_att_changed(geovol_isosurf *, int)
Set attribute changed.
int gvl_isosurf_init(geovol_isosurf *)
Initialize geovol_isosurf struct.
int gvl_isosurf_set_att_const(geovol_isosurf *, int, float)
Set isosurface attribute constant.
void GS_set_focus(float *)
Set focus.
int gvl_isosurf_set_att_src(geovol_isosurf *, int, int)
Set attribute source.
int gvl_isosurf_freemem(geovol_isosurf *)
Free geovol_isosurf struct.
int gvld_wire_vol(geovol *)
Draw volume in wire mode (bounding box)
geovol_slice * gvl_slice_get_slice(int, int)
Get geovol_slice struct.
int gvld_wind3_box(geovol *)
Draw volume bounding box.
int gvl_isosurf_get_att_src(geovol_isosurf *, int)
Get attribute source.
void gvl_delete_vol(int)
Remove volume set from list.
int gvl_init_vol(geovol *, double, double, double, int, int, int, double, double, double)
Initialize geovol structure.
char * gvl_file_get_name(int)
Get file name for given handle.
int gvl_num_vols(void)
Get number of loaded volume sets.
int Rast3d_read_window(RASTER3D_Region *, const char *)
Reads window from the file specified by windowName. The name is converted by the rules defined in win...
void Rast3d_init_defaults(void)
Initializes the default values described in RASTER3D Defaults. Applications have to use this function...
void Rast3d_get_window(RASTER3D_Region *)
Stores the current default window in window.
int GVL_slice_get_drawmode(int id, int *mode)
Get slice draw mode.
int GVL_isosurf_unset_att(int id, int isosurf_id, int att)
Unset isosurface attributes.
int GVL_isosurf_get_flags(int id, int isosurf_id, int *inout)
Get isosurface flags.
int GVL_isosurf_num_isosurfs(int id)
Get number of available isosurfaces.
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.
void GVL_draw_wire(int id)
Draw volume in wire mode.
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.
int GVL_slice_move_down(int id, int slice_id)
Move down slice.
int GVL_isosurf_get_att(int id, int isosurf_id, int att, int *set, float *constant, char *mapname)
Get isosurface attributes.
int GVL_slice_num_slices(int id)
Get number or slices.
int GVL_load_vol(int id, const char *filename)
Load 3d raster map to volume set.
void GVL_isosurf_get_drawres(int id, int *xres, int *yres, int *zres)
Get draw resolution for isosurface.
int GVL_slice_set_transp(int id, int slice_id, int transp)
Set slice trans ?
int GVL_isosurf_set_att_const(int id, int isosurf_id, int att, float constant)
Set constant isosurface attribute.
int GVL_slice_set_drawres(int id, int xres, int yres, int zres)
Set slice draw resolution.
int GVL_isosurf_set_drawmode(int id, int mode)
Set isosurface draw mode.
void GVL_slice_get_drawres(int id, int *xres, int *yres, int *zres)
Get draw resolution of slice.
int GVL_get_volname(int id, char *filename)
Get volume set name.
int GVL_isosurf_set_flags(int id, int isosurf_id, int inout)
Set isosurface flags.
int GVL_slice_move_up(int id, int slice_id)
Move up slice.
int GVL_isosurf_set_drawres(int id, int xres, int yres, int zres)
Set isosurface draw resolution.
void * GVL_get_window(void)
Get window.
int GVL_isosurf_set_maskmode(int id, int isosurf_id, int mode)
Set mask attribute mode.
int GVL_delete_vol(int id)
Delete volume set from list.
int GVL_num_vols(void)
Get number of loaded volume sets.
int GVL_slice_get_transp(int id, int slice_id, int *transp)
Get slice trans ?
int GVL_isosurf_del(int id, int isosurf_id)
Delete isosurface.
void GVL_alldraw_vol(void)
Draw all volume sets.
int GVL_isosurf_move_up(int id, int isosurf_id)
Move up isosurface in list.
void GVL_alldraw_wire(void)
Draw all volume sets in wire mode.
int GVL_isosurf_add(int id)
Add isosurface.
void GVL_init_region(void)
Initialize 3D region.
int * GVL_get_vol_list(int *numvols)
Get list of loaded volume sets.
int GVL_slice_set_drawmode(int id, int mode)
Set slice draw mode.
void GVL_libinit(void)
Library initialization for volumes.
void * GVL_Get_ClientData(int id)
Get client data.
int GVL_Set_ClientData(int id, void *clientd)
Set client data for volume set.
void GVL_set_focus_center_map(int id)
Set focus on map center.
int GVL_slice_add(int id)
Add slice.
void GVL_set_trans(int id, float xtrans, float ytrans, float ztrans)
Set trans ?
int GVL_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
Get trans ?
int GVL_slice_del(int id, int slice_id)
Delete slice.
int GVL_isosurf_move_down(int id, int isosurf_id)
Move down isosurface in list.
int GVL_isosurf_get_maskmode(int id, int isosurf_id, int *mode)
Get isosurface mask mode.
void GVL_set_draw_wire(int id, int draw_wire)
Set drawing wire box.
int GVL_get_region(float *n, float *s, float *w, float *e, float *t, float *b)
Get region extent settings.
int GVL_isosurf_set_att_map(int id, int isosurf_id, int att, const char *filename)
Set isosurface map attribute.
int GVL_vol_exists(int id)
Check if volume set exists.
void GVL_get_dims(int id, int *rows, int *cols, int *depths)
Get volume dimensions.
int GVL_new_vol(void)
Create new volume set.
int GVL_isosurf_get_drawmode(int id, int *mode)
Get isosurface draw mode.
void GVL_draw_vol(int vid)
Draw volume set.
OGSF header file (structures)
#define VOL_FTYPE_RASTER3D
geovol_isosurf_att att[7]