DOC TEKTRONIX

------------------------------------------------------------------------------
WARNING: The programmes mentioned in this file are liable to be removed or
substatially altered in future version of POPLOG.  If you find a use for them
then you are advised to make a private copy.
------------------------------------------------------------------------------


Copyright University of Sussex

DRAFT: A. Sloman 19768

                    USE OF THE TEKTRONIX GRAPHICS TERMINAL
                    ======================================

For full details, do SHWOLIB GRAPHIC.

The tektronix terminal may either be used on its own, or together with a
VDU, in which case the two terminals are plugged into the C.A.D.C
switching unit, which is then connected to the PDP11.

It is far more convenient to use the switching unit, with both the graphics
terminal and the VDU connected through it. Unfortunately, the switching unit
cannot work at speeds higher than 1200 baud, so use a 1200 or slower line.

At the back of the Tektronix unit there are two separate speed controls, both
of which must be set, if you need to change the speed. You'll also need to set
the speed of the switching unit, and the linked VDU.

After connecting the terminals, login as usual. You can log in on either the
Tektronix or the VDU.

THE GRAPHICS PROGRAMS
=====================

To use the graphics programs, log in after connecting the terminals as
above. Run POP11. Then type:
    : LIB GRAPHIC;

This makes available normal POP11 turtle programs modified for drawing pictures
on the screen. The following procedures are available:

DRAWTO
JUMPTO
DRAW
JUMP
TURN
GRESET (clears the screen)

However, to use these facilities conveniently with switching unit and VDU
linked to the graphics unit, you should first type:
    : GRAPHIC;

This sets up a special environment which ensures that non-graphical
communications are switched to the VDU, unless over-ridden. To remind you that
you are in this environment, SETGRAPHIC is printed out instead of SETPOP after
error messages, etc.

To leave this mode, either type CTRL Z, or SETPOP();


Also, if you type CTRL C to interrupt processing, you'll find that instead of
an immediate SETPOP, you'll get SETGRAPHIC.

GLOBAL VARIABLES
================

The origin (0,0) is set to be near the centre of the screen. You can
change it by altering GXORIGIN and GYORIGIN. If you make their values
0,0, then the origin is at the bottom left. The values 1023,790, make
the origin the top right corner.

Scale can be varied. GXSCALE and GYSCALE control horizontal and vertical
stretching and shrinking. They are initially set to 1. So DRAW(1020); creates
a line 1020 screen units long, i.e. the width of the screen.

The height is about 790 units. So Draw(100); creates a line about one inch
long. If you assign 5 to GXSCALE and GYSCALE, then the same command will
create a line five times as long.

The variable CLIPPING (default TRUE) switches clipping of the picture
on and off. If CLIPPING is FALSE, then lines drawn beyond the limits of the
screen will "wrap around".

Boundaries for clipping are controlled by GXMIN,GXMAX,GYMIN,GYMAX, whose
default values are 0,1023, 0,1023.

By altering them you can constrain pictures to appear only in a specified
rectangle on the screen, the excess being suppressed.

N.B. these variables use screen co-ordinates, so their effect is not altered by
changing GXORIGIN, GXSCALE, etc.
(Although notionally the screen extends vertically to Y = 1023, in fact
it is only visible up to about Y=790.)


The GRAPHIC package also contains facilities for reading co-ordinates in using
the GIN (Graphic INput) mode of the terminal. These are used in LIB GINREAD
and documented in DOC GINREAD.

THE POLY PROGRAM
================

The easiest way to use the graphics package is to log in to POP11 then type
    LIB POLY;

This will load all the graphics programs (if they have not been compiled
previously) and then allow you to generate pictures using the procedure
POLYSPI which draws "polygonal spirals". It requires four parameters
    a size for the initial line
    an increment to be added to the size after drawing each line
    an angle through which to turn after drawing each line
    the total number of lines to be drawn

You do not need to call POLYSPI explicitly: The command
    POLY;

will prompt you (on the VDU) and all you need to do is type in the numbers
(each terminated by "return" or "CR").

After drawing your picture, POLY assumes you want to draw another, and again
prompts you for the initial length. You can exit from POLY by typing CTRL Z.
THERE IS NO OTHER MEANS OF LEAVING POLY. After you've left POLY, you'll be
back to POP11.

The interrupt facility (CTRL C) is altered inside POLY, so that instead of
causing a SETPOP it simply restarts POLY. Similarly if there is an error
POLY will be restarted afterwards. Use CTRL C if you want to change your
mind about some parameters, or if a picture is taking too long and you
want to interrupt it.
