28#define READ() gvl_read_char(pos[i]++, gvl->isosurf[i]->data)
71 G_debug(5,
"gvld_wire_vol(): id=%d",
gvl->gvol_id);
95 int cols, rows, depths;
98 float xres, yres, zres;
104 int n_i =
gvl->n_isosurfs;
139 for (i = 0; i <
gvl->n_isosurfs; i++) {
140 G_debug(5,
" start : gvl: %s isosurf : %d\n",
151 cols =
gvl->cols /
gvl->isosurf_x_mod;
152 rows =
gvl->rows /
gvl->isosurf_y_mod;
153 depths =
gvl->depths /
gvl->isosurf_z_mod;
170 window[0] += (
int)(yres * 2);
171 window[1] -= (
int)(yres * 2);
172 window[2] -= (
int)(xres * 2);
173 window[3] += (
int)(xres * 2);
184 for (i = 0; i <
gvl->n_isosurfs; i++) {
185 isosurf =
gvl->isosurf[i];
246 for (z = 0; z < depths - 1; z++) {
250 for (i = 0; i <
gvl->n_isosurfs; i++) {
251 G_debug(5,
" break : isosurf : %d datalength : %d B\n", i,
263 for (y = 0; y < rows - 1; y++) {
264 yc = ((rows - 1) * yres) - (y * yres);
266 for (
x = 0;
x < cols - 1;
x++) {
269 for (i = 0; i <
gvl->n_isosurfs; i++) {
297 pos[i] +
j *
e_dl[i];
318 for (
j = 0;
j < 3;
j++) {
325 pt[
X] = xc + (
READ() / 255. * xres);
326 pt[
Y] = yc + (-(
READ() / 255. * yres));
336 pt[
X] = xc + (
pt[
X] * xres);
337 pt[
Y] = yc + (-(
pt[
Y] * yres));
341 n[
X] = (
READ() / 127. - 1.) / xres;
342 n[
Y] = (-(
READ() / 127. - 1.)) / yres;
343 n[
Z] = (
READ() / 127. - 1.) / zres;
345 if (
gvl->isosurf[i]->inout_mode) {
355 curcolor[i] = (
r & 0xff) | ((
g & 0xff) << 8) |
392 for (i = 0; i <
gvl->n_isosurfs; i++) {
393 G_debug(5,
" end : isosurf : %d datalength : %d B\n", i, pos[i]);
433#define DISTANCE_2(x1, y1, x2, y2) \
434 sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
468 for (i = 0; i <
gvl->n_slices; i++) {
472 if (
gvl->slice[i]->transp == 0)
476 for (i = 0; i <
gvl->n_slices; i++) {
480 if (
gvl->slice[i]->transp > 0)
504 int color, offset, transp;
507 int cols, rows, c,
r;
525 if (slice->
dir ==
X) {
536 else if (slice->
dir ==
Y) {
591 transp = (255 - slice->
transp) << 24;
598 for (c = 0; c < cols; c++) {
607 for (
r = 0;
r < rows + 1;
r++) {
609 offset = (c + 1) * (rows + 1) * 3 +
r * 3;
612 color = (slice->
data[offset] & 0xff) |
613 ((slice->
data[offset + 1] & 0xff) << 8) |
614 ((slice->
data[offset + 2] & 0xff) << 16);
625 offset = c * (rows + 1) * 3 +
r * 3;
628 color = (slice->
data[offset] & 0xff) |
629 ((slice->
data[offset + 1] & 0xff) << 8) |
630 ((slice->
data[offset + 2] & 0xff) << 16);
687 G_debug(5,
"gvld_wire_slices");
704 for (i = 0; i <
gvl->n_slices; i++) {
705 slice =
gvl->slice[i];
708 if (slice->
dir ==
X) {
716 else if (slice->
dir ==
Y) {
791 G_debug(5,
"gvld_wind3_box(): id=%d",
gvl->gvol_id);
CELL_ENTRY cell_table[256]
void G_free(void *)
Free allocated memory.
int G_debug(int, const char *,...) __attribute__((format(printf
void gsd_endtmesh(void)
ADD.
void gsd_pushmatrix(void)
Push the current matrix stack.
void gsd_getwindow(int *, int *, double *, double *)
Get viewport.
void gsd_do_scale(int)
Set current scale.
int gvl_slices_calc(geovol *)
Calculate slices for given volume set.
void gsd_shademodel(int)
Set shaded model.
void gsd_bgnpolygon(void)
Delimit the vertices of a primitive or a group of like primitives.
int gvl_isosurf_calc(geovol *)
Fill data structure with computed isosurfaces polygons.
void gsd_color_func(unsigned int)
Set current color.
void gsd_translate(float, float, float)
Multiply the current matrix by a translation matrix.
void gsd_popmatrix(void)
Pop the current matrix stack.
void gsd_zwritemask(unsigned long)
Write out z-mask.
void gsd_linewidth(short)
Set width of rasterized lines.
void gsd_endline(void)
End line.
void gsd_colormode(int)
Set color mode.
void GS_get_scale(float *, float *, float *, int)
Get axis scale.
void gsd_set_material(int, int, float, float, int)
Set material.
void gsd_bgnline(void)
Begin line.
char * gvl_file_get_name(int)
Get file name for given handle.
void gsd_blend(int)
Specify pixel arithmetic.
void gsd_vert_func(float *)
ADD.
void gsd_bgntmesh(void)
ADD.
int GS_check_cancel(void)
Check for cancel.
void gsd_endpolygon(void)
Delimit the vertices of a primitive or a group of like primitives.
void gsd_litvert_func(float *, unsigned long, float *)
Set the current normal vector & specify vertex.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
#define DISTANCE_2(x1, y1, x2, y2)
int gvld_isosurf(geovol *gvl)
Draw volume isosurfaces.
int gvld_slice(geovol *gvl, int ndx)
Draw slice.
int gvld_wire_slices(geovol *gvl)
Draw wire slices.
int gvld_wire_isosurf(geovol *gvl)
Draw volume isosurface in draw mode.
int gvld_wind3_box(geovol *gvl)
Draw volume bounding box.
int gvld_slices(geovol *gvl)
Draw slices.
int gvld_wire_vol(geovol *gvl)
Draw volume in wire mode (bounding box)
int gvld_vol(geovol *gvl)
Draw volume set (slices and isosurfaces)
OGSF header file (structures)
geovol_isosurf_att att[7]