For most ADAM applications, PGPLOT (SUN/15) is the graphics package of choice; it provides an easy to use yet powerful interface for plotting 2D axes, contour maps, grey-scale, colour images and many other styles of plot. The NCAR package (SUN/88) provides similar facilities and some additional styles of plot (e.g. stream-line diagrams) and is in general more powerful (for example, NCAR can draw an X,Y plot with different scales on the right and left hand axes) but is somewhat harder to use. NCAR also contains a 3D drawing package. It is possible to combine NCAR graphics with calls to SGS and GKS by using the Starlink Extensions to NCAR (SNX—SUN/90) package.
The NAG graphics package can also be used but it is forbidden for software that is to become part of the Starlink software collection because its availability on all hardware platforms is not guaranteed (particularly in its single precision form) and non-Starlink sites may not have a licence to use it.
NCAR and the NAG graphics do not have their own mechanisms for opening graphics devices and SGS or GKS (see below) must be used to open a device before plotting can begin.
For line graphics which requires a style not catered for by PGPLOT or NCAR, the Simple Graphics System (SGS) should be used (SUN/85). This package is “lower level” than PGPLOT or NCAR (there are no facilities for drawing axes for example) but it does have excellent facilities for manipulating transformations and “organising” the display surface. SGS programs are also permitted to make direct calls to GKS (with a few documented restrictions) so the full power of GKS is available if SGS’s facilities are not adequate.
Programming purely with GKS is not advisable because getting even simple things done (e.g. opening a workstation) can be very long-winded and more easily achieved with SGS. Furthermore, achieving device independence is far from straight-forward; all the necessary facilities are available but making proper use of them requires an in-depth knowledge of GKS. Again, this is better left to SGS or higher level packages.
Programs requiring intimate interaction with an image display device should use the Image Display Interface (IDI—SUN/65) which is not based on GKS and offers access to facilities that are outside the GKS model of a graphics device. Currently the only device supported by IDI is X-windows. The routines for opening and closing an IDI device in an ADAM program are described in SUN/65.
All PGPLOT routines may be used in ADAM applications with the exception of the following routines, which must never be called in ADAM programs :
The functions of PGBEG (and the equivalent obsolete routine PGBEGIN) are performed by the
environment routine PGP_ASSOC. The environment routines PGP_ANNUL, PGP_CANCL and PGP_DEACT all
call PGEND, but should be used as described in section 3.2 in order to be compatible with any future
enhancements to PGPLOT which might separate the action of closing a workstation and closing down
PGPLOT itself.
PGASK controls whether PGPLOT prompts the user for confirmation before clearing the screen of a
graphics device; if used in an ADAM program PGPLOT will bypass the parameter system
and attempt to read directly from the users terminal. So the “prompt state” must never be
changed from its default state (’OFF’ in ADAM programs). If prompting is required it is up
to the application to keep track of when PGPAGE will clear the screen and issue its own
prompt.
All SGS routines may be used in ADAM applications with the exception of the following routines, which must never be called in ADAM programs :
The functions of SGS_INIT, SGS_OPEN and SGS_OPNWK are performed by the environment routine
SGS_ASSOC. The environment routines SGS_ANNUL and SGS_CANCL dispose of resources used in SGS
programs. SGS_CLOSE will be called by the environment level SGS de-activation routine
SGS_DEACT.
Subroutines in the ‘environment level’ of the ADAM GKS system have names of the form GKS_x whereas true GKS routines have names of the form Gx.
All GKS routines may be used in ADAM applications with the exception of the following routines, which must never be called in ADAM applications:
The functions of GOPKS and GOPWK are performed by the environment level routine GKS_ASSOC. The
function of GCLWK is performed by the routines GKS_ANNUL or GKS_CANCL. The function of GCLKS is
performed by the routine GKS_DEACT.