Contact us Heritage collections Image license terms
HOME ACL ACD ICF SUS DCS G&A STARLINK Literature
Further reading □ OverviewContentsPrefaceNotation1. Introduction2. Graphical output3. Coordinates4. Segments and Attributes5. Input devices6. Interaction styles7. Workstations8. Environment9. Input control10. Segment storage11. Metafiles12. Further facilities13. Individual attributesA. AbbreviationsB. Language bindingC. Complete programIndex
C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACDLiteratureBooksGKS
ACDLiteratureBooksGKS
ACL ACD C&A INF CCD CISD Archives
Further reading

OverviewContentsPrefaceNotation1. Introduction2. Graphical output3. Coordinates4. Segments and Attributes5. Input devices6. Interaction styles7. Workstations8. Environment9. Input control10. Segment storage11. Metafiles12. Further facilities13. Individual attributesA. AbbreviationsB. Language bindingC. Complete programIndex

Chapter 7: Workstations

7.1 INTRODUCTION

It is time for us to consider the problems that arise when we start to think about output appearing on real devices. So far the description has considered virtual devices. The application program has been able to specify output in terms of world coordinate systems which have been mapped on to a hypothetical or normalized device having a display surface with a range 0 to 1 in both the X and Y directions. For output primitives of the same type, it is possible to differentiate between primitives by associating different primitive indices with specific primitives. The realization of how these primitives are differentiated on real devices has not been discussed.

This splitting of the description of GKS into two parts in this book - a virtual part followed by a description of how this relates to real devices _ closely parallels the philosophy of GKS itself. In GKS, there is a clear distinction between the part of the program which defines a graphical application in a virtual or device independent way and the part which describes how the program will be interfaced to the devices available for an operator at a particular installation.

Let us consider an example to illustrate the picture composition on normalized device coordinate space so far. The scene to be generated consists of a house, tree and duck each of which is defined with its own coordinate system. We will use the array of data points defined in Chapter 2 to describe the duck. An array for describing the tree would be:

      REAL XT(58), YT(58) 
      DATA XT/14,18,21,23,24,25,25,23,19,16,13,10,8,9,11,12,15,18,20, 
        22,24,26,28,30,33,37,38,42,46,50,54,57,59,62,63,64,67,68,67, 
        65,63,61,58,53,50,48,45,42,39,37,36,35,35,36,37,38,40,42/ 
      DATA YT/10,11,13,16,19,40,43,44,45,47,50,50,52,55,58,60,62,64,65, 
        65,66,67,66,65,66,66,65,65,66,66,65,64,63,63,61,60,60,59,58, 
        56,54,52,50,49,48,47,46,45,44,42,40,35,30,20,15,12,11,10/

A house with a window and a door could be defined by:

      REAL XHS(6), YHS(6), XWN(5), YWN(5), XDR(5), YDR(5) 
      DATA XHS/1,1,5,9,9,1/ 
      DATA YHS/0,6,9,6,0,0/ 
      DATA XWN/3,3,7,7,3/ 
      DATA YWN/4,6,6,4,4/ 
      DATA XDR/4,4,6,6,4/ 
      DATA YDR/0,3,3,0,0/

Composing the picture in NDC space can be done by:

      SET WINDOW(1, 0, 30, 0, 20) 
      SET VIEWPORT(1, 0.25, 0.55, 0.05, 0.25) 
      SET WINDOW (2, 0, 70, 0, 70) 
      SET VIEWPORT (2, 0.05, 0.4, 0.05, 0.4) 
      SET WINDOW(3, 0, 10, O, 10) 
      SET VIEWPORT(3, 0.55, 0.9, 0.05, 0.75)
      SELECT NORMALIZATION TRANSFORMATION(1) 
      SET POLYLINE INDEX(1) 
      DUCK
      SELECT NORMALIZATION TRANSFORMATION(2) 
      SET POLYLINE INDEX(2) 
      POLYLINE(58, XT, YT)
      SELECT NORMALIZATION TRANSFORMATION(3) 
      SET POLYLINE INDEX(1) 
      POLYLINE(6, XHS, YHS) 
      SET POLYLINE INDEX(2) 
      POLYLINE(5, XWN, YWN) 
      SET POLYLINE INDEX(3) 
      POLYLINE(5, XDR, YDR)

The polyline index settings are such that the duck and house outline are drawn with polyline index 1, the tree and house window with polyline index 2, and the house door with polyline index 3. Schematically, the picture is composed as shown in Figure 7-1.

World Coordinates 10 20 30 20 10 10 20 30 40 50 60 70 70 60 50 40 30 20 10 5 10 10 5 Normalized Device Coordinates 2 1 1 3 2 Real World

Figure 7-1

Labels have been added to the polylines to indicate the polyline index associated with each one. We must now consider how the picture that has been composed can be viewed or output to a real device and what will be the appearance of the various poly lines on the display or plotter.

On the input side, the application program receives logical input values of one of the types LOCATOR, STROKE, VALUATOR, CHOICE, PICK and STRING, which are associated with the picture composed in NOC space and, thence, the parts of the picture specified in world coordinates. Again, nothing has been said so far as to how these logical input values are derived from devices in the real world.

7.2 WORKSTATIONS

GKS has been defined so that it is equally applicable as a graphic system in a wide range of different environments. In graphics today, there is a wide range of devices on the market for input and output. Depending on whether the application environment is simple or complex, an operator may be working on a single device or using a number of devices. For example, GKS might be used to off-line graphical output to a remote plotter or it might be used in a very simple interactive mode at a storage tube, with text commands at the keyboard causing pictures to be displayed on the screen. At the other end of the spectrum, an operator may have a refresh display with lightpen, tablet, keyboard and button box together with a small plotter and large digitizer to provide a sophisticated workbench for a CAD application. The aim in GKS is that all these environments should be catered for in a similar way while still allowing the application program to make best use of both the total environment available and the specific characteristics of each device.

Rather than consider individual input or output devices, GKS has introduced the concept of a workstation, which in simple environments closely approximates to the display and associated input peripherals attached to a single line to the computer. Considering first a workstation capable of input and output, its main characteristic is that it can only have a single display surface for graphical output. However, it may have a number of real input devices associated with it. Thus, for example, a storage tube with keyboard and thumbwheels would be regarded as a workstation in GKS. It is not necessary, however, for a workstation to be capable of both output and input. Consequently, both digitizers and plotters can be regarded as workstations in their own right. They are called INPUT and OUTPUT workstations respectively. Workstations capable of doing both output and input are called OUTIN workstations. OUTPUT, INPUT and OUTIN are referred to as workstation categories.

If an operator has a complex workbench involving a pair of displays or a display and plotter, this environment cannot be described to GKS as a single workstation. Instead it is described as several workstations clustered together under the control of one operator and one application program. It is therefore necessary in GKS to allow several workstations to be used together.

The definition of GKS workstations will depend to a large extent on the devices available at a particular installation. It is envisaged that each site will have an installation manager who will provide a handbook indicating the types of workstation available, the category that they belong to, and their location. It is possible that the same device may be configured as part of more than one workstation type. It is up to the local installation to provide GKS with the necessary information concerning the devices available. Normally, the user will not need to worry about this but he will need to know the workstation types (and their categories) and devices available. A typical installation might have a variety of devices available in which case a possible entry in the installation handbook is given in Table 7-1.

It should be noticed that the storage tube can be used in three different modes. In the simplest mode, the thumbwheels would not be used and it is practically an output only workstation except that keyboard input can be used to control the program. In the second mode, it can be used effectively with the thumbwheels being used for locator input etc. In the third mode, a tablet is attached which allows more flexibility in the way a logical device such as a STROKE device can be implemented.

WS
Type
WS
Category
WS
Description
Location Device
Coordinates
Logical
Devices
Supported
1 OUTIN Storage Tube or raster look alike with use of keyboard input only Many located around site 1024 × 780 All
2 OUTIN Storage Tube with full use of keyboard and thumbwheels Many located around site 4096 × 3120 All
3 OUTIN Storage Tube with tablet attached Two systems in X Terminal Pool 4096 × 3120 All
4 OUTIN Vector Refresh Display Available at A, B, C locations 1024 × 1024 All
5 OUTPUT Central Plotter Computer Room 1000 × 5000 None
6 OUTPUT Portable Pen Plotters On loan from pool 2000 × 2000 None
7 INPUT Digitizers Available at locations A and B 16384 × 16384 LOCATOR CHOICE STROKE
8 OUTIN Colour Raster Display In location A only 512 × 512 All
9 OUTIN Vector Refresh Displays Available at A and B (used with digitizer) 1024 × 1024 PICK VALUATOR STRING
Table 7-1

7.3 WORKSTATION SELECTION

Each program must identify the workstation that it is going to use, indicate the type of each one, describe how it is connected to the computer and identify when it is in use, If several workstations are used together, they will most likely be connected to the computer over different lines. Similarly, a single workstation is likely to have a single connection to the computer. The channel to be used by the computer will normally be defined by some operating system command and there is likely to be some convention concerning channels that can be used for input and output.

The function used for specifying that a particular workstation is to be used is:

OPEN WORKSTATION(WS, CONNECTID, WSTYP)

The first parameter, WS, is the workstation identifier, which specifies the number to be used by the program to identify the workstation. CONNECTID specifies the channel that the operating system will use for communication to the workstation. WSTYP defines the workstation type of this particular workstation. For example:

      OPEN WORKSTATION(1, 6, 3)

This defines the workstation to be the one identified as 1 by the program. It is connected to channel 6 and has a workstation type of 3 indicating (in our example installation) that it is a storage tube with a tablet attached. As the operator may be provided with several workstations to complete the task, the OPEN WORKSTATION function may be called several times with different WS values. For example, adding:

      OPEN WORKSTATION(2, 5, 6)

indicates that a second device is available to the operator which is a portable pen plotter connected to channel 5 via a separate line.

So far, the workstations to be used have been defined but neither has been activated. Consequently, if some output primitives were created, GKS would exit with an error indicating that no workstations are active. To activate a workstation so that it receives output, the function:

ACTIVATE WORKSTATION(WS)

is called. From the time that a workstation is activated, all output is sent to the device for display. It is possible for several workstations to be active together in which case they will all receive the graphical output. As the program executes, workstations may be activated and deactivated so that only some fraction of the complete output appears on each workstation. The function to deactivate a workstation is:

DEACTIVATE WORKSTATION(WS)

Before creating output, it is necessary to define a function which moves to the next frame on film or to the next sheet in the plotter or clears the screen of a display. Such a function might always perform this action or might only perform it when necessary. For example, on film it is often necessary to know precisely how many frames are generated or to include a precise number of blank frames. Conversely, it is sensible to move to the next sheet on the plotter only if the previous sheet has been used. GKS provides both these alternatives with the function:

CLEAR WORKSTATION(WS, FLAG)

where FLAG may take the values CONDITIONALLY and ALWAYS. If FLAG has the value CONDITIONALLY, the film is advanced or the screen cleared only if something has been drawn. If FLAG has the value ALWAYS, the film is always advanced or the screen is always cleared even if nothing has been drawn.

It should be noted that this function has side effects if segments have been stored on the workstation (see Section 7.10). As an example of the functions described in this section, the program below outputs a set of frames to the first workstation while only outputting every 10th frame to the second workstation.

      OPEN WORKSTATION(1, 6, 3) 
      OPEN WORKSTATION(2, 5, 6)
      ACTIVATE WORKSTATION(1)
      DO 100 I = 1, 200 
      J=MOD(I, 10) 
      READ COORDS(X, Y) 
      IF(J .EQ. 0) ACTIVATE WORKSTATION(2) 
      POLYLINE(l5, X, Y) 
      CLEAR WORKSTATION(1, ALWAYS) 
      IF(J .EQ 0) CLEAR WORKSTATION(2, CONDITIONALLY) 
      IF(J .EQ 0) DEACTIVATE WORKSTATION(2) 
 100  CONTINUE

READ COORDS reads in a set of X,Y coordinates. At the end of the program, any workstation still active should be deactivated and all the workstations should be closed down. The function to close a workstation is:

CLOSE WORKSTATION(WS)

Thus the above program should be terminated by:

      DEACTIVATE WORKSTATION(1) 
      CLOSE WORKSTATION(1) 
      CLOSE WORKSTATION(2)

This will ensure that all output has been transferred to the device and that a hygienic disconnection is made from the channels in use.

7.4 WORKSTATION TRANSFORMATIONS

The section above defines when output may be sent to a workstation and, therefore, to its associated display screen. As has been described in the introduction to this chapter, a picture has been composed in NDC space and it must be output to the active workstations. The simplest approach would have been to insist that all devices viewed the whole of the NDC space within the unit square. This is what happens by default. However, there are distinct advantages if some control is allowed over what part of NDC space is to be seen on a particular device.

A good method of visualizing what is going on is to use the analogy of a camera focused on the normalized device coordinate space. Each workstation can focus on a specific part of the complete square and can zoom in or out. Consequently, only a part of the output to NDC space may appear on a display screen.

This is shown schematically in Figure 7-2. In this example, the first workstation is focused on the trunk of the tree while the second is focused on the house. The method of defining which part of NDC space is to appear on the workstation is very similar to the way positioning of output on NDC space is achieved. A workstation window to viewport mapping defines which part of NDC space will be seen at the workstation and where it will appear on the display screen. The two functions used are:

Workstation 1 Workstation 2

Figure 7-2
SET WORKSTATION WINDOW(WS, XNMIN, XNMAX, YNMIN, YNMAX) 
SET WORKSTATION VIEWPORT(WS, XDMIN, XDMAX, YDMIN, YDMAX)

The SET WORKSTATION WINDOW function specifies that area of the NDC space in the range 0 to 1 which will be output to workstation WS. The window is specified in NDC coordinates.

The SET WORKSTATION VIEWPORT function defines where on the display screen the view of NDC space will appear. The viewport is specified in the appropriate device coordinates.

However, unlike normalization transformations, there is only one workstation transformation (per workstation) which is used for the whole picture. If the workstation transformation is changed, the whole picture is displayed with the new transformation. This may have side effects as explained in Section 7.11.

There is a major difference between the normalization transformations used to compose the picture in NDC space and the workstation transformation defined above to view the picture on the display. Whereas the normalization transformation allows differential scaling, this is not the case for the workstation transformation. In our example (see Figure 7-1), the house is elongated in the Y direction as it is defined in NDC space by the normalization transformation. Such possibilities are not available at the workstation level where the aspect ratio of the display in NDC space must be the same as how it appears on the device screen.

This raises the question of what happens if the aspect ratio of the workstation window and viewport are defined differently. In this case, the complete window is displayed on the device in the correct aspect ratio using a rectangle with its bottom left corner equal to the bottom left corner of the viewport specified and as large as possible. Some examples in Figure 7-3 show viewports used when the window and viewport have different aspect ratios. To avoid confusion, it is good practice to always specify the workstation window and viewport with the same aspect ratio.

Default settings are available for each workstation and, if not changed, these will map the whole unit square of NDC space on to the largest square on the device with the lower left hand corner of NDC space at the lower left hand corner of the display screen. Specific default settings, for different display aspect ratios are shown in Figure 7-4.

Window Viewport Area used Window Viewport Area used

Figure 7-3

Area of display used as default viewport equivalent to NDC unit square

Figure 7-4

7.5 POLYLINE REPRESENTATION

The example in Section 7.1 shows polyline primitives used to compose a picture in NDC space and indicates the polyline index for each primitive. Polylines with different index values associated with them should be displayed in differentiable ways on the actual devices of workstations. This section describes how this is done.

For polylines, GKS identifies three aspects that a workstation could use to differentiate between polylines - linetype, linewidth and colour, A particular workstation may use one of these aspects or a combination to ensure that polylines with different index values are differentiated on its display. As not all these possibilities may exist on a particular workstation, it is up to the application program to define the mapping unless the defaults provided by the local installation are accepted.

For each polyline index value, its representation on a particular workstation is defined by the function:

SET POLYLINE REPRESENTATION(WS, PLI, LT, LW, PLCI)

The WS parameter specifies the workstation in question and PLI specifies which polyline index is being defined. The three other parameters specify the representation associated with the polyline index PLI:

LT specifies the linetype, for which the standardized values are:

   1 solid line 
   2 dashed line 
   3 dotted line 
   4 dashed - dotted line

Other values of the parameter may also be used to select other linetypes allowed on this type of workstation. Values higher than 4 are the subject of registration. These values do not appear in the GKS standard, but will be allocated by the ISO Registration Authority. Any of the registered values can be supported by a workstation, but must have the meaning that has been registered. Negative values of the parameter may be defined by the local installation to give other linetypes allowed on this type of workstation. Later in this book, there will be other instances of parameter values being the subject of registration.

LW specifies the linewidth scale factor: this is a real number giving the width of the line relative to the width of a standard line on this device. Values less than 1 specify lines thinner than the standard line. For example, a value of 0.5 defines a line half the thickness of a standard line on the device while a value of 2 defines a line with twice the thickness of a standard line. The workstation will use the closest available linewidth to the specified one.

PLCI specifies the polyline colour index: this does not define a colour directly but instead points to a colour table for the workstation where the colours are actually specified as RGB intensity values. For pen plotters, it will be usual for the colour table to be set up for the workstation by the installation manager. For example:

COLOUR INDEX COLOUR PEN
0 White
1 Black
2 Red
3 Blue
4 Green
5 Yellow
6 Orange
7 Brown
8 Grey

For colour displays, it is possible for the entries in the table to be changed as will be seen later.

If workstations 1 and 2 were active and specified to be of types 3 (storage tube) and 6 (portable plotter with several pen colours) respectively, the picture in NDC space could have its form on the workstation controlled by:

      SET POLYLINE REPRESENTATION(1, 1, 1, 1, 1) 
      SET POLYLINE REPRESENTATION(1, 2, 3, 1, 1) 
      SET POLYLINE REPRESENTATION(1, 3, 2, 1, 1) 
      SET POLYLINE REPRESENTATION(2, 1, 1, 1, 2) 
      SET POLYLINE REPRESENTATION(2, 2, 1, 1, 4) 
      SET POLYLINE REPRESENTATION(2, 3, 1, 1, 3) 

If colour is unavailable on a device, it is usual for colour index 1 to indicate the natural colour for the display.

In the example, the three different polyline representations will be output on the storage tube as solid, dotted and dashed lines, respectively, while their appearance on the pen plotter will be as red, green and blue lines. GKS has the aim of differentiating the different polyline index values on all devices thus providing true device independence, If necessary, the user can define the representations corresponding to the index values so that they appear as nearly the same as possible on all devices being used. However, this is only one of the possibilities open to the user. GKS gives the user the opportunity to define the mapping, unlike many systems where the mapping is made within the system.

An expert user defining a system to run with several workstations in use at a time may need to take quite a bit of time specifying the appearance of primitives on each workstation. However, it can be seen that the description of the graphics program in terms of the virtual world defines one part of the system and this can be kept quite independent of the other part defining the realization of the system on particular devices available at an installation.

7.6 COLOUR TABLE

For a colour display, it is possible to redefine the entries in the colour look up table pointed at by the colour index. Each entry in the table consists of:

  COLOUR INDEX   RED INTENSITY   GREEN INTENSITY   BLUE INTENSITY

The intensity values are specified in the range 0 to 1. Particular entries in the table can be redefined by:

SET COLOUR REPRESENTATION(WS, CI, RED, GREEN, BLUE)

where CI is the colour index and RED, GREEN and BLUE specify the respective intensities. For a raster display with an internal colour table, this command would alter its colour table. For a pen plotter, it would cause the pen with the nearest colour to this value to be used when the colour index was specified.

On a raster display, it is also possible to alter the background colour, that is the colour of the display surface before anything is drawn. For a pen plotter, it may be possible to specify the colour of the paper to be used. Entry 0 in the colour table (that is, the entry corresponding to a colour index value of 0) defines the colour of the background. On those devices, where the background colour cannot be changed, attempting to redefine the representation of colour index 0 will have no effect.

To set the first five entries of the colour table for WS2 to black (background colour), white, yellow, green and blue would require:

      SET COLOUR REPRESENTATION(WS2, 0, 0, 0, 0) 
      SET COLOUR REPRESENTATION(WS2, 1, 1, 1, 1) 
      SET COLOUR REPRESENTATION(WS2, 2, 1, 1, 0) 
      SET COLOUR REPRESENTATION(WS2, 3, 0, 1, 0) 
      SET COLOUR REPRESENTATION(WS2, 4, 0, 0, 1)

It should be noted when other primitives are described that there is a single colour table for each workstation. If polyline index values and text index values use the same colour index in their representation, the same colour will be used as they both point to the same colour table.

7.7 POLYMARKER REPRESENTATION

The aspects of the polymarker primitive controlled by the workstation via the polymarker index are defined by the function:

SET POLYMARKER REPRESENTATION(WS, PMI, MT, MS, PMCI)

In a similar way to polyline, WS specifies the particular workstation and PMI specifies which polymarker index is being defined. PMCI is the polymarker colour index, which is treated in the same way as the polyline colour index.

MT specifies the marker type, which defines the form of the marker to be displayed. The standard marker types are:

Marker Type Marker Form
1 .
2 +
3 *
4 0
5 ×

The first marker type defines the smallest displayable point while the other markers have a size that is workstation dependent. Marker types greater than 5 may be allocated marker shapes by the ISO Registration Authority in a similar way to linetypes. Negative values may access non-standard and non-registered marker shapes.

MS specifies the marker size scale factor, which is a real number giving the size of the marker relative to the workstation standard marker size. A value of 2 will specify a marker twice as large while 0.5 will specify one half the normal size. The workstation will output markers as close to this size as possible.

7.8 FILL AREA REPRESENTATION

The aspects of the fill area primitive controlled by the workstation via the fill area index are defined by the function:

SET FILL AREA REPRESENTATION(WS, FAI, IS, SI, FACI)

where, as usual, WS specifies the workstation and FAI and FACI specify the fill area index and fill area colour index. IS and SI specify the fill area interior style and the fill area style index.

Chapter 2 has described FILL AREA. A set of coordinates define the outline of the area to be filled. The method of filling the area is defined in NDC space by the fill area index. Individual workstations will attempt to differentiate between fill area primitives with different index values by giving them different representations.

The possible values for the fill area interior style are HOLLOW, SOLID, PATTERN and HATCH. The fill area style index only has meaning for the interior styles PATTERN and HATCH.

HOLLOW will cause the boundary to be drawn in a colour defined by the colour index. SOLID will cause the interior to be completely covered using the colour selected via the colour index specified.

PATTERN will shade the area by repeating a pattern, using the size and positioning defined in a workstation independent way by the pattern size and pattern reference point attributes. These attributes are set by the respective functions:

SET PATTERN SIZE(SX, SY) 
SET PATTERN REFERENCE POINT(PX, PY)

where SX and SY are the size of each instance of the pattern in the X and Y directions and PX and PY are the coordinates of the pattern reference point. Note that for this interior style the colour index is not used. Thus, for example:

      REAL XAR(4), YAR(4) 
      DATA XAR/2, 2, 10, 10/
      DATA YAR/2, 10,10,2/
      SET FILL AREA REPRESENTATION(WS, 1, PATTERN, 1, 0) 
      SET FILL AREA INDEX(1) 
      SET PATTERN SIZE(2, 2) 
      SET PATTERN REFERENCE POINT(1, 1) 
      FILL AREA(4, XAR, YAR)

produces the fill area shown in Figure 7-5. The actual shading applied to the individual squares is defined by the style index given to fill area index 1. The fill area style index points to a separate pattern table where individual patterns are defined. As an example using just two colours, black and white, in the pattern definitions, the fill area index defines patterns as in Figure 7-6.

Entries in the pattern table may be already preset by the installation or they may be set by the user using:

SET PATTERN REPRESENTATION(WS, PI, DIMX, DIMY, SX, SY, DX, DY, NA)

where PI specifies the pattern index associated with the entry to be defined. DX and DY specify the number of cells of the pattern in the X and Y directions while the NA array, which is DIMX by DIMY, specifies the colour table index for each cell. SX and SY specify the starting indices of the pattern in the array. In the example above, the second pattern entry would be defined by:

Reference Point One instance of pattern

Figure 7-5
      SET PATTERN REPRESENTATION(WS, 2, 3, 3, 1, 1, 3, 3, NA)

where the array NA contains the values 3 and 4 in the elements corresponding to the black and white squares, respectively, in the pattern.

Note that the colour index of the fill area representation is not used for the PATTERN interior style but only for SOLID, HOLLOW and HATCH (see below) interior styles. The colours in the pattern are derived from the elements of the pattern array.

The fourth method of shading the fill area is by interior style HATCH. In this case, the style index defines the different styles of hatching available on the workstation. Positive hatch style values will be registered and negative values may be defined for a particular workstation or installation. The difference from linetypes and marker types, which may also be registered, is that there are no standard hatch style values.

Not all workstations provide all interior styles and it will be necessary for the user to consult the local installation manual to decide what is available. Only style HOLLOW has always to be provided.

Fill Area Representation Index Style Style Index Colour Index 1 HOLLOW 1 2 SOLID 2 3 PATTERN 1 4 PATTERN 2 5 PATTERN 3 Pattern Table Entry Pattern 1 2 3 Colour Table Entry Colour 0 Blue 1 Green 2 Red 3 Black 4 White

Figure 7-6

7.9 TEXT REPRESENTATION

Text is the most complex of the GKS primitives and certainly the one with the most attributes. In Chapter 2, it was shown how the text position, height, writing direction, alignment and orientation could be defined in a device independent way. Thus the appearance of a text string in terms of its overall size and shape is defined in NDC space.

For example:

      SET WINDOW(1, 0, 100, 0, 100)
      SET VIEWPORT(1, 0, 1, 0, 1) 
      SELECT NORMALIZATION TRANSFORMATION(1)
      SET CHARACTER HEIGHT(5) 
      SET CHARACTER UP VECTOR(-1, 1) 
      SET TEXT PATH(RIGHT) 
      SET TEXT ALIGNMENT(LEFT, BASE) 
      SET TEXT INDEX(1)
      TEXT(50, 50, 'Example')

This defines output on NDC space approximately of the form given in Figure 7-7. However, a number of characteristics associated with the text string have not been set globally but are controlled by the text index in the same way that linetype, linewidth and colour are controlled by the polyline index in the workstation. The text aspects controlled by the workstation independent text index are:

Example

Figure 7-7
   Text font and precision 
   Character expansion factor 
   Character spacing 
   Text colour index

Text font and precision: a workstation may have access to a number of different fonts. GKS lays down rules for font designers indicating that character height is the major attribute. Fonts may be defined as mono or proportionally spaced with sufficient space around the characters that they fit together without usually needing additional spacing. The height to width ratio of characters is a property of the font. The text font and precision aspect defines the characteristics of the font type being used in two parts: font and precision. The font part defines the number of the font to be used while the precision part specifies how well the font type can describe the output in NDC space. The three possible precision values are:

  1. STRING: of the global attributes only character height need be used. The minimum requirement is that the text string will be drawn horizontally left to right from the position specified at a height as close to the one specified as possible. A workstation can use its hardware character set and if this can only be output in one size. that is acceptable.
  2. CHAR: the global attributes are used to define the position of the character boxes accurately. The appearance of the individual characters within the box may not take account of all the attributes. For example, characters may still be horizontal.
  3. STROKE: the font will display the text string precisely using all attributes.

Character expansion factor: the assumed width of the characters relative to the height can be increased or decreased by redefining the character expansion factor. For example, a value of 2 will produce characters twice as wide as they would otherwise be.

Character spacing: the assumed space between character bodies is zero although the font will be defined so that space is provided around the character in the character body. Character spacing can be used to increase or decrease the space between characters. It is defined in terms of the character height. For example, a value of 0.5 would insert space equal to half the character height between each of the character bodies.

Text colour index: as for the other primitive colour indices, this is a pointer to an entry in the colour table defining the colour to be used. The function which defines the workstation characteristics of each text primitive is:

SET TEXT REPRESENTATION(WS, TI, TF, TP, CEF, CS, TCI)

where TF and TP together specify the text font and precision, CEF and CS specify the character expansion factor and character spacing and TCI specifies the text colour index, all to be associated with the text index TI. If two workstations 1 and 2 are active with text index 1 specified by:

      SET TEXT REPRESENTATION(1, 1, 2, STROKE, 2, 0.5, 1) 
      SET TEXT REPRESENTATION(2, 1, 1, STRING, 1, 0, 1)

the output on the two workstations may be as shown in Figure 7-8. Thus, unlike polyline, the workstation is likely to output text in significantly different ways depending on the hardware facilities supported.

7.10 SEGMENT STORAGE ON WORKSTATION

Chapter 4 described how segments are created and manipulated. However, it did not give any indication where storage for these segments takes place. Conceptually, segments are stored on the workstations active when the segment is created. A particular implementation of GKS could store segments centrally but, for intelligent workstations with local storage, the aim would be to store the segments on the workstation to improve the performance seen by the user in terms of segment manipulation. Even if stored centrally, the implementation must be such that the user can imagine that segments are stored on the workstation. For example:

Workstation 1 Example Workstation 2 Example

Figure 7-8
      OPEN WORKSTATION(1, 6, 3) 
      OPEN WORKSTATION(2, 7, 4) 
      ACTIVATE WORKSTATION(1)
      CREATE SEGMENT(8) 
      POND 
      CLOSE SEGMENT
      ACTIVATE WORKSTATION(2) 
      CREATE SEGMENT(9) 
      DUCK 
      CLOSE SEGMENT
      DEACTIVATE WORKSTATION(1)
      CREATE SEGMENT(lO) 
      TREE 
      CLOSE SEGMENT
      DELETE SEGMENT(9)
      DEACTIVATE WORKSTATION(2) 

The pond (segment 8) would be stored on Workstation 1, while the duck (segment 9) would be stored on Workstations 1 and 2. The tree (segment 10) is only stored on Workstation 2 as Workstation 1 has been deactivated by the time segment 10 is defined. Deleting a segment removes all knowledge of it from the system so deleting segment 9 will delete the duck from both Workstation 1 and 2 even though the deletion takes place when Workstation 1 is inactive.

The functions for manipulating a segment, by assigning a value to a segment attribute (see Section 4.3), affect all copies of the specified segment stored in GKS.

It is possible to delete a segment from a single workstation by calling:

DELETE SEGMENT FROM WORKSTATION(WS, ID)

The effect is as if the workstation WS had not been active when the segment ID had been created.

The function CLEAR WORKSTATION deletes all the segments stored on the specified workstation. The function REDRAW ALL SEGMENTS ON WORKSTATION (see Section 7.11) can be used to clear the display surface without deleting segments.

Simple uses of GKS are likely to have nearly the same set of segments defined on each workstation. Some skill is required to define segments on a specified subset of the workstations that are open. It would normally only be used in a complex program.

Closing down a workstation deletes from that workstation all the segments currently defined on it. If it is reopened, it will be initialised with an empty segment storage.

If a segment is deleted from each workstation, on which it is stored, (either by using DELETE SEGMENT FROM WORKSTATION or by closing the workstation) then the segment itself is deleted (as if DELETE SEGMENT had been called).

7.11 DEFERRING PICTURE CHANGES

If an intelligent refresh display is being used as a workstation, the operator would expect that picture changes would take place immediately. For example, if a polyline is output by the program, the operator would expect to see the polyline image on the display screen immediately. However, if a less powerful system is being used or if there are inefficiencies in the link between the host computer running GKS and the display, this may not be possible and may, in some cases, not be desirable due to the high overhead it places on the system.

Two examples where it may be undesirable to update the picture immediately are an off-line plotter and a storage tube connected to the host via a network. In the first case, output for the plotter may be accumulated as records on a magnetic tape. Rather than output a record for each primitive output, it would be more efficient to buffer the output into reasonable size blocks before sending to the magnetic tape. In the second case, sending small packets of output across the network is inefficient and it would be more efficient to save them up if the application allowed.

There are occasions, however, particularly in an interactive mode of working, where, if the display is not up to date, it may be difficult for the operator to continue. An example might be where the operator is defining locator positions to be joined by lines. If the last locator position does not have the associated line drawn, it is difficult for the operator to know where the starting point of the next line is.

GKS allows the user to specify the mode in which he wishes a particular workstation to perform (the deferral mode). Normally, he will choose the mode which is most efficient. The possible deferral modes are:

ASAP:
the effect of the visual change must be achieved As Soon As Possible.
BNIG:
the effect of the visual change must be achieved Before the Next Interaction Globally - that is on any workstation currently open. Thus, the display screen may not always be up to date but it is always made current as soon as input is requested from any workstation.
BNIL:
the effect of the visual change must be achieved Before the Next Interaction Locally - that is on this workstation. Thus, the display screen may not always be up to date but it is always made current as soon as input is requested from this workstation.
ASTI:
the effect of the visual change must be At Some TIme but there is no guarantee when this will be.

Another source of inefficiency on some displays is that certain functions cause an implicit regeneration of all the displayed information. For example, changing the polyline representation on a workstation, for a particular polyline index already used in the picture, should cause all poly lines with that index as attribute to take on the new representation. On a storage tube, this could only be done if the whole picture on the screen was redrawn. Similarly, a pen plotter would need to redraw the complete picture. On the other hand, a refresh display could probably perform this change immediately.

The following functions may cause an implicit regeneration:

SET POLYLINE REPRESENTATION 
SET POLYMARKER REPRESENTATION 
SET TEXT REPRESENTATION 
SET FILL AREA REPRESENTATION 
SET PATTERN REPRESENTATION 
SET COLOUR REPRESENTATION
SET WORKSTATION WINDOW 
SET WORKSTATION VIEWPORT 
SET SEGMENT TRANSFORMATION 
SET VISIBILITY 
SET HIGHLIGHTING 
SET SEGMENT PRIORITY 
DELETE SEGMENT 
DELETE SEGMENT FROM WORKSTATION 
ASSOCIATE SEGMENT WITH WORKSTATION (see Section 10.3) 
INSERT SEGMENT (see Section 10.3) 
INTERPRET ITEM (see Section 11.3)

The output functions may also cause an implicit regeneration if a primitive is added to a segment which overlaps a segment of higher priority.

For any of the situations listed above, it is possible to ascertain for each workstation whether an implicit regeneration is required, by use of inquiry functions (see Section 8.4).

GKS recognizes that implicit regeneration may be inefficient on some workstations and allows the user to delay such picture changes if it is not a problem for the application program. GKS allows a workstation to perform in one of two modes:

SUPPRESSED:
implicit regenerations of the picture are suppressed.
ALLOWED:
implicit regenerations of the picture are allowed.

An implicit regeneration consists of clearing the display surface and redrawing all the segments stored on the workstation. This may result in a loss of information if parts of the picture are not stored in segments. The user specifies the setting of the deferral and implicit regeneration modes by:

SET DEFERRAL STATE(WS, DM, IGM)

where DM and IGM are the desired deferral mode and implicit regeneration mode for the workstation WS. If the deferral mode has a value other than ASAP or the implicit regeneration mode has the value SUPPRESSED, it must be possible to force the display to be current and that is achieved by the function:

UPDATE WORKSTATION(WS, RF)

where RF is the regeneration flag which may take the values PERFORM or POSTPONE. The function performs all the deferred actions, but only does an implicit regeneration if one is necessary and the regeneration flag is specified as PERFORM. In contrast, the function:

REDRAW ALL SEGMENTS ON WORKSTATION(WS)

performs all the deferred actions, clears the display surface, and redraws all the segments stored on this workstation unconditionally.

It is anticipated that refresh displays would normally work in the modes (ASAP, ALLOWED) while local storage tubes might work in the mode (BNIL, SUPPRESSED). For an off-line plotter, the mode would most likely be (ASTI, SUPPRESSED).

7.12 INPUT DEVICES

Chapter 5 and Chapter 6 have described the logical input devices defined by GKS in the virtual world. Thus the application program will define its output in terms of the output primitives and will define inputs to the program using the logical input devices LOCATOR, STROKE, VALUATOR, CHOICE, PICK and STRING. GKS ensures that the operator of an OUTIN workstation has at least one logical input device of each type available to him. If the operator is using a single workstation, this implies that the workstation must be capable of providing inputs of each type.

A particular installation when it defines workstation types must indicate which logical input devices they support and how they are achieved. It is quite possible for different installations to define the same logical input device on a GKS workstation in significantly different ways. Section 7.2 gave a list of workstations available at the XYZ installation and the logical input devices supported by each workstation.

Whereas most of the OUTIN workstations support all logical input devices, workstations of type 7 and 9 must be used together or in conjunction with one of the other workstations as this is the only way that the operator can have one logical input device of each type available to him. The exact details of how the physical devices available produce logical input values should be described in the installation manual. The available physical devices may be mapped onto one or many logical input devices of each class.

The implementation of the logical input devices is much simpler if the installation only supports REQUEST input (see Section 8.6), since only one input device may be active at anyone time. It is then unnecessary for the physical device to include a device identification with the input data.

If XYZ is such an installation, a workstation of type 2 might be defined as follows. This device is a storage tube with keyboard and thumbwheels for controlling the crosshairs. The system can send a signal to the device which causes the crosshairs to appear. The thumbwheels can change the position defined on the display screen by the crosshairs. The input can be sent to the system from the terminal by hitting any key. The key hit and the X, Y coordinates of the crosshairs are sent.

This particular installation has decided to use the crosshairs to produce LOCATOR, STROKE and PICK logical inputs while using the keyboard for VALUATOR, CHOICE and STRING inputs. Only one logical device of each type is supported.

LOCATOR:
requesting a LOCATOR value will cause the crosshairs to appear. The locator input value is sent by positioning the crosshairs and hitting a key on the keyboard.
STROKE:
requesting a STROKE value will cause the crosshairs to appear. Individual positions of the stroke input are signified by positioning the crosshairs and hitting any key on the keyboard except F. The stroke input is completed by hitting the F key.
VALUATOR:
the keyboard is used to input the required value, terminated by the RETURN key.
CHOICE:
the keyboard is used to input the required positive integer, terminated by the RETURN key.
PICK:
requesting a PICK value will cause the crosshairs to appear. The pick input value is sent by positioning the crosshairs as close as possible to the desired segment and hitting a key on the keyboard.
STRING:
the string is typed on the keyboard followed by a RETURN key hit.

If, however, XYZ installation allows all input operating modes (REQUEST, SAMPLE and EVENT), then more sophisticated logical input devices must be defined. Several devices may be active at one time and so extra information to identify the device must be sent (in this case, identifying the class of device is sufficient as the installation is only defining one logical input device of each class). The following changes are needed to the definitions of the logical input devices.

LOCATOR:
activating the LOCATOR device will cause the crosshairs to appear if not already visible. A locator value is sent by hitting the L key.
STROKE:
activating the STROKE device will cause the crosshairs to appear if not already visible. The S key must be hit to signify the individual positions and the F key to signify completion of the STROKE.
VALUATOR:
the value must be preceded by CTRL-V to indicate that it is a valuator input.
CHOICE:
the integer must be preceded by CTRL-C to indicate that it is a choice input.
PICK:
activating the PICK device will cause the crosshairs to appear if not already visible. The P key must be hit to send a pick input.
STRING:
the string must be preceded by CTRL-S to indicate that it is a string input.

Even though it is possible to distinguish between the different logical input devices if several are active at once, it is likely that a workstation of this type would only be used in REQUEST mode.

On a richer real device such as a refresh display with lightpen, keyboard, tablet, potentiometers and button box, the workstation type has a much easier task in mapping real devices to logical ones.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site