You are on page 1of 14

The Graphical Kernel System

(GKS)
D A Duce and F R A Hopgood
Since its publication in 1985, the Graphical Kernel System embody, and this provides a framework within which
(GKS) has become established as an important standard GKS is described. GKS is a 2D graphics system that pro-
for computer graphics. Both its output and input models vides graphical output and input. The major features of
are superior to earlier 2D systems, and its coordinate sys- GKS are described in the section on principles. One ques-
tems are flexible and device-independent. GK5 uses dif- tion that inevitably arises is what is the impact of GKS on
ferent concepts to previous graphics packages, and existing applications programs and programmer practice.
includes a number of innovative features, including how Some of the difficulties that are likely to be encountered
the values of aspects are determined and the model of in moving existing programs and indeed programmers to
input. The impact of GK5 on existing applications prog- GKS are described in the section on changing to GKS.
rams and programmer practice is addressed, and prob- There are now a large number of GKS implementations
lems with reprogramming existing applications to run appearing on the market, and the section on implementa-
using GK5 are also described. Implementation of GK5 is tions gives some hints about what to look for when pur-
reviewed from the viewpoint of purchasing a GK5 chasing a GKS implementation. The implementations on
implementation and the different implementation the market and reported in the literature by no means use
philosophies. The issues of conformffy testing and regis- a common implementation philosophy. Some of the
tration of graphical items are discussed. approaches that have been published are discussed in
the section on implementation philosophies. The impor-
computer graphics, graphics standards, GKS, primitives, coordinates, tant issue of conformity testing is addressed, as is the topic
aspects, implementations of registration of graphical items, a process for standardiz-
ing the meanings of graphical items that it is not manda-
This paper gives an overview of the International Organi- tory for implementations to provide.
zation for Standardization (ISO) standard for computer
graphics, the Graphical Kernel System (GKS), and some
related topics. Before entering this discussion, it is PRINCIPLES OF COMPUTER GRAPHICS
appropriate to consider briefly the origins of GKS. There are a number of fundamental topics that must be
The most impressive CAD systems have been turnkey addressed by any computer graphics system. The most
systems built using customized hardware and large important of these are listed below.
software systems whose construction has taken many
man-years. Such systems are by nature expensive to pro-
duce and maintain, and are difficult to transport to Output primitives
another hardware environment. The graphics subsystems
in such products tend to be tailored to the capabilities of The primary purpose of generative computer graphics is
the device hardware being supported. A number of pack- to generate a picture on the display surface of some
ages have existed for a number of years that attempt to graphics device. Graphical output is defined in terms of
provide device independence across a range of devices basic building blocks, which are called output primitives.
(the twentieth anniversary of the release of the first ver- Points, lines and areas are examples of output primitives,
sion of the Ghost package falls in 1987), but there has which may or may not be included in a particular
been little agreement about how this should be achieved. graphics system. The questions facing a graphics standard
The existence of numerous graphics packages and are what is the fundamental set of output primitives and at
their importance to CAD led IFIP Working Group 5.2 in what level of abstraction are they defined. Clearly, such a
1974 to invite Richard Guedj (of France) to start an active set must be rich enough to cover all possible graphical
programme directed towards establishing standards for pictures in the field of application of the standard.
computer graphics. The first step in this programme was
the Seillac I Workshop on Methodology in Computer Primitive aspects
Graphics 1. This led to international activity to develop a
standard for a 2D kernel graphics system under the When an output primitive is displayed on a graphics
auspices of ISO. The history of the development of GKS device it will have a particular appearance, for example,
has been told elsewhere 2-s; suffice it to say here that after lines may be displayed with a particular colour, and solid
an extremely thorough review by an international team of or dotted. Those facets of a primitive that determine its
experts between 1980 and t 984, GKS was published as appearance when displayed are termed the aspects of the
ISO 7942 on 15 August 1985. primitive. In the example given, colour and linestyle
The next section discusses the major concepts that any would be aspects. A standard needs to decide what the
device-independent, interactive graphics system has to aspects should be for each type of output primitive. The
number of aspects recognised governs the flexibility
lnformaticsDivision, RutherfordAppletonLaboratory,Chilton, Didcot, given to the programmer to control the appearance of
Oxon OX11 0QX, UK pictures.

396 0010--4485187/080396-- 14 $03.00 (~) 1987 Butterworth & Co (Publishers) Ltd computer-aided design
Coordinates
It is accepted that the user of a graphics system should be /
able to define graphics in a coordinate system relevant to
the application. It is also accepted that this coordinate
system is unlikely to be the one specified for the device by +
+
the manufacturer. As a result, there is a need to transform
user coordinates to device coordinates. The problem that Polymorker +
+
+ +
arises is what kinds of user coordinate system should be
supported (for example, Cartesian, polar, spherical
polar), and how should the mapping to device coordi-
nates be specified.
Text characters
Input primitives
Interactive programs need to be able to accept graphical
and nongraphical input. These data correspond to a F i l l area
number of different types, for example, coordinate posi-
tions, character strings for labelling and values for iden-
tifying groups of primitives. The different types of input
data are termed input primitives. Questions facing a
graphics standard include: what kinds of input primitive
should be provided? Should all input be handled by the Cell o r r o y
graphics system or just graphical input? Should graphical
and nongraphical input be differentiated?
Figure 1. The five main output primitives in GKS
Input model
An input model describes how input primitives are Output primitives
related to physical input devices, the degree of control The output primitives in GKS are abstractions from the
provided to the application (for example, selection of the output primitives typically provided by graphical output
way in which input values are echoed to the device's devices. GKS defines six output primitives.
.operator), and the styles of interaction available to an
application program (for example, can the operator gen- • Polyline, which draws a sequence of connected line
erate input values asynchronously from the execution of segments.
the program?) What kind of input model should a • Polymarker, which marks a sequence of points with
graphics standard support? the same symbol.
• Fill area, which displays a specified area.
• Text, which draws a string of characters.
Device independence • Cell array, which displays an image composed of cells
Most high level standards are defined so that the user can with specified colours or grey scales.
be isolated from specific characteristics of the graphics • Generalized drawing primitive (GDP), a controlled
output and input devices being used and can concentrate method of adding more exotic primitives, for exam-
on defining graphical output and input in a device-inde- ple, conic arcs and splines.
pendent way. It might be deemed desirable to be able to
move an application from one device environment to The five main output primitives are illustrated in Figure I.
another without having to make major changes to the This choice of primitives calls for some comment.
program structure. Issues that arise in connection with Many existing graphics packages use the concept of
device independence include: how is the user to be in- current position. GKS does not. There are several prob-
sulated from the details of device hardware while having lems with current position, for example, should there be
some degree of control over the appearance of pictures one current position or should each type of primitive
on devices with differing capabilities (for example, colour have its own associated current position, and what hap-
and monochrome)? How is the transformation from user pens to current position when transformations are
to device coordinates to be specified so that different changed. There are several answers to these questions,
device coordinate systems can be accommodated? How each of which has its merits for particular applications.
can the user retain some degree of control over the map- Therefore GKS did not incorporate this concept, though
ping from abstract input and output to physical input and it is interesting to note that at least one project has built
output so that the devices can be used in an optimal way? current position on top of GKS in a controlled way (see
later).
Another notable feature of the GKS output primitives is
PRINCIPLES OF GKS the absence of relative coordinates. All coordinate data
This section examines how the principles of computer are absolute. Relative coordinates were omitted on the
graphics are realised in the Graphical Kernel System. grounds that they could be implemented on top of GKS.
Other graphics standards under development embody The line drawing primitive in GKS draws a sequence of.
these principles in similar ways. A full description of GKS lines rather than a single line. This choice stems from the
is given elsewhere 3,s,~.GKS is a 2D graphics system that observation that many applications deal in sequences of
provides graphical output and input that is defined in a lines rather than single lines and the decomposition to
language-independent manner. single lines is rather unnatural, and also the observation

volume 19 number 8 october 1987 397


that aspects of polylines such as dotted or broken apply to ping, called the workstation transformation, transforms
the complete polyline rather than individual line seg- these coordinates to device coordinates.
ments, which is a more natural view when drawing The purpose of the normalization transformation is to
curves or contours depicted as polylines. facilitate the composition in NDC space of pictures
The text primitive is the most complex of the output defined in different world coordinate system spaces.
primitives and aroused the most discussion during the Different device coordinate systems are accommodated
development of GKS. The difficulty with text is that text in the workstation transformation. Thus to use an applica-
has a variety of functions in graphics, ranging from tion program with different devices, it is only necessary to
graphics art quality text, which is a part of the picture (for change the workstation transformation. The composition
example, writing on the side of a building), to low quality of the picture in NDC space does not need to be
text used for messages to the operator of an interactive changed.
display. The GKS text primitive attempts to encompass all A major difference from earlier systems is that GKS
these varying requirements and provides a rich set of allows multiple normalization transformations to be
facilities, including support for languages not written from defined at the same time. This leads to a different style of
left to right. programming, as will be seen later. The GKS philosophy
Implementors of GKS might like to know of the exis- is that it should still be possible for the system to have
tence of an algorithmic description of the text primitive in knowledge of all output currently being displayed to the
a paper by Brodlie and Pfaff z. The algorithm described operator or user.
calculates the starting position of each character in a text Figure 2 shows two objects defined in two world coor-
string. dinate systems, mapped onto specific areas of the NDC
The fill area and cell array primitives are abstractions space.
from the kinds of primitive typically provided by raster The workstation transformation may be set differently
devices. However, it is important to notice that they are for different workstations, thus allowing different regions
abstractions; the primitives are defined in world coordi- of the virtual picture to be displayed on different work-
nates rather than device coordinates, and they have well- stations as shown in Figure 2. Through the workstation
defined meanings for devices other than raster devices. activation and deactivation mechanism, not all primitives
The GDP defines a controlled method of adding more in the virtual picture need be displayed on all worksta-
exotic primitives. Particular implementations are free to tions that are viewing the picture. This provides a kind of
add to the basic primitive set by specifying particular GDP filtering mechanism. A trivial application might be if it was
types as higher level shapes such as circles and ellipses. only required to display annotation on the plotter record-
There is a mechanism for standardizing GDPs called reg- ing the final version of a drawing, rather than on the
istration (see later). Part of the GDP name space is interactive workstation on which it is being created.
reserved for registration and part is available for The aspect ratios of window and viewport may differ in
implementations to use as they please. the normalization transformation, but the workstation
The GKS output primitives have a rich set of aspects, transformation maps the workstation window to the
allowing a high degree of control over the way primitives
are rendered on displays. The aspects ofa polyline primi- Workstation I
tive, for example, allow control over the linetype (solid,
dotted etc), linewidth and colour. The mechanisms by Workstation

which the values of aspects are determined are described


shortly. ! /

I L ~ . . / / ~ Workstation
, 'J/ 1 .,e..o,, 2
Coordinate systems and device independence |
I ..
// 11
I , //
/
i I
The GKS concept of a workstation is the key to device
independence in GKS. A workstation consists of zero or
,¢~/" //// i1111'1
one display surfaces and zero or more input devices plus
associated software. The GKS idea of a workstation is an
Viewport I ondl l / // ~.~Worksiotion
I / w,ndo.2
abstraction from physical hardware.
A major difference from many earlier graphics systems
w,. ow, _ I!
is that GKS allows more than one workstation to be in use ,'1/-" ,'; ,'
simultaneously. For example, an operator may be Normolizotion/n," JE _I/ ,II 'iJtv,ew
/ ..... <
interacting with a design through an interactive display, transform- / / ~ '
OllOn | / • i I . . I t
while taking copies of completed parts of the design on a
plotter. ,' ," /I ,'i /,
Output primitives are specified in a Cartesian world ,,,,; ,I/
. I /
1i #
I'
I I Normalization
coordinate system. Applications that require other user
level coordinate systems, for example, polar or
Ib-._-ql ,.o°s,or o,oo2

logarithmic coordinates, must first transform these user i.,c.._ )ll I,'.__.-,
coordinates to world coordinates. [i¢---'-zi
Transformation to the coordinate system of the display Window I ~'--"------..~ f
device is accomplished in two stages. First, world coordi- Window 2
nates are transformed to an intermediate coordinate sys-
tem called normalized device coordinates (NDC) by a Figure 2. Two objects defined in two world coordinate
window to viewport mapping termed a normalization systems, mapped onto specific areas of the normalized
transformation. Then a second window to viewport map- device coordinates

398 computer-aided design


largest possible region of the workstation viewport with Each entry in this table specifies values for all the
the same aspect ratio. This is illustrated in Figure 3. The nongeometric aspects of a polyline. Each workstation has
philosophy is that the normalization transformation pro- its own bundle table and so a polyline in the virtual pic-
vides picture composition while the workstation transfor- ture may be displayed with different representations on
mation views the already composed picture. different workstations.
Bundled specification also provides a convenient
Aspects mechanism for writing library routines. This approach has
The appearance of primitives on the display surface of a been used to good effect in the NAG library graphics
workstation is controlled by their aspects. One of the chapter 8.
more innovative parts of GKS is the mechanism by which GKS does also provide the traditional method of aspect
the values of aspects are determined. Earlier graphics control through the individual specification mechanism.
packages tended to associate values of aspects directly In this case, there is one attribute for each workstation-
with primitives. Thus an application would request that a dependent aspect, and thus each aspect has the same
line be drawn in red and it was up to the implementation value on each workstation on which the primitive is dis-
to determine how red lines would be represented on played. How each workstation approximates this value is
monochrome devices. The application programmer had dependent on the workstation and implementation.
no control over this. A consequence of this was that it was A set of aspect source flags controls the mode of
difficult to move programs from device to device, specification of each aspect. It is possible to have some
because the code that controlled the appearance of aspects specified by a bundle and others individually.
primitives was typically scattered throughout the prog- Bundled specification is important when it is necessary
ram. It was also difficult to write device-independent to ensure that primitives with different attributes can be
library routines. The solution adopted by GKS is a table- differentiated on different workstations; while the indi-
driven approach. Aspects of a primitive in GKS belong to vidual scheme is important when primitives with specific
two classes: aspects are to be represented on each workstation as
closely as possible to the specification.
• Global aspects are applicable on all workstations and Each workstation has its own colour table. The aspects
take the same value on all workstations on which the of primitives specifying colour (polyline colour index,
primitive is displayed. polymarker colour index etc) all point into this one colour
• Workstation-dependent aspects may vary from work- table. The specification of colour is a complex subject.
station to workstation, so that the same primitive may GKS uses the RGB colour model (entries in the colour
be displayed quite differently on different work- table define RGB triples). This is an area in which more
stations. work is needed in a standards context.
There is another difference between aspects specified
The aspects of each type of primitive are listed in Table 1. by bundles and aspects specified individually, which is
The values of aspects are controlled by attributes. worth mentioning briefly. The values ofa primitive's attri-
There is one attribute per aspect for global aspects. How- butes are bound to the primitive when it is created and
ever, there are two modes for specifying the workstation- cannot subsequently be altered. Thus the value of the
dependent aspects of a primitive, bundled specification primitive index associated with a primitive cannot be
and individual specification. Bundled specification uses a changed, nor can the value of, say, the linetype attribute.
lookup table approach. A single attribute for each primi- A direct consequence of this is that the values of aspects
tive, the primitive index, controls the values of all the specified individually cannot subsequently be changed.
workstation-dependent aspects of the primitive. However, bundle table entries can be changed and GKS
The polyline primitive will be used as an example. The allows these changes to affect primitives previously as
values of all the aspects of a potyline (linetype, linewidth well as subsequently displayed. Thus if a polyline bundle
scale factor and polyline colour index) are determined by table entry is changed, the workstation is expected to
the value of the potyline index attribute. A polyline index change the aspects of all polylines that use that entry. The
defines a position in a table, the polyline bundle table.
Table 1. Aspectsof each type of primitive
Viewport
Primitive Aspects

Workstation-dependent Global

Polyline Linetype
Areo used Linewidth scalefactor None
Window Polyline colour index
Viewport Polymarker Markertype
Marker size scalefactor None
Polymarker colour index
Fill area Fill area interiorstyle Pattern reference point
Fill area style index Patternsize
Fill areacolour index
Areo used Text Text font and precision Character height
Character expansion factor Character up vector
Figure 3. Workstation transformation maps the work- Character spacing Text path
Text colour index Text alignment
station window to the largest possibte region of the work- Cell array None None
station viewport with the same aspect ratio.

volume 19 number 8 october 1987 399


mechanisms that control this are rather complicated and initial value for the device, the prompt/echo type (for
in fact the change is only guaranteed for primitives stored example, a Iocator device may be echoed as a rubber
in segments. band line, a tracking cross etc), the area of the display
space to be used for displaying the echo, and further
Graphical input device-dependent data.
A major innovation in GKS is the model of input. The The implementation decides how the physical input
paper by Rosenthal et al 9 gives a detailed exposition of devices of a particular workstation are to be mapped onto
this model. logical devices.
The data that can be entered into an application prog- The input model of GKS is very rich and enables some
ram by the operator are divided into six different types, sophisticated user interfaces to be created with little effort
and six classes of logical input device are defined corres- from the programmer. The main difficulty with the input
ponding to these six data types. Logical input devices in functions in GKS is that much of the richness is implemen-
GKS are characterized by a measure and a trigger. The tation-dependent in the sense that it is not mandatory for
measure describes the type and value of the input to be an implementation to provide it. For example, menus can
returned to the application. The trigger is an event, which be conveniently provided by a choice device, however it
for certain styles of input determines when the measure is not mandatory that all implementations that support a
value is returned to the application program. choice device also support the menu prompt/echo type.
The six logical input data types are:
Segments
• locator: a position in world coordinates and the
associated number of the normalization transforma- The segment model in GKS is less innovative than some
tion used to convert back from device coordinates via parts of the standard. Associated with each workstation is
NDC to world coordinates. The normalization trans- a segment store in which segments that consist of sets of
formation used is that whose viewport contains the GKS commands can be stored. Functions exist to create,
datapoint. Overlapping viewports are dealt with by a delete, rename and manipulate segments. Associated
priority mechanism; viewport priorities are under the with each segment are a set of attributes that control visi-
control of the application program. bility, highlighting, priority ordering for output when seg-
• stroke: similar to locator except that it represents a ments are overlayed and detectability from a pick device.
sequence of world coordinate positions rather than a It is also possible to transform segments so that the picture
single position. defined by the segment can be scaled, moved, rotated
• valuator: a real number in some range. etc.
• choice: an integer that represents a selection from a As well as the segment store associated with the work-
set of choices. station, there is also a workstation-independent segment
• pick: the name of a selected segment and an identifier storage (WlSS), which is used as a central library. Seg-
that indicates which set of primitives in the segment ments can be moved from WlSS to a workstation. A
has been picked. macro facility is also provided so that segments in WlSS
• string: a character string. can be inserted into other segments.

The idea that different parts of the picture can be defined Levels
in different world coordinate systems and input can sub-
Rather than insist that all facilities in GKS are supported by
sequently be returned to the application program in the
every implementation, GKS is defined as a set of levels on
right world coordinate system is a very powerful feature
two orthogonal axes:
of GKS.
Logical input devices may operate in one of three
• 0: simple output
modes:
• 1 : output including segments
• request rather like Fortran READ. A request is made by • 2: full output including all the facilities for inserting
the application program for a measure to be returned segments from WlSS into the current segment
from a specified device. GKS waits until the operator • a: no input
has set the measure to the desired value and has acti- • b: request input only
vated the trigger. • c: all forms of input
• sample: the current measure value is returned
whenever requested by the application program. The There are, therefore, nine levels in total, with 0a the
trigger is not used by sample input. simplest and 2c the most comprehensive. The American
• event: a number of input devices may be active National Standards Institute GKS standard defines an
together. Each time the trigger for a particular device is additional level, m, which mandates very minimal
activated, the current measure value and data that capabilities. There is no likelihood of this being added to
identify the device are added to a single queue of the ISO standard and many American suppliers are ignor-
input events for all the devices used in event mode. ing it.
The application program can interrogate the queue to
retrieve the input events. It is possible to couple more C H A N G I N G TO G K S
than one input device to the same trigger so that mul- Current s y s t e m
tiple events can be generated from a single trigger
event. The problems encountered in reprogramming an existing
application to run using GKS will clearly differ depending
Some degree of control over logical input devices is pro- on the graphics software used in the original implementa-
vided to the application program through device initiali- tion. Consequently, this section has to be a generalization
zation functions. These enable the program to define the from the experience encountered in the UK. The major

400 computer-aided design


systems in use in the UK before GKS were Gino-F, Ghost, then a difficulty in associating the origin with the rest of
Plot 10 and, to a minor extent, GSPC-Core. Even now, the the loop. The advantage of the new code is that it is easier
extent to which existing applications have been reprog- to read, the graphics is more clearly differentiated from
rammed is low. The major community is probably the the data definition and aspect setting for the sine curve as
image processing community in astronomy. At the time a whole is straightforward. In some existing systems, it
when GKS was a draft proposal, they were installing a would not be possible to produce a dotted line through
new facility called Starlink, which comprised a set of net- the sine curve without major changes to the program.
worked VAX/VMS systems using Sigma ARGS displays Some systems such as Gino-F recognise the need for
for image processing. The community decided to stan- applying the aspect dotted to the complete set of line seg-
dardize on GKS and have been early users of the Ruther- ments and provide special facilities that are not particu-
ford Appleton GKS system. larly attractive either in concept or programming. A dis-
advantage may be the need to define data storage for the
Output primitives individual points. Normally this is done within the pack-
Polyline age. The attraction of the GKS approach may be that the
user has more control over the size of data arrays used for
Probably the main cultural shock when using GKS is the buffering. A GKS implementation is, for this reason, likely
fact that the basic line primitive is a polyline and there is to be smaller than an equivalent Gino-F one.
no current position concept. Using pidgin Fortran as a The major educational change is to remove the con-
vehicle for explanation, to draw a sine curve in many of cept of current position. Unfortunately, it has been
the existing packages would be achieved by commands ingrained into the subconscious of many programmers
of this form: and it may be difficult to get them to change. The motiva-
tion for the removal of current position was the view that
MOVE ABS (0,0) it had dangerous interactions with coordinate changes
DO 100 J=2,21 that were frequently not understood by programmers.
x = (J-1)*0.1*PI Also, using the same current position for several different
LINE ABS (X,SIN(X)) primitives often led to bad programming practices. Con-
100 CONTINUE sequently, a solution that re-establishes a current position
Similarly, a routine for drawing symmetric axes about a and reverts to the standard line primitive is not recom-
given origin (see Figure 4) might be: mended. For example, an early implementation rede-
fined a current position established by a MOVE ABS
SUBROUTINE AXES(XORIGIN,YORIGIN,DX,DY) routine added on top of GKS. Graphical calls such as
MOVE ABS (XORIGIN-DX,YORIGIN) LINE REL or LINE ABS were converted into
LINE REL (2*DX,0) POLYLINE(2,XA,YA) calls so that almost all POLYLINE
MOVE REL (-DX,-DY) calls were for single line segments. Apart from being inef-
LINE REL (0,2*DY) ficient, it re-establishes the problems that GKS was
RETURN
END attempting to cure.
The Starlink implementation adopted a slightly differ-
In both examples, the code has to be written in terms of ent approach that allows current position in a modified
polylines using only absolute coordinates. The simple form while not violating the central GKS philosophy. Star-
change in the first example would be: link has introduced a set of routines for putting data into
arrays:
REAL XA(21), YA(21) • (1) BEGIN POLY initializes an array and stores the
DO 100 J=1,21 point specified in the first array element.
XA(J) = (J-1)'0.1 *PI • (2) ADD POLY adds another absolute point to the
YA(J) = SIN(XA(J)) array that increments the count of points stored.
100 CONTINUE • (3) OUTPUT POLY outputs a polyline whose length is
POLYLINE (21 ,XA,YA) given by the previous calls of type (1) and (2).
The major changes are that the user needs to define array
These routines can only be used for creating polylines
storage and that the two graphics calls, MOVE ABS and
LINE ABS, are replaced by a single POLYLINE call. If the and have no interaction with other primitives. The values
stored in the array are world coordinate positions and the
code in the orginal application is transparent, this tends
not to be a problem. However, older programs may well current position is just a useful concept to reduce the
number of parameters to routines without having any real
have the MOVE ABS away from the loop, and there is
graphical significance.
The previous example to generate a sine curve would
look like:

BEGIN POLY (0,0)


DO 100 J=2,21
X = (J-1)*0.1*PI
ADD POLY (X,SIN(X))
t00 CONTINUE
OUTPUT POLY

Notice the similarity with the original coding, although


Figure 4. Symmetric axes about a given origin the semantics have changed significantly with the DO

volume 19 number 8 october 1987 401


loop not generating graphical output any more. coordinates.
The second example of the AXES subroutine shows A simple method of reprogramming would be to use a
GKS in its worst light. The equivalent GKS code would be: single GKS normalization transformation in place of the
existing system. None of the systems in common use have
SUBROUTINE AXES(XORIGIN,YORIGIN,DX,DY) multiple normalization transformations. This may not be
REAL XA(2),YA(2) a sensible approach for two reasons.
XA(1) = XORIGIN-DX
XA(2) = XORIGIN+DX
YA(1) = 0 • Multiple normalization transformations allow the user
XA(2) = 0 to separate coordinate specification from their use.
POLYLINE (2,XA,YA) For static use of multiple coordinate systems, it is pos-
XA(1) = 0 sible to declare the coordinate systems in GKS once
XA(2) = 0 and for all at the head of the program. The attraction is
YA(1) = YORIG1N-DY that redefinition is no longer necessary, only reselec-
YA(2) = YORIGIN+DY tion. As GKS has a number of attributes and functions
POLYLINE (2,XA,YA) whose meaning changes on redefinition of normaliza-
RETURN tion transformation, using a single normalization
END transformation and redefining it may lead to run time
inefficiency in a GKS environment.
Variants can be defined that shorten the code somewhat, • Multiple normalization transformations were
but GKS is not designed for the production of single line included to allow Iocator input to be returned to the
segments. An early survey in Germany showed that most user in appropriate world coordinates. Depending on
real applications tended to be dominated by multiline the application, it may be that correct use of normali-
output. Consequently, examples such as the AXES zation transformations will simplify the input side of an
routine should be relatively infrequent in real programs. application.
Some implementations have added a single line routine
on top of GKS when thought to be appropriate. The The mapping from normalized device coordinates (NDC)
danger is that it will be used in the wrong places. to device coordinates appears to be a smaller problem.
Either the earlier system had a similar facility or the system
Output primitives -- fill area, text went straight from world to device coordinates. In the lat-
Most of the existing systems have much less control over ter case, NDC can be treated as the device coordinates
area fill and text output than GKS. Consequently, there with a default workstation transformation.
tends to be an easier 1-1 mapping from earlier systems GKS provides a wide range of inquiry functions, which
when the equivalent facilities are provided. allow the application to access information in various
In some systems, area fill is not provided. Con- internal GKS state tables. Precise scaling of output pro-
sequently, if the facility is used, a considerable amount of vides a good example of the use of inquiry functions. For
existing code may be replaced by a single call. example, an application may require to output to a plotter
a scale drawing at a precise size. Suppose the application
Cell array defines the picture in NDC space so that the range 0 to
The cell array primitive has been much criticized in the 0.5 in the xand ydirections corresponds to 400 cm on the
GKS development as not providing the facilities needed plotter output. If the application is to be used in a number
and not fitting into the GKS primitive set. However, Star- of different environments, it will be unaware of the sizes
link has found that the primitive does give it what it of the plotters available or the device coordinates that
required, and the ability to define the primitive in world they use. 1he inquiry function:
coordinates while still controlling its mapping to the dis-
play allows Starlink 1° to overlay contour information INQUIRE DISPLAYSPACESIZE(WSTYP,IND, UNITS,RX,RY,IX,IY
easily and efficiently.
One function often required by astronomers is to tog- returns the characteristics of a workstation of type
gle between two images so that the differences can be WSTYP. UNITS indicates whether the device is addres-
identifed. Starlink includes ESCAPEfunctions for this pur- sed in metres or not. RX and RY give the maximum size of
pose. the display either in metres, if precise scaling is possible,
or the device coordinates used if not. IX and IY give the
Generalized drawing primitives (GDP) display size in terms of addressable positions. To achieve
Many of the existing implementations do not provide a the desired effect would require:
rich set of GDPs. Those that do have tended to provide
arcs, conics and various curve fitting routines. There is lit- INQUIRE DISPLAYSPACESIZE(WSTYP,IND,UNITS,RX,
RY,lX,IY)
tle standardization and it is probably wise to identify IF (UNITS .NE. METRES)GOTO 100
clearly any use of such facilities as they are bound to JFIMIN(RX, RYI .LT. 0.41COTO 100
change once some of the more frequently used examples SETWORKSTATION WINDOW (WS,0,0.5,0,0.5)
are registered and assigned specific forms by the GKS SETWORKSTATION VIEWPORr (WS,0,0.4,0,0.4)
Registration Authority.
loo RROR
Coordinates
Most existing systems provide window/viewport map- Aspects
ping as a concept, although Gino-F has a more primitive The richer aspect model of GKS does present a problem
mechanism for converting world coordinates to device in reprogramming existing applications. Most will have

402 computer-aided design


been defined with an attribute model similar to individual if an application program written in this way is moved to
specification rather than bundled specification in GKS. an environment that does not support this combination,
A decision has to be made whether the bundled mode the escape function will fail, but the application will still
of working, which provides maximum differentiability work, although the operator would have to input the pos-
across a range of workstations, is an asset for the particu- ition and key hit on separate events. Different implemen-
lar application. If it is and the number of variants in a par- tations have taken different approaches and care should
ticular primitive's aspects is small, a move to bundled be taken as to the need to use this facility and how it is
working is appropriate. If it is large (greater than the identified in the program. It is one where the user may
number of bundle table entries allowed in the implemen- well have to modify the application when he changes to
tation) either a hybrid scheme or individual working will a different GKS or when GKS itself is updated.
still be needed. If only one aspect is being used with many A GKS implementation that provides good prompt/
different values, it is possible to define that as an indi- echo facilities may well do a number of functions cur-
vidual aspect while leaving the rest bundled. rently handled by the application. At RAL, several appli-
Each workstation has a number of predefined bundles. cations have been able to remove significant amounts of
These will probably not be appropriate for any particular code and replace them by a single input call.
application. The tendency has been for implementations For devices with mouse or tablet input, positioning has
to have only one aspect changing in the predefined bun- often been used as the mechanism for menu input (pull-
dles. For monochrome displays, the polyline linetype down and pop-up menus often use a mixture of mouse
tends to vary with the other aspects being set to the button pressing and positioning to define a choice). In
default value. For colour displays, the colour changes and such cases, the GKS implementation should provide
the other aspects are set to the default. Clearly, some choice implementations that use the echo area to define
thought has to go into the reorganization and choice of the extent of the pop-up menu, provide echoing via
settings. inversion etc. If such devices are in wide use at a particu-
GKS does allow more generic library functions to be lar installation, it may well be important to compare the
defined. If aspect handling is changed significantly, it may richness of the input devices provided. They may seri-
be sensible to consider how library routines can be used ously alter the amount of work needed in reprogram-
for maximum effect. For example, contour routines can ming.
be defined with bundle table indices being the only
mechanism used for differentiation. The application can Summary
then tailor the use by suitable definition of bundle table This section has only really touched on the reprogram-
entries. Use at Rutherford Appleton Laboratory (RAL) and ming problems likely when moving to GKS. The main
in the NAG graphics supplement has demonstrated that points are:
the structure of library routines can be simplified while
retaining or increasing their flexibility. • Keep to the GKS philosophy rather than modifying
GKS to fit to a particular practice. The reprogramming
Input may be higher but the later benefits will be well worth
Input is the area where existing systems differ most from it.
GKS. For a full GKS level 2c implementation, the GKS • Look seriously at the attribute model needed in the
input model is sufficiently rich and flexible that most exist- particular area now and in the future.
ing input models can be handled without too much • A level 2c implementation may well make it easier to
reprogramming. For example, Gino has different input reprogram the application, particularly if it is highly
models depending on the device and these can now be interactive. Failing that, be careful to assess the sophis-
unified into one. tication of the standard input defaults provided by the
A problem that does exist is how to map the Tektronix system. If a window manager or user interface man-
input from tablet or thumb wheels that delivers both a agement system is used, GKS may need to be compat-
Iocator position and a key hit. The device is a hybrid ible with it.
between a Iocator device and a choice device. A good
level 2c implementation would model this as two devices The communities that have moved to GKS appear to be
with a single trigger, the key hit. Two simultaneous events satisfied with the change. However, it should be clear that
would be delivered to the event queue where one gives GKS is a 2D system that is not designed for highly interac-
the Iocator position and the other the choice from a set of tive environments where a close coupling is required
possible key hits. between the application database and the graphics. In
For level b implementations, there is a problem in that such environments, it may well be worth waiting until an
only request input is available and simultaneous events appropriate standard is provided.
are not allowed. The tendency has been for implementa-
tions to provide a locator input device and an escape GKS IMPLEMENTATIONS
function, which provides the key hit that activated the
trigger for the previous event. An alternative approach,
Implementation differences
which has been proposed for the RAL implementation, is Choosing a GKS product will depend significantly on cur-
to regard the thumbwheels as a locator device and choice rent and future needs. Some points that need to be consi-
device as above. Request locator will return the position dered are:
and request choice the key hit, arising from a single
operator event, the locator and choice measures being GKS level
held as an internal state of the devices in GKS. An escape Most current implementations on the market are either
function will be used to associate particular locator and level I b or 2b. That means that complex interaction is not
choice devices with the thumbwheels. The theory is that possible. There is no sample and event mode input. An

volume 19 number 8 october 1987 403


implementation that has a rich set of echo types may died is a cultural difference between the USA and Europe.
make the need for these modes less essential. A particu- Many American implementations have the default as
larly good test of an implementation is how it handles individual while the European ones favour bundled. This
Tektronix 4010 input from a cursor position and key hit. provides a clue to which mode of working the implemen-
The level 2b implementation has to provide some tation is optimized for. If the installation only requires one
nonstandard action to cover this. or other mode of working, looking at the default may help
The richer the implementation, the larger it will be. in making a decision between two GKS implementations.
Thus if a minimal graphics package is all that is required,
then only level 0a may be needed. For flexibility, a level
Font definitions
2b implementation should also allow the user to access it
as a level 0a with reduction in space and, hopefully, some Most of the laser printer output devices now have a wide
improvement in speed. Again, implementations vary as to range of fonts available. For good previewing of text, a
whether this is possible. range of fonts is essential. Again in the presentation
graphics area, muttifont use is frequent. Implementations
Aspect source flag (ASF) settings vary between the availability of two or three fonts to 30 or
The default setting of the ASF flags to individual or bun- 40.

Table 2. Minimum support required at each level


Level

Capability 0a 0b 0c 1a 1b 1c 2a 2b 2c

Foreground colours (intensity) 1 1 I 1 1 1 1 1 1


Linetypes 4 4 4 4 4 4 4 4 4
Linewidths 1 1 1 1 1 1 1 1 1
Predefined polyline bundles 5 5 5 5 5 5 5 5 5
Settable polyline bundles - - - 20 20 20 20 20 20
Marker types 5 5 5 5 5 5 5 5 5
Marker sizes 1 1 1 1 1 1 1 1 1
Predefined polymarker bundles 5 5 5 5 5 5 5 5 5
Settable polymarker bundles - - - 20 20 20 20 20 20
Character heights* 1 1 1 1 1 1 1 1 1
Character expansion factors* 1 1 1 1 1 1 1 1 1
String precision fonts 1 1 1 1 1 1 1 1 1
Character precision fonts 1 1 1 1 1 1 1 1 1
Stroke precision fonts 0 0 0 2 2 2 2 2 2
Predefined text bundles 2 2 2 6 6 6 6 6 6
Settable text bundles - - - 20 20 20 20 20 20
Predefined patterns t 1 1 1 1 1 1 1 1 1
Settable patterns t* - - - 10 10 10 10 10 10
Hatch styles § 3 3 3 3 3 3 3 3 3
Predefined fill area bundles 5 5 5 5 5 5 5 5 5
Settable fill area bundles - - - 10 10 10 10 10 10
Settable normalization transformations 1 1 1 10 10 10 10 10 10
Segment priorities ~ - - - 2 2 2 2 2 2
Input classes - 5 5 - 6 6 - 6 6
Prompt and echo types per device - 1 1 - 1 1 - 1 1
Length of input queue* - - 20 - - 20 - - 20
Maximum string buffer size (characters) - 72 72 - 72 72 - 72 72
Maximum stroke buffer size (points) - 64 64 - 64 64 - 64 64
Workstations of category Output or Outin 1 1 1 1 1 1 1 1 1
Workstations of category Input or Outin - 1 1 - 1 1 - 1 1
Workstation-independent segment storage . . . . . . 1 1 1
Metafile output workstations 0 0 0 1 1 1 1 1 1
Metafile input workstations 0 0 0 1 1 1 1 1 1

0 indicates explicitly defined and nonrequired at that level.


- indicates not defined at that level.

* Relevant only for character and string precision text.


t Relevant only for workstation supporting pattern interior style.
:1= As available resources are finite and entries have variable size, it may not always be possible to achieve the minimum
values in a particular application.
§ Relevant only for workstation supporting hatch interior style.
¶ Relevant only for workstation supporting segment priorities.

404 computer-aided design


Languagebinding Environment
GKS language bindings form the subject of a separate Any GKS implementation chosen must fit into the local
standardization project. There are effectively two Fortran environment. At the simplest level, it must support the
language bindings, a Fortran 77 and a Fortran 77 subset. devices available and run on the hosts owned by the site.
Some Fortran compilers cannot handle the full Fortran 77 A useful facility is to have a skeleton driver available that
dialect. Consequently, the Fortran 77 subset has been can be used as a basis for constructing new drivers. A
introduced to ensure that these compilers can be used. portable implementation available on a range of hosts
The major problem is whether or not variable length might be desirable if there is a range of hosts on a particu-
strings can be defined using Character*(*). lar site. Most suppliers are tending to prefer a single
For other languages, a number of implementations implementation of GKS on their system. Large sites may
allow Pascal and C programs to call the Fortran binding. therefore run several different implementations of GKS in
This is nonstandard, and Pascal programs should use the which case compatibility between implementations is
correct Pascal binding. The major differences will be in important. For example, metafiles should be transport-
how enumeration types, lists of points and character able from one implementation to another.
strings are handled. An implementation that has genuine
Fortran and Pascal bindings may be worth while if use is Availability of GKS implementations
made of both languages. The two early implementations of GKS that are still widely
Some C implementations have used features of the C available are GKSGral, which derives from the version
language that go against the GKS philosophy (for exam- implemented at the Technical University of Darmstadt,
ple, amalgamating many inquiries into a single function), and the joint ICL/Rutherford Appleton Laboratory
but these implementations predate the ISO working implementation, which is widely used in the UK univer-
drafts of the C binding. sity environment.
Some of the implementations (to level 2b unless indi-
Minimal support cated) with Fortran as the main binding (unless indicated)
G KS insists that a particular level of G KS must have a min- include:
imal level of richness. Implementations should be • Rutherford Appleton (RAL)/ICL (level 1b going to 2b)
checked against the criteria. Otherwise, it is feasible that • GTS-Gral (level 2c)
applications ported from other sites may not work. Table • Nova Graphics, Austin, USA
2 gives details of minimal support. • CWl Amsterdam, Netherlands (level 2c)
• Tektronix
Devices • Ceegen, Los Gatos, USA
Some devices provide the facilities of a GKS workstation, • Whitechapel, UK
including segment operations. Effective use of these • Prior Data Sciences, Ottawa, Canada (C Binding)
devices may not be possible with some implementations • Precision Visuals, Boulder, USA
that have limited internal workstation interfaces. • Dataplotting Services Inc
• Ramtek
Richness • Visual Engineering, San Jose, USA
Table 2 gives a minimum set of requirements. GKS • Advanced Technology Centre, Culver City, USA
implementations vary considerably in their richness. Par- (level 2c)
ticular areas of concern include the number of work- • Template
station types supported, variety of linetypes, number of • Uniras, Massachusetts, USA
GDPs and colour table size. • DEC (level 0b)
• Data General
Input • IBM/Graphic Software Systems
• lnfolytica, Montreal, Canada (level mb)
Levels of GKS that support input require the user to have • AED-GKS (level 2c)
access to at least one input device of each class at his • CMC, Bombay, India
workspace. That does not imply that all workstations • Sysgraph, Vienna, Austria
have to support all input device classes, but an installation • System Simulation Ltd, London, UK
is required to ensure that a workstation cluster fulfils this • XGKS, Hungary
requirement. An application program can expect to have • Sun Microsystems (based on Prior Data Sciences)
at least one input device of each class available to it.
A number of implementations provide workstations IMPLEMENTATION PHILOSOPHIES
with only a subset of the input devices available, for
example, Iocator, string, valuator but not choice, stroke Details of some of the GKS implementations are given
and pick. An organization needs to decide if the work- elsewhere 14"2s.If these are looked at in detail, differences
stations provided by the implementation are valid within in implementation philosophy can be seen. These differ-
its environment. ences give some clue as to the audience that the
As mentioned above, GKS insists on a minimum of implementation is targeted at. This section aims to give
prompt/echo types, of which the first is natural to the some pointers towards the key implementation features.
device. Again implementations differ as to this first echo
method chosen and how many additional ones are pro- Positioning the device-independent (DI)/
vided. device-dependent (DD) interface
For devices such as stroke and string, a buffer is needed GKS does not have a well-defined internal interface
to hold the individual elements of the input. This buffer between the DI front-end part of GKS, which the applica-
size must be appropriate for the installation. tion calls, and that part of GKS, the DD part, which is

volume 19 number 8 october 1987 405


responsible for the interface to devices. The reason for descriptions in that the back-end can pick and choose
this is that devices vary a great deal in capability, and a which functions it can handle and do a partial set of one
rigid specification of this interface would cause problems type if it is appropriate. For example, it may be able to
for specific devices. Intelligent devices might not be able handle short dashed polylines and solid ones, but that is
to use all their features and dumb devices might have a all.
large amount of simulation to do. Looking at the infer-
faces available, they can be categorized as follows. Device-dependent tool set
Thin back-end The major disadvantage of the thin front-end technique is
the duplication of code at the driver level. An approach
The DI/DD interface is positioned close to the devices. that solves this is to produce a large toolkit for individual
The DI part maps all GKS functions to a simple device drivers to use. The ICL/RAL implementation has taken
order code. This approach decreases the amount of code this approach.
to be written and makes device drivers simple to imple-
ment. The penalty is that intelligent devices are unlikely to Layered
be able to make use of many of their features. The Amster-
dam CWl implementation was originally of this type. The It is possible to define more than one internal interface in
movitation for this was that it was a portable implementa- GKS. Between the DI and DD code, there is a set of oper-
tion to be used in a UNIX environment on a variety of ations that apply to all workstations that are currently
sites. active. It is possible to define an interface between the DI
part and the workstation manager. A second interface
Thin front-end can be defined between the workstation manager and a
particular workstation. This has some similarity with the
All GKS functions are passed to the workstation for window manager in a single user system. This approach
execution with a minimal amount of workstation- is particularly useful in a distributed environment where
independent code. There is some GKS state information data physically crosses the interface with the possibility
that needs to be kept centrally. However, primitives can that the two sides of the interface are in different proces-
be passed to the workstation in world coordinates, leav- sors. For example, a set of simple devices could be con-
ing all attribute binding, coordinate transformation and trolled by a single workstation manager remote from the
segment storage to the workstation. The advantage of this host system where the application resides. This can be
approach is that intelligent workstations have maximum a considerable saving in communications traffic. Seg-
flexibility to use their facilities. A disadvantage is that sim- ments to be displayed on several workstations attached
ple devices may have very large and complex drivers to the workstation manager need only be sent across the
with the possibility of enormous duplication. network once to the workstation manager. This approach
With the appearance on the market of a number of was pioneered in the Nova GKS implementation.
GKS workstations with a high level interface, this The positioning of this interface in a particular
approach becomes more applicable. implementation is an important attribute of the
implementation and will have a considerable effect on
Fixed workstation descriptors the properties of the implementation.
It is feasible to define a Termcap-like facility (Graphcap?)
that provides a data file that describes workstation I m m e d i a t e / d e l a y e d execution
characteristics. The front-end code modifies the protocol Many functions in GKS cause changes to the overall GKS
to be sent to the workstation dependent on the data file. state, which needs to be up-to-date before the next input
The major problem with this approach is being able to or output occurs. For example, changes to primitive attri-
define a data file that encapsulates the characteristics of a butes will affect the way the primitive is output. A particu-
wide range of devices. Herman's implementations have lar example is changing the text font and precision aspect,
attempted to provide a flexible way of doing this descrip- which may require a different font to be loaded or a
tion and automatically modifying the code in the GKS sys- switch from direct execution in the workstation to simula-
tem loaded so that it is tuned to the workstation set avail- tion in the front-end. When should this work be done?
able. Depending on the positioning of the DI/DD interface,
Such an implementation tends to have most GKS func- choices can be made that depend on the assumed usage
tions simulated in the DI part as well as similar code being of GKS.
available in the drivers. Stretching the above example further than may be sen-
sible, it is possible that an application may change text
Negotiation font and precision several times before it outputs any text.
A technique pioneered by Gino-F was to allow negotia- Imagine an interactive application where the user selects
tion between the front- and back-ends to decide who is a font and inquires its characteristics before deciding on
responsible for particular functions. A well-defined pro- which one to use. Another application may select the font
tocol between the two parts is maintained, but the DD required initially and make no further changes through-
part has the ability to refuse to do certain operations. out the program execution. Implementation efficiency
There is a minimal set that it has to handle but that is all. will vary depending on which of these two scenarios is
For example, the front-end may request the back-end to most likely.
draw a dotted polyline. It can refuse, in which case the One approach is for the implementation to delay all
front-end is forced to simulate the dotted polyline that operations until it is essential that they be done. In the
sends individual line segments to the back-end for out- example above, the resetting of text font and precision
put. will just set a flag that indicates that the font available is
This is a more flexible variant than fixed workstation not correct and that is all. Each output of the text primitive

406 computer-aided design


will then need to check whether the selected font is the To do this, the workstation must have the ability to read
current one or a new one has to be loaded. back segments to the host for manipulation and display
The alternative approach is for the implementation to on other workstations. Some intelligent GKS workstations
load the font as soon as the text font and precision aspect on the market do not have this capability.
is changed. Each output of the text primitive can now Another feature of GKS is that segments can be created
assume that the correct font information is available. with random names. On creating a new segment, the seg-
In GKS, there are a large number of features of this type. ment store needs to be checked to see if the name is
The situation is complicated by the decision on whether already in use. This can be a significant table handling
bundled or individual mode of working is in place. Par- problem that needs to be done efficiently, particularly ifa
ticular GKS operations (for example, setting primitive large number of segments are in use. As the population of
aspects) can be negated or made temporarily inaccessi- legal segment names is very large, some kind of hashing
ble by other operations (setting ASF). Other data are technique or caching of recently used segment names is
defined by more than one function call. For example, the essential for rapid picture updating. It is worth checking
normalization transformation is defined by setting the the performance of implementations in this area if it is
window and viewport in two function calls that can be important in the GKS environment where it is to be used.
done in either order. Does the implementation update Finally, as segments cannot be reopened they are
the transformation each time one or other is called? effectively linear and can be stored in contiguous loca-
Some implementations have made the decision to do tions. However, gaps appear in storage as soon as seg-
immediate execution of all GKS functions while others ments are deleted. This produces a typical garbage col-
(for example, ICL/RAL) delay the execution as long as lection problem. A simple implementation of segment
possible. These strategies will cause the GKS implemen- store may produce fast traversal but slow garbage collec-
tation to have different properties that can be tested by tion. Alternatively, the garbage collection problem can
benchmarks. be largely solved by allowing segments to be stored in
fragments with links between them. This slows down trav-
S e g m e n t storage ersal but speeds up garbage collection. Again, bench-
Conceptually, each workstation has its own segment marks can easily be designed to test an implementation
store. For intelligent workstations this is sensible as it against the environment where it is to be used.
makes it possible for good interaction to be achieved at
the workstation. If the level of GKS in use is level 2, GKS
CONFORMITY TESTING
also has a workstation-independent segment store
(WlSS), which contains a set of segments that can later be The existence of standards for computer graphics
manipulated and moved from WlSS to specific work- immediately raises the important question: how can the
stations under application control. There are a variety of user be sure that an implementation of a standard adheres
strategies that can be taken to achieve the desired results. to the standard? In the absence of an answer to this ques-
tion, it is arguable that standardization is a pointless activ-
Central segment store ity.
At present the only practical approach to this question
A single central segment store could be implemented
is to consider methods of falsification, in which systematic
with tables that indicate which segments are available to
efforts are made to demonstrate that an implementation is
which workstations. Segment updating at the workstation
incorrect. This approach has been adopted for program-
generates traffic from the central store to the workstation.
ming languages. Typically, a compiler is subjected to a
If all or nearly all the devices in use are relatively unintel-
large suite of test programs, specially designed to uncover
ligent, this is a valid approach. Implementing WlSS is
likely errors or possible misinterpretations of the stan-
achieved by adding WlSS functions to the central store.
dard. This approach has been adopted for Cobol, Pascal
and now Ada. There are some deep philosophical ques-
Phantom workstation
tions raised by this approach, for example, how is it
All workstations are assumed to be capable of holding known whether the behaviour prescribed for the test
their own segments. An unintelligent workstation can ask suite adheres to the standard? However, with current
the phantom workstation to hold its segments for it. This programming technology, it is the best that can be done.
means that the only segments stored centrally in the The European Economic Community (EEC), recognis-
phantom are the ones required by unintelligent work- ing the importance of the area, sponsored a number of
stations. An interesting aspect of this approach is to label workshops during 1982, aimed at developing a falsifica-
WlSS as unintelligent, in which case the phantom work- tion procedure for validating GKS implementations. A
station will also handle the WlSS. comprehensive test suite for GKS was subsequently
developed by the University of Leicester (UK) and the
Distributed segment store Technische Hochschufe Darmstadt (Germany), with sup-
Assuming at least one intelligent workstation capable of port from funding agencies in the UK and Germany.
storing segments, it is feasible to distribute all segments,
including WlSS, to the workstations. Intelligent work-
stations can hold both the WISS and the segment stores of GKS test suite
unintelligent workstations. As a particular application The candidate GKS implentation is stimulated in different
tends to use WISS only for intermediate storage of seg- ways and the response to the stimulation is then checked.
ments ultimately destined for a workstation and the unin- The stimulus in the case of GKS takes the form of a GKS
telligent workstations have a close affinity to the intelli- function call or sequence of GKS function calls, possibly
gent workstation (a plotter attached to a raster display), in conjunction with an operator action on an input
this approach is more sensible than it may seem at first. device. The response can be in the form of graphical out-

volume 19 number 8 october 1987 407


put on one or more devices, a change to the GKS data REGISTRATION OF GRAPHICAL ITEMS
structures, or data returned as an output parameter of a The current and anticipated standards for computer
GKS function. graphics have certain classes of graphical items in com-
There are two interfaces across which stimuli can be mon that are allowed to vary across implementations of
sent and-responses observed, the application program the standards. Linetype is an example of such an item.
interface and the human operator interface. GKS requires that every implementation provide four
The GKS conformance testing scheme is based on a linetypes, solid, dashed, dotted and dashed-dotted,
suite of test programs coupled with operator action on which values of 1,2,3 and 4 are reserved for these types.
input devices to provide the stimulation. The test suite is Negative values are used for implementation-dependent
described in some detail elsewhere 11-13.The checking of linetypes, and while two different implementations may
responses is automated as far as possible. provide, say, linetype -2, their appearances may be
GKS defines a large set of data structures that maintain totally different. Linetype values 5 and greater are
the current values of GKS data such as the current reserved for what is known as registration, which means
polyline index. The standard defines precisely the action that the meaning of the value is defined and any
of each GKS function on these data structures. Data in the implementation that provides any of these values will
GKS state lists can be accessed through inquiry functions. provide the same meaning. Thus linetype 5 might be
One part of the test suite is devoted to testing the effect of registered as meaning a repeating pattern of three line
each GKS function on the state lists. Checking in this case segments and three gaps; an application program that
can be done automatically without the need for human uses this value will then get this repeating pattern if the
interaction. value 5 is supported by the GKS implementation used.
GKS has a well-defined error reporting mechanism, The classes of graphical items to be registered are
with an explicit set of error messages associated with linetype, marker type, hatch style, text font usage, prompt
each function. Another part of the test suite is devoted to and echo type definitions, generalized drawing primitive
testing the response of each GKS function in error situa- function definitions, escape function definitions and error
tions. messages.
Response at the human interface is a much more dif- A register of graphical items is maintained by a registra-
ficult problem, consisting of output on one or more tion authority, in this case the National Bureau of Stan-
graphical output devices. The problem is compounded dards in the USA. The register contains the names and
by the workstation dependencies allowed by the GKS meaning assigned for graphical items in the classes men-
standard, for example, whether linetype is continuous or tioned above. The procedures for the re~;istration of
restarted at the start of a polyline, at the start of a clipped graphical items are described informally in Skal126 and
piece of polyline and at each vertex of a polyline. formally by the ISO 2z In outline, an item is accepted for
This part of the GKS test suite consists of a series of test inclusion in the register when it has been approved by the
programs that generate visual images. The (human) tester ISO subject committee responsible for computer
then has to check each image generated against a refer- graphics. Proposals are submitted to the subcommittee
ence image in the testing manual and has to decide through sponsoring authorities, which include any ISO
whether or not the image from the candidate implemen- technical committee or subcommittee and national
tation conforms to the reference image. A great deal of bodies with an appropriate status in ISO. The register will
care has been taken with this part of the test suite to be available in due course to all interested parties.
design images that check large amounts of GKS with a At the time of writing the procedures for the registration
small amount of visual effort. The images are carefully of graphical items had reached the final stages of
annotated to aid the tester, for example, a test of fill area approval.
interior style can attempt to produce the four styles hol-
low, pattern, solid and hatch, and then label each to indi-
cate which it is, or is not, mandatory for the workstation to CONCLUSIONS
display. The visual aspects of the test suite are discussed GKS is the first international standard for computer
by Maguire 13 graphics. It has attribute and input models that are much
The test suite is structured so that testing proceeds with better than those used in earlier systems and its coordi-
increasing complexity, fundamentals being tested first. nate systems provide a high degree of flexibility and
On the output side, for example, the tests are organized device independence.
in six classes: simple control, output, primitive attributes, Considerable numbers of GKS implementations are
normalization transformations and clipping, workstations now appearing in the marketplace and it was very notice-
and workstation attributes, and workstation transforma- able at the 1986 CAD/CAM Exhibition that many device
tions. manufacturers are announcing products that provide
firmware support for GKS.
Conformance testing services GKS is not the solution to every graphics problem and
The Commission of the European Communities has taken is to be seen as the first of a family of compatible graphics
the first steps towards establishing European confor- standards. A 3D extension to GKS is registered as a Draft
mance testing services for standards in the information International Standard, and PHIGS (Programmer's
technology and telecommunications areas. Three Euro- Hierarchical Interactive Graphics System), a system that
pean laboratories are collaborating to establish a testing caters for highly interactive applications, is currently
service for GKS: AFNOR in Paris, GMD in Bonn and the being voted on as a draft proposal. The Computer
National Computer Centre in the UK. The testing service Graphics Metafile for the transfer and storage of picture
is expected to commence during 1987. description information is awaiting publication as ISO
The GKS testing service is based on the GKS test suite standard 8632. Standardized language bindings 28for the
described in the previous section. functional graphical systems are also under develop-

408 computer-aided design


ment, along with standards for the transfer of graphical 13 Maguire, M C 'Visual testing of GKS at the human
information to devices. interface' CompuL & Graph. Vol 8 No 1 (1984) pp
There has been much progress since IFIP WG 5.2 19-28
invited Richard Guedj to begin an active programme for 14 Ducrot, A, Lemaire A and Watkins, H 'A GKS
establishing standards for computer graphics. One stan- implementation for meteorological applications'
dard exists and others are close behind. The judgment on Proc. Eurographics "81 North-Holland (1981 )
GKS must now be awaited, which can only come from
experience of use across a wide range of products. 15 Rosenthal, D and ten Hagen, P 'GKS in C' Proc.
Eurographics '82 North-Holland (1982)
REFERENCES 16 Buhtz, R 'CGM -- concepts and their realisation'
1 Guedj, R A and Tucker, H A (eds) Methodology in Proc. Eurographics "82 North-Holland (1982)
computer graphics North-Holland (1979)
17 glarer, M and Baker, R J 'GRAPH: an interactive prog-
2 Duce, D A 'The Graphical Kernel System (GKS) ISO ram based on the Graphical Kernel System' Proc.
7942' Computer Compacts, Vol 4 No 5 (1986) pp Eurographics '82 North-Holland (1982)
163-164
18 Herman, I, Tolnay-Knefely, T and Vincze, A 'XGKS
3 Hopgood, F R A, Duce, D A, Gallop, I R and Sutcliffe, -- a multitask implementation of GKS' Proc. Eurog-
D C Introduction to the Graphical Kernel System raphics '83 North-Holland (1983)
(GKS), 2nd edition Academic Press (1986)
19 Bettarini, R, Faconti, G and Moltedo, L 'Extending
4 Bono, P R, Encarnacao, J L, Hopgood, F R A and ten GKS to a distributed architecture' Proc. Eurographics
Hagen, P J W 'GKS -- the first graphics standard' IEEE "85 North-Holland (1985)
Comput. Graph. AppL (July 1982) Vol 2 No 5
20 Herman, I, Reviczky, J and Tolnay-Knefely, T 'A con-
5 Enderle, G, Kansy, K and Pfaff, G Computer graphics cept for a GKS machine' Proc. Eurographics '85
programming - GKS -- the graphics standard North-Holland (1985)
Springer-Verlag (1984)
21 Osland, C D 'Case study of GKS development' Euro-
6 ISO 'Information processing systems - Computer graphics Tutorials "83 Springer-Verlag (1983)
graphics -- Graphical Kernel System (GKS) functional
description' ISO 7942 ISO Central Secretariat, 22 Waggoner, C N, Tucker, C and Nelson, C J 'NOVA*
Geneva (1985) GKS, a distributed implementation of the Graphical
Kernel System' CompuL Graph. Vol 18 No 3 (July
7 BrodUe, K W and Pfaff, G 'An algorithmic interpreta- 1984)
tion of the GKS text primitive' Comp. Graph. Forum
Vol 2 No 4 (1983) pp 233-241 23 Simons, R W 'Minimal GKS' Comput. Graph. Vol 17
No 3 (July 1983)
8 Brodlie, K W, Fisher, D L, Tolton, G C and Lambert,
T W 'The development of the NAG graphical supple- 24 Herman, I and Reviczky, l 'A general device driver
ment' Comput. Graph. Forum Vol 1 No 3 (1982) for GKS' Comput. Graph. Forum Vol 4 No 3 (Sep-
pp 133-142 tember 1985)
9 Rosenthai, D S H, Michener, ! C, Pfaff, G, Kessener, 25 Gallop, J R and Osland, C D 'Experiences with imple-
R and Sabin, M 'The detailed semantics of graphics menting GKS on a PERQ and other computers' Com-
input devices' Comput. Graph. Vol 16 No 3 (1982) pp put. & Graph. Vol 9 No 1 (1985)
33-38 26 Skall, M W 'NBS's role in computer graphics stan-
10 Stoll, C 'GKS for imaging' Comput. Graph. Vol 18 No dards' IEEEComp. Graph. Appl. Vol 6 No 8 (August
3 (July 1984) 1986) pp 66-70
11 Brodlie, K W 'GKS certification -- an overview' Corn- 27 ISO 'Procedures for registration of graphical items'
put. & Graph. Vol 18 No 1 (1984) pp 5-12 150 TC97/5C2 I /WG2 N 514 (October 1986)
12 Brodlie, K W, Maguire, M C and Pfaff, G E 'A practical 28 Sparks, M R and Gallop, J R 'Computer graphics lan-
strategy for certifying GKS implementations' Comput. guage bindings: programmer interface standards'
& Graph. Vol 8 No 2 (1984) pp 125-134 Comput.-Aided Des. Vol 19 No 10 pp 418-424

volume 19 number 8 october 1987 409

You might also like