IGS


Introduction

IGS is a graphic library that enables the user to easily programmatically define graphics in two or three dimensions. Basic idea of IGS is to enable the user programming of graphics without worrying about how to implement rotations of graphic objects, surface hiding in three dimensions, output in different graphic formats and similar things.


Technical Aspects of the System

How the system is built can be best seen from a scheme of a typical IGS-based application (you can download the same scheme in PostScript and view it with Ghostview).

The most basic part of the system is a simple graphic interface (module grint) which can be based on an arbitrary graphic library installed on the machine where IGS is used. This interface is the only part of IGS which is platform dependent, all other parts need only standard ANSI C for compilation. So, if you want to build IGS on a different platform, only this module must be reprogrammed. This is usually not a hard task because module grint contains only the most basic graphic functions such as for opening and closing windows, drawing primitives (lines, triangles, fourangles, circles, faces, text) in a window, etc. The first library on which module grint (and IGS) was built was PEXlib. Later IGS was also built on Borland's BGI (which did not work out very well because of problems with memory - BGI runs only on DOS) and Xlib. Implementation built on Xlib is presently the most often used; there can still be some problems with colors an fonts with this implementation, but otherways it works quite well and is much faster than the implementation built on PEXlib).

The central part of IGS is module gro. This module contains the definitions which constitute the basic concepts of graphic objects construction and manipulation in IGS. It includes the definitions of data types with which graphic objects are represented.

Further on, it includes auxiliary functions for construction of complex graphic objects.

Functions for manipulation of graphics objects follow, i.e. functions for different kinds of geometric transforms, for sorting primitive objects according to their depth, etc.

Another part of this module takes care of plotting of complex graphic objects on screen and to files in different formats. This part is unified in new versions of IGS (in old versions there were separated sub-modules for plotting in different formats). IGS currently supports output of graphics in various formats such as Tcl, PostScript, and DXF. A plotting part of the gro module includes many auxiliary functions that help to achieve a specific look of graphs, such as functions for lighting and plotting in different perspectives.

Beside the basic modules described above, IGS is extended with some higher level modules. These modules provide functions for construction of graphic objects which are often used in graphs, for example different kinds of grids, simple function plots, parametric function plots, polar plots etc. The gr3d module provides a set of such functions for plotting in three dimensions, while the gr2d module provides similar functions for plotting in two dimensions. Development of additional module which will provide some FEM post-processing extensions was started in May 1997. These modules can read finite element meshes and values of various calculated quantities (temperatures, displacements, velocities, strains, stresses, etc.) from simulation input and result files, and presents them graphically on screen or exports them to graphic files.

Using IGS in Applications

It is quite simple to use IGS in an application. Basic steps of plotting a graph in an application using IGS are shown in this figure.

First, graphic objects are constructed for things user wants to plot. This is the only step user must program alone. Therefore the only graphic thing users must care about when using IGS is how the graph he wants to produce and plot is built in sense of primitive graphic objects like lines and faces. Auxiliary functions for construction of complex graphics objects using primitive objects are provided by the gro module.

The next step is putting primitives from a tree structure created by the user to a stack. This must be doe only at plotting in three dimensions as a preparation for sorting graphic primitives by their depth. Functions for this task are provided in module gro.

Before plotting can start, initialization of graphic interface must be done and windows must be open using functions from module grint.

Plotting can now be performed in a loop. All tasks are performed by functions from module gro: First, geometric transformations are applied to graphic object and geometric limits are set. Next, primitives are sorted by their depth and finally they are plotted one by one in order to obtain a possibly three-dimensional plot of our graph. If necessary, user can export a plot to a file in one of the formats supported by IGS.

For more better feeling about details you can check the programmer's handbook in PDF (only available in Slovenian language), or download the PostScript version and view it by Ghostview or print it by a PostScript printer.


History and Further Development

IGS is a shortcut for "Igor's Graphic System". IGS is primarily used internally in C3M and by our partners). I began to develop it in April 1996. By the end of 1996, IGS was sufficiently developed to be used for building applications with it. In February 1997, I started with introduction of IGS to other members of our staff, who made their first applications based on IGS in spring. My goal is to encourage other members of staff to use IGS in their applications so that IGS would begin to live. Another goal is to draw another people in development of the system itself to gain experience in close team work.


Back to Igor's main page
C3M main page