Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ Contents1. Introduction2. Regions3. Display routines4. SPROGS files5. The file format6. Character fonts7. Index variables8. Efficiency of picture storage9. The sequence list10. Further facilities11. SPROGS on the 1906A12. An example film13. SPROGS preprocessor14. Future extensionsAppendices
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureICL 1906A manualsSPROGS
ACLLiteratureICL 1906A manualsSPROGS
ACL ACD C&A INF CCD CISD Archives
Further reading

Contents
1. Introduction
2. Regions
3. Display routines
4. SPROGS files
5. The file format
6. Character fonts
7. Index variables
8. Efficiency of picture storage
9. The sequence list
10. Further facilities
11. SPROGS on the 1906A
12. An example film
13. SPROGS preprocessor
14. Future extensions
Appendices

Chapter 3: DISPLAY ROUTINES

A number of routines are provided within SPROGS to allow the user to output graphical information. For example,a user might wish to output a number of lines. To start with he needs to define to which region the units used in the display routine refer. All subsequent output will be in terms of the selected region's current unit system.

3.1 Display Position

For each region a current display position is defined as (XPOS, YPOS). The current display position can be changed by the following routines:-

      SETXY (X,Y) 
      SETX (X) 
      SETY (Y)

which set XPOS=X and YPOS=Y

Alternatively the display position can be moved relative to its current position by:

      UPDXY (DX,DY)
      UPDX (DX)
      UPDY (DY)

3.2 Basic Line Drawing

The basic line drawing command is:

      TODXY (DX,DY)

which draws a line between the points (XPOS,YPOS) and (XPOS+DX,YPOS+DY). In addition the current display position is changed to (XPOS+DX,YPOS+DY).

3.3 Moving to the Edge of a Region

A frequent need is to move the current display position to one of the edges of the current region. The basic routine of this type is:

      DRCTN (DIR) 
If DIR = 1.0, this sets XPOS = XMIN 
If DIR = 2.0, this sets YPOS = YMIN 
If DIR = 3.0, this sets XPOS = XMAX 
If DIR = 4.0, this sets YPOS = YMAX

where XMIN, YMIN, XMAX, YMAX are the coordinates defining the region boundary.

3.4 Plotting

Most graphical output devices have a number of special hardware symbols which can be output at a specific position on the display area. For example, in the SD4020 a set of basic characters including the digits and upper case alphabet are available.

The basic routine for displaying a symbol is:

      PLOT (X)

which outputs the hardware symbol represented by SPROGS character number X at the current display position. (See Appendix for SPROGS numbers. )

3.5 Second Level Routines

The display routines defined so far are not the only ones that are most likely to be used. The following second level routines are defined in terms of the earlier routines:

      LEFT                   = DRCTN (1.0)
      DOWN                   = DRCTN (2.0)
      RIGHT                  = DRCTN (3.0)
      UP                     = DRCTN (4.0)
      VEC (X1, Y1, X2 , Y2)  = SETXY (XI, YI) TODXY (X2-X1, Y2-Y1)
      TOXY(X,Y)              = TODXY(X-XPOS, Y-YPOS)
      TODX(DX)               = TODXY(DX,0.0)
      TODY(DY)               = TODXY(0.0,DY)
      TOX(X)                 = TODXY(X-XPOS,0.0)
      TOY(Y)                 = TODXY(0.0,Y-YPOS)

3.6 Expansion and Rotation

It is desirable to have a simple means of expanding and rotating all subsequent output (apart from the options available in the current region). The current setting of expansion and rotation is independent of a particular region. It is just applied to the coordinates supplied by a display routine before the region conversion takes place.

The standard routine for defining expansion is:

      EXPAN (EOX,EOY,EX,EY)

which causes all subsequent coordinates to be expanded about the origin (EOX,EOY) by EX in the X-direction and EY in the Y-direction. Thus a coordinate (X,Y), given in a display routine, will be equivalent to (X', Y') where:

X' = EOX + (X-EOX)*EX 
Y' = EOY + (Y-EOY)*EY

The routine for rotation is:

      ROTN (ROX,ROY,RXY)

which rotates the coordinates about the origin (ROX,ROY) by an amount RXY radians in the anti-clockwise direction. Thus a coordinate (X,Y) will be changed to (X',Y') where:

X' = ROX + (X-ROX)*COS(RXY)-(Y-ROY)*SIN(RXY) 
y' = ROY + (X-ROX)*SIN(RXY)+(Y-ROY)*COS(RXY)

Note that a rotation caused by a call to ROTN is applied before any scissoring (cf rotation caused by a setting of RGPLIM with CNV = 2.0, which is applied after the scissoring).

If the origins for rotation and expansion are different, it is important that the order in which the two operations take place is specified. The standard order is rotation before expansion. The order is controlled by:

      ERDR (XI)
If XI=1.0, rotation before expansion 
      2.0, expansion before rotation

3.7 Line Drawing Parameters

The standard method of drawing a line is to draw it solid once only at the standard intensity. A routine is provided to vary the intensity of a line. This applies to all subsequent lines drawn until some other call of the routine occurs.

      INTNST (XINT)

changes the current setting of intensity to the new value XINT. XINT should be 0.0 or positive. If XINT = 0.0, the line is not drawn. Otherwise, the line is drawn 2**(XINT-I) times. Due to differences in the photographic properties of paper and film, it is not possible to say that XINT = 4.0 setting will produce a line 4 times as dark as XINT = 1.0. However, it should be possible to differentiate between the intensities produced by the low values of XINT. On the SD4020, XINT = 4.0 is a maximum setting. Note that if a whole film sequence is to be made darker, it is more economic to ask the SD4020 operators to change the camera's aperture setting.

      THICK (X)

will cause all subsequent lines to be thickened, according to the value of X. On the SD4020, thick lines are produced by drawing extra lines parallel to the given line, at one raster intervals, so line thickening can be very expensive. If X is negative, ABS (X) lines are added each side of the given line. If X is positive, lines are added on either side of the given line until the line is X units thick in the current coordinate system. With this setting, changing the region coordinates will change the apparent line thickness. Not~ however that the thickness will be unaffected by EXPAN and the calculation to find the correct position of the extra lines will ensure that they are correct for the first base region in the chain. x=0.0 will reset lines to their normal thickness.

      DOTTED (DOT,DOTYP)

will cause all subsequent lines to appear broken. DOT determines the length of the resulting visible segments, according to the setting of DOTYP:

-x
Line segment lengths as for DOTYP=X, but line still appears whole.
0.0
All lines are solid, not broken.
1.0
Line segments of length DOT interspersed with gaps of length DOT.
2.0
Repeated segment pattern of: 2 * DOT line segment gap of length DOT
3.0
Repeated segment pattern of: 2 * DOT line segment gap of length DOT.

Other values of DOTYP may be specified later.

A second level routine:

      LNTYP (XINT,X,DOT,DOTYP)

is equivalent to:

      INTNST (XINT) 
      THICK (X) 
      DOTTED (DOT,DOTYP)

3.8 Colour

Although it is not possible to change colour on the SD4020 directly, it is possible to obtain a finished film in colour by outputting separate film sequences for each required colour and using a photographic bureau to produce the required film. Also it is likely that future devices attached to SPROGS will have provision for colour output. Consequently, two routines have been introduced to enable colour films to be produced.

The routine:

      COLOUR (X)

will indicate that all subsequent output is to be considered as having a colour set by X (this is a bit setting similar to that used in DVOUT). Thus X=5.0 indicates the first and third colours. The routine:

      COLGL (Y)

indicates that output is only to be generated for lines whose colour matches one of those specified by the bit setting of Y.

For example, if a two colour film is to be produced, the user should write the appropriate orders, using COLOUR to indicate which lines are which (settings 1.0 and 2.0, say). These orders can then be obeyed twice, interspersed by a call to FLEMKS to separate the sequences (see Section 10.4 ), once with COLGL (1.0) and once with COLGL (2.0). The resulting two film sequences will be in step for the merging process. COLGL (3.0) will output both colours together (for test runs, or to obtain the background).

3.9 Advance Film

In order to complete the current display and initialise the display for the next output, the routine:

      ADVFLM

is defined.

This routine causes the output on a particular frame to be concluded on the defined output devices. In the case of the SD4020 it will cause the film to be advanced in the microfilm or hardcopy cameras.

3.10 User Display Routines

SPROGS allows a user to define his own display routines, which can be used in the same way as the system defined ones. However, the user is advised to follow the rules carefully, as malformed, display routines can cause havoc in the rest of the system.

The user must write two routines, one taking care of file storage (see Chapter 4) and the other dealing with the execution of the routine. He must then make SPROGS aware of this new routine, by calling:

      NEWDSP (ANAME('DSPRTN'), XNO, XNI)

In the above, DSPRTN is the name of the first user routine, and will be the name by which the user refers to the display routine. XNO is the number of arguments expected by the routine, in the range 0.0 ≤ XNO ≤ 6.0. XNI is the desired display routine number, which must be in the range 82.0 ≤ XNO ≤ 89.0 (Appendix 3 indicates this bank of numbers as being available for use).

The execution routine must have the name:

      DSPF * (A)

where * indicates the chosen display routine number. Thus, if XNI = 84.0, the corresponding execution routine must be:

      DSPF84 (A)

A is an array containing the arguments for the routine. It must have dimension equal to XNO, except that if XNO = 0.0, A must still be present (with dimension 1).

The display routine itself has a very strict format:

      SUBROUTINE DSPRTN (X,Y) 
      DIMENSION A(2)
      A(1) = X
      A(2) = Y
      IF (IDSTST (XNI,A) ) 2,1,2
 1    CALL DSPF * (A) 
 2    RETURN 
      END

Note that:

  1. The routine name DSPRTN corresponds to the name used in the call of NEWDSP
  2. The number of arguments, and the dimension of A, must correspond to the value of XNO used in NEWDSP, with the exception that A(1) is required if no arguments are used.
  3. In the above, XNI must be set to the chosen display routine number, as set in NEWDSP. IDSTST is a system function for dealing with file storage and index variables (see later).
  4. * is replaced by the appropriate digits, as explained above.

The user execution routine must not contain calls to DRAW, STSQLS or ADVFLM.

Example:

      SUBROUTINE PLOTX (X,Y,Z) 
      DIMENSION A(3)
      A(1) = X
      A(2) = Y
      A(3) = Z
      IF (IDSTST (85.0,A) ) 2,1,2
 1    CALL DSPF85 (A) 
 2    RETURN 
      END
      SUBROUTINE DSPF85 (A) 
      DIMENSION A(3)
      CALL SETXY (A(1), A(2) ) 
      CALL PLOT (A(3) ) 
      RETURN 
      END
      MASTER MAIN 
      CALL STSPR
      CALL NEWDSP (ANAME('PLOTX'),3.0, 85.0)
      .............
      CALL PLOTX (3.0, 4.0, 22.0)
      ............
      END

Display routines have a special significance, in that they can be used in files (see Chapter 4) and can be used in conjunction with index variables (see Chapter 7). The facility described above should only be used by those who want to make use of these two features, otherwise normal FORTRAN subroutines are more efficient.

⇑ 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