POLYGRAPHICS USER'S MANUAL

Frank Sarno

1967

Polytechic Institute of Brooklyn

Many of the original drawings have been redrawn for clarity while the text is hopefully a rewrite in HTML without change.

TABLE OF CONTENTS

1. INTRODUCTION

1.1 The SC 4020 Graphics Package

This manual describes a package of FORTRAN subroutines which were developed at the Polytechnic Institute of Brooklyn (PIB) to facilitate producing graphical hardcopy and film output on a Stromberg Carlson 4020 computer recorder, The routines in the package are built on ideas and techniques developed in a previous group of routines for the IBM 7040. The project was initiated under the leadership of Dr, Edward Zajac, a visiting professor on leave from the Bell Telephone Labs from September 1966 to September 1967. The project continues under the leadership of Dr. Ludwig Braun. Except where changes Were made for the sake of compatibility with MTS, this manual is virtually the same as the PIB original, written by Frank Sarno.

1.2 Running the POLYGRAPHICS Package in MTS

The POLYGRAPHICS subroutines are found in the public file *PIB, which should be concatenated to the user's load module when invoking the $RUN command. The only job output FDname (the location of SC 4020 plot commands) currently available is a 7 track magnetic tape, This tape should be mounted by the user prior to running his program with the command language invocation $RUN MOUNT, or dynamically by a subroutine call to MOUNT before plotting command generation begins. At any rate, the latest library file description of the tape mounting programs should be consulted for information on specifying the various mounting parameters. The MTS version of POLYGRAPHICS uses the QSAM I/O subroutines, described in the MTS manual, for writing plotting commands on the output tape. These routines require that the I/O FDname be specified rather than assigning it to a logical unit number. The name which has been selected is *PIBTAPE*; accordingly, this is the only acceptable pseudo-device name that can be specified in the mounting instructions. In fact, in the following example, all of the emphasised parameters must be used exactly as given.

$RUN MOUNT PAR = XXXX 7TP, *PIBTAPE*, MODE = 8CV, 
  SIZE = 3024, RING = IN, 'USER'S TAPE NAME', 
  COMMENTS TO OPERATOR. 

Underline in the original document is denoted by emphasis in this HTML version.

Here XXXX represents the user's 4 character tape ID number.

Several comments can appear on the user's printed output. There are a variety of error comments that originate from the subroutines themselves which will be directed to logical unit 6. Normally this would be assigned to *SINK*. Depending upon the subroutines used, some accounting information will also be written on unit 6. For example, if CALL CLEAN is executed, the total number of film and hardcopy frames that have been produced will be reported to the user.

Other error comments which originate from the QSAM routines and, on a higher level, from the buffer manipulating routines will be written on SERCOM. The structure and type of QSAM error comments can be found in the MTS manual and will usually indicate a fundamental tape error, such as a full output tape. When buffer construction has begun, PIB will print the comment

SC 4020 CODE GENERATION HAS BEGUN! 

This does not mean that anything has been written on the tape as yet. At the conclusion of the job *PIB will write

YOU HAVE WRITTEN XXXX FULL 3024 BYTE RECORDS 
PLUS 1 PARTIAL RECORD, WHICH REPRESENTS THE BUFFER 
CONTENTS AT PROGRAM TERMINATION. 
YOU HAVE GENERATED YYYY FRAMES OF FILM AND 
ZZZZ FRAMES OF HARDCOPY. 

In order to obtain this message the last buffer must be dumped by calling WCFDMP directly or by a call to CLEAN, which in turn calls WCFDMP. Failure to call WCFDMP in one way or another results in a loss of the plotting commands that were in the buffer at program termination.

1.3 Processing the Output Tape

Even if the user has a successful *PIB run, he cannot be sure that the commands he has written on the output tape represent a successful movie. For example, there may be scaling errors, positioning mistakes, or simply esthetically undesirable results. Since there is no SC 4020 on campus the problem arises of how to examine the quality of a tape before sending it away for processing. A program has been developed, therefore, that solves this problem and also extends the usefulness of the POLYGRAPHICS package. In the public file *FLIKPLT there is a program which accepts as input the contents of the *PIB output tape, and plots the frames represented thereon in the form of a print plot or a CALCOMP plot. One should note that *FLIKPLT can be thought of as an intermediate processor for producing CALCOMP plots as the end result Since POLYGRAPHICS possesses many features not found in the CALCOMP plotting package (7 graphic arts quality fonts of characters, for example) this feature of *FLIKPLT can be quite useful.

When the user is satisfied that the tape he has produced will result in a successful movie he must send it to an SC 4020 installation. Any such organization with which the user is familiar can process the tape but it is suggested that he avail himself of the low rates offered to academic institutions by the Polytechnic Institute of Brooklyn. Users interested in details of cost and setting up accounts should contact

Professor R. F. Benenati, Director 
Computer Center 
Polytechnic Institute of Brooklyn 
333 Jay Street 
Brooklyn, New York 
Phone: (212) 643-2851 

2. OPTIONS

In many of the subroutines, the user can specify one or more of several tasks the subroutine is to do or one of several ways in which the subroutine can operate. There are generally two devices which the user can employ to specify subroutine operations.

The first device involves varying the number of arguments inserted in the calling sequence. The subroutines test for the number of arguments inserted by the user in the call to determine if the user is attempting to override specifications which the subroutine would otherwise use by default, Since the implementation of this device varies from subroutine to subroutine, the user must read the description of each subroutine to determine what changes in the number of arguments are allowed and how the changes effect the operation of the subroutine.

The second device available to the user is a variable length option string which can be inserted as the last argument in the calling sequence. The variable length option string consists of a sequence of words, separated by commas, terminated by a period and enclosed in apostrophes. The example below shows how a 4-word option string would be inserted in a call to a subroutine:

      CALL ASUB(N,X, Y, 'WORD1,WORD2,WORD3,WORD4.') 

The option string could also be inserted as a Hollerith argument: as follows:

      CALL ASUB(N,X,Y,24HWORD1,WORD2,WORD3,WORD4.) 

where the Hollerith count includes the separating commas and the terminating period. In all the subsequent examples in the manual in which apostrophes are used, one could also use the Hollerith form shown above.

The words which can be used to invoke different options are described in subsequent sections with the descriptions of the subroutine in which they may be used. The option string is frequently represented in the examples by 'OPT.'

The following rules apply when using options in a variable length option string in this package:

  1. the variable length option string must be the last argument in the calling sequence.
  2. the order of the words in the option string is immaterial. For example, the effect would have been the same if the four word option string in the call to ASUB had been written as 'WORD2, WORD1, WORD4, WORD3.' or as 'WORD4, WORD3, WORD1, WORD2. '
  3. words which are not allowable options (e.g., misspelled words) may be accepted during compilation but are ignored during execution.
  4. any repetitions of a legal option word in an option string are accepted during compilation but ignored during execution. For example, 'WORD2, WORD1.' has the same effect as 'WORD1, WORD2, WORD1.'
  5. blanks in the option string are ignored completely except when using the option word PLOT to plot a character,
  6. if two option words with opposite meanings are included in an option string, the subroutine uses the option word which is not the default option.

3. CAMER A SELECTION, FRAME ADVANCES

3.1 Camera Selection

Output may be obtained on either hardcopy or film or both by executing a call to CAMERA('OPT.')

      CALL CAMERA('PAPER.') selects the hardcopy camera. 
      CALL CAMERA('FILM.')  selects the film camera. 
      CALL CAMERA('PAPER, FILM.') selects both cameras. 
      CALL CAMERA('FILM, PAPER.') selects both cameras. 

The option word FRAME may be included in the option string to effect a single frame advance, viz.

      CALL CAMERA('FILM, FRAME.') 

In that case, the camera selection occurs before the frame advance.

3.2 Frame Advances

The subroutine CALL FRAMES(N,'OPT.') allows the user to advance the film selectively in either the hardcopy camera, the film camera or both.

      CALL FRAMES (N) 

advances the film N frames in the camera(s) selected by a call to CAMERA. N is an integer or integer variable.

The user may advance the film in either camera, regardless of the output medium chosen by the last call to CAMERA, by executing

      CALL FRAMES (N,'OPT.') 
      
 where 'OPT.' might typically be
 'PAPER.' or 'FILM.' or 'PAPER,FILM.'
      

The inclusion of PAPER or FILM in the variable option string does not mean that the paper or film camera will replace the camera selection made in a call to CAMERA. For instance, the user may want film output but desire a hardcopy picture every 200 frames. The user could execute

      CALL CAMERA('FILM.') 
to select the film camera and execute 
      CALL FRAMES(1) 

199 times to obtain the film output. Every 200th frame the user should execute

      CALL FRAMES(1,'FILM,PAPER.') 

to obtain the hardcopy and film output. The paper camera is not introduced as a selected camera for the next 199 frames by the last call to FRAMES.

The word FRAME may also be included in the option string. For instance,

      CALL FRAMES(1,'FRAME.') advances the film twice in the camera(s) 
                              selected by a previous call to CAMERA. 

If the hardcopy camera had been chosen,

      CALL FRAMES(1,'FILM.') would advance the film one frame in the film camera, 
      CALL FRAMES(1,'PAPER,FRAME.') would advance the film twice in the hardcopy camera. 
Note that, if 
   N<0, or 
   N>500, or 
   N>2 and PAPER is one of the cameras, or 
   N= floating point, 

then an error message will be given to the effect that an illegal call to FRAMES has been attempted, The value of N as an. integer and a floating point number will be printed. A two frame advance will be executed and then the program will be allowed to continue.

3.3 Identification Frame

An identification frame may be produced on the medium(s) selected by CAMERA by executing

      CALL IDFRAM('/.','line1/line2/..lineN.') 
where 

'/.' is a two character string in which the first character (here a /) will be used to separate lines of text given in the second string, and the second character (here a .) is used to terminate the text given in the second string. 'line1/line2/.../lineN.' is a variable length character string which contains the text the user wishes to display in an ID frame.

The character size of the text on film is large enough to be read by the naked eye. The identification frame may contain up to 13 lines, up to 22 characters per line and up to 255 characters in total. A single frame advance occurs in the execution of the call to IDFRAM.

3.4 Movie Modes

Execution of

      CALL MOVIE 

selects the film camera, draws an arrow pointing in the direction of succeeding frames and generates 250 frames of leader.

Execution of

      CALL CLEAN 

empties the output buffer, generates 250 frames of trailer if a call to MOVIE had been made previously, and draws an arrow pointing in the direction of previously generated frames.

3.5 Emptying the Output Buffer

If one is not operating in the movie mode or it is not desired to generate 250 frames of blank output medium (e.g. when producing hardcopy) the output buffer can be emptied by execution of

      CALL WCFDMP 

prior to program termination.

4. REGIONS, SCALING, WINDOWS, SHIELDS

4.1 Regions and Scaling

The 4 inch by 4 inch square plotting area on the face of the 4020 tube which contains 1024 by 1024 raster points will be called the screen.

The scaling of a rectangular or square plotting area is specified by identifying the coordinate values of the lower left hand corner and the upper right hand corner of the area. Unless the user specifies otherwise, the screen is scaled to coincide with the following area on the x-y plane:

Y 1.00 0.75 0.50 0.25 0.0 (0.0, 0.0) (1.0, 1.0) X 0.0 .25 .50 .75 1.0 SCREEN

With the above scaling by default, the raster point at position (0,0) is given by the screen coordinates (0.0,0.0) and the raster point (1023, 1023) by the screen coordinates (1.0,1.0).

The default scaling for the screen may be overridden by executing

      CALL SCALE(XLL,YLL,XUR,YUR) 

where

XLL and YLL are the coordinates of a point in the x-y plane to be made coincident with the lower left hand corner of the screen, and

XUR and YUR are the coordinates of a point in the x-y plane to be made coincident with the upper right hand corner of the screen.

For example, execution of

      CALL SCALE(10.0,-5.0,35.0,20.) 

would make the screen coincident with the area of the x-y plane shown below:

+Y 25.0 20.0 15.0 10.0 5.0 0.0 -5.0 (10.0, -5.0) (35.0, 20.0) X 5 10 15 20 25 30 35 40 45 50 SCREEN

In addition to the area on the x-y plane corresponding to the screen, the user may define 10 additional areas on the x-y plane. The additional plotting areas are

  1. called regions,
  2. positioned with respect to the screen,
  3. scaled independently of the screen, and
  4. identified by number.

To define a region, execute the statement

      CALL REGION(XLL,YLL,XUR,YUR,NREG,'OPT.') 

where

XLL,YLL
are the screen coordinates of the lower left hand corner of the region,
XUR,YUR
are the screen coordinates of the upper right hand corner of the region,
NREG
is a positive integer by which the region is to be identified in other calls to other subroutines, and
'OPT.'
is a variable length option string.

If the screen has been scaled (0.0,0.0,1.0,1.0) by default and if the two statements

 
CALL REGION(.5,.5,.75,.75,55) 
CALL REGION(0.75,0.0,1.5,0.25,23) 

are executed, the result would be to define regions which were placed with respect to one another and the screen as follows:

+Y 1.00 0.75 0.50 0.25 0.0 (0.0, 0.0) (1.0, 1.0) +X 0.0 .25 .50 .75 1.0 1.25 1.50 1.75 S C R E E N REGION 55 REGION 23

The default scaling for each region is the same as the default scaling for the screen, i.e. (0.0,0.0,1.0,1.0). The complete picture descriptions of regions 23 and 55 in the above example should then be:

+Y 1.00 0.75 0.50 0.25 0.0 (0.0, 0.0) (1.0, 1.0) +X 0.0 .25 .50 .75 1.0 1.25 1.50 1.75 S C R E E N (0,0) (1,1) (0.0,0.0) (1.0,1.0) REGION 55 REGION 23

The user can override the default scaling for a region by executing

      CALL SCALE(XLL,YLL,XUR,YUR,NREG) 

where NREG identifies the region to be scaled, and the other arguments are the lower left and upper right hand coordinates to be used in scaling the region. Changing the scale of a region in this manner does not alter the position of the region with respect to the screen. For example, execution of

      CALL SCALE(5.0,2.0,20.0,17.0,55) 
and 
      CALL SCALE(200.0,100.0,500.0,200.0,23) 

would result in:

+Y 1.00 0.75 0.50 0.25 0.0 (0.0, 0.0) (1.0, 1.0) +X 0.0 .25 .50 .75 1.0 1.25 1.50 1.75 S C R E E N (5,2) (20,17) (200.0,100.0) (500.0,200.0) REGION 55 REGION 23 Point (400,0,150.0) in REGION 23

Note that two-thirds of region 23 is off the screen. Since the 4020 recording cameras are by definition focused on the screen, any plotting attempted on the right hand two-thirds of region 23 would not be recorded. The screen is the window through which we are looking at the x-y plane.

Therefore, an object drawn in region 23 and centered at the coordinates (400.0, 150.0) could be made to slide into view in a film sequence by redrawing the object in a loop in which the x-coordinates for scaling were incremented. A sequence of instructions to do it in 150 frames would look like

      XLL = 200.0 
      XUR = 500.0 
      DO 20 I= 1,150 
      CALL SCALE(XLL,100.0,XUR,200.0, 23) 
      
  (instructions to draw the object and advance the film) 
  
      XLL = XLL + 1.0 
      XUR = XUR + 1.0 
   20 CONTINUE 

4.2 Windows and Shields; Active and Inactive Regions

To define a region, the user executes a call to REGION in which the last argument can be a variable length option string. The option words are WINDOW, SHIELD, ACTIVE and INACT.

All regions are either a window or a shield. All regions are either active or inactive. All defined regions which have not been completely specified are inactive windows by default.

The screen is always active. Only one region in addition to the screen can be active at a time.

If a region is specified as being active, that has the effect of requiring that all line drawing, plotting and text writing routines are to interrogate the region's modality to see if it is a window or a shield and to use that information to determine whether or not to plot in that region.

A region which is specified as a window is a region in which all plotted lines which are on the screen will be seen in the output. If a region is specified as a shield and is an active region, then one would not see on the output the parts of those lines which passed through that region.

For example, region 55 in the previous example could have been specified to be an active shield by defining it in the call to REGION as follows:

      CALL REGION(0.5,.5,.75,0.75,55,'SHIELD,ACTIVE.') 

Thus a portion of the line drawn diagonally on the screen from the lower left to the upper right would be shielded to give

If the screen were a shield and region 55 were an active window, the same line drawn on the screen would give

There are four ways in which the mode of a region can be changed after the region has been defined. It can be made an active window or shield by executing

      CALL ACTIVE(NREG,'OPT.') 

where the option words allowed are WINDOW or SHIELD. To make the active region inactive, execute

      CALL INACT(NREG). 

No matter what region number is used in the call to INACT, the active region, if there is one, will be made inactive. The screen always remains active.

The user can also

      CALL SHIELD(NREG, 'OPT.') 
or
      CALL WINDOW(NREG, 'OPT.') 

where the option words allowable are ACTIVE or INACT.

If any of the last four subroutines are called without the 'OPT.' argument, the region referenced retains the other modal qualities not changed. For example, if region 3 is an inactive shield, executing

      CALL ACTIVE(3) 

makes region 3 an active shield.

4.3 Nonlinear Scale Options

To invoke the use of a nonlinear scale in a region, the call to SCALE may be executed with an option string included as the last argument, viz.

      CALL SCALE(X1,Y1,X2,Y2,NREG.'OPT.') 

where the option string 'OPT.' may include the option words

LOGX     LOGY      LINEAR 

If LOGX is used, the natural logs of X1 and X2 are used to compute a log scale for the x-axis in the region NREG. If LOGY is used, the natural logs of Y1 and Y2 are used to scale the y-axis in the region NREG. If either LOGX or LOGY is used by itself, a semilog scaling for the region results. Using both LOGX and LOGY gives a log-log scaling for the region. If a nonlinear scale is desired for the screen, set NREG equal to zero.

To return to linear scaling for a region, execute a call to scale with the option word LINEAR.

If a call to SCALE is executed without having included any options, all previously specified options will be kept.

4.4 Retrieving Scale and Raster Point Coordinate Values

Suppose that XIN and YIN represent the coordinates of a point in terms of the scaling in force for the screen or a region NREG. The corresponding raster point coordinates may be retrieved as floating point numbers x, y by executing

      CALL CONRAS(XIN,YIN,x,y) 
or 
      CALL CONRAS(XIN,YIN,x,y,NREG) 

If a log scale is being used for the x and/or the y-axis, the routine CONRAS first computes log(XIN) and/or log(YIN), finds where that point is drawn on the screen and returns the corresponding raster point coordinates.

Conversely, one may have the raster point coordinates of a point XI and YI and wish to convert to the corresponding floating point coordinates in terms of the scaling in force. To convert raster point coordinates XI, YI to scaled screen or region coordinates x, y execute

      CALL CONSCA(XI,YI,x,y) 
or 
      CALL CONSCA(XI,YI,x,y,NREG)

5. DRAWING LINES AND PLOTTING DATA

Five routines are available for drawing lines and plotting data. They are

      CALL DRAW...) 
      CALL LINES(...) 
      CALL LINE(... ) 
      CALL EZPLOT...) 
      CALL MPLOT(...) 

5.1 CALL DRAW

Let X and Y be two N-dimensioned arrays containing coordinate values of N points. There are several ways the DRAW subroutine can be called. They are:

(a) CALL DRAW(N,X,Y) 
(b) CALL DRAW(N,X,Y,NREG) 
(c) CALL DRAW(N,X,Y,NREG,'OPT.') 
(d) CALL DRAW(N,X,Y,NSTRK,'OPT.') 
(e) CALL DRAW(N,X,Y,NREG,NSTRK,'OPT.') 

where the options allowed are

FRAME   CLOSE          STRIKE (required if (d) or (e) is used)
PAPER   CONNECT        EXTEND
FILM    PLOT(char)     CONTAIN

Execution of (a) above will draw (N-1) lines on the screen connecting

X(1),Y(1)     to   X(2),Y(2) 
x(2),Y(2)     to   X(3),Y(3) 
...
X(N-1),Y(N-1) to   X(N),Y(N)

The above operation of the routine corresponds to using by default the option called CONNECT. If the form (c) or (e) is used to draw on the screen, NREG must be set equal to zero.

FRAME, PAPER, FILM OPTIONS

The lines will be recorded by the camera previously selected by CALL CAMERA or CALL MOVIE. If form (b) of the call to DRAW is used, the option PAPER or FILM may be invoked to temporarily choose an additional camera on which to record the output. In that case, the camera selection takes place before the lines are drawn. After the lines are drawn, the FRAME option will advance the film in all cameras which recorded the output.

CLOSE, CONNECT, PLOT OPTIONS

The options CLOSE, CONNECT and PLOT should be considered together. When none of the three is invoked, CONNECT is assumed. That is, points 1 through N are connected by straight lines.

The option CLOSE 'closes' the figure constructed by connecting point N to point 1. Whenever CLOSE is invoked as an option, CONNECT is assumed.

The option PLOT (char) causes the character enclosed in parentheses to be displayed at the points X(1),Y(1) through X(N),Y(N). The size of the character is determined by the X1Y1 values set by the subroutine SETSIZ. The routine SETSIZ allows specifications for letter sizes to be set separately for each region; that routine is described in a later section. The first character following the left parenthesis in the option PLOT(char) is the character used as the plotting character even if it is a blank. This is the only case in which a blank in. the option field is not totally ignored.

If PLOT(char) is specified and neither CONNECT nor CLOSE is specified then CONNECT is not assumed. Only the character will be displyed. The lines connecting the points will not be displayed. However, if PLOT(char) is specified, and either CONNECT or CLOSE is specified, then both the character and the lines are displayed.

If N is 1 in a call to DRAW, the following variations are possible:

  1. If CLOSE is not specified, no lines are drawn.
  2. If neither CLOSE nor PLOT(char) is specified, nothing is displayed on the screen.
  3. If CLOSE is specified, a line connecting the point to itself (i.e. a point) is displayed in addition to the character if PLOT(char) is specified.
  4. If FRAME is included in the option string, a frame advance will be executed regardless of what is plotted.

If N is 0, the subroutine generates a return immediately. The options are not interrogated. Therefore a frame advance will not take place even if specified in the option string.

STRIKE, EXTEND, CONTAIN OPTIONS

In a call to DRAW which takes the form of (c) or (e), the argument NREG must be an integer or an integer variable. The same holds for NSTRK which appears in (d) and (e). When the option STRIKE is used in the 'OPT.' argument, the argument NSTRK must immediately precede the option string in the calling sequence. NSTRK is the number of overstrikes to be made in this call to DRAW. The overstrikes apply to both lines and characters which are being drawn. If NSTRK is zero or negative, no lines are drawn but a frame advance will take place if optionally called for.

If a region is specified in the call to DRAW, all the previous rules apply except that lines, points and characters will now be plotted with respect to the scaling in force for the region NREG. Although the region NREG may overlap only a portion of the screen, the scale coordinates for the region will be extrapolated to the limits of the screen to allow drawing lines beyond the limits of NREG if the coordinate values in X and Y so dictate. This manner of operation when drawing lines and characters in a region corresponds to the default option EXTEND. When drawing the lines and characters, the modality of the active region and of the screen is observed.

If the user does not want the scaling for the region to be extrapolated to the limits of the screen, the option CONTAIN should be invoked. Under that option, no lines will be extrapolated beyond the region boundary. Should the boundary cut through a character to be drawn, only that part of the character which is inside the region will be drawn. If an active region overlaps the region specified in the call to DRAW, the modality of the overlapping region will be observed.

The only way to override an active region is to make the region inactive.

5.2 CALL LINES

Let X1, Y1, X2 and Y2 be M-dimensioned arrays. The ways in which LINES may be called are as follows:

(a) CALL LINES(N,X1,Y1,X2,Y2) 
(b) CALL LINES(N,X1,Y1,X2,Y2,NREG) 
(c) CALL LINES(N,X1,Y1,X2,Y2,NREG,'OPT.') 
(d) CALL LINES(N,X1,Y1,X2,Y2,NREG,NSTRK,'OPT.') 

where 'OPT.' may include EXTEND, CONTAIN, FRAME, PAPER, FILM and STRIKE. The argument N must be no larger than M. Execution of (a) will result in N straight lines connecting

X1(1),Y1(1) to X2(1),Y2(1)
X1(2),Y1(2) to X2(2),Y2(2)
.....
X1(N),Y1(N) to X2(N),Y2(N)

Subscripts can be inserted in the arrays X1, Y1, X2 and Y2 to start drawing lines from some place beyond the beginning of the arrays. Lines will be drawn for N successive positions in the arrays.

All the options have the same meaning as described for the routine DRAW except for the case in which the user wants to use the strikeover option. The only way to indicate the number of overstrikes desired is by making use of form (d) for calling lines. Therefore, if the overstrike is desired while drawing on the screen, then the user must enter a value of zero for the argument NREG.

As with the routine DRAW, if N = 0, no lines are drawn and the options are not looked at (i.e., no frame advance occurs even though specified as an option).

5.3 CALL LINE

CALL LINE is identical to CALL LINES except that the argument N is omitted. CALL LINE is used to draw a single line between the coordinates X1, Y1 and X2, Y2. The other arguments NREG, NSTRK, and 'OPT.' follow the same rules as described in LINES.

5.4 CALL EZPLOT

Two routines, EZPLOT and MPLOT, are contained in the Polygraphics package to allow generating plots of data on scaled and labelled graphs with a minimum of effort.

The routine EZPLOT may be called in the following ways:

a) CALL EZPLOT(N,X,Y) 
b) CALL EZPLOT(N,X,Y,NREG) 
c) CALL EZPLOT(N,X,Y,NREG,'OPT.') 
d) CALL EZPLOT(N,X,Y,NREG,'OPT.','XUNIT','YUNTT') 
where 

   N    is the number of points to be plotted 
   X    is the array of x values 
   Y    is an array of y values 
   NREG is a region number (zero if the screen) 
   XUNIT and YUNIT represent sequences of up to 8 characters 
   which are to be printed along the x and y-axis respectively. 

and where the option words which may be included in the option string 'OPT.' are

LOGX    LINEARX     NOLABEL     NOPLOT
LOGY    LINEARY     NOGRID      UNITS

If form c) or d) is used and the area to be drawn on is the screen, set NREG equal to zero. For the option words:

LOGX, LOGY
these option words, if used, invoke logarithmic scaling for the x-axis and/or y-axis. This means that the data in the X and Y arrays is to be plotted using the log scales specified. These options are the same as the LOGX and LOGY options allowable in the call to SCALE. Therefore, negative values are not permitted in the X and/or Y arrays if. LOGX and/ or LOGY is to be used. Illegal negative values will result in no plot.
LINEARX, LINEARY
must be used to return to linear scaling if the last plot used log scaling.
NOLABEL
deletes the labels (the numbers next to the tic marks on the grid) from the graph and uses the extra space to draw a larger grid.
NOGRID
deletes the grid and the labels.
NOPLOT
deletes the plot so that the routine can be used to create grids.
UNITS
is required if the arguments XUNIT and YUNIT are to be included as shown in form d). The subroutine then uses up to the first 8 characters of the arguments to annotate the x and y-axis.

NOTE:

  1. the scales are automatically set so that the grid spacing is 1., 2., or 5. multiplied by a power of 10.
  2. the tic mark labels are printed out in a format equivalent to the FORTRAN 1PE11.5. The labels always take up a fixed space. If the plotting region is too small, the labels will dwarf the plot itself.
  3. the region numbers -l and -2 are reserved for plotting purposes when using EZPLOT. Region -1 is the region that is scaled for the drawing to be made in (as opposed to the region for the tic mark labels). Consequently one may retrieve the raster point coordinates of a point or convert absolute raster point positions to coordinates in terms of the scaling used by EZPLOT by calling CONRAS or CONSCA witb a region number of minus one.
  4. EZPLOT observes the mode of the active region.
  5. If one attempts to plot more than 8 characters to annotate the x and y-axis, the x-axis annotation will go off the plot and not be seen and the y-axis annotation will overprint on the grid.

5.5 CALL MPLOT

In order to plot several graphs on one grid, use the routine MPLOT in one of the following ways:

a)  CALL MPLOT(M,N,X,Y) 
b)  CALL MPLOT(M,N,X,Y,NREG) 
c)  CALL MPLOT(M,N,X,Y,NREG,'OPT.') 
d)  CALL MPLOT(M,N,X,Y,NREG,'OPT.','XUNIT*','YUNIT*') 
where
M   is the number of sets of points (or the number of graphs) 
N   is an array of at least dimension M where the i'th element 
       is the number of points in the i'th graph, 
X   is an array of all the x values for all the graphs, 
Y   is an array of all the y values for all the graphs 

and the rest of the arguments are the same as for EZPLOT.

For example, if M is 3, and if N is 5,10, 5, then X(1), Y(1) through X(5), Y(5) are the points of the first graph, X(6), Y(6) through X(15), Y(15) are the points of the second graph, and X(16), Y(16) through X(20), Y(20) are the points of the third graph.

The NOPLOT option does not work with MPLOT.

6. LABELING ROUTINES

The size and position of all letters and characters are fixed by specifying two pairs of values X1,Y1, and X2,Y2 as shown in the sketch below

0 X2 X1 Y1 Y2

where the distances X1 and Y1 are the width and height of a single character and the distances X2 and Y2 are the dimensions of the box within which the character will be centered. The boxes for successive characters in a line abut. The boxes for characters on successive lines abut. Therefore, X2 is the distance between corresponding points on successive letters in a row and Y2 is the distance between corresponding points on successive lines.

The routines available for varying the size of characters to be drawn and for displaying text are:

1)    CALL SETSIZ 
2)    CALL RASSIZ 
3)    CALL LETTER 
4)    CALL JCTEXT 
5)    CALL TYPE 

The routine SETSIZ allows the user to set the size and spacing of letters for a region or the screen. It interprets X1, Y1, X2 and Y2 values in terms of the scaling of the plotting area to compute the actual raster point letter size and spacing that will be used to construct the characters. The. routine RASSIZ can also be used to set the size and spacing of characters for a region or the screen. In this case, the X1, Y1, X2 and Y2 values are the actual raster point dimensions that will be used to construct characters. The routine LETTER is designed to allow constructing a sequence of variable length lines in which all lines are positioned with respect to the position of the first letter of the first line in the manner of an unindented paragraph. The routine JCTEXT is designed to allow centering of text in a plotting area or justification of text in any one of four directions.

Any character which appears on the 026 keypunch can be used in text to be constructed by LETTER and JCTEXT. The characters normally obtained are stick characters shown in section 6.5.A. The other character fonts which may be chosen and how they may be italicized are described in sections section 6.5.A through section 6.5.D.

The routine TYPE may be used to obtain fixed size CHARACTRON characters.

The active region and the mode of the screen are both considered in constructing characters.

6.1 CALL SETSIZ

The routine SETSIZ allows the user to set the size and spacing of characters for a region or the screen. The values X1, Y1, X2 and Y2 in the sketch below

X2 X1 Y1 Y2

may be set for any region NREG by executing

      CALL SETSIX(NREG,X1,Y1,X2,Y2)

where the floating point arguments are converted in terms of the scaling of the region to corresponding raster point dimensions. To use SETSIZ for the screen, set NREG equal to zero.

If the user does not avail himself of SETSIZ, the character sizes assumed for all regions are

X1 = 12/1023  Y1 = 18/1023
X2 = 1.5*X1   Y2 = 1.5*Yl 

and for the screen the character sizes are 12 by 18 raster points on the default scale of (0.0,0.0,1.0,1.0).

The user can change the character sizes and retain the same proportional spacing by executing

      CALL SETSIZ(NREG,X1,Y1) 

in which case the subroutine sets X2= 1.5*X1 and Y2=1.5*Y1, or by executing

      CALL SETSIZ(NREG,X1) 

in which case the subroutine sets Y1 =X1*1.4 and computes X2 and Y2 again as one and a half times the X1 and Y1 values.

6.2 CALL RASSIZ

The routine RASSIZ can be used to set the size and spacing of characters for a region of the screen. To use it, execute

      CALL RASSIZ(NREG,IX1,IY1,IX2,IY2) 

where the character dimensions may be integers or integer variables. The arguments are the actual raster point dimensions that will be used to construct the characters in the region specified.

The routine is useful in keeping the size. of characters constant on successive frames generated by a loop in which the scaling is changing for each frame.

All the variations which may be used in calling SETSIZ may also be used in calling RASSIZ.

6.3 CALL LETTER

The routine LETTER is designed to allow constructing a sequence of variable length lines in which all lines are positioned with respect to the position of the first letter in the first line in the manner of an unindented paragraph. The ways in which this routine may be executed are:

a)      CALL LETTER(X0,Y0,'/.',;string')
b)      CALL LETTER(X0,Y0,'/.',;string','OPT.')
c)      CALL LETTER(X0,Y0,'/.',;string',NREG,'OPT.')
d)      CALL LETTER(X0,Y0,'/.',;string',NSTRK,'OPT.')
e)      CALL LETTER(X0,Y0,'/.',;string',NREG,NSTRK,'OPT.'))

where X0, Y0 are the coordinates of the center of the first character,

'/.' represents a general two character string as described in section 3.3.

'string' represents the text characters (see section 3.3) and 'OPT.' can contain

EXTEND   PAPER   STRIKE
CONTAIN  FILM
         FRAME

The rules for using NREG and NSTRK apply just as they do for the subroutine CALL LINES.

If the size of the text characters and the number to be constructed on a given line are such that the line will not fit on the screen, then the characters at the end of the line will be lost.

If the user wants to include the apostrophe as a text character, then the Hollerith form of the argument must be used for 'string'. Up to 255 characters may be used in 'string'.

6.4 CALL JCTEXT

The routine JCTEXT is designed to allow centering of text in a plotting area or justification of text in any one of four directions. The ways in which it may be executed are:

a)      CALL JCTEXT('/.','string')
b)      CALL JCTEXT('/.','string','OPT.')
c)      CALL JCTEXT('/.','string',NREG,'OPT.')
d)      CALL JCTEXT('/.','string',NSTRK,'OPT.')
e)      CALL JCTEXT('/.','string',NREG,NSTRK,'OPT.')

where the two character string and 'string' are to be used as defined previously (section 3.3). The use of the options follows the rules set down previously for CALL LINES and where the options. allowed are

PAPER    STRIKE    LEFT
FILM               RIGHT
FRAME              UP
                   DOWN
                   FILL
                   RESTORE

If none of the options LEFT, RIGHT, UP or DOWN are included in the option string of the CALLJC TEXT, the subroutine centers the text in 'string'. The character sizes are determined by previous calls to either SETSIZ or RASSIZ or by default dimensions described in section 6.1 and 6.2. For example, with a suitable scaling

      CALL JCTEXT('/.','SEE WHERE/I/GO/NOW.') 

would produce the text centered on the screen as follows:

SEE WHERE I GO NOW

In another example, with the same suitable scaling, using the option LEFT, and using different characters in the two character string, Le.

      CALL JCTEXT('AB','SEE WHEREAIAGOANOWB','LEFT.') 

would produce on the screen

SEE WHERE I GO NOW

with the option UP, one gets

SEE WHERE I GO NOW

Similarly, if the option RIGHT or DOWN are used, one would get

SEE WHERE I GO NOW or SEE WHERE I GO NOW

In the previous four examples, the stored parameters X1, Y1, X2 and Y2 which are referenced in constructing the proper character sizes remain unchanged.

If the routine is called as follows

      CALL JCTEXT('./'.'SEE WHERE.I.GO.NOW/','LEFT,RIGHT.') 

the routine computes a new value for X2 to use and it produces on the

SEEWHERE I GO NOW

The new value for X2 remains in effect unless the option RESTORE is also included in the option string. If the option word RESTORE is included in the option string, the new value for X2 remains in effect only temporarily during the execution of this call to JCTEXT. If the routine is called with the options UP and DOWN, it computes a new value for Y2 and produces on the screen

SEE WHERE I GO NOW

Again the new value for Y2 will remain in effect unless the option RESTORE is also used. A call to the routine with the option FILL yields

SEE WHERE I GO NOW

with new values for X1, Y1, X2 and Y2 being computed and remaining in effect unless the option RESTORE is also used.

Up to 30 lines may be included in the text to be displayed. The total number of characters permitted in 'string' is 255.

6.5 Selecting Character Fonts

Unless the user specifies otherwise, all characters displayed using JCTEXT and LETTER are stick characters. The stick characters obtained by default will be referred to as the 'NORMAL' character set. In addition to the NORMAL character set, there are seven other sets which the user may select. The seven additional character sets are referred to as FONTl, FONT2, FONT3, ... , FONT7.

Each of the Fonts may be changed in size by appropriate calls to RASSIZ or SETSIZ in the same way that the NORMAL characters are changed in size.

All eight character sets may be italicized to varying degrees. Finally, the user may choose constant size CHARACTRON characters for displaying text.

The characters in each font, the method of selecting them, the character spacing options available, the way to invoke italicization and how to produce CHARACTRON characters are all described in the following subsections.

6.5.A The Characters in Each Font

The NORMAL characters and each of the seven fonts are displayed in eight tables. The character size in each table is the same and was obtained by first executing

CALL RASSIZ(0,27,27,47,47) 

While inspecting the fonts, the following should be noted:

  1. The number of lines used to construct the characters in fonts 1 and 2 are greater than the number of lines used to construct the characters in fonts 3 and 4. Therefore text characters produced with fonts 1 and 2 are going to be darker than the same size characters produced using fonts 3 and 4.
  2. Font 2 represents the lower case letters that correspond to the capitals that appear in Font 1.
  3. Font 4 represents the lower case.letters that correspond to the capita.ls that appear in Font 3.
  4. Fonts 5 and 6 are capital and lower case Greek letters respectively.
  5. Font 7 is a set of special characters.
Table 6.1 - NORMAL Character Set Stick Characters
Table 6.2 - FONT1
Table 6.3 - FONT2
Table 6.4 - FONT3
Table 6.5 - FONT4
Table 6.6 - FONT5
Table 6.7 - FONT6
Table 6.8 - FONT7

6.5.B How to Select a Particular Font

To change to a particular font, the user must execute a call to the subroutine CHARF. For instance, to change from the NORMAL font to FONT1 characters, the user must execute

      CALL CHARF(FONT1)

Each font which is invoked by the user's program must be previously identified in an external statement. This method of use is adopted to prevent the loading of unused fonts into storage. For instance, to use fonts 1, 4 and 6, the following sequence of statements could be used:

      EXTERNAL FONT1 
      EXTERNAL FONT4 
      EXTERNAL FONT6 
      CALL JCTEXT('/.','STICK CHARACTERS WILL BE USED.') 
      CALL CHARF(FONT1)  
      CALL JCTEXT('/.','FONT1 CHARACTERS WILL BE USED.') 
      CALL CHARF(FONT4) 
      CALL JCTEXT('/.','FONT4 CHARACTERS WILL BE USED.') 
      CALL CHARF(FONT1) 
      CALL JCTEXT('/.','BACK TO FONT1.') 
      CALL CHARF(FONT6) 
      CALL JCTEXT('/.','NOW USING FONT6 CHARACTERS.') 
   . . . .

The previous eight tables showed the characters available in each set. The text character which must be keypunched to produce a particular character in one of the fonts is the text character which appears in the corresponding position of he table of NORMAL characters. For instance, the last call to JCTEXT in the illustration used FONT6 characters. Therefore the sequence of characters printed would have been

6.5.C Options with Subroutine CHARF

The subroutine CHARF may be executed with two arguments where the second argument is the option string, viz.

      CALL CHARF(FONT,'OPT.') 

where the options allowed are

BOXED    CLEAR    XALIGN    SPACED
FREE     NORMAL   YALIGN

Unless the user specifies otherwise, the characters are BOXED according to the values in existence for the parameters X1, Y1, X2 and Y2 described in section 6.1. Since the characters in the fonts have greatly varying widths, their appearance may be greatly improved if they are SPACED according to their width. Use of the option SPACED instructs the routines to calculate the spacing of each character: Use of the option BOXED negates the spaced option to allow the user to return to the BOXED method of spacing characters.

The NORMAL option should be used to return to using the stick characters. When this option is used, the first argument may be anything, viz.

      CALL CHARF(XYT,'NORMAL.') 

The argument XYT will be ignored by the subroutine.

If the width to height ratio of the characters is distorted due to the scaling of the region in which the characters are being drawn, the appearance of the characters may suffer. The option XALIGN causes the routines to take the width and calculate the height. The option YALIGN causes the routines to use the height to calculate the width. The option FREE instructs the routines to stop the X or Y alignment and to resume using the scaling specifications in force for the region in which the characters are being drawn.

The option CLEAR sets both the BOXED and FREE mode. Initially the mode is clear for the NORMAL character set and the fonts. If one of the fonts is called by the subroutine CHARF and one or more of the modes SPACED, XALIGN or YALIGN is invoked, the mode stays in force for the font even when the NORMAL option is used to return to the stick characters.

In summary:

NORMAL option negates  CALL CHARF(FONTn)
BOXED  option negates  SPACED option
FREE   option negates  XALIGN and/or YALIGN options
CLEAR  option negates  SPACED, XALIGN and/or YALIGN options

6.5.D Italicizing the Fonts

The italicization of NORMAL or FONT characters may be invoked by including in the option in a call to CHARF the option word ITALICS. For instance, to obtain italicized characters from FONT3 by subsequent calls to JCTEXT or LETTER, one should first execute

      CALL CHARF(FONT3,'ITALICS.')

The angle of tilt assumed for the italicized characters is 15 degrees to the right. The user may adjust the angle of tilt to another value by executing

      CALL ITALIC(MANG) 

where MANG may be any value between -60 and +60 degrees of tilt from the vertical. A call to the routine ITALIC will not give italics unless the option word ITALICS is included. For instance, one would obtain a 25° italicization of whatever character set was being used by executing

      CALL ITALIC(25,'ITALICS.')

One may revert back to non-italicization of the character set being used by executing either

      CALL ITALIC(0) 

or by using the option word NOITALICS in the execution of

      CALL ITALIC(MANG,'NOITALICS.') 
or  
      CALL CHARF(FONT,'NOITALICS.')

6.5.E CHARACTRON Characters and CALL TYPE

CHARACTRON characters may be obtained by executing calls to the subroutine TYPE in the following ways:

a)      CALL TYPE(X,Y,'/.','text') 
b)      CALL TYPE(X,Y,'/.','text', NREG) 
c)      CALL TYPE(X,Y,'/.',BCDVAR) 
d)      CALL TYPE(X,Y,'/.',BCDVAR, NREG) 

where

X,Y are the coordinates of where the middle of the first character on the first line will be positioned, with respect to the screen or region NREG if included.

'/.' is a two character string as defined in section 3.3 except that when the / is encountered in the text, a carriage return is executed to the x-coordinate X.

'text' represents the string of characters to be printed using CHARACTRON characters.

BCDVAR is a variable in which a series of characters to be printed has been stored using A-type FORTRAN.format. Typically it would be the first position in a dimensioned array.

NREG is the number of the region with respect to which the coordinates X,Y are used in placing the position of the first character of the text.

A maximum of 150 characters per line may be printed. If this limit is exceeded, an automatic carriage return is executed to begin typing the next line in the leftmost position of the screen. Any character on the 026 punch may be printed. The spacing between lines is 16 raster points.

7. MAN1PULATING REGIONS

There are several ways the user may manipulate a region which has been previously defined by the CALL REGION command described in section 4.1. Those ways are enumerated below.

  1. A region which is already defined by a CALL REGION command may be repositioned with respect to the screen by executing another CALL REGION command in which the same region number is used. In this case the existing scale for the region is retained and is moved with the region to the new region position.
  2. A region may be moved to a new position with respect to the screen by executing CALL MOVE(...). In this case scaling coordinates for the lower left and upper right corner of the region at its new position are computed by extrapolating the scale values of the region at its previous position.
  3. A previously defined region and its scale may be rotated by executing CALL ROTATE(...).
  4. A rotated region can be restored to its unrotated position by executing CALL RESTORE( ... ).
  5. All regions can be repositioned with respect to the camera by rescaling the screen.
  6. Finally, a region may be removed from the list of defined regions by executing CALL REMOVE(... ).

7.1 Repositioning a Region with CALL REGION

The user may reposition a region already defined by executing

      CALL REGION(XLL,YLL,XUR,YUR,NREG)

This redefines the region at a new position in the xy-plane. The region is repositioned with respect to the screen. The options may be used in the call just as they could be used when defining the region originally. If the options are not used

  1. the scaling of the previously defined region is retained in its new position,
  2. the mode of the repositioned region i.s retained. If it was active, it is still active. If it was a window, it is still a window.
  3. If the region had been rotated (by routines to be described in section 7.3), the rotation is retained.

For example, if the screen is scaled (0.0,0.0,10.0,10.0), a region
previously defined by CALL REGION(2.0,2.0,12.0,12.0,17) and scaled
by CALL SCALE(100.0,100.0,200.0,200.0,17) would appear as

0 2 4 6 8 10 12 2 4 6 8 10 12 14 16 SCREEN (100.0, 100.0) (200.0, 200.0) REGION 17

Region 17 could be repositioned by executing

      CALL REGION(2.0,2.0,15.0,7.0,17) 

to give

0 2 4 6 8 10 12 2 4 6 8 10 12 14 16 SCREEN (100.0, 100.0) (200.0, 200.0) REGION 17

7.2 Moving a Region with CALL MOVE

A region can be moved to a new position by executing

      CALL MOVE(XLL,YLL,XUR,YUR,NREG) 

where the coordinates XLL, YLL, XUR, YUR, NREG are defined with respect to the scaling of the region being moved. For example, if region 17 is once more defined as

0 2 4 6 8 10 12 2 4 6 8 10 12 14 16 SCREEN (100.0, 100.0) (200.0, 200.0) REGION 17

execution of CALL MOVE(100.0,100.0,230.,150.,17) would give

0 2 4 6 8 10 12 2 4 6 8 10 12 14 16 SCREEN (100.0, 100.0) (230.0, 150.0) REGION 17

7.3 Rotating a Region with CALL ROTATE

To rotate a previously defined region execute

      CALL ROTATE(NREG,THETA,X0,Y0) 

where

NREG = number of the region to be rotated

THETA = degrees the region is to be rotated counterclockwise

X0,Y0 = coordinates of the point about which the region is to be rotated where X0,Y0 are specified with respect to the scaling of the region to be rotated.

Successive calls to ROTATE in the form given above will reset the region and rerotate it about the point X0,Y0.

The call to ROTATE may also be made with the arguments X0,Y0 omitted, viz.

CALL ROTATE (NREG, THETA) 

If called with the arguments X0,Y0 omitted, the routine

  1. will rotate an unrotated region about its center, and
  2. will continue to rotate a region which is already rotated. The rotation will be continued about the point about which rotation had already occurred,

For: instance, suppose region 17 is scaled and defined to occupy the position on the x-y plane shown below

0 2 4 6 8 2 4 6 8 10 12 14 16 (100.0, 100.0) (230.0, 150.0) REGION 17

The sequence of calls

      CALL ROTATE(l7,90.0,100.0,100.0) 
      CALL ROTATE(17,45.0,230.0,100.0) 
      CALL ROTATE(17,90.0) 

would place the region in the three successive positions shown below.

-8 -6 -4 -2 0 2 4 6 8 10 12 14 2 4 6 8 10 12 14 16 18 20 22 (100.0, 100.0) (230.0, 150.0) REGION 17
-8 -6 -4 -2 0 2 4 6 8 10 12 14 2 4 6 8 10 12 14 16 18 20 22 (100.0, 100.0) (230.0, 150.0) REGION 17
-8 -6 -4 -2 0 2 4 6 8 10 12 14 2 4 6 8 10 12 14 16 18 20 22 (100.0, 100.0) (230.0, 150.0) REGION 17

The rules governing the use of CALL ROTATE are summarized below:

  1. The scaling of the region is retained with the region in the rotated position.
  2. The attributes of the region are retained by the region in its rotated position. If the region was active, it remains active. If it was a window, it remains a window.
  3. If CALL ROTATE(...) is executed with positive values for the angle THETA, the rotation is counterclockwise. If negative values for THETA are used, the rotation is clockwise.
  4. If a call to rotate is made with the four arguments, the region is rotated THETA degrees from ifs normal (unrotated) position. This applies regardless if the region is in a rotated position at the time the CALL ROTATE (4 arguments)is made.
  5. If the coordinate values X0,Y0 are omitted in the call and the region is in an unrotated position, the routine assumes the rotation is to be made about the center of the region.
  6. If the coordinates X0,Y0 are omitted and the region is in a rotated position, the rotation is additive, i.e., the region is rotated THETA degrees from its rotated position about the same point.
  7. If a rotated region is repositioned by a CALL REGION command, the region remains rotated in its new position.
  8. If a rotated region is moved by a CALL MOVE command, the region remains rotated in the position to which it was moved.
  9. The screen cannot be rotated.
  10. If the screen is rescaled, all rotated regions remain rotated.
  11. When a region has been rotated about its center by execution of the call to ROTATE with only 2 arguments, subsequent changes in scale while the region is rotated will change the position on the screen of the center of the originally scaled region. Therefore a pan at an angle will not produce the intended effects. Right the region first, change the scale and then rotate it to where it was.

7.4 CALL REST0R

A rotated region can be restored to an unrotated position by executing

      CALL RESTOR(NREG). 

Nothing but the rotation of the region is changed by executing this command.

7.5 CALL REMOVE

A region can be removed from the list of defined regions by executing

      CALL REMOVE(NREG), 

All vestiges of the previously defined region are removed. Therefore if a region which is an active shield and which is scaled (50.,10.,200.,300.) is removed, a subsequent CALL REGION to define a region with the same number will have all default options in effect unless changed by the user. That is it will be an inactive window and scaled (0.0,0.0,1.0,1.0).

8. SAVEIT ROUTINES

The graphics package contains a group of routines collectively called the SAVEIT routines. With these routines, the user can control transmittal of the SC 4020 instructions generated by his program to the appropriate graphic job output device. Under most operating procedures, the user's job output device is a 7-track tape. This tape which contains the instructions for tbe SC 4020 is used off line as input to the SC 4020.

The sequence of instructions written on the user's job output tape will be called SC4020 records.

In addition to being transmitted to the job output device, the SAVEIT routines make it possible to transmit the SC4020 records to an area in core and to identify that area in core by a user specified name. The control the user can exercise over the SC4020 records is to permit or forbid their transmittal to the job output device and/or to the user named section in core.

The SC4020 records saved in core may be transmitted to the job output device over and over again without having to reexecute the program instructions that were used to construct the SC4020 records in core.

8.1 Constructing and Writing Saved Section

At any point in the logical flow of a program, the user may define and open a save section in core by executing

      CALL BEGINV(NSECT) 

where NSECT is an integer constant or variable which may be used later to refer to the same section. The section remains open until closed by execution of

      CALL ENDV(NSECT) 

Any record which is written on the job output device will also be saved in all open sections unless the user employs switcles to be described later to prevent saving records in the open sections.

Once a section has been closed, it may not be reopened to add additional C4020 records to what was saved previously. Once a section has been closed, it is impossible to add SC020 records to it. Consider the following sequence of statements:

 2    CALL BEGINV(12) 
 5    CALL FRAMES(1) 
      NSECT = 45 
10    CALL BEGINV(NSECT) 
15    CALL JCTEXT'/.','TITLE/BY.') 
20    CALL ENDV(45) 
25    CALL FRAMES(2) 

Statement 2 opens a saved section to be identified by the integer 12.

Statement 10 opens section 45.

Statement 5 generates instructions to be written on the output device to cause a frame advance. The call for the frame advance in statement 5 is also saved in all open sections, the only open section at that time being section 12.

Statement 15 generates 4020 instruction which are written on the output device to construct the two lines of text 'TITLE/BY'. The same 4020 instructions are saved in all open sections, those sections being 12 and 45.

Statement 20 closes section 45.

Statement 2 generates on the output device the instructions to advance the film two frames. The same instructions are saved in the open section 12.

To write the instructions stored in the saved sections on the job output: device, execute

      CALL WRITEV(NSECT). 

A sequence of 50 frames of the two lines 'TITLE/BY' could be obtained by the following:

      DO 48 1=1,50 
      CALL WRITEV(45) 
 48   CALL FRAMES(1) 

One may call WRITEV for a section which is not closed. For instance, by executing CALL WRITEV(12) one would obtain a frame advance, a frame with the words TITLE BY on it and then two blank frames.

If statement 10, which opened section 45, had been placed before statement 5, then 50 frames of the text could have been obtained by the following:

      DO 55 I=1,50 
 55   CALL WRITEV(45) 

To write out an open or closed section M times, one should execute a call to the subroutine WRITEN as follows:

      CALL WRITEN(M,NSECT) 

where NSECT is an integer variable or an integer identifying the section to be written out M times. Section 45 might then have been written out 50 times by executing

      CALL WRITEN(50,45) 

8.2 CALL DLETEV, CALL MOSTV

The SAVEIT routines are structured to allow the user to define up to ten save sections. When in the program flow a saved section is no longer needed, the user may delete all references to the saved section and retrieve for other sections the core storage that the deleted section had consumed by executing

      CALL DLETEV(NSECT). 

For programs in which the limit of 10 sections is insufficient, the limit may be raised by executing

      CALL MOSTV(N) 

where N is the number (exceeding 10) of sections to be defined at one time.

8.3 Switches UNPLTV, REPLTV, WAITV and RZOOMV

The switches UNPLTV and REPLTV give the user the capability of forbidding and permitting, respectively the transmittal of 4020 records to the job output device. Consider the following:

      CALL UNPLTV 
      CALL BEGINV(6) 
      CALL JCTEXT('/.','PICTURE.') 

No 4020 output would be obtained from the above statements since the switch to allow plotting on the output device has been turned off. The text 'PICTURE' would be saved in the open section 6. To allow plotting again on the output medium, execute

      CALL REPLTV. 

The switches are additive so that if 4 calls to UNPLTV are executed, then at least 4 calls must be made to REPLTV to permit writing 4020 records again on the job output device.

In a similar way the switches WAITV and RZOOMV can be used to forbid and permit respectively the saving of 4020 records in all open sections. Consider the following:

      CALL WAITV 
      CALL BEGINV(6) 
      CALL JCTEXT('/.','PICTURE.') 

Nothing would be saved in the open section 6 since the switch to allow saving in all open sections was turned off. Instructions would have been written on the job output device to produce the word 'PICTURE'. To resume saving in all open sections, execute

      CALL RZOOMV. 

The switches WAITV and RZOOMV are also additive.

The following is a typical way in which the save routines can be used:

      CALL BEGINV(8) 
      X1 = some initial value 
      Y1 = some initial value 
      DO 50 N =- 2, 100 
      CALL UNPLTV 

      some time consuming computation of X2 and Y2 
      
      CALL LINE(X1,Y1,X2,Y2) 
      CALL REPLTV 
      CALL WAITV 
      CALL WRITEV(8) 
      CALL FRAMES(1) 
      CALL RZOOMV 
      X1 = X2 
      Y1 = Y2 
 50   CONTINUE 
      .....

8.4 RCRSV, ENCRSV, COPYV

In the usual operation of the SAVEIT routines, all open sections will have saved in them 4020 records which are generated by the software, unless a call to WAITV has been executed. It frequently occurs that one wants to execute WRITEV for a section which is still open and to which 4020 records are still being added. To avoid saving the open section in itself while it is being written out by a call to WRITEV, one must call WAITV prior to calling WRITEV and call RZOOMV afterwards to allow adding 4020 records to the open section. The calls to WAITV and RZOOMV may be eliminated by executing earlier in the program

      CALL ENCRSV. 

The switch ENCRSV is an additive switch to prevent saving in all open sections whatever action is being produced on the job output device by a call to WRITEV.

By executing

      CALL RECRSV 

the user allows the saving in all open sections of the 4020 records transmitted to the job output device by calls to WRITEV.

The routine executed by

      CALL COPYV(NSECT) 

copies the section NSECT in all open sections.

8.5 Allocating Core Area for Save Sections

In order to use the SAVEIT routines in the MTS version of the POLYGRAPHICS package it is necessary to include two statements in the user's main program. These are a labeled common statement and an assignment that must be constructed as follows:

      COMMON/SAVEIT/N, IARRAY (words of core to reserve) 
      N = words of core to reserve 
      

The variables N and ARRAY can have any names, but the common block must be labeled SAVEIT. The number of words of core to reserve will be dependent. upon the amount of code that a user wishes to store in save regions. It is recommended that at least 2000 words be reserved since all save regions defined draw space from this common block. If the user attempts to store more 4020 records in the area initially reserved for such sections, an error message to that effect will be received and the job will abort, calling CLEAN and STOPping. The remedial action available to the user is to increase the size of the common block SAVEIT.

For example, to reserve 8000 fullwords of core, the two cards required would be

      COMMON/SAVEIT/N, IARRAY(8000) 
      N = 8000 

9. VECTOR ROUTINES

In those cases where there exists a concise vector representation of the lines to be drawn and where vector algebra operations are to be carried out to compute changes in direction and extent of the lines, there is then motivation for having a graphical vector language to facilitate conversion from the mathematical representation to the physical representation to be displayed. The vector routines in the Polygraphics package are described in subsequent sections.

9.1 Defining Vectors

Vectors may be defined in the following ways:

      A = (5.0,3.,8.0) 

This defines A to be a constant vector with the x-coordinate of A equal to 5.0, the y-coordinate equal to 3. and the z-coordinate to 8.0. If the z-coordinate is not specified, it is assumed equal to zero.

      B = VECTOR(U,T,V) 

This defines B to be a vector where the x, y and z coordinates of B are set equal to the nonvector arguments U, T and V respectively. This method allows defining a vector in terms of variables.

9.2 Extracting Vector Components

The x, y and z components of a vector variable may be determined by use of the functions XCOORD, YCOORD and ZCOORD. For instance, the components of the vector A may be obtained and stored in the non-vector variables x, y and z by executing:

      x = XCOORD(A) 
      y = YCOORD(A) 
      z = ZCOORD(A) 

9.3 Vector Algebra Functions

Vector operations may be carried out with the help of the following functions which are in the Polygraphics package:

      A=SUM(B,C)     defines A as the vector sum of the vectors B and C.
      A=DIFF(B,C)    defines A as the vector difference between vectors B and C.
      A=SMULT(R,C)   defines A as the vector obtained when multiplying the vector C 
                       by the scalar R.
      A=DOT(B,C)     defines A to be the scalar quantity equal to the dot product 
                       of vectors B and C.
      A=CROSS(B,C)   defines A to be a vector equal to the cross product of the 
                       vectors B and C. 

9.4 Size, Unit and Same Functions

Other vector functions available are explained below:

      A=SIZE(B)     sets A equal to the magnitude of the vector B. 
      U=UNIT(B)     defines U to be a unit vector pointing in the same direction as 
                      the vector B.
      A=SAME(C)      defines A to be a vector with the same components as the vector C. 

9.5 Writing Unique Vector Functions

Vector functions may be defined by the user in the following way:

Define the function subprogram by following the usual FORTRAN rules and then insert the four cards marked with an.asterisk, as shown below.

      FUNCTION ANEW1(ARGl, ... ARGN) 
      *COMMON/VEKTOR/F(1000), IFIRST 
      *EQUIVALENCE (A,K) 
      ...
      ANEW1 = final computation of vector ANEW1 
      *A = ANEW1 
      *F(K+3)=ADDRES(A) 
      RETURN 
      END 

Except for the starred cards, any non-conflicting names and variables may be used. Currently, this function definition feature can be implemented in MTS only by (1) compiling the function separately from the main program and (2) 1oading the resulting object module last, i.e. after loading *PIB.

9.6 Listing Vector Coordinates

The components of a vector may be printed on the output device by either a) extracting the components using XCOORD, YCOORD and ZCOORD and listing the values with usual write statements, or b) by executing

      CALL WRITEC (A) 

in which case the components of the vector will be extracted by the subroutine and will be printed using the format

      (2H (F15.8,1H,,F15.8,1H,,F15.8,1H)) 

10. PROJECTION ROUTINES

Three projection routines are contained in the Polygraphics package to allow the user to obtain orthographic, perspective or stereoscopic projections of vector quantities.

10.1 Orthographic Projections

To obtain a vector A which represents the orthographic projection of the vector X, execute

      A = ORTH(X,N,THETA,PHI,PSI) 

where THETA, PHI and PSI are the Euler angles which specify the orientation of the eye point with. respect to the vector X and where N is the total number of arguments named in using ORTH, excluding N itself.

If all of the variables are specified,, i. e. if N equals 4, then the Euler angles in the argument list are used to compute the projection of the vector named in the first argument in the list.

Should a large set of vectors be projected, all with the same angular setting, the number of arguments used in referencing ORTH may be shortened to

      W = ORTH(U,1) 

if the values of THETA, PHI and PSI have been defined by the execution of a previous function statement. Thus

      S= ORTH(T, 4, 15.0, 30.0, 45.0) 
      W = ORTH(U, 1) 
      Y = ORTH(Z, 1) 

yields the same result as

      S = ORTH(T, 4, 15.0, 30.0, 45.0)
      W = ORTH(U, 4, 15.0, 30.0, 45.0) 
      Y = ORTH(Z, 4, 15.0, 30.0, 45.0). 

Therefore any function statement with 1 as the value of N will return the last assigned values of THETA, PHI and PSI. Should the statement be the first call to ORTH, the angles will be assumed to be zero when returning the projected vectors.

10.2 Perspective Projection

To obtain a vector A which represents a perspective projection of the vector X, execute

      A = PROJ(X,N,R,THETA,PHI,PSI) 

where R is the distance from the object to the eye point, and all the remaining arguments are the same as in ORTH. The only variation between PROJ and ORTH is the addition of this new variable and hence the value of N is now 5. For example,

      F = PROJ(G,5,1500.0,20.0,15.0,10.0) 
      X = PROJ(Y,5,1000.0,45.0,90.0,0.0) 

If N equals one, the previously established values of R, THETA, PHI and PSI are used. For instance, if there had been no prior use of PROJ and if the following statements were executed,

      DO 10 I=1,100 
   10 X(I) = PROJ(Z (I),1) 

then the value of the angles would have been set to zero as in ORTH while for R a value of 1000.0 is assumed.

10.3 Stereoscopic Projection

The stereoscopic projection is a combination of two perspective projections made from slightly displaced eye-points. The general form of this function subprogram is

      S = STEREO(T,N,D,R,THETA,PHI,PSI) 

where D is the interpupilary distance and all the other arguments are as defined previously. One of the two perspective projections is obtained by executing the function with N and D as positive variables, the other perspective view is obtained by executing the function subprogram with N and D as negative variables of the same absolute magnitude as before.

For good depth perception in viewing a stereoscopic image, D should be approximately R/5. The additional variable D alters only slightly the use of STEREO when compared with the other projection routines. The variable N is now 6. For example, the two perspective views that comprise the stereo pair of the vector X could be obtained by executing

      A = STEREO(X ,6, 100.0,1000.0,45.0,0.0,0.0) 
      B = STEREO(X,-6,-100.0,1000.0,45.0,0.0,0.0). 

If N equals one, the previously assigned values of the Euler angles, R and D are used in the calculation. Should this be the first call to STEREO, all arguments are set as in PROJ and D is assumed equal to 100*N. The variable N may be set equal to minus one in those cases where the only alteration in a second or subsequent call to STEREO is the sign of D. Thus in the previous example, the second statement could have been written as

      B = STEREO(X,-1) 

When all arguments are used such that D varies numerically from statement to statement, the sign of D must also be assinged to N. For example

      R = STEREO(X,-6,-20.0,200.0,45.0,45.0,45.0) 
      S = STEREO(X,-6,-60.0,200.0,45.0,45.0,45.0) 
      T = STEREO(X, 6, 10.0,330.0,30.0,30.0,50.0) 
      U = STEREO(X, 6, 70.0,300.0, 0.0,30.0,30.0). 

It is recommended that in using STEREO projection, several blank frames (for 16mm - 7 frames) be left between the two views for sufficient room for cutting the film to fit a stereo viewer.

Note that in all the projection routines if the absolute value of N is greater than 1, the program assumes that all the other arguments are present.

11. FORMATTING NUMERICAL DATA FOR DISPLAY

Variables may be formatted for display by making use of the routines FORMIT, OUTVAR, OUTARY and RESETF. The screen or region position in which the data is to be displayed is then specified by appropriate calls to JCTEXT or LETTER. The next four sections briefly describe the use of each of these routines. Section 11.5 gives more details on the interpretation of the formats by FORMIT.

11.1 Specifying the Format to Use: CALL FORMIT

The routine FORMIT permits the user to specify the format to be referenced in converting numerical data to a form to be displayed. To specify the format to use, execute

      CALL FORMIT('FORTRAN format') 
,p>where the apostrophes for the string argument should enclose the format to be referenced in outputting data for display. It is assumed that the reader is familiar with FORTRAN format statements. The quantity between the apostrophes corresponds to the outermost parenthesis pair and everything between them as used in the FORTRAN format statement for printing. For instance if 7 variables are to be displayed using the format 6F10.5,I5, the user's program should first execute

      CALL FORMIT('(6F10.5, I5)') 

A call to FORMIT designates the format to use when variables are subsequently specified to be formatted for display.

11.2 Specifying the Variables to Display: CALL 0UTVAR, CALL OUTARY

To specify the variables which are to be displayed, execute

      CALL OUTVAR(V1,V2,V3,...V10) 

where V1, V2, etc., represent the variables to be displayed and anywhere from 1 to 10 variables may be specified with a single call to OUTVAR. Successive calls to OUTVAR will reference the format specified in FORMIT by continuing from where the last call to OUTVAR left off. Therefore, all the variables to be displayed in a given frame need not be specified in the same call to OUTVAR. For instance, a program to display on one frame, three successive sets of values assigned to the variables A and B and a final integer M could be done as follows:

      CALL FORMIT('(6F10.5, 15)') 
      DO 25 M=1,3 
      A=... 
      B=... 
 25   CALL OUTVAR(A, B) 
      CALL OUTVAR (M) 
      ...

If the variables to be displayed are contained in an array X, the user may display N items from the array by executing

      CALL OUTARY(N, X). 

That is equivalent to saying:

      DO 10 I=1,N 
 10   CALL OUTVAR(X(I)). 

Also, 

      CALL OUTARY(5,X(10)) 

is equivalent to 

      DO 20 J=10,14 
 20   CALL OUTVAR(X(J))
 

11.3 Displaying the Variable Specified

Prior calls to FORMIT and OUTVAR and/or OUTARY will have established the format and the data to be displayed. They will also have stored a packed string of characters representing what is to be displayed. To display the formatted variables, execute any of the allowable calls to JCTEXT which include the option string 'OPT.' and in the option string include the option word UNPACKED. For example, execute

       CALL JCTEXT(DUM,DUM,NREG,NSTRK,'UNPACKED.') 
or 
       CALL LETTER(X,Y,DUM,DUM,NREG,NSTRK,'UNPACKED.'). 

The usual arguments which appear in JCTEXT and LETTER are replaced by DUM or any other dummy variable. The option word UNPACKED signals the routines to ignore the arguments which usually appear where DUM is used. ALL other options which are possible with JCTEXT or LETTER may still be used.

11.4 Additional Comments: CALL RESETF

If OUTVAR and OUTARY specified so many variables that the last parenthesis in the referenced format is encountered, the routines revert to the last open parenthesis to continue formatting the data for display. For instance, a call to OUTVAR with 10 variables referencing the format (F10.3) will give 10 lines with a single variable per line.

On the other hand, if the format referenced is (10F8.4) and one variable is specified at a time by calls to OUTVAR until a total of 10 are specified, and if a call to LETTER or JCTEXT is executed after each call to OUTVAR, then the successive calls to JCTEXT or LETTER will give 10 lines where each line contains all the numbers from the previous line plus one additional number in F8.4 format.

If it is desired that the call to OUTVAR or OUTARY revert back to the beginning of the format, the program should execute

      CALL RESETF. 

The routine FORMIT searches for the first left parenthesis after the first apostrophe and ignores all blanks except those contained in a Hollerith field.

11.5 FORTRAN Format Usage as Interpreted by FORMIT

There are various devices that may be used in the format in the call to FORMIT that parallel the ways the FORTRAN format statement may be used. For example,

a) use nX
to specify n blanks, is equivalent to 1X
b) nH...
may be used to identify the n successive characters following the H (including blanks) to be displayed. An alternate form allowable is to replace the Hollerith field by a string where the limits of the string are marked by $ instead of '. For instance, the following two lines have the same effect when included in a format in FORMIT: 10HA FEW ABCS, $A FEW ABCS$
c) n$...$
may be used to indicate that the characters in the string are to be repeated. For instance 2$D0G$ = 6HDOGDOG
d) / , n/
indicates that the next characters to be displayed will be on a new line. n/ will start the display of the next character on the n'th line after the current line.
e) nAw, nRW
is the usual A-format specification. If the number of characters in a word is less than w, the specification inserts trailing blanks. nRw is like nAw except that it inserts leading blanks if the number of characters in a word is less than w. For instance, given a four character word containing the letters ABCD, the use 0f A3 to display it gives ABC, while the use of R3 to display it gives BCD.
f) nLw
displays w-1 blanks followed by T or F.
g) NIw
displays an integer, or if the number is too big for the format, w asterisks
h) nI
requests the FORMIT routine to choose the smallest number of characters possible in displaying the integer. For instance, the format (INTEG=$I) would display the integers -468 and 1234567 as follows: INTEG=-468 INTEG=1234567
i) nOw
displays w octal digits. Asterisks are obtained if the number to be displayed is too big for the format.
j) nZw
displays w hex digits.
k) nFw.w2, nFw.0, nFw.
provide. the normal F-conversion with the point displayed unless the number is too large, in which case asterisks are obtained.
l) nFw
provides the F-conversion without displaying the decimal point. Asterisks result if the number is too big.
m) nF
works the same way the nI format specification works. It instructs FORMIT to use the smallest number of digits possible and omit the decimal point. Asterisks are never obtained with this.
n) nF.w2, nF0.w2
are interpreted by FORMIT to display w2 places to the right of the decimal point and as many places as are needed in front of the decimal point.
o) nEw.w2
provides the normal E -conversion of data.
p) nE.w2
displays the floating point variable using as many places as are necessary before the decimal point and w2 places after the decimal point. nEw or nEw. are not allowed and cause only asterisks to be displayed.
q) nP, -NP
are scale factors that are allowable for use with E and D formatted variables only. The scale factor holds until another nP is encountered.
r) nDw.w2
is identical to the E-specification except that D replaces the E.
s) nGw.w2, nG.w2
invokes the specification nFw.w2 if that will give at least 6 significant characters. Otherwise the specification nEw.w2 is used. For instance, using the format (G.4) for X=123.45678, gives123.4567. and for X=.1234567 gives 1.2345E-01

12. SPECIAL ROUTINES CIRCLE, ARC, PLYGON

The three routines CIRCLE, ARC and PLYGON are included in the package to facilitate drawing basic geometric figures.

12.1 CALL CIRCLE

To draw a circle, any of the following ways may be used to call the subroutine:

a)     CALL CIRCLE(X,Y,R) 
b)     CALL CIRCLE(X,Y,R,NREG) 
c)     CALL CIRCLE(X,Y,T,NREG,NSTRK,'OPT.') 

where

X,Y are the coordinates of the center of the circle with respect to the screen or region NREG if included,

R is the radius of the circle,

NREG is the region whose scaling is referenced in using the values X, Y and R,

NSTRK is the number of overstrikes desired, and

'OPT.' is an option string for which allowable option words are

XALIGN    YALIGN    EXTEND    CONTAIN 
FRAME     PAPER     FILM

If form c) is used and the plotting region is the screen, set NREG equal to zero.

The XALIGN and YALIGN options are included to provide a means of obtaining round circles in regions which do not have the X and Y axis scaled, so that distances are the same length in each scale. For instance, if the screen is scaled (0.,0.,1.,1.) and CALL CIRCLE(0.5,0.5,0.25) is executed, one would obtain the circle in figure A below.

(0.,0.) (1.,1.) Figure A (0.,0.) (1.,2.) Figure B (0.,0.) (1.,2.) Figure C (0.,0.) (1.,2.) Figure D

If the screen is scaled (O.0,0.,1.0,2.), the same call to CIRCLE would give the elipse shown in figure B.

If the screen remains scaled as in figure B, but the call to CIRCLE is

      CALL CIRCLE(0.5,0.5,0.25,0,1, 'XALIGN.') 

the circle shown in figure C would be obtained. If the call to CIRCLE to get figure C had included the YALIGN option instead of the XALIGN option, the circle obtained would be that shown in figure D. If both XALIGN and YALIGN are included in the option string, the last one on the list is taken as the direction in which the circle is to be aligned. If the argument NSTRK is zero or less, nothing is obtained.

12.2 CALL ARC

Circular arcs may be obtained by executing any of the following forms of the subroutine:

a)    CALL ARC(X,Y,R,SA,FA) 
b)    CALL ARC(X,Y,R,SA,FA,NREG) 
c)    CALL ARC(X,Y,R,SA,FA,NREG,NSTRK,'OPT.') 

where all the arguments are as defined before for CIRCLE and in addition the arguments SA and FA are the starting and finishing angles in degrees. The convention adopted for both this routine and the PLYGON routine is that positive angles are measured clockwise from the positive Y axis,

0 180 90 270 +X +Y

All angles are projected down to a 0 to 360 degree basis. Thus 405 degrees is considered to be the same as 45 degrees. The following table describes the arc drawn and the arc length in degrees which would be obtained for several choices of SA and FA.

 SA      FA                    ARC DRAWN               ARC LENGTH   
 405.   -260.    Arc is drawn starting at 45 degrees      55 deg.
                 and ending at 100 degrees

-260.    405.    Arc drawn from 100 to 45 degrees        305 deg.    
 405.     45.    Full circle                             360 deg.   
  45.     45.    Nothing drawn                             0 deg.   

The effects of the options XALIGN and YALIGN on the arc obtained are the same as described for the subroutine CIRCLE when drawing in regions in which the scaling would otherwise produce an elliptical figure.

12.3 CALL PLYGON

Polygons may be drawn by executing any of the following:

a) CALL PLYGON(X,Y,R,NSIDES) 
b) CALL PLYGON)X,Y,R,NSIDES,IWANT) 
c) CALL PLYGON(X,Y,R,NSIDES,IWANT,SA) 
d) CALL PLYGON(X,Y,R,NSIDES,IWANT,SA,NREG) 
e) CALL PLYGON(X,Y,R,NSIDES,IWANT,SA,NREG,NSTRK,'OPT.') 

where all the arguments are as defined before except where noted below

NSIDES is the total number of sides in the polygon to be drawn if all sides were drawn,

IWANT is the number of consecutive polygon sides to be drawn,

SA is the angle of tilt of the polygon as measured from the positive vertical axis with positive degrees measured in the clockwise direction (convention used is same as described in section 12.2), and

R is defined as the distance from the center of the polygon to a corner of the polygon.

The first polygon side to be drawn is that side emanating from the corner whose position is fixed by the polar coordinates R and SA.

If NSIDES=4 and IWANT=1, only one side of a square would be drawn, If IWANT was increased to 2, then two sides of the square would be drawn, If IWANT=3, three sides are obtained. If IWANT = 4, four sides are drawn but if IWANT was greater than 4, you would still get only the square. If IWANT is zero or less, nothing is drawn. If IWANT is not specified as in form a), it is assumed equal to NSIDES.

If the argument SA is not specified, it is assumed equal to zero.

For example, execution of

      CALL PLYGON(0.5,0.5,0.3,3) 

would give

(0.0, 0.0) (1.0, 1.0) 0.3 POINT 0.5,0.5

Execution of

      CALL PLYGON(0.5,0.5,0.3,3,3,60.0) 

would yield

(0.0, 0.0) (1.0, 1.0) 0.3 60°

Execution of

      CALL PLYYGON(0.5,0.5,0.3,3,2)

would give

(0.0, 0.0) (1.0, 1.0)

Non-uniform scaling of the X and Y axis would produce distorted polygons. The distortions may be eliminated by using the XALIGN and YALIGN options as described for the subroutine CIRCLE.

13. SPECIAL ROUTINES BFRAME, GROWL and CGROWL

13.1 CALL BFRAME

Sometimes several pictures are to be introduced in a movie sequence at different times and retained for unequal durations. A routine BFRAME is included in the package to allow a) constructing each picture by a separate subroutine, and b) merging the pictures with relatively simple coding while a changing foreground picture is being displayed.

The subroutine BFRAME can maintain a list of up to 100 picture displaying routines, To enter a subroutine name on the list, execute

      CALL BFRAME(SBNAME,NFRAMES) 

where SBNAME is the name of the subroutine which draws the picture and which has been previously named in an external statement, and

NFRAMES is the number of consecutive frames for which the picture drawn by SBNAME is to be displayed starting with the next frame advance execution requested.

The subroutines named in calls to BFRAME should not contain any calls to advance the film either directly or indirectly.

Suppose we have four subroutines A, B, C, and D which draw pictures. A sample of the statements which might be used to mesh the pictures is given below:

      EXTERNAL A 
      EXTERNAL B 
      EXTERNAL C 
      EXTERNAL D 
      CALL MOVIE 
      CALL BFRAME(A,1000) 
      CALL BFRAME(B,125) 
      CALL BFRAME(C,250) 
      CALL FRAMES(200) 
      CALL BFRAME(D,300) 
      CALL FRAMES(800) 
      CALL CLEAN 
      CALL EXIT 
      END 

The previously listed program statements would yield the following:

  1. 250 frames of leader
  2. 125 frames of pictures drawn by subroutines A, B and C
  3. 75 frames of the pictures drawn by subroutines A and C
  4. 50 frames of the pictures drawn by subroutines A, C and D
  5. 250 frames of the pictures drawn by subroutines A and D
  6. 500 frames of 'the picture drawn by subroutine A
  7. 250 frames of trailer

13.2 CALL GROWL

With the routine GROWL, the user may specify the coordinates of the end points for up to 100 straight lines and the number of frames to take to draw each line growing from one end point to the other. The ways the routine may be called are as follows:

a) CALL GROWL(NUMB,X1,Y1,X2,Y2,NGROW) 
b) CALL GROWL(NUMB,X1,Y1,X2,Y2,NGROW,NHOLD) 
c) CALL GROWL(NUMB,X1,Y1,X2,Y2,NGROW,NHOLD,NREG) 
d) CALL GROWL(NUMB,X1,Y1,X2,Y2,NGROW,NHOLD,NREG,NSTRK,'OPT.') 

where

NUMB is an integer the user can assign to the line to allow identifying it in subsequent calls,

X1,Y1 are the coordinates of the end point from which the line is to be drawn,

X2,Y2 are the coordinates of the point to which the line is to be drawn,

NGROW is the total number of frames to be used in showing the line grow from point X1,Y1 to point X2,Y2,

NHOLD is the number of frames for which the completely drawn line is to be displayed when it has finished growing,

NREG, NSTRK and 'OPT.' are the region, number of overstrikes and the option string respectively. The only option words recognized are EXTEND and CONTAIN (see Section 5.1)

When the routine GROWL is called, it does not draw anything. The lines to be drawn each frame are drawn only when a frame advance is requested by other program statements and then the lines are drawn just before the frame advance is executed. When used, GROWL counts as one subprogram of BFRAME.

Line numbers are used to allow referring to a line after the execution of the CALL GROWL statement and to change the number of frames for which the line is to be displayed. For instance, if the user does not know for how many frames a completed line is to be held for display, the call to GROWL could be issued with a very large value for NHOLD, viz:

      CALL GROWL(5,X1,Y1,X2,Y2,20,10000) 

which requests that a straight line, numbered 5, be drawn between points (X1,Y1) and (X2,Y2) over the next 20 frames and that the completed line be displayed for 10000 frames. Program tests may subsequently indicate that the display is to be discontinued sooner. The display of line 5 can be cut off by executing

      CALL GROWL(5,ANYX,ANYY,ANYX,ANYY,0) 

Note:

  1. the length of the straight line increment drawn each frame is equal to (1.0/NGROW) times the distance from X1,Y1 to X2,Y2.
  2. If NGROW is 1 or less, the entire line will be drawn just before the next frame advance request and the line will continue to be displayed for NHOLD subsequent frames.
  3. If no line number is desired, set NUMB=0. If line numbers are used, they must not be in the range -17000 to -19999.

13.3 CALL CGROWL

This routine is similar to GROWL. It has the added features that the coordinates of the points to be connected frame by frame are given arrays in the call to the routine and that the tail of the line may be made to shrink while the front of it is growing. The ways this routine may be called are as follows:

a)     CALL CGROWL(NUMB,NPTS,XARRAY,YARRAY,NGROW) 
b)     CALL CGROWL(NUMB,NPTS,XARRAY,YARRAY,NGROW,ITERM,NTERM) 
c)     CALL CGROWL(NUMB,NPTS,XARRAY,YARRAY,NGROW,ITERM,NTERM,NREG) 
d)     CALL CGROWL(NUMB,NPTS,XARRAY,YARRAY,NGROW,ITERM,NTERM,NREG,NSTRK,'OPT.') 

where. the arguments that are the same as in GROWL mean the same thing and

NPTS are the number of successive points in the x and y-arrays to be connected (ARRAY(1),YARRAY(1) to XARRAY(2),YARRAY(2), etc)

ITERM is the number of frame advances to elapse before the removal of the line is commenced,

NTERM is the number of frames to take to remove the line.

The erasure of the beginning of the line starts with frame ITERM. The first line segment to be erased is the segment from XARRAY(1),YARRAY(1) t0 XARRAY(2),YARRAY(2). The erasure of line segments will continue for NTERM frames.

Suppose that X and Y are arrays of at least dimension N and CGROWL is called as follows:

      CALL CGROWL(0,N,X,Y,100,2,100) 

What will happen is that the routine will attempt to grow a line for the next 100 frames by connecting X(1),Y(1) to X(2), Y(2) etc., up to X(N),Y(N). However at frame 2, the routine will start erasing from X(1),Y(1) and this erasure will take 100 frames. Thus as the line is being drawn, the part of the line drawn one frame back is being erased. If the points in the X and Y arrays are fairly close together, the effect is that of a dash moving around the screen along the coordinates given by X,Y.

The number of calls which CGROWL can handle at any one time depends upon the number of points the user requests that it store in each call. At present, there are 999 array locations available for storage of array values given by the user. Evey call to CGROWL requires (10+3*NPTS) locations. Thus the two calls

      CALL CGROWL(0,40,X,Y,54) 
      CALL CGROWL(0,100,X,Y,76) 

would require

call 1      10 + 3*40  = 130 locations
call 2      10 + 3*100 = 310 locations 
                         ---
                         440 locations

leaving a total of 559 1ocations for other calls to CGROWL.

Routine CGROWL, when in use, counts as one subprogram of the routine BFRAME.

-

14. ZOOMS AND PANS

The POLYGRAPHICS package contains a routine called ZOOM to relieve the user of calculating intermediate scale values for zooms and pans of several types that may be desired in several regions at the same time. The perspective change which occurs in moving a real camera and its associated disappearance or reappearance of parts of objects displayed to the right, left or behind other objects is not taken into account here. Consequently some would prefer to think of the scale changes made by the routine as enlarging or shrinking. Nevertheless, in this context, the word zoom will refer to changes in scale. Several types of zooms may be produced in going from a given scale at the start of the zoom to a final scaling. The ways in which the routine may be called are:

a)   CALL ZOOM(XA1,YA1,XA2,YA2,XB1,YB1,XB2,YB2,NFRAME) 
b)   CALL ZOOM(XA1,YA1,XA2,YA2,XB1,YB1,XB2,YB2,NFRAME,NREG) 
c)   CALL ZOOM(XA1,YA1,XA2,YA2,XB1,YB1,XB2,YB2,NFRAME,NREG,'OPT.') 
d)   CALL ZOOM(XA1,YA1,XA2,YA2,XB1,YB1,XB2,YB2,NFRAME,NREG,'OPT.',EX) 

where

XA1...YA2 denote the scaling in effect at the start of the zoom,

XB1...YB2 denote the scaling in effect at the end of the zoom,

NFRAME is the number of frames for which the zoom or pan is to take place,

NREG is the region to which the scale values XA1...YB2 refer. If NREG is omitted as in form a) or is zero, the scale changes refer to the screen.

'OPT.' is an option string for which the allowable option words are

SIMPLE    TRIANGLE     EXTERNAL   VTYPE    CONTINUOUS
STRAIGHT  TRAPEZOID               ITYPE    INCREMENTAL 
          EXPONENTIAL 

EX is the name of an external zoom function which the user can write and name.

The routine ZOOM changes the scaling for the region NREG or the screen from the A values (the first four arguments in the call) to the B values (the second four arguments) in NFRAME steps. Therefore, if YA1=YB1 and YA2=YB2, a pan to the left or right is obtained depending on the values assigned to the x-coordinates. The zoom or pan does not occur when the call to ZOOM is executed. The ZOOM routine sets up the instructions to change the scale for the region specified after each of NFRAME subsequent calls to advance the film. When the zoom is completed, the region or screen to which the zoom referred remains scaled with the coordinates XB1...YB2.

The call to ZOOM can be made for the screen and for each of the ten regions which may be defined, so that 11 zooms and pans can be going on at once.

14.1 Simple Zooms

The option words describe the type of zoom to be used. The option words SIMPLE and STRAIGHT mean the same thing and yield a zoom in which the picture appears to be changing in NFRAME equal increments or in which the scale is changed in NFRAME equal increments. Which type of zoom is obtained depends upon which of the options VTYPE and ITYPE are in force or invoked at the time the call to ZOOM is made. The VTYPE and ITYPE options will be described later. The discussion below assumes the ITYPE option.

A pan made with the SIMPLE option would move the picture across the screen at a constant velocity. A zoom on a circle with the SIMPLE option would yield a picture in which the scale was changing at a constant rate even though the visual effect would not be that of a circle with a uniformly changing area. If no options are specified in the call to ZOOM, the SIMPLE option is assumed.

If we plot the change in scale per frame versus the n'th frame number in the zoom, the result is a straight line parallel to the x-axis and intercepting the y-axis at the velocity determined by the distance to move and the number of frames in which the scale change is to take place: Viz:

0 NUMBER OF FRAMES SIMPLE Velocity Curve NFRAME ΔX/FRAME XB1-XA1 NFRAME +X +Y

Note that the area under the curve is numerically equivalent to the total change in the x-scale to take place during the zoom. The y-scale change produces a similar velocity curve.

14.2 Options TRIANGLE, TRAPEZOID and EXPONENTIAL

The option TRIANGLE computes the change in scale required so that the velocity increases at a constant rate from 0 at frame 1 to a maximum at frame (NFRAME/2) and then decreases at a constant rate to zero at frame NFRAME. The velocity curve in terms of the x-coordinate looks like

0 0 NUMBER OF FRAMES TRIANGLE Velocity Curve NFRAME NFRAME/2 ΔX/FRAME

The actual height of the triangle, i.e. the maximum velocity reached in the middle of the zoom, is fixed by the total change in scale to be made and the number of frames in which to make it, so that the area under the triangle is numerically equivalent to the total change in scale to take place.

The option TRAPEZOID starts the velocity at zero and increases it at a constant rate for (NFRAME/6) frames. The scale changes are then kept constant until the final (NFRAME/6) frames when the velocity starts to decrease at a constant rate to a value of zero at the final zoom frame.

0 0 NUMBER OF FRAMES TRAPEZOID Velocity Curve NFRAME ΔX/FRAME

If TRAPEZOID is specified in the option string but NFRAME is of such a low value that there are less than 12 frames for the velocity to increase and then decrease, a TRIANGLE zoom is obtained instead.

If the EXPONENTIAL option is specified, the velocity increases to a peak near (NFRAME/2) and then decreases to zero at NFRAME. The scale changes are chosen to follow a square law curve so that the velocity curve looks like

0 0 NUMBER OF FRAMES EXPONENTIAL Velocity Curve NFRAME ΔX/FRAME

Therefore the EXPONENTIAL zoom starts off more slowly than either the TRIANGLE or TRAPEZOID zoom but reaches a higher velocity than either of them.

14.3 External Zoom Functions

If the user wants a zoom which is different from those provided in the package, the option word EXTERNAL should be inserted in the option string and the name of the function in the position of the argument EX. For instance, if the user writes a function called SINW, the call for a zoom in 80 frames on the screen would be

      CALL ZOOM(XA1,YA1,XA2,YA2,XB1,YB1,XB2,YB2,80,0,'EXTERNAL.',SINW) 

where the function SINW must be defined some place else in the program with three arguments in the following form:

      FUNCTION SINW(DUMMY,IF,NFRAME) 
      A = FLOAT(IF)/FLOAT(NFRAME) 
      SINW = SIN(A+3.14159265) 
      RETURN 
      END 

The first argument, DUMMY, must be included in the definition of the function but not used. The second argument, IF, is the frame number of the zoom or pan, The third argument, NFRAME, will contain the same value as NFRAME in the call to ZOOM. Therefore, 1 ≤ IF ≤ NFRAME. As IF varies from 1 to NFRAME, a plot of the function value versus IF will give the shape of the velocity curve used in zooming. Since the user-defined function may return positive or negative values, it is possible to obtain a velocity curve which has negative values so that a zoom may start from the initial scaling XA1...YA2 and proceed part of the way to XB1...YB2 and then move backwards towards XA1...YA2 again. A restriction placed on the user defined function is that the forward and backward motion of a zoom must all take place within the end scale values XA1......YB2. Therefore one should not attempt to zoom a picture from a set of scale values within XA1.....YB2 to a scale that is outside those limits. If that occurs, the EXTERNAL function will be ignored and a SIMPLE zoom assumed. The EXTERNAL statement must also be used as is done with the character fonts.

14.4 VTYPE, ITYPE, Continuous and Incremental Options

The velocity curve shapes which are described above can be used in two ways. If the velocity with which the viewer is approaching a picture is to follow the SIMPLE, TRIANGLE, TRAPEZOID, EXPONENTIAL or EXTERNAL function, the option word ITYPE should be included in the option string. The velocity curve specified will be followed in computing the scale changes.

If the zoom desired is one in which. the viewer appears to be approaching the picture along one of the velocity curves, the option word VTYPE should be included in the option string. The percentage change per frame of the screen or region area then follows the velocity curve specified.

If neither ITYPE nor VTYPE is specified, then VTYPE is assumed. If the initial and final scale values for a region are of the same area, then there is no difference between the VTYPE and ITYPE options.

In constructing a pan, the velocity with which a picture moves across the screen is of more interest than the final scale values. In that case, the option word INCREMENTAL is useful. Instead of going to XB1...YB2 in NFRAME frames, the routine adds the value of XBl, YB1, XB2, YB2 to XAl, YAl, XA2, YA2 each frame for NFRAME frames. To return to the previously defined use of the coordinates XB1...YB2, use the option word CONTINUOUS in the next call to ZOOM.

APPENDIX A1. LIBRARY FILE DESCRIPTION - FLIKPLT

Contents

The object module of a program that produces CALCOMP Or print plot hardcopy of SC4020 movie frames.

Purpose

To enable a user to reproduce selected frames from a movie tape which was generated either by *PIB or *SCORS. (See Computing Center Memo No. M69, *PIB.)

Usage

The program is invoked by a $RUN command specifying *FLIKPLT as the file where the object module is to be found. The desired output medium is selected by a parameter field. Data is read from a tape which must have been previously *MOUNTed.

Logical I/O Units Referenced:

7 - the pseudo-device name of the input tape which contains SC4020 commands.

9 - a permanent file that will contain the line file description of the CALCOMP plots.

SPRINT - the FDname to which the print plot output is directed.

SERCOM - the FDname to which error comments and confirmation messages are directed.

Prototype:

$RUN FLIKPLT 7 = *pseudodevicename* 
                      [9= plotfile] [PAR = keyword parameters] 

(Entries in the PAR field must be separated by a comma.)

Examples:

$RUN *FLIKPLT 7 = *PIBTAPE* 
$RUN *FLIKPLT 7 = *TAPE*9 = PFILE 
                   PAR = CCPLT = 1 
$RUN *FLIKPLT 7 = *INTP* 9 = PLOT 
          PAR= CCPLT = 2, PLFIL = 'PLOT' 
$RUN *FLIKPLT 7 = *TP* PAR = NFRMS = 2, TERM = .TRUE 

Description:

Users of the POLYGRAPHICS subroutines (*PIB) or the SCORS routines (*SCORS) will now be able to examine the contents of the tapes they have written before sending them away for processing. This will allow one to assure himself that the movie he wishes to make is being produced as intended. Moreover, since the subroutines in *PIB contain many features not found in the CALCOMP plotting package, the user may wish to consider *FLIKPLT as a post-processor for producing CALCOMP plots as the end result.

A variety of key words may be included in the "PAR =" field of the $RUN command for selection of the plotting medium, and for selection and sizing of the plots to be produced. Unless the keyword CCPLT is assigned all output will be in the form of a print plot, either on the batch printer or on a terminal. Several keywords apply to CALCOMP plotting only; they are identified with a dagger, †. All others can be used with either plotting medium, except TERM which controls the print plot size.

If no parameters are specified default values will prevail. The first example, for instance will process the entire tape (until encountering an end-of-file), producing a print plot on the batch printer. The following parameters are available:

NFRMS
integer total number of frames to be plotted. If not specified, the entire tape is processed until an end of file is detected.
NSKIP
integer number of frames to be skipped before plotting a frame. Default is NSKIP = 0.
NREC
integer number of records to be skipped before plotting FRMCT (see below) frames, and to be skipped again before plotting FRMCT frames, etc. Default is NREC = 0.
FRMCT
integer numbers of frames to be plotted when using the record skipping parameter NREC. There is no default value.
NPRT
integer number specifying that every NPRTth frame is to be plotted. Default is NPRT = 1.
†FZIZ
floating point size of the CALCOMP frames to be plotted, in inches, Permissible sizes are in the range 1.≤FSIZ≤20. Default is FSIZ =10.
†NOFRM
logical switch that controls whether or not frame boundaries are to be drawn around the CALCOMP plots. Default is NOFRM =.FALSE. or F, meaning frame boundaries are drawn.
TERM
logical switch that controls the size of print plot frames. If .TRUE. or T the output is sized for a Teletype, producing a frame about 7 inches square. The default. value is .FALSE. resulting in a 13 inch square frame on the batch printer. This switch does not control selection of the printer or a terminal as the output device, only the size of the frame.
†CCPLT
integer switch that selects CALCOMP as the output medium and controls CALCOMP post-processing. The default value is CCPLT = 0, meaning print plots will be produced. Setting CCPLT = 1 will produce a CALCOMP fine file on logical unit 9. If the user wishes to have this file processed by *CCQUEUE he should set CCPLT = 2 and he will be presented with a CALCOMP plot receipt. Before using this second feature see PLFIL below.
†PLFIL
literal constant that specifies the name of the permanent file where *CCQUEUE can find the CALCOMP commands. The default value is PLFIL = 'PF', If this name is satisfactory the user need only $CREATE stich a file and *PERMIT it. to the status ALL. A plot receipt is the end result (see CCPLT above). Example 3 shows a case where the plot file has been renamed.

Various combinations of. these parameters may be used but the following guidelines are offered:

  1. The default value of FSIZ = 10. was selected to yield approximately the same resolution with CALCOMP plotting that one has on the 4 inch square SC4020 screen. Smaller values of FSIZ will reduce CALCOMP plotting. costs but also diminish resolution. Larger frames will cost more and appear more crude.
  2. The record skipping feature (NREC > 0) is intended for use with lengthy tapes involving, perhaps, thousands of frames. Users of *PIB will receive as output a message which indicates the total number of frames produced (including leader and trailer) and the number of records written. This provides a rough frame/record correspondence which allows one to select a reasonable NREC and FRMCT. There is no guarantee that after skipping NREC records plotting will begin on a frame boundary. For this reason one should set FRMCT = 2 at least, to ensure plotting of one full frame.
  3. The number assigned to NFRMS, when specified, will always override the effect of other parameters in determining when to terminate plottiug. Thus, if there is some doubt about the length of one's tape, NFRMS can be set to a reasonable number and will be the controlling factor in the length of the job.
  4. The parameters NSKIP and NPRT are meant to be used on jobs involving a relatively small number of frames e.g., less than 100. For jumping or spacing with larger jobs the NREC and FRMCT mode of operation is suggested.
  5. The modes of selection may be combined; NSKIP and NPRT may be set to appropriate values when using the NREC-FRMCT parameters. Then if NREC = 2, FRMCT = 10, NSKIP = 1, and NPRT = 2, two records will be skipped, the first occurring frame (full or partial) will be skipped, and every second frame will be plotted until a total of 10 is reached. Then two more records will be skipped and the above process will be repeated.
  6. Detection of an end-of-file, either by skipping or by sequentially plotting the contents of an entire file, will always terminate execution, indicating this action on SERCOM.
  7. The resolution of a print plot produced on the Teletype will obviously be poorer than that achievable on the batch printer (which is not too good). Electing a terminal plot, however, does have the advantage of giving an immediate indication of the quality of the movie tape. In general, the print plot option will be cheaper than electing CALCOMP output. CALCOMP output, however, is of high quality and looks exactly like the finished movie frame.
  8. *FLIKPLT will always ignore blank frames, e.g. leader and trailer. Thus, only data frames should be considered when deciding on a value for any of the above frame counting parameters.

More Computer Animation Papers 1964-1976