GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
|
by GRASS Development Team (https://grass.osgeo.org)
Overview
The OGSF (gsurf) library, consisting of approximately 27,000 lines of C code, contains some 250 public functions and about twice as many internal functions for run-time data storage, manipulation, querying, and visualization using OpenGL. The library handles all drawing and lighting operations, including use of user-defined clipping planes and drawing various style "fences" on clipping planes when drawing multiple surfaces, and treats datasets as objects which can be used for various attributes of the rendering. It allows data sharing (e.g., same data for more than one attribute of same or different surfaces), separate masking for each surface, multiple surfaces, vector sets, or point sets, and will also allow multiple volumes. The library provides all query features such as 3D "point on surface", keyframe animation routines, and full state saving functionality. Database-specific routines for interfacing with the GRASS GIS General Library (aka GIS Library) are kept isolated for easier library reuse with other databases. The gsurf library is not dependent upon any particular interface library, and has been used successfully with both Motif, Tcl/Tk or wxPython. It is used for Nviz visualization tool.
The library is designed to provide a unique "handle" or identifier number to the calling program for each new geographic object added to the model. The object could be a surface, vector set, or point set, which could each be defined by one or more database files. Once created, the application only needs to keep track of the "handles" to the objects (which are returned by the creation routines); for example, to draw a surface the application would make the call:
The following naming conventions for function prefixes are used:
Programmers' documentation is currently incomplete, but see the following for more details of the library design and capabilities in the appendix (PLEASE ADD EXPLANATIONS!!):
Functions which have to do with loading & manipulating surfaces. Also functions for library initialization, setting global variables, viewer positioning, and lighting.
Functions which have to do with loading & manipulating vector sets.
Functions which have to do with loading & manipulating point sets.
Functions which have to do with setting & manipulating keyframes for viewer position animation (fly-bys).
Functions which have to do with loading & manipulating 3D volumes.
Functions which have to do with loading & manipulating isosurfaces.
Functions which have to do with loading & manipulating slices.
Bill Brown GMSL/University of Illinois