This is a subset of the full 200 page manual missing out the appendices which are similar to others and the information specific to the 1906A. The emphasis on defining fonts is due to the linguistic group which was working with ancient languages. Many of the SC4020 users were interested in animation which reflects the procedures added for saving and manipulating information.
The manual starts with several Chapters outlining the facilities available. It is hoped that these Chapters will act as a primer for the system. A more rigorous definition of the package and the SC 4020 is given in Chapters 8 and 9. The user is well-advised to read the description of the SC 4020 in Chapter 9 at least once as it will help to put the system in perspective. However, at this stage, we need only concern ourselves with the basic operations of the plotter and a brief description will suffice.
The SC 4020 can produce graphical output on a continuous roll of plain paper (not graph paper). The plotting area is divided up into pages (or frames) which are 7.5in square and it is possible to advance the paper automatically by an SC 4020 order, ADVANCE FILM. As the name of this operation implies, it is also possible to produce the output on microfilm but more of this later. The possible plotting positions on the page are not continuous. The square page is divided up into a 1024 x 1024 raster and all plotting positions must be approximated to by the nearest raster position. As these positions are about 0.007in apart, this should not cause any problems. It is also possible to plot one of the 64 hardware characters at any co-ordinate of the raster. In addition, straight lines can be drawn between any two raster positions.
From these simple operations, it is possible to produce a set of procedures for curve drawing, generating software characters from short vectors, producing a graticule and so on. It is important to remember that so far only the simplest form of operation of the SC 4020 has been described. It is not until Chapter 5 that we need to concern ourselves with the more sophisticated use of the SC 4020. Until then we shall assume that the user is producing graphical output on continuous paper. However, as stated earlier, it is possible to produce output on 35mm or 16mm microfilm. This means that it is possible to produce cine films on the SC 4020. The GROATS system has, therefore, been designed to aid the user in film-making as well as the more conventional graphical output.
The user will, in general, prefer to define the plotting area in terms of his own units rather than have to convert them into inches of paper, millimetres of microfilm, or raster positions. Almost always, he will have some co-ordinate system and units of his own that he will prefer to use. Consequently, as Soon as the graphical output has been identified (see Chapter 6), the user should call:
limits (xmin, ymin, xmax, ymax) ;
This defines the minimum and maximum values of x and y which coincide with the corners of the 7!" square page in the user's own units. All references to positions on the page will now be defined in terms of this scaling defined by the user. Apart from being more convenient for the user, it also means that the system, as far as the user is concerned, is independent of the type of graphical device being used. The scaling in both the x and y directions is assumed to be linear. For example, the x-value halfway between 'xmin' and 'xmax' will be equivalent to the centre point of the page.
To draw the function y = sin(x) for x = 0 to 2π so that it covers the complete plotting area, we could write:
limits (0, -1 , 2*pi, 1 ) ; for x := 0 step dx until 2*pi - dx do vector (x, sin (x), x + dx, sin(x + dx) ) ;
The procedure 'vector(x1,y1,x2,y2)' is assumed to draw a straight line between the points (x1,y1) and (x2,y2) If 'dx' is sufficiently small then the graph produced will approximate to the smooth sine curve. By changing the call of the procedure 'limits' in the example above to:
limits (-pi, -2, 3*pi, 2) ;
the graph would have been drawn within a 3.75in square area in the centre of the page. The procedure 'limits' may be called many times so that the user can have several different sets of units if he so desires. This constant changing of units could be inconvenient and the GROATS system is defined so that the plotting area can be divided into separate regions each having its own co-ordinate system.
Normally, apart from the desired graph, additional information such as titles will be on the plotting area. Although the user will appreciate being able to plot points in terms of his own units, it would be unreasonable to expect the user to define the position of his titles in the same units. It is therefore quite useful to be able to define sub-regions of the total plotting area with their own particular scaling.
A sub-region is defined by:
region(xmn, ymn, xmx, ymx, I) ;
This defines sub-region I as that part of the currently selected region which has minimum and maximum values (xmn,ymn) and (xmx,ymx). Initially the region selected is the whole plotting area and this is region 0. The scaling for this region is defined by the initial call of 'limits'. The arguments of the procedure 'region' are in the units of the selected region. For example:
limits (0, 0, 3, 3); region(1, 1, 2, 2, 1);
defines the units to be used for the whole plotting area. The sub-region 1 is then defined as the 2.5 square in the centre of the plotting area. This is shown in Fig 2.1.
Once more than one region has been defined, it is necessary to define which region is being referred to. Initially region 0 is selected. A sub-region I can be selected by:
select region (I) ;
All subsequent commands now refer to region I and not region 0 which was selected originally. However, no units and scaling have been defined for region I and, before generating any graphical output, this must be defined by a call of procedure 'limits'. The maximum and minimum values defined by the call of 'limits' always refer to the currently selected region. For example, the 'sine' curve plotted in the centre of the plotting area in Figure 2.2 could have been produced by:
limits (0, 0, 3, 3) ; region (1, 1, 2, 2, 1) ; select region (1) ; limits (0, -1, 2*pi, 1) ; for x := 0 step dx until 2*pi - dx do vector (x, sin (x), x + dx, sin(x + dx) ) ;
Region 1 is defined as in Fig 2.1. The region is then selected and the bottom left-hand corner is defined as the point (0, -1) and the top right-hand corner as (2π,1). The sine curve is then drawn across region 1 as shown in Fig 2.2.
In this example, not too much has been gained by the definition of region 1. However, if four separate graphs were required in the four quarters of the plotting area and each required a different set of units then this would best be done by defining four separate subregions rather than redefining the units to be used for the complete region.
The procedures 'limits' and 'region' may be called more than once for each sub-region. This greatly increases the flexibility of the system. For example, the same graph can be plotted at different positions on the plotting area by redefining the position of the subregion by calling 'region' again. Also different magnitudes of the same graph in the same region can be produced by redefining the scaling using 'limits'. These facilities, which are useful in normal graphical work, become essential when making a film. The redefinition of the position of a sub-region over several frames of film can be used to simulate camera movement or, alternatively, the movement of objects in the region. Similarly, by redefinition of the scaling by calls of 'limits', it is possible to simulate camera zoom.
It is important to remember that all GROATS procedures will have their positional arguments defined in terms of the units of the currently selected region and a conversion is made automatically to give the value in terms of the plotting area.
Additional points of interest which might be overlooked are:
The terms 'region' and 'sub-region' have been used rather loosely in the above section. All regions, other than region 0, are thought of as sub-regions. However once more than one region or sub-region has been defined, they all have equal standing so that the terms then become interchangeable. The superiority of region 0 is only that initially it is defined as the whole plotting area and that the initial call of 'limits' refers to it. Currently, the allowed regions are numbered 0 to 10.
A region can be thought of as defining a window through which part of an infinite scene can be viewed. All regions are initially defined so that they act as windows which stop the appearance of any information plotted outside the boundary of the currently selected region. In the example (2.1), the sine curve was only drawn between 0 and 2π so that the limits of the sine curve coincided with the boundary of the region. If instead we had:
limits (0, -1, 2*pi, 1) ; for x := -50*pi step dx until 50*pi do vector (x, sin(x), x + dx, sin(x +dx) ) ;
then many periods of the sine curve would attempt to be drawn. However, as the selected region is a window containing the viewable plotting area within the boundaries of the region, the curve actually plotted in (2.1) and (2.4) would be the same. This automatic 'scissoring' can often be very helpful to the user as it saves him from worrying too much about what happens at the edges of the region. This is taken care of by the system.
A region need not always be defined as 'containing' the graphical output. There is a second mode of operations where any drawing on the plotting area will be displayed even if it is outside the boundaries of the selected region. This is achieved by calling the procedure:
extend;
From this point onwards the currently selected region's boundary and limits act only as a means for defining the units to be used. For example:
limits (0, 0, 3, 3) ; region (1, 1, 2,2, 1) ; select region (1) ; limits (0,-1, 2*pi, 1) ; for x := -2*p i step dx until 4*pi - dx do vector (x, sin(x), x + dx, sin(x + dx) ) ;
would define region 1 in the centre of the plotting area and, as the region 1 is initially defined as contained, only the middle cycle of the sine curve (that is the one inside the boundaries of region 1) would be displayed. This is shown in Fig 2.2. However, if we had:
limits (0, 0, 3, 3) ; region (1, 1, 2,2, 1) ; select region (1) ; limits (0,-1, 2*pi, 1) ; extend ; for x := -2*p i step dx until 4*pi - dx do vector (x, sin(x), x + dx, sin(x + dx) ) ;
then all three cycles would be drawn stretching from one side of the plotting region to the other. A region, which has been defined as 'extended', can later be redefined as a containing window by calling:
contain;
when the region is selected.
In example (2.6) there does not appear to be any mechanism for stopping a user attempting to plot information off the allowable SC 4020 plotting area. For example:
limits (0, 0, 3, 3) ; region (1, 1, 2,2, 1) ; select region (1) ; limits (0,-1, 2*pi, 1) ; extend ; for x := -50*p i step dx until 50*pi - dx do vector (x, sin(x), x + dx, sin(x + dx) ) ;
This program looks as though it will attempt to draw cycles of the sine curve several feet away from the 7.5in square plotting area of the SC 4020 hardcopy! There must be some mechanism ensuring that, in extended mode, a user does not plot outside the bounds of the SC 4020 plotting area. This could have been done by having the GROATS package insert a constant test just before plotting. Instead, a slightly more flexible approach was adopted. In the GROATS system, one region is always defined as the passive region. Initially, region 0 is defined as the passive region. The passive region always acts as a window which contains all plotting within its boundary independent of which region is selected. Region 0 is initially passive and, as its boundary is initialised to coincide with the boundary of the SC 4020 plotting area, it will always ensure that no illegal plotting takes place. There is no reason why a different region should not be defined as the passive region. However, under no circumstances should a larger region be defined as the passive region. Unless familiar with the system, it is probably wise not to alter the region defined as passive or its boundaries. A region smaller than the complete SC 4020 plotting area can be defined as the passive region. This would ensure that all plotting was contained within a smaller region than the 7.5in square SC 4020 hardcopy page. A region may be defined as the passive region by calling:
passive;
which defines the currently selected region as the passive region. In example (2.7), the original setting of region 0 as the passive region ensures that only the three cycles of the sine curve that appear on the SC 4020 plotting area will be plotted. However, if, for example, we had:
limits (0, 0, 3, 3) ; region (0.5, 1, 2.5, 2, 2) select region (2) ; passive ; select region (0) region ( 1, 1, 2, 2, 1 ) ; select region (1) ; limits (0, -1, 2*pi, 1 ) ; extend ; for x := -50*pi step dx until 50*pi do vector (x, sin (x) , x + dx, sin(x + dx) ) ;
then, although the extend mode of region 1 would normally allow the three cycles of the sine curve to be displayed, the new passive region 2 restricts the curve plotted to the two cycles between x = -π and 3π.
So far,it has been assumed that the mapping of points and lines defined in a selected region onto the plotting area is linear and is done in a straightforward manner. That is, if the limits of the plotting area and sub-region are defined by:
limits (XMIN,YMIN,XMAX,YMAX) ; region (XMN,YMN,XMX,YMX,1) ; region (1) ; limits(xmin,ymin,xmax,ymax) ;
then the point (x,y) in units of region 1 is equivalent to the point (X,Y) on the plotting area in units of region 0 where:
X = XMN + (x - xmin) (XMX - XMN)/ (xmax - xmin)
Y = YMN + (y - ymin) (YMX - YMN)/ (ymax - ymin)
That is the standard conversion that is done and it will produce the normal results expected. If, for example, in region 1 a procedure is called which produces the letters EXAMPLE by vectors then the word will appear in this form on the plotting area. If, instead, the declaration of region 1 had been:
region (XMX,YMN,XMN,YMX,1) ;
then
would have been plotted. Similarly by interchanging the maximum and minimum y values in the region declaration, the characters could be turned upside down.
It is also possible to allow a rotation or expansion of the material defined in the selected region before doing the conversion to a position on the plotting area. For example, before the conversion given above, the point (x,y) could first be mapped into the point (x' ,y' ) where:
x' = xorig + e × ( (x - xorig) cos(alpha) - (y-yorig) sin(alpha) )
y' = yorig + e × ( (x - xorig) sin(alpha) - (y-yorig) cos(alpha) )
The point (xorig,yorig) is defined as the centre of rotation and expansion. The conversion, shown above, consists of a rotation of alpha radians anti-clockwise about this centre together with an expansion by a factor 'e' about the same centre. The GROATS package allows either expansion or rotation of this form to be specified. The only limitation is that, if both are defined, then the same centre of rotation must be used for both the expansion and rotation. Rotation is achieved by the call:
rotate (xorig, yorig, alpha) ;
while expansion 1S achieved by:
expand (xorig, yorig, e)
It is important to remember that basically all regions are defined in terms of the plotting area even though they may have been defined in terms of other regions. This means that, in attempting to define the position of the point (x,y) on the plotting area, only the rotation and expansion defined for the selected region will be applied. The rotations and expansions of other regions, in terms of which the selected region may have been defined, have no effect on the conversion. Similarly, if a region is defined in terms of a rotated region, its definition will be as if no rotation had been defined on this region. This ensures that all regions are defined as rectangular with boundaries parallel to the x and y axes. The rotation and expansion are local to the plotting of points in the selected region.
In subsequent Chapters, procedures will be described having x and y values as arguments. These arguments are always in the units of the currently selected region.
In section 2.2 regions were defined as windows which contained the plotting that could be seen. An alternative is to define a region as a shield which only allows plotting outside the bounds of the selected region. The currently selected region can be defined as a shield by calling:
shield;
The region can be redefined as a window by calling:
window;
Together with the contain/extend switch this allows the four possibilities:
The 'shield' facility is particularly useful for doing wipes starting from the centre of the picture in cine films.
One drawback with the local shielding is that the shielding or masking will only affect plotting in the selected region. Consequently, if plotting is being done in several different regions it is not possible to define a mask that will affect plotting in all the regions. The active region is similar to the passive region in that its action is global to all regions. The passive region only has meaning if it is a window and contains all plotting within it. Conversely, the active region only has effect when it is also defined as a shield. In this case only plotting outside the active region will be displayed. The currently selected region is defined as the active region by calling
active;
For example
1imits (0, 0, 10, 10) ; region (1, 1, 9, 9, 1) ; region (3, 3, 7, 7, 2) ; select region (1) ; passive; window; select region (2); active; shield; select region (0); scene;
will allow only that part of the scene defined between the limits of regions 1 and 2 to be displayed.
All line drawing in the GROATS package is eventually accomplished by calling the procedure:
vector(x1, y1, x2, y2) ;
which defines a line joining the points (x1,y1) and (x2,y2). If the selected region is 'contained' (see Section 2.2) then only the part of the line appearing inside the selected region is drawn. If the selected region is 'extended' then the complete line is drawn assuming that it is within the boundaries of the passive region (see Section 2.3). It is important to remember that all output on the SC4020, apart from the generation of the hardware characters, is achieved by line drawing so that this section applies equally well to curve drawing and software character generation as well as line drawing.
The standard settings controlling the procedure 'vector' will mean that the line is drawn once unbroken. Unless the line is horizontal or vertical, this will be achieved by a set of calls of the SC4020 DRAW VECTOR operation. Horizontal and vertical lines are produced more efficiently on the SC4020 by the special axes generating instructions and these will be used wherever possible. The SC4020 at the Atlas Laboratory has been set up so that the axes generating operations produce lines slightly fainter than the lines produced by the DRAW VECTOR operation. This may be useful when producing vertical and horizontal grid lines but, in standard line drawing, it may cause unevenness in plotting intensity. To force all lines in the selected region to be produced by DRAW VECTOR operations, the procedure:
use vectors;
should be called. This increases the number of instructions generated for the SC4020 (for a line across the complete plotting area, 16 instructions would be required instead of 1) and should therefore be used sparingly. To return the selected region to using the axes generating operations, call:
use axes;
Darker lines on the SC4020 can be obtained by repeating the drawing of the line several times. The standard setting is to draw the line once only. By calling the procedure:
dark (I);
all subsequent line drawing in the selected region will consist of each line drawn I times. Lines tend to become too dark if I is greater than 5. If I = 0 then the line will not be drawn at all.
Thicker lines can be produced by calling the procedure:
thick (I);
After calling this procedure, all lines in the selected region will consist of the original line together with I-1 lines on either side of the original line. These additional lines are drawn parallel to the original line and touching it. For example, if I = 2, 3 lines will be drawn touching each other. If I is less than 1 no lines will be drawn. This facility can be quite useful in film work. Single lines tend to appear rather thin on microfilm and it is desirable to have I set to 2 or more.
Broken lines can be produced by calling the procedure:
broken (I);
The standard setting is I = 0 which will draw the line unbroken. The parameter I can be set between 1 and 63. It causes the line to be broken up into visible and invisible segments approximately .007in × I in length on the hard copy output. This distance does vary depending on the angle of the line with the horizontal. This is not ideal as far as the user is concerned but it does help to produce SC4020 output as efficiently as possible. Short broken lines will cause the SC4020 to work very inefficiently and they should be used sparingly.
Small reproductions of large drawings having considerable detail can become indistinct due to a large number of lines being truncated to a vector of zero length. Such vectors appear on the SC4020 as a dot. The drawing of these dots can be inhibited by calling:
zero invisible;
All zero length lines will not be drawn in the selected region once this procedure has been called. The drawing of zero length lines can be reinstated by calling:
zero seen;
It is hoped that this suppression of zero length lines may be useful when zooming in on a complex scene. Features will remain invisible until they become at least one raster unit in length.
When constructing line drawings, it quite often happens that several lines are required in succession with the end-point of one line being the starting point of the next. To avoid unnecessary repetition of the common point, the user may call:
vector(x1, y1, x2, y2) ; to point(x3, y3) ;
instead of:
vector(x1, y1, x2, y2) ; vector(x2, y2, x3, y3) ;
The procedure 'to point' takes its initial point from the end-point of the previous line drawn. The end-point saved after each line is drawn is not local to a particular region. Consequently,it is wise always to start a set of line drawing commands by a call of 'vector'.
When drawing curves, it is sometimes useful to shade the area above or below the curve in order to make the difference between the two regions stand out. It is possible to do this in the GROATS package by calling the procedure:
shadow (I);
before drawing the curve. The area which is shaded depends on the value of I.
The shading is produced by drawing an axis, originating from the start of each vector drawn, to the edge of the selected region.
To delimit the plotting areas being produced, it is useful to surround them with a border. Two procedures are provided for this purpose. A call of:
border;
will draw a straight line border around the edge of the selected region. A call of:
box (xmin,ymin,xmax,ymax);
will draw a rectangle where the minimum and maximum points are (xmin,ymin) and (xmax,ymax) respectively.
There is a set of 64 hardware characters available on the SC4020 which may be plotted at any raster position of the plotting area. In addition to plotting a character at a specified position, it is possible to type strings of characters on the plotting area. This could, of course, be done by several calls of the plotting operation. However, as it is likely to be required frequently, the SC4020 has special hardware for simulating the action of a typewriter. Once in this typewriting mode, the hardware will automatically increment the typing position after each character is typed so that there is the correct spacing between it and the following character. In addition, the hardware automatically moves to a newline when the right hand margin is reached and the top of the page when the last line has been typed. This is the most efficient method of generating textual information on the SC4020 but does not fit easily into the GROATS system. For example, the GROATS system is designed around the concept of regions and any automatic newline facility should return to the left of the selected region rather than the complete plotting area. Consequently, the GROATS system does not make use of the automatic newline or top-of-page hardware. Instead checks are inserted to ensure that all typing appears on the plotting area. If typing goes outside the boundaries of the selected region then it is ignored assuming the region is contained. The rules for typing being visible are as defined in Chapter 2. However the hardware typing orders can cause a large compression of the information required by the SC4020. Therefore the GROATS package uses these special orders when typing hardware characters away from the edge of the plotting area. In the typing mode, two of the 64 hardware characters have special significance as they can be used to change the SC4020 from typing mode to plotting mode (these are the characters having SC4020 internal number in octal: 12 and 56). To avoid confusion the GROATS package has decided not to allow these two characters in either the typewriting or plotting mode. A third character, the plotting dot (octal 52) is also not available in typing mode. However, as it is probably the most important plotting character, it has not been eliminated from the set of GROATS characters. Instead the user must take care not to use the plotting dot in typing operations.
The basic set of hardware characters available on the SC4020 is too restrictive for most requirements and so it has been augmented by a set of software characters made up of short vectors. The main objections to the hardware set are that only a fixed size of about 0.1in in height is available and the lower case alphabet is not provided. The internal numbering of the characters is also not very useful as it bears little resemblance to the 1900 internal code in which Algol strings are stored. Consequently the GROATS package has defined a set of 256 characters with its own numbering system, so that, as far as the user is concerned, there is a 256 character set. The user need not concern himself with the difference between hardware and software characters: the GROATS package will attempt to use hardware characters wherever possible.
Character size and spacing are defined for each region independently so that it is possible to have different character sizes for each of the regions defined. When the units to be used in a region are defined by a call of the procedure 'limits', several typing parameters for that region are automatically initialised. In particular the size of characters defined for that region is set to the standard hardware size. Consequently, unless one of the character procedures is called, the user will automatically use hardware characters wherever possible. The hardware character size is taken as one of the standard sizes of characters in the system. It is possible to redefine character size by defining the height and width required for the characters. This is achieved by calling:
character size (HEIGHT, WIDTH);
The height and width are defined in terms of units of the selected region. As the limits of the selected region are changed, the size of characters will also change on the plotting area. In order that the user may keep the size of characters constant, he may call:
hardwaresize;
All regions have character settings initialised to this and characters will be printed this size eVen though the limits of the region are altered.
A second method of defining a character size independent of the reglon is by calling:
character factor (N);
This will cause the characters to be printed N times as large as the standard size for the character font.
Each character is automatically surrounded by an area which will separate it from neighbouring characters in both the horizontal and vertical directions. The character size is defined as HEIGHT units above and below the line upon which the character sits and WIDTH defines the width of the character with sufficient space between it and its neighbour. It is possible in text editing that the amount of space allowed between characters may need to be decreased or increased. This can be arranged by calling:
character space (X);
This inserts an extra space of X units between characters In the horizontal direction.
To plot the GROATS character numbered N at the point (x,y), the user calls:
plot (x, y, N);
The character is plotted so that the centre of the character is approximately at the point (x,y). For example:
limits (0, 0, 2, 2); plot (1,1,95);
will plot the 'plotting dot' at the centre of the selected region. The plotting dot is carefully positioned so that it is positioned accurately at the point requested. Most of the hardware and software characters take up several raster positions in height and width so that it is not too obvious where the centre of the character is positioned. In the case of the hardware characters, these tend to be positioned so that the centre of the character corresponds with the plotting position. The main exception is the 'degree' character (GROATS number 94) which is considerably offset. Hardware symbols which appear to be centred accurately are +, -, 0, *. These therefore make good plotting characters. Some of the software characters (especially the lower case alphabet) are considerably offset and should therefore not be used if accurate plotting is required.
If the same character is to be plotted at several different points then the procedure call:
plotn (x,y);
can be used. This plots at the point (x,y) the same character used in the last call of the procedure:
plot (x,y,N);
Alternatively, the character to be plotted in calls of 'plotn' can be defined by:
set plot char (N);
For example, the three programs:
plot (1,1,95); plot (1,2,95); plot (1,1,95); plotn(1,2); set plot char (95); plotn (1,1); plotn (1,2);
are all equivalent.
The definition of 'last plotted character' is not linked to the selected region but is global to the region selection commands.
There is also a facility to plot individual characters with a specified intensity: the procedure call
plot intensity (x,y,N,I);
causes the character N to be plotted with intensity I at the point (x,y). For this procedure, N must be the SC4020 hardware character number : software characters may not be plotted by this procedure. There are sixteen levels of intensity, numbered from 0 (the lightest) to 15 (the darkest). The operation of this command does not affect the intensity for other plotting as determined by a prior 'expose heavy' or 'expose light' command.
Before any typing may be done in a region, it is necessary to set the current typing position. Once this has been done, any typing command will cause typing to take place starting from this position. The simplest method of setting the current typing position is to call:
move type to (x,y);
where the position (x,y) is defined in the units of the currently selected region. The typing position corresponds to the centre of the next character to be typed. In order to start typing from the top left hand corner of the selected region, call:
move type to top;
The typing position is set so that the first character typed remains within the boundaries of the selected reglon.
To adjust the typing position by moving on one position call:
increment type position;
This is equivalent to typing a space. Several spaces can be left between characters typed by calling:
type blanks (I);
To reset the typing position to a newline call:
type newlines (I);
If I = 0 the typing position is reset to the left hand edge of the selected region but the Y-coordinate of the current typing position is not altered. In both the procedures with argument I, the user is allowed to use negative or fractional values as argument with the obvious meaning.
Once the typing position has been set, single characters may be typed by the call:
type (N);
which types the GROATS character number N at the current typing position and moves the typing position one position to the right. The amount that the typing position is incremented obviously depends on the current settings of the various parameters associated with size of characters and distance between them. The procedure 'type' may be useful in some circumstances but it is more likely that strings of characters will require typing in which case the procedure 'type string' (to be described later) will be used.
To output a number starting at the current typing position, a procedure 'type number' is provided. This is based on the ICL 'print' output procedure. Calling:
type number (A,I,J);
will output the number A with I places before the decimal point and J places after. The special cases when J = 0 or I = 0 are used to define integer and floating point output formats.
In order to obtain suffices and superfices, procedures are provided which automatically adjust the current character size and typing position. For example:
type (33); superfix; type (18); super return; type (34); suffix ; type (10); suf return; type (35);
will type A2B3C
Only a single level of using these procedures has been given in the example. However, there is no reason why a superfix of a superfix or a suffix of a suffix or any other combination should not be typed. The standard procedure for typing strings of characters is:
type string (I);
This types the string of characters whose position is defined by the integer I. This procedure could have been defined with the string of characters as the argument but it is more flexible in Algol to access the string indirectly. The position of a string of characters is obtained by
I:= pointer('ABCD');
The procedure 'pointer' sets I to the address of the string 'ABCD'. Typing the string can then be done by calling
type string (I);
or alternatively
type string (pointer( , ABCD ' ) ) ;
In order to allow strings of characters to be read as data and accessed by the type string procedure, we have:
read string (A, IMIN, IMAX, STR);
The fourth argument, STR, of this procedure is a string consisting of two characters. All characters on the currently selected input are read and ignored until the first of these two characters appears. The input string is then read into the one-dimensional array A starting at A[IMIN] until the second of the two characters appears on the input stream. The two characters themselves are ignored and, after the procedure call, the input pointer is to the character after the terminating character for the read. On exit from the procedure, IMAX is set to the next available location in the array A. This enables several input strings to be stored next to each other in the array. The array elements each contain four characters and two extra words of the array are used to contain the string header. For example, if the input stream is:
rubbish C this is the required string X more ..
and the procedure call is:
j:= 200; read string (A, 1, j, 'CX');
then 'this is the required string' is stored in A[1] onwards.
To use this stored string in the procedure 'type string' it is necessary to be able to define its position and this can be done by:
I: = addr (A, IMIN);
which sets I to the position of the string stored in A[IMIN] onwards. For example the string read in above could be output by:
type string (addr(A,1));
One problem with the procedure 'read string', as defined, is that the only characters accessible to it as arguments are those which can be read in from data streams or stored as strings in the body of the program. The Algol system only allows those characters which have 1900 internal code values to be accessed in this way: this is restricted to the 64 character set of the lineprinter. Consequently, some method must be provided for typing the remaining characters of the GROATS character set. This is done by calling the procedure:-
displacement is (M) ;
After the call of this procedure, any typing instruction referring to character N will be assumed to refer to character numbered M+N.
For example:
displacement is (64) ;
type string(pointer(' ABC')) ;
will cause the characters 'abc' to be printed instead of 'ABC'. GROATS numbering of the two alphabets differs by 64.
Even so, this global setting of the displacement can be too inflexible and it would be more convenient to be able to change the displacement in the middle of the string in some cases.
This is achieved in the GROATS system by the ability to redefine any character in a string as a setting procedure. Once this has been done the corresponding setting procedure will be called each time this character is encountered in a string instead of typing the character. The possible procedures that may be called in this manner are:
A character is replaced by a setting procedure by:
define char as special (N,J,I);
which replaces the GROATS character N appearing in a string to be typed by a call of the Jth setting procedure in the above list. For example:
define char as special (33,1,196); define char as special (34,3,0); define char as special (35,4,0);
will replace A by a call of the procedure:
displacement is (196);
while B and C will act as the commands superfix and super return.
Calling the procedure:
type string (pointer ('DB2CAD'))
would produce: D2δ
It is possible that other setting procedures will be added to the above list as the need arises. This use of spare characters for defining 'carriage operations' of a typewriter, it is hoped, will greatly increase the flexibility of the typing commands.
The standard method of typing characters in GROATS is to space them such that the distance between the centres of any pair of adjacent characters on the line is constant. Since, for example, the letter I is very much narrower than the letter M, the space between the letter I and its neighbours in a word appears to be much greater than for the letter M - ie the spacing between the characters varies although the centres of the characters are the same distance apart.
The option has therefore been provided to allow users to type characters so that the space occupied by each character varies, depending on the width of the character: in this mode, the spacing between the characters appears constant (and equals the value set by the last call to 'character space' in the selected region) whereas the distance between the character centres varies.
This second, variable character width, mode is entered by the procedure call
constant width (false);
after which all typing in all regions will be with variable character widths.
By calling
constant width (true);
the user may return to the normal constant character width (and hence variable character spacing) mode.
Certain languages, such as Persian, are written from right to left: to aid the typing of such languages, a facility for typing backwards has been introduced. By calling
type backwards (true);
all typing in all regions will be from right to left: this affects the operation of all procedures which alter the horizontal typing position, namely:
increment type position move type to top type type string type number type blanks type newlines suffix suf return superfix super return
By calling
type backwards (false);
the user may return to the normal left to right typing mode.
During a call to 'type string' it is possible to have one character typed over (ie typed in the same position as) another: this has applications to quantities such as accents (where the accent is defined as a separate character to be typed over another character) or some special characters in a language such as Persian.
The procedure to do this, overtype, may only be called via a setting character in a call to 'type string', as follows:
if N 1S the GROATS number of the character Q say, then the call
define char as special (N,14,0);
made, with the result that in the call
type string (pointer ('PQR'));
the character R will be typed over the character P. Note the result of:
type string (pointer ('PQQR'));
ie 'overtype of overtype' is indeterminate and should not be used; this restion also applies to calling 'overtype' directly.
The standard software character font is called FONT 0. This font is provided automatically with the GROATS package and has a basic size 20 × 10 raster units (this is approximately hardware size). It is made up of single straight lines and over expansion of its simple character forms make them appear thin and inelegant. Five additional character fonts are available. Three of these, fonts 1, 2, 3, correspond to those defined at Bell Telephone Laboratories and described in a paper 'Three fonts of computer drawn letters' by Matthews, Lochbaum and Moss in CACM, 10, 10 (Oct 1967) 627-630. These fonts are much more elegant than the standard font 0 and can be used for high quality textual output. The fourth font, font 4, is a Helvetica font: it is an open font - that is, for example, the letter A appears as:
This font is particularly useful for titles in film.
The remaining font is available to the user (as font 5): it is at present identical to font 0, but may be redefined by the user.
Each region is initially associated with font 0. The selected region will have all characters plotted as characters from font I if the call
font(I);
is made after selecting the required region, but prior to issuing the plotting (or typing) orders.
The standard size of each of the character fonts - that is the size obtained by calling
character factor (1);
is:
| FONT 0 | FONT 1 | FONT 2 | FONT 3 | FONT 4 | |
|---|---|---|---|---|---|
| width of character | 10 | 18 | 28 | 36 | 32 |
| height of character | 10 | 12 | 18 | 25 | 32 |
| x coordinate of centre | 5 | 9 | 14 | 18 | 16 |
| y coordinate of centre from top | 5 | 6 | 9 | 12 | 16 |
The measurements are in raster positions.
In the previous chapters, we have described the procedures required for plotting, drawing or typing information on the SC4020 without concerning ourselves with the destination of this information. The SC4020 has both hard copy and microfilm cameras available and it is possible to direct the graphical output to one or other of these (or to both). As far as the user is concerned, it behaves rather like a normal pen-plotter having a roll of continuous paper divided up into plotting areas 7.5in square together with a roll of microfilm divided up into frames. In the following description 'frame' will be used to denote either the microfilm frame or the 7.5in square plotting area. Any call of a graphical output procedure in the GROATS package will cause the correct plotting to occur on the frames that are selected. Once the user's identification has been placed at the head of his graphical output both outputs are advanced to a new frame and the hard copy output is selected. If no control procedures are called by the user, all output will appear on the current frame of the hard copy. In order to get output on microfilm, call:
select camera (I);
If I = 1 then the microfilm output is selected and the hard copy becomes unselected. All output commands after this call of 'select camera' will then appear on the microfilm frame only. If I = 3 then both hard copy and microfilm will be selected. To return to plotting only on the hard copy, the procedure 'select camera' must be called with I = 2.
In order to produce output on a new frame, it is possible to advance the output to the next frame by calling
advance film;
This will advance the selected outputs to the next frame position ready for a new frame of output to be produced. The ability to advance the frames on microfilm and hard copy separately and to output graphical information on only one or other of the two output forms means that two distinct types of output can be produced on a single run. For example:
select camera (3); draw sine curve; select camera (2); advance film; draw cosine curve; advance film; select camera (3); draw tangent curve; advance film;
would cause the sine, cosine and tangent curves to be drawn on three separate frames of hard copy while the sine and tangent curves are output on the same frame of microfilm. This switching of output streams on and off can be quite useful in microfilm work. A selection of the frames produced on microfilm can be output on hard copy for debugging and monitoring purposes.
The fact that both output streams can be turned on and off independently does mean that the user could get confused as to the order in which frames had been produced. For example if alternate frames were being output on hard copy and microfilm then it might be difficult to merge the two. To help the user, a count is kept of the number of times 'advance film' has been called and this is printed at the top left hand corner of the selected frames after the 'advance film' procedure has moved to a new frame. The count is initialised so that:
FRAME 1
appears on the initial frame of hard copy that is selected. This frame count may be a nuisance in microfilm work and it can be removed by calling:
frame (I);
If I is negative then this stops the frame count being output. A positive value of I will reset the count to I so that the next call of 'advance film' will cause the new frame or frames to be numbered I.
The SC4020 hard copy output will be returned to the user in a roll. Unfortunately, this does mean that the output is difficult to cut and flatten if it is left rolled for any length of time. The Laboratory is looking into the possibility of getting a machine to cut the hard copy roll as soon as it is processed. To aid the cutting process, a cut mark is drawn for each frame outward from the bottom right hand corner. The user can stop this cut mark appearing by calling:
set cut mark (false);
The standard setting of the SC4020 plotting areas is called REDUCE IMAGE mode and produces hard copy frames 7.5in square and microfilm frames with the standard spacing between each. A second mode called EXPAND IMAGE mode is available and is intended for 35 mm microfilm users who require to abut several frames of microfilm to allow plots to extend continuously through several adjacent frames. The exact size of the frame in EXPAND IMAGE mode is adjusted for 35 mm film. The hard copy plotting area is also increased in size and in EXPAND IMAGE is approximately 8in square. The centre of the plotting area remains in the same position and expansion is uniform in both directions. The size of the hardware characters, however, does not change so that, in EXPAND IMAGE mode, the spacing between hardware characters increases and the characters become rather smaller than the equivalent software characters. To change to EXPAND IMAGE mode the user should call:
expand image;
A call of the procedure:
reduce image;
returns the user to REDUCE IMAGE mode. The procedures have no effect if the correct mode is already selected.
In Chapter 3, the procedure 'dark' was described which enabled vectors and software characters to be produced darker than the standard plotting intensity. The procedure 'dark' does not, however, alter the intensity of the hardware characters. It is possible to define two different intensities of these using the SC4020 hardware. Hardware characters are either produced in HEAVY or LIGHT mode. The standard setting used by the GROATS system is the HEAVY mode. If the user wants to change to the LIGHT mode he should call:
expose light;
The HEAVY mode can be reset by calling:
expose heavy;
As stated above, the hardware character modes, HEAVY and LIGHT, are produced by hardware and are therefore global and not defined just for the selected region. This is, of course, different from the 'dark' setting of vectors which is local to the region.
An interesting facility available on the SC4020 is the ability to produce a 'form slide' which can be used as a standard background to a set of plotting frames. The 'form slide' has to be specially produced and loaded into the SC4020. To superimpose the 'form slide' on the output frames currently selected the user calls:
project form;
Examples of possible 'form slides' are maps and business forms. A special Atlas Laboratory form slide is displayed on the identification frame and it is necessary to inform the operator that it is to be replaced by the user's own slide.
In the production of movies, it is often necessary to repeat the same or a set of frames many times. This could be achieved by repeated generation of the same frame many times. However the SC4020 does provide a more efficient method of doing this by hardware. There is a hardware facility for marking a position on the magnetic tape and later rewinding to this position and repeating the intervening plotting information several times. In the GROATS system, the information to be plotted several times must be preceded by the call:
advance repeat (0);
and is terminated by the call:
advance repeat (I);
The initial call advances the selected output to a new frame. All the frames between this frame and the current frame are repeated I times. The number of times the frames are repeated must be less than or equal to 31. There is no simple limit on the number of frames which may be repeated. It largely depends on the amount of information plotted on each frame. The total number of SC4020 records (ie magnetic tape blocks) repeats must be less than 511. If the user attempts to repeat more than 511 records then a diagnostic will be given.
In this section some of the system routines in less general use are described; also, there are descriptions of some procedures which are available in source form to be incorporated into the user's object program.
Unlike the standard graphical pen-plotters, the SC4020 hardcopy output uses specially treated paper. A consequence of this is that, unlike the pen-plotters which use graph paper, the SC4020 sheet is initially blank and if a graticule of any kind is required then this must be produced by the user.
A procedure in the GROATS package is available for covering the selected region by a graticule. For example:
graticule at (dx, dy);
will draw horizontal lines across the region at a separation of 'dy' and vertical lines at a separation of 'dx' in the units of the selected region. The program:
1imits (0, 0, 7.5, 7.5) ; graticule at (0.1, 0.1); graticule at (1, 1);
would define the whole region as having inches as units and graph paper would be produced at intervals of 0.1in. The second call of 'graticule at' would darken the markings every 10th line. The lines are drawn so that lines in both directions would pass through the point (0, 0) if that was in the bounds of the selected region. It is perhaps worth emphasizing that graticules will be produced much more efficiently in the 'use axes' rather than 'use vectors' mode. A second procedure is:
axes at (x, y);
which draws axes through the point (x, y).reaching to the edges of the selected region.
Scales may be printed in the horizontal and vertical directions by calling:
scales at (dx, dy, xo, yo, mx, nx, my, ny);
This takes (x, y) as the origin and prints the values at intervals of 'dx' and 'dy' in the two directions. In the x-direction, the printing will occur just below the line y = yo and the form of printing will be equivalent to:
typenumber (x, mx, nx) ;
For integers, the least significant digit will be positioned at the point to which the printing refers. Otherwise the decimal point will be at this position. In the y-direction, the printing will be to the left of the line x = xo and the centre of the characters will be positioned at the point to which they refer. For example:
limits (0,0, 10, 10); region (2, 2, 8, 8, 1); select region (1); limits (0, 0, 5, 5); graticule at (0.1, 0.1); graticule at (1, 1); scales at (1, .5, 0, 0, 1, 0, 1, 1);
would define a region in the centre of the plotting area having units ranging from 0 to 5 in both directions. The graticule is again at intervals of 0.1 with the unit positions darker. Around the edge of the region the scales are marked every integer position in the x-direction and every 0.5 in the y-direction. In the y-direction, one place before and after the decimal point is printed.
In the production of the identification frame, two procedures have been written for obtaining information about the job. The first is:
job title (A) ;
which stores as a string in the array A, from A[1] onwards, the title of the job. This could then be output on a frame by:
type string (addr(A, 1));
The array A must be one-dimensional and have a range from A[1] to A[9] at least.
The second procedure will read into the array A either the current time or date:
job time date (A,I);
If I = 1 the current time is put in the array A, while I = 2, will put the current date. Once more the string is stored from A[1] onwards (the range must be from A[1] to A[4] at least).
The procedure 'define new character' when called will read in internal code from the currently selected input stream the definition of a GROATS character which will replace the existing definition if one exists. The new character definition added will be to the currently selected font. The format for redefining a character is given later. There is no limit to the number of characters that may be redefined. However, new definitions do not replace the old definitions but are added to the end of the definition table. This could mean that if a large number of characters are redefined then the space available to each font will be filled. Each font is allowed room for defining approximately 3500 lines in the complete character set.
If the number of characters being redefined starts getting large, it is preferable to redefine the complete font. In this case, the new font definition completely replaces the old font definition. A new font is defined by calling 'define font'. This procedure, when called, will read in internal code from the currently selected input stream the complete font definition. The format of the data for redefining a complete font is given later.
The standard fonts are defined in terms of a rectangle W units wide and 2H units deep. The origin is at the top left hand corner and X increases from left to right while Y values increase as one goes from top to bottom of the rectangle. Thus the bottom right-hand corner of this rectangle is the point (W, 2H). Each character in the font is defined to be within the bounds of a rectangle of this form. The assumption is made that characters will sit on the horizontal line halfway down the rectangle. That is the line joining the points (0, H) and (W, H). For plotting, the centre of the character is assumed to be at the point (CX, CY). It is usual to have CX = W/2 and CY = H/2. The parameters W, H, CX, and CY are defined once for all characters in the font.
Character typing in GROATS will output characters with the rectangular regions for the characters touching. This means that it is usual to leave sufficient space at the sides of each character so that during typing, characters do not run together. Similarly, a newline will be typed with its rectangles touching the row above. Sufficient space should therefore be left at the bottom of the character definitions so that two lines do not run together. The maximum value allowed for W and H is 31. This is so that character definitions may be packed one or two lines per word.
The standard font size for each font is defined as W raster positions in the X direction and 2H raster positions in the Y direction. This is obtained by calling:
character factor (1) ;
The font may be output in any size by using one of the procedures for redefining the size of characters on the output.
The input expected for defining a character using the procedure 'define new character' is as follows:
<character number><character definition>
<character number>::=<positive integer> | <negative integer> < positive integer>
<character definition>::=<line definition *?>F | E<positive integer>
S<positive integer><positive integer>
<line definition>::=V<positive integer><positive integer><positive integer> <positive integer> |
T<positive integer><positive integer>
<positive integer>::= A positive integer followed by a terminator
consisting of a , or two spaces.
<negative integer>::= A negative or zero integer followed by a terminator
consisting of a , or two spaces.
Examples of character definitions are as follows:
-17 1 V4, 1 , 5, 0, T5, 10 , V3, 10, 7, 10, F 128 S 1 ,9 140 V5, 1 , 5, 10, V3, 7, 5, 10, T7, 7, F 161 E 33
These are in fact four of the definitions In the standard font 0.
The <character number> defines which GROATS character is being defined. If the first possibility consisting of a single positive integer is written then this is the number of the character in the GROATS character set. If the character being defined has a hardware character representation and the user wishes to use the hardware character in place of the software character whenever the font is being output in hardware size then the second alternative is used. The negative of the GROATS character number is output followed by the SC4020 hardware character number replacing this character. Our four examples are therefore defining the GROATS characters 17, 128, 140, and 161 (ie 1, Newline, downarrow, A). The first of these, the digit 1, will be replaced by the hardware character numbered 1 when the font is being output hardware size.
The most usual method of defining the character is as a set of lines using the co-ordinates of the rectangle box defined above. The rectangle can be thought of as having a unit declaration:
limits (0, 2H, W, 0);
The definition then consists of a set of lines equivalent to GROATS calls as follows:
Vp, q, r, s defines vector (p, q, r, s); Tw, x defines topoint (w, x);
The definition is terminated by the letter F.
If the definition of a character is identical to that for another character in the font which has already been defined then the definition takes the form
p E q
where this defines the GROATS character p as being identical to character q. In the example the upper case Greek letter A is defined as being identical to the standard upper case A.
The character may be defined as a setting procedure. This is done by
p S q r
which defines GROATS character p as the setting procedure obtained by calling:
define char as special (p, q, r);
In the example the character 128 is defined as the setting procedure 'newline'.
A complete font definition consists of 256 character definitions for the GROATS characters 0 to 255 in any order. These are preceded by:
FONT i W, H, CX, CY
where i is the number of the font and W, H, CX, and CY are integers as defined above. The standard FONT 0 has, for example, a definition starting:
FONT 0 10, 10, 5, 5 0 63 F -1 48 F -2 12 V4, 2, 4, 4, V6, 2, 6, 4, F
It is usual to equate undefined character positions to the space character (GROATS character 1). For example,
210 E 1
The user-defined fonts will normally work in both constant and variable width spacing modes. The procedure 'define font' will automatically produce the necessary table for variable width spacing. If later, new characters are defined for a font by calling 'define new character' then the variable width table could be incorrect. It is therefore sensible, after redefining characters, to call:
define variable widths;
before storing the font away or using it. It is called automatically by the procedure 'define font'.
The facilities described above allow the user to redefine either individual characters or a complete font for the current run of his program. The user may, however, require a non-standard font on many runs of his program. In this case, it is preferable that these non-standard fonts are loaded initially rather than the standard fonts.
If a user has a parameter
FONT filename
in the call to the GROATS macro then the fonts used by the GROATS package {and the user program) will be loaded from the file 'filename' instead of from the standard system file.
When producing cine films, it frequently occurs that some part of each frame may behave as a static background, which appears on several frames: alternatively, the user may have some pictorial object which he wishes to display on a number of frames, possibly modifying it slightly from one frame to the next. Rather than having to recompute this information, the user can store it and then re-use it as and when required.
There are two saving systems available: one is to define "pictures" - pictorial information is stored and given a name chosen by the user: this picture can then be displayed or modified merely by specifying the name the user has associated with this pictorial object. The other saving system is somewhat simpler - the plotting information is saved in an array nominated by the user, who may then re-use the saved information at the required points in his program.
There are two methods of defining pictures
These procedures save the plotting information in a stack created solely for this purpose. When 'def' or 'start def' is entered, a check is made to see if this stack, henceforward called the "picture stack", exists: if not, it is created automatically. The user need not attempt to set up this stack initially, and there is no mechanism provided for him to do so. The picture stack is situated in virtual memory above the normal Algol stack: the Algol stack starts at address 512K and the picture stack at address 1M. Thus the limit on the size of the Algol stack when defining pictures is 512K words.
The initial size of the picture stack is 1K words, and the picture defining routines automatically attempt to enlarge this (in increments of 1K words) by requesting an increase in the active program size. This will be granted until an attempt is made to extend the program's size beyond the maximum permitted for the user program. If an increase in size is not granted, then a diagnostic message will be printed and the program will halt: the standard error procedure will then be entered.
The maximum size of the picture stack is the maximum program size minus the amount of core used by the remainder of the program ("remainder of the program" means the program code areas plus all data areas (including the Algol stack) but excluding the picture stack).
The declaration of this procedure is:
procedure def(proc,st); procedure proc; string st; algol;
The procedure 'def' stores away the picture that would have been generated if a call of the procedure 'proc' had taken place at this point. The procedure 'proc' must have no arguments. The string 'st' is the name assigned to this pictorial information. The name can be of any length but only the first seven are used to define the item. Different names must therefore differ within the first seven characters. For example:
def (border, 'box around region');
defines the border surrounding the current region and gIves it the name 'box around region'.
This method of defining a picture is similar to 'def' except that plotting orders between calls of 'start def' and 'finish def' are stored away. Both procedures must be called with the same string argument. For example :
start def ('box around region');
border;
finish def ('box around region');
s equivalent to def (border,'box around region');
The procedure 'fidef' is used in exactly the same way as 'finish def' but it does not require an argument: it terminates the definition of the picture currently being defined (note: only one picture can be defined at once). Thus the example above could be written :
start def ('box around region');
border;
fidef;
Pictorial information may be stored in two different forms. The absolute positions of the lines on the display area may be stored or alternatively (X,Y) co-ordinates relative to a particular region. The second method is the more costly in space but it does allow more flexibility in the form that drawing can take. Normally, all plotting will be stored in the first or absolute form. The form of storage relative to the units set for the region is obtained by calling the procedure
absolute (false);
The switch can be reset to absolute by calling
absolute (true);
If a picture is being saved in the relative mode, then the information stored will depend on the vector drawing order used. When the saved picture is drawn, the output will, of course, depend on the type of information stored in the save area. In the following table the columns give
The variable R is used to denote the currently selected region. It is assumed that this region is selected before the order in column (3) is executed. The parameters LASTX and LASTY are used to indicate the end point of the last vector drawn. For example :
vector (X1, Y1, X2, Y2);
will set
LASTX = X2, LASTY = Y2
Similarly
topoint (X, Y);
is equivalent to
vector (LASTX, LASTY, X, Y);
| (1) | (2) | (3) |
|---|---|---|
| vector (X1, Y1, X2, Y2); | R,X1,Y1,X2,Y2 | vector(X1,Y1,X2,Y2); |
| setlast(X,Y); | R,X,Y | setlast(X,Y); |
| penup(X,Y); | R,DX,DY | penup(LASTX+DX,LASTY+DY); |
| topoint(X,Y); | R,DX,DY | topoint(LASTX+DX,LASTY+DY); |
| storeline parameters; | R,B,D,T | broken(B);dark(D);thick(T); |
| draw(NAME,0) | R,NAME | draw(NAME,-1); |
The values of DX and DY stored are X-LASTX and Y-LASTY respectively. The values of LASTX and LASTY are those when the saved picture is being defined. The values of LASTX and LASTY in column (3) are the current values when the picture is being used. These can, of course, be different.
The procedures 'vector' and 'topoint' have their usual meaning.
Details of the other procedures available follow:
The declaration of this procedure is:
procedure set last (X,Y); value X,Y; real X, Y; algol;
This procedure resets the value of LASTX and LASTY to X and Y respectively.
The declaration of this procedure is:
procedure penup(X,Y); value X,Y; real X, Y; algol;
This procedure resets the value of LASTX and LASTY to X and Y respectively. It differs from 'set last' in that when used in a saved definition, it defines a relative movement of the drawing position rather than an absolute one.
This stores the current values of the 'broken', 'dark' and 'thick' parameters for the selected region if the procedure is used in a save definition.
The declaration of this procedure is:
procedure draw (st, num); value num; integer num; string st; algol;
This procedure allows the user to display several subpictures for 'num' frames; the names of the subpictures should be put in the argument 'st' separated by commas.
For example, if subpictures named BORDER, CIRCLE, ELLIPSE have been defined then:
draw('BORDER', 10);
draw('BORDER, CIRCLE', 15);
draw('BORDER, CIRCLE, ELLIPSE', 10);
would produce a film sequence of 10 frames with just BORDER displayed followed by 15 frames with BORDER and CIRCLE displayed and then 10 frames with BORDER, CIRCLE and ELLIPSE displayed.
If the value of 'num' is negative then the result is to draw the picture -num times with no advance films in between. Usually only num = -1 is required.
If the value of num = 0 then there will be no action unless the call of 'draw' is part of the definition of a picture in relative mode. In this case the string 'st' is stored In the save area and using this item will be equivalent to
draw (st, -1 ) ;
Note the important difference between the following definitions:
absolute (false);
startdef ('AA');
draw ('FRED', -1);
finishdef ('AA');
startdef ('BB');
draw ('FRED' ,0);
finishdef ('BB');
In the first case the definition of AA will contain all the line drawing orders making up the definition of FRED. In the second case, the definition of BB will just contain the name of FRED. This is obviously a saving in space. In addition if FRED is redefined then this will have no effect on AA's definition but EE will now be equivalent to the new version of FRED.
The declaration of this procedure is:
procedure draw from to(st1, st2, FR); value FR; integer FR; string st1, st2; algol;
This procedure changes the picture defined as 'st1' into the picture defined as 'st2' in FR + I frames if FR > 0. If FR < 0 then the intermediate positions are all displayed on the same frame. If the strings 'st1' and 'st2' consist of several items then they must both be the same length. Each item is transformed into its equivalent item.
Two restrictions on the use of this procedure are
For example:
absolute (false);
def (circle, 'CIRCLE');
def (border, 'BORDER');
def (square, 'SQUARE');
def (ellipse, 'ELLIPSE');
draw from to ('ELLIPSE, SQUARE','CIRCLE, BORDER', 10);
would change ELLIPSE into CIRCLE and SQUARE into BORDER in the next 11 frames.
The movement from one object to another is achieved by taking the position of equivalent lines in the two objects and linearly interpolating to give the position for each frame. If one picture has more lines than another then the picture with fewer lines will have lines broken into two until the two items are of equal length. This procedure is particularly useful for producing animated movement.
The declaration of this procedure is:
procedure drawvar (st, num, proc); value num; integer num; string st ; procedure proc; algol;
Frequently a constant background is required together with some information whose position varies linearly over a set of frames. The procedure 'drawvar' will generate 'num + 1' frames consisting of the background 'st' defined as for 'draw' with, in addition, a variable picture defined by calling 'proc'. The global variable 'framemax' is set to 'num' and the global variable 'fram' takes the value 0, 1, 2 ... num in calls of 'proc'. The procedure 'proc' can therefore define the variable plotting required depending on 'fram'. For example:
procedure movingbox;
begin real r, a;
r:-= 1/framemax;
a:= r * (5 * (framemax - fram) + 7 * fram);
box (a, a, a + 3, a + 3);
end;
drawvar ('BORDER, CIRCLE', 20, movingbox);
would produce 21 frames with the background BORDER and CIRCLE and a box which starts having co-ordinates (5, 5, 8, 8) and finishes with co-ordinates (7, 7, 10, 10).
The declaration of this procedure is:
procedure change display (stl, st2, N); value N; integer N; string st1,st2; algol;
This procedure is used to dissolve the picture st1 into the picture st2 in N + 1 frames. At each frame, 1/N lines of the display st1 are replaced by 1/N lines of st2. The pictures defined as st1 and st2 must consist only of lines and, in particular, must not contain any hardware character plotting. Also, it is advisable that the frame count and cutmark are not being produced. For example:
change display ('BORDER, CIRCLE', 'ELLIPSE', 10);
will dissolve the BORDER and CIRCLE into ELLIPSE in 11 frames.
These three procedures provide different methods of reclaiming space in the picture stack. For example:
remove ('FRED');
would remove the picture called FRED from the stack and make this storage space available again. The procedure 'removei' is similar. For example:
removei ('ALF,FRED,SID' ,2);
would remove the second item in the string. That is the picture FRED would be removed. This is sometimes a useful alternative when passing multiple named strings between routines.
The procedure 'release' removes not only the picture defined in the string name but also all pictures defined after the definition of this picture. Care should be taken when using this procedure as the procedure 'draw from to' may redefine existing pictures unknown to the user.
Although the picture stack is not an Algol array, it is possible to access it as such by means of the following:
real array ARRY[1:2];(the name of the array is not significant - the user can choose his own).
save array (ARRY);
The action of this procedure is to generate an Algol array header for the picture stack, and to overwrite the header of the specified array with the header just generated. Thereafter, references to the array ARRY, for example:
ARRY [I] :=3.0; print(ARRY[4],20,0);
will refer to the corresponding element of the picture stack. The original contents of the array ARRY are irretrievably lost, and hence there is no point in initially declaring ARRY to be an array with a large number of elements.
After making a call to 'savearray', the user may define further pictures: this could possibly cause the picture stack to be extended. A 1900 Algol array header contains, amongst other information, the address of the first word after the end of the array; if the picture stack has been extended, this address will be the address of the first word added to the stack, and the Algol array header will now only refer to that portion of the new picture stack that formed the entire picture stack when the call to 'savearray' was made. Hence, after defining further pictures, the user should make another call
savearray (ARRY);
if he wishes to reaccess the picture stack (this point is particularly important if the user wishes to access the new portion of the picture stack).
It is possible to determine which elements of the picture stack are occupied by a specified picture. For example, the programmer wishes to access the save area of the picture FRED: the following program demonstrates, this:
real array A[1:2];
integer I,J,K;
...
savearray(A);
I := hash ('FRED',1);
J := savepointer(I*2);
K := savepointer(I*2+1);
After this, the picture FRED can be accessed as the array elements A[J], A[J+l], ...... ,A[K-l].
This section describes the alternative method of storing plotting information: we start with an example.
It is possible that some part of a frame may behave as a static background which is required to appear on several frames. Rather than having to recompute this information, it is possible to save the orders in an array. For example:
background; scene (1) ; background ; scene (2) ; background ; scene (3) ;
might define a program which produced 3 frames called scenes 1 to 3 with a static background. This could have been written:
start saving (A, 1, 1000); background ; finish saving (A, MAX); scene (1) ; use saved (A, I, MAX); scene (2) ; use saved (A, I, MAX); scene (3) ;
The one dimensional real array A is provided by the user to store the SC4020 orders. The procedure 'start saving' defines the limits of the area of the array to be used - in the example, the SC4020 orders will be stored from A[1] onwards, using as many elements of the array as are required, up to (and including) A[1000]. If an attempt is made to store plotter orders beyond the end of the specified array area (ie if an attempt is made to store more plotter orders than will fit into the specified area) then the saving of plotting information is terminated, and a diagnostic is printed.
The procedure 'finish saving' terminates the saving of plotter orders, and returns in MAX the first free location of the array A not used by the SC4020 orders. The procedure 'use saved' causes the SC4020 orders to be re-output at this point. In the example, the SC4020 orders are saved in the array elements A[1] to A[MAX-1]. Four more array elements are required than the number of SC4020 orders saved.
It frequently happens that the amount of information that is to be saved gradually increases. On one frame a certain amount of graphical output is presented; on a subsequent frame this together with some additional output is to be displayed and so on. The procedure 'use saved and restart' is intended for such situations: the following program indicates how it could be used:
start saving (A,1,10000); scene; finish saving (A,J); advance film; for i:= 0 step 1 until 10 do begin use saved and restart (A,1,J,10000); output addition to scene(i); finish saving (A,J); advance film; end;
The declaration of the procedure 'use saved and restart' is
procedure use saved and restart(A, IST, J, IMX); value IST,IMX,J; integer IST,IMX,J; array A;
A call to this procedure will cause the equivalent action of:
use saved(A, IST, J);
and will then continue storing information in element A[J] onwards, up to element A[IMX]: the error action if an attempt is made to store information beyond A[IMX] is the same as in 'start saving'. After a call to 'use saved and restart', saving is continued until the next call to 'finish saving'.
The user should note that the call:
use saved and restart (A, IST, J, IMX);
is not equivalent to the two calls:
use saved (A,IST,J); start saving(A,J,IMX);
since 'start saving' causes a four element header block to be put in the elements A[J], , A[J+3], whereas 'use saved and restart' causes the header in elements A[IST], . A[IST+3] to be updated. Thus the program
start saving (B,1,1000); .... finish saving (B,MAX);
creates a save area in array elements B[1], B[2], ..... , B[MAX-1].
If this program is followed by
use saved and restart (B,1,MAX,1000); .... finish saving (B,MAXI);
then the save area will now be B[1], B[2], .... , B[MAXI-1] with only one header in B[1], B[2], B[3] and B[4]. If however, the second of these programs was
use saved (B,1,MAX); start saving (B,MAX,1000); ... finish saving (B,MAXI);
then there would be two save areas B[1], B[2], ..... , B[MAX-1] and B[MAXI], ........., B[MAXI-1] with headers in B[1] to B[4] and B[MAX] to B[MAX+3]. In this case, the call
use saved (B,1,MAXI);
will probably cause an execution error when an attempt is made (by 'use saved') to plot the header in B[MAX] to B[MAX+3].
The plotting information can be saved in both relative and absolute modes, as for picture definition: the routines
vector setlast penup topoint storeline parameters
are available - their use and properties are as described in section 7.4.1. However, it is not possible to save a call to procedure 'draw': the calls
draw ('NAME', 1) ;
draw ('NAME' ,-1);
both result in saving either the calls to the procedures called in defining the picture NAME (in relative mode) or the SC4020 orders (in absolute mode). The call
draw ('NAME' , 0) ;
will have no effect. If the call:
draw('NAME' ,3);
is made while saving in relative mode, then the advancefilm orders will not be saved (but will be if the saving is in absolute mode).
Calls to 'start saving' while defining a picture, or calls to 'start def' (or 'def') while saving are not allowed: these conditions are detected, diagnostics are printed, and the offending procedure call is ignored. For example the two programs
start def ('SHAPE1');
vector(1,1,2,2);
start saving(A,1,1000);
vector(2,4,5,6);
fidef;
border;
finish saving(A,MAX);
and
start def('SHAPE1');
vector(1,1,2,2);
start saving(B,1,500);
vector(2,4,5,6);
finish saving(B,MAX);
fidef;
border;
are both equivalent to:
start def ('SHAPE1');
vector(l,1,2,2);
vector(2,4,5,6);
fidef;
border;
Similarly, calls to 'start def' while already defining a picture, or calls to 'start saving' while already saving, are ignored. Thus the program
start saving(A,1,1000); vector(0,0,1,1); start saving(B,1,500); border; finish saving (A,MAX); vector (0,1,0,2); finish saving(B,MAXB); vector(3,2,1,4);
is equivalent to
start saving (A, 1, 1000); vector (0,0, 1, 1); border; finish saving (A,MAX); vector (0,1,0,2); vector (3,2,1,4);
Note however that the program
start saving (A, 1, 1000); vector (0,0,1,1); start saving (B,1,500); border; finish saving (B,MAXB); vector (0,1,0,2); finish saving (A,MAX); vector (3,2,1,4);
will produce indeterminate results. The second call to 'start saving' will be ignored (and produce a diagnostic), and after this call, saving will continue in array A. The first call to 'finish saving' will be executed, but with one unfortunate feature, namely that it will assume (from the array parameter) that plotting information is being saved in B, whereas it is actually being saved in A: this may cause the program to fail.
The programs
start def ('PICA');
vector (0,0, 1, 1);
start def ('PICB');
border;
finish def ('PICA');
vector (4,5,6,7);
finish def ('PICB');
vector (1,2,3,4);
and
start def ('PICA');
vector (0,0,1,1);
start def ('PICB');
border;
fidef;
vector (4,5,6,7);
fidef;
vector (1,2,3,4);
are both equivalent to
start def ('PICA');
vector (0,0, 1, 1);
border;
fidef;
vector (4,5,6,7);
vector (1,2,3,4);
However, the program
start def ('PICA');
vector (0,0,1,1);
start def ('PICB');
border;
finish def ('PICB');
vector (4,5,6,7);
finish def ('PICA');
vector (1,2,3,4);
will produce indeterminate results, since the second call to 'start def' will be ignored, and so when the call
finish def ('PICB');
is executed, the picture being defined is PICA, not PICB.
procedure fraction (I, MAX,RST,RFI,TYPE); value I, MAX, TYPE; integer I, MAX, TYPE; real RST, RFI;
If an object is to be moved from one position to another over MAX + 1 frames then it is necessary to know its position at the Ith frame where I = 0 (1) MAX.
The procedure 'fraction' when called with I and MAX set, will return in RST the fraction of the distance between the starting and final positions that still has to be moved after I frames. The parameter RFI is set to 1-RST.
For example, if a coordinate of the object moves from (XST, YST) to (XFI, YFI) then its position after I frames will be: (XST*RST + XFI*RFI, YST*RST + YFI*RFI). The parameter TYPE is used to define different types of motion
In TYPE = 2,3 the final and initial increments are approximately 0.5π/MAX. This is useful to know if the speed is intended to continue at a constant velocity. When using the procedure 'drawvar', the global parameter FRAM and FRAMEMAX should replace I and MAX in the call of 'fraction'.
It is hoped that the GROATS package defines a fundamental graphic system which can be extended by library routines to cover most user applications. There are a number of library procedures available, as detailed below: additional procedures will be documented as they become available.
Files GR1A, GR1D, GR1P, GR1PA contain source listings of the GROATS system, and are provided for user's reference. The other files contain Algol procedures, held in source form, and may be incorporated into user's programs. They are listed in the order of the filenames, not alphabetical order of procedure name.
These contain source listings of different parts of the GROATS system:
procedure texture(xmn,ymn,xmx,ymx,type,deg); value xmn,ymn,xmx,ymx,type,deg; integer type,deg; real xmn,ymn,xmx,ymx;
The rectangular area in the selected region having opposite corners (xmn,ymn) and (xmx,ymx) will be 'textured' by one of several possible patterns.
The periodicity of the pattern varies according to the setting of the parameter 'deg'. If deg = 0 then the periodicity is 20 raster positions, deg = 1 then 10 raster positions, deg= 2 then 5 and so on. On the hardcopy output, 20 raster positions is about .15 inches.
There are 9 different designs available in the procedure and the one used is determined by the parameter 'type'. These are as follows:
| type | design |
|---|---|
| 0 | No design at all. |
| 1 | Plotting dots aligned by rows. |
| 2 | Horizontal lines. |
| 3 | Vertical lines. |
| 4 | Diagonal lines (bottom left to upper right). |
| 5 | Diagonal lines (top left to bottom right). |
| 6 | Horizontal and vertical lines. |
| 7 | Diamonds formed from the two sets of diagonal lines. |
| 8 | The equivalent of 1 together with itself displaced by .5 of period in each direction. |
The periodicity of the pattern is, in fact, 10*21-deg. Values of 'deg' outside the range 0 to 2 will probably have little value as they produce texture either too course or too fine.
procedure histogram (X,Y,DX,YV,M,N,TYPE,DEG); value X,Y,DX,M,N; integer M,N; real X,Y,DX; integer array TYPE,DEG; real array YV;
The procedure draws axes across the selected region through the point (X,Y). In addition a histogram will be drawn. The interval in the x-direction will be DX. The histogram drawn will have y-values, YV[i] in the interval (X + (i - M) * DX, X + (i - M + I) * DX). The histogram is defined for x-range, (X,X + (N - M + 1) * DX). That is, the function values defined are YV[M] to YV[N]. The Ith interval will be shaded with texture of type TYPE[I]and degree DEG[I]as defined in GR2.
The elements of the histogram may extend either above or below the base line y = Y.
The library item GR2 must also be added to the program when GR3 is used.
procedure conic (X,Y,A,B); value X,Y,A,B; real X,Y,A,B;
The procedure will draw the conic:
(x-X)2/A2 + (y-Y)2/B2 = 1 if A>0, B>0
(x-X)2/A2 - (y-Y)2/B2 = 1 if A>0, B<0
(y-Y)2 = 4A(x-X) if B=0
The units are those of the selected region. For B>0, the curve is cut off as the bounds of the selected region. The procedure uses library item GR5.
procedure curvfunc (F, XMN, XMX) value XMN, XMX; real XMN, XMX; real procedure F;
This procedure draws the curve y = F(x) between XMN and XMX. The function F(x) must be single values between XMN and XMX (XMN <XMX).
procedure curve (C,N,XV,YV); value C,N; integer C,N; real array XV, YV;
The set of points XV[I] , YV[I] for I = O(1)N are joined to form a closed curve if C = 0 and an open curve if C = 1. The points I and I + 1 are joined by the arc of the circle which also goes through the point I + 2. Points can be repeated but no two consecutive points can be identical. (In the case of closed curve, points N and 0 are treated as consecutive). The curve produced will appear smooth if sufficient points are used.
procedure composite histogram (X,Y,DX,YV,M,N,NV,TYPE,DEG); value X,Y,DX,M,N; integer M,N; real X,Y,DX; integer array TYPE,DEG,NV; real array YV;
This procedure is similar to GR3. The procedure draws axes across the selected region through the point (X,Y). In addition a histogram will be drawn. The interval in the X-direction will be DX and the histogram is defined for intervals (X + I*DX, X + (I + l)*DX) where I ranges from M to N.
For each interval I, instead of a single Y value to be plotted, NV[I] different Y values may be given and each sub-part of the histogram may be textured differently. For each interval I, a set of Y-values, YV[I,J] must be given for J = 0 to NV[I] and YV[I,J] > YV[I,J - 1] and YV[I,J] will be shaded with texture TYPE[I,J] and degree DEG[I,J]. (see GR3, section 7.6.3).
The procedure uses the procedure 'texture' defined as GR2.
procedure shade area (XV,YV,N,XMN,YMN,XMX,YMX,TYPE,DEG); value N,TYPE,DEG,XMN,YMN,XMX,YMX; integer N,TYPE,DEG; real XMN,YMN,XMX,YMX; real array XV,YV;
A closed area is defined by the set of points (XV[I], YV[I]) where I = 0(1)N. The point (XV[0], YV[0]} is joined to the point (XV[N], YV[N]). The consecutive points are assumed to be joined by straight lines. The area so defined is textured by a pattern defined by TYPE,DEG. These parameters have the same meaning as in the library item 'texture' defined as GR2.
An even number of vectors that are coincident has the same effect as no vectors so that it is possible to shade figures with holes in or alternatively two distinct figures with the same texture simply by joining the figures with a pair of coincident vectors from any two points. For example a square defined by the points 1, 2, 3, 4 having a triangular hole defined by 5, 6, 7 can be shaded by defining the area to be shaded as 123456754. The procedure only produces the shading. It does not join the edge points of the area by straight lines. The arguments XMN, YMN, MXM, YMX define the limits of the currently selected region.
procedure illustrate (N,XV,YV,XMN,YMN,XMX,YMX,NAREAS,
TYPE,DEG,NVEC,NV,NLINES,NPOINTS,NP);
value N,NAREAS ,NLINES ,XMN,YMN, XMX, YMX;
integer N,NAREAS,NLINES;
real XMN, YMN, XMX, YMX;
real array XV,YV;
integer array TYP,DEG,NVEC,NV,NPOINTS,NP;
This is an extension to GR8 which will allow a whole scene or picture to be produced which consists of several areas to be shaded and several lines to be drawn.
The arrays XV,YV[I : N] contain the coordinates of all the points defining the areas and lines.
The number of areas is defined by NAREAS. The Ith area has texture defined by TYP[I], DEG[I] and is defined by the sequence of points XV,YV[K] where K = NV[I,J] and J = 0(1) NVEC [I]. In addition NLINES lines will be drawn. The Ith line (I = 1(1)N) is drawn between the points (XV,YV[K]) where K = NPOINTS[J] and J = 1(1) NPOINTS[I].
This indirect way of addressing the points which define the object does mean that texturing of a scene with certain characteristics but changing in detail can be achieved by simply changing the set of data values in XV,YV.
The shading is done by using procedure 'shade area' in library file GR8, which must also be included in the program. The values XMN, YMN,XMX,YMX are the limits of the selected region.
procedure contour (XV,M,YV,N,ZV,CV,R); value M,N,R; integer M,N,R; real array XV,YV,ZV,CV;
A mesh is defined by the set of X and Y values, XV[O : M] and YV[0 : N]. At the intersections on the mesh, a function is defined having values ZV[O : M][O : N]. This procedure will attempt to draw the set of contour lines at the function values CV[I : R]. The mesh must be sufficiently fine so that a contour line must not enter and leave a square on the same side.
The contour lines are drawn by using the procedure 'curve' defined as GR6. This joins points together on grid lines which have function values equal to the contour value. These points are found by linear interpolation over each of the grid squares in turn.
The procedure does not draw axes, graticule or scaling. These must be produced by the user.
procedure curve (F,P,A,B,INC,PHI,EPS); value A,B,INC,PHI,EPS; real A,B,INC,PHI,EPS; procedure F; real array P;
This procedure draws the function F in the range A ≤ T ≤ B where T is a parameter from which both the x and y co-ordinates are found by F. P is an array of constants which may be used in the definition of F. The maximum increment of T is INC and this is subdivided recursively until chords in adjacent subdivisions differ in direction by less than PHI radians or the chords are shorter than EPS. The maximum chord length satisfying these conditions is found at all points and drawn. Finite discontinuities of the function and its derivatives will be plotted correctly. F has arguments F(X,Y,T,P).
The procedure was provided by P J le Riche.
procedure fan(x1,y1,x2,y2,x3,y3,x4,y4, density); value x1,y1,x2,y2,x3,y3,x4,y4, density; real x1,y1,x2,y2,x3,y3,x4,y4; integer density;
This procedure will draw a set of lines, 'density' in number, between the two lines (x1,y1) to (x4,y4) and (x2,y2) to (x3,y3). If we consider these two lines as divided into 'density + 1' intervals then the corresponding interior points on each line are joined together to form the set of lines making up the fan.
This set of lines can also be thought of as a set which interpolate between the lines (x1,y1) to (x2,y2) and (x4,y4) to (x3,y3).
procedure wipe (ST1, ST2, FRAMES, FRAMES, TYPE, REGION}; value FRAMES, TYPE, REGION; integer ST1, ST2; integer FRAMES, TYPE, REGION;
This procedure allows the user to change the picture being displayed from ST1 to ST2 in FRAMES + 1 frames. The type of wipe obtained depends on the parameter TYPE. REGION must be set to the number of a region not currently being used.
If TYPE = 1, the new picture will start appearing at the middle and will gradually grow in size until it completely covers the region.
If TYPE = 2, the new picture will start appearing at the outside and will gradually grow in size working towards the middle.
If TYPE = 3, the wipe is from left to right. The new picture appears on the left and gradually moves across the whole plotting area.
It is likely that additional wipes will be added to this routine from time to time. Pictures used in wipe must be relative.
(1) If a single region is to be used for a variety of dark, thick and broken lines, it is sensible to define a standard setting for yourself and define all objects which differ from this standard as separate pictures. For example:
absolute (false);
dark (2);
thick (1);
broken (0);
startdef ('AA' );
vector (0,0,1,1);
finishdef ('AA');
startdef ('BB');
broken (10);
storelineparameters;
vec tor (1, 1 ,2, 2) ;
broken (0);
storelineparameters;
finishdef ('BB');
startdef ('DD');
dark (5);
storelineparameters;
vector (2,2,3,3);
dark (2);
storelineparameters;
finishdef ('DD');
draw ('AA,BB,DD' ,1);
In this case each item drawn will leave the dark, thick and broken parameter settings in the standard form chosen. This will avoid one item having an effect on the definition of another.
(2) The definition of relative pictures can be useful at times. For example:
absolute (false);
setlast (0,0);
startdef ('BIGX');
penup (-1, -1);
topoint (1, -1);
penup (-1, 1);
topoint (1, -1);
penup (0,0);
finishdef ('BIGX');
defines an X which will be drawn centred on the last (X,Y) position drawn. It will leave the setting of the last (X,Y) position the same. Notice that the definition
absolute (false);
setlast (2,2);
startdef ('BIGX');
penup (1,1);
topoint (3,3) ;
penup (1,3);
topoint (3, 1) ;
penup (2,2);
finishdef ('BIGX');
is identical to the one above. The origin defined outside the picture definition can be any value. The only difference is that on leaving the definition, the last (X,Y) position is (0,0) in one case and (2,2) in the other.
The set of orders:
vector (0,0, 1, 1);
draw ('BIGX', -1);
topoint (2,2);
draw ('BIGX', -1);
topoint (3,3);
draw ('BIGX', -1);
will produce a diagonal line with an X situated at the end point of each sub-line making up the complete line form (0,0) to (3,3).
procedure printchar (FONTNU,I,USEFONT); value FONTNU,I,USEFONT; integer FONTNU,I,USEFONT;
Assuming that W = width of character, H = height of character defined in font (FONTNU) this procedure will
FONT 1 CHARACTER 20which will be typed 1n characters from font USEFONT : usually FONTNU is not USEFONT
procedure printfont (FONTNU, USEFONT); value FONTNU, USEFONT; integerFONTNU, USEFONT;
The procedure will print out the complete font FONTNU where each frame of output has the same layout as that described for the procedure printchar. The headings of each frame will use font USEFONT.
procedure revcounter(A,M,N,R); value A,M,N,R; real A; integer M,N,R;
This procedure will print the value of A, with M digits to the left of the decimal point and N digits to the right, in the region R. The size of the characters is such that they just fill the region R. If N = 0 then the decimal point is not printed. M may not be zero: if it is, a diagnostic is printed and M will be set to 1.
The method of printing A is similar to that on a counter. To output A on successive frames with the value of A increasing or decreasing will give the impression that the least significant digit is rotating. When it reaches 9 in counting forward, it causes the next digit to move around and so on.
We should like to thank Stromberg-Carlson for permission to use diagrams appearing in the Programmer's Reference Manual for the SC 4020. (Due to a change in the company's name to Stromberg-Datagraphix, the machine is now referred to as the SD 4020.)
The main facilities available in the GROATS system were developed after reading the literature describing the following systems:
The authors have borrowed ideas from each of these systems. The main influence has been the P.I.B. system. The list of references following are particularly applicable to graphic output systems.