Loading...
Searching...
No Matches
gvld.c File Reference

OGSF library - loading and manipulating volumes (lower level functions). More...

`#include <math.h>`
`#include <grass/gis.h>`
`#include <grass/ogsf.h>`
`#include "mc33_table.h"`
Include dependency graph for gvld.c:

Go to the source code of this file.

## Macros

#define | READ()
#define | DISTANCE_2(x1, y1, x2, y2)

## Functions

int | gvld_vol (geovol *gvl)
| Draw volume set (slices and isosurfaces).
int | gvld_wire_vol (geovol *gvl)
| Draw volume in wire mode (bounding box).
int | gvld_isosurf (geovol *gvl)
| Draw volume isosurfaces.
int | gvld_wire_isosurf (geovol *gvl)
| Draw volume isosurface in draw mode.
int | gvld_slices (geovol *gvl)
| Draw slices.
int | gvld_slice (geovol *gvl, int ndx)
| Draw slice.
int | gvld_wire_slices (geovol *gvl)
| Draw wire slices.
int | gvld_wind3_box (geovol *gvl)
| Draw volume bounding box.

## Detailed Description

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.

Author
  Tomas Paudits (February 2004)
  Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file gvld.c.

## Macro Definition Documentation

## DISTANCE_2

#define DISTANCE_2 | ( |  | x1,
|  |  | y1,
|  |  | x2,
|  |  | y2 )

Value:
sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))

Definition at line 433 of file gvld.c.

Referenced by gvld_slice().

## READ

#define READ | ( |  | ) |

Value:
gvl_read_char(pos[i]++, gvl->isosurf[i]->data)
gvl_read_char
unsigned char gvl_read_char(int pos, const unsigned char *data)
Read char.
Definition gvl_calc.c:763

Definition at line 28 of file gvld.c.

Referenced by gvld_isosurf().

## Function Documentation

## gvld_isosurf()

int gvld_isosurf | ( | geovol * | gvl | ) |

Draw volume isosurfaces.

Parameters

  gvl | pointer to geovol struct

Returns
  -1 on failure
  1 on success

Definition at line 92 of file gvld.c.

References b, cell_table, g, G_debug(), G_free(), GS_check_cancel(), GS_get_scale(), gsd_bgnpolygon(), gsd_blend(), gsd_colormode(), gsd_do_scale(), gsd_endpolygon(), gsd_getwindow(), gsd_litvert_func(), gsd_popmatrix(), gsd_pushmatrix(), gsd_set_material(), gsd_shademodel(), gsd_translate(), gsd_zwritemask(), gvl_file_get_name(), r, READ, X, x, and Y.

Referenced by gvld_vol().

## gvld_slice()

int gvld_slice | ( | geovol * | gvl,
|  | int | ndx )

Draw slice.

Parameters

  gvl | pointer to geovol struct
  ndx |

Returns
  1

Definition at line 500 of file gvld.c.

References DISTANCE_2, gsd_bgntmesh(), gsd_blend(), gsd_endtmesh(), gsd_litvert_func(), gsd_zwritemask(), r, X, x, and Y.

Referenced by gvld_slices().

## gvld_slices()

int gvld_slices | ( | geovol * | gvl | ) |

Draw slices.

Parameters

  gvl | pointer to geovol struct

Returns
  0

Definition at line 443 of file gvld.c.

References G_debug(), GS_get_scale(), gsd_blend(), gsd_colormode(), gsd_do_scale(), gsd_getwindow(), gsd_popmatrix(), gsd_pushmatrix(), gsd_set_material(), gsd_shademodel(), gsd_translate(), gsd_zwritemask(), and gvld_slice().

Referenced by gvld_vol().

## gvld_vol()

int gvld_vol | ( | geovol * | gvl | ) |

Draw volume set (slices and isosurfaces).

Parameters

  gvl | pointer 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(), and gvld_slices().

Referenced by GVL_draw_vol().

## gvld_wind3_box()

int gvld_wind3_box | ( | geovol * | gvl | ) |

Draw volume bounding box.

Parameters

  gvl | pointer to geovol struct

Returns
  0

Definition at line 787 of file gvld.c.

References G_debug(), gsd_bgnline(), gsd_color_func(), gsd_colormode(), gsd_do_scale(), gsd_endline(), gsd_linewidth(), gsd_popmatrix(), gsd_pushmatrix(), gsd_shademodel(), gsd_translate(), gsd_vert_func(), X, and Y.

Referenced by GVL_draw_vol(), and gvld_wire_vol().

## gvld_wire_isosurf()

int gvld_wire_isosurf | ( | geovol * | gvl | ) |

Draw volume isosurface in draw mode.

Parameters

  gvl | pointer to geovol struct [unused]

Returns
  0

Definition at line 423 of file gvld.c.

Referenced by gvld_wire_vol().

## gvld_wire_slices()

int gvld_wire_slices | ( | geovol * | gvl | ) |

Draw wire slices.

Parameters

  gvl | pointer to geovol struct

Returns
  0

Definition at line 678 of file gvld.c.

References G_debug(), gsd_bgnline(), gsd_color_func(), gsd_colormode(), gsd_do_scale(), gsd_endline(), gsd_linewidth(), gsd_popmatrix(), gsd_pushmatrix(), gsd_set_material(), gsd_shademodel(), gsd_translate(), gsd_vert_func(), X, and Y.

Referenced by gvld_wire_vol().

## gvld_wire_vol()

int gvld_wire_vol | ( | geovol * | gvl | ) |

Draw volume in wire mode (bounding box).

Parameters

  gvl | pointer 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(), and gvld_wire_slices().

Referenced by GVL_draw_wire().