1 DIGS
VAX DIGS is an implementation of the Fermilab Device Independent
Graphics System (DIGS)  for  the  VAX-11 series computer under VMS. 
Several Post Processors are available which can produce output  from 
this  DIGF  on  4010  type  terminals, or PRINTRONIX printers. 
2 GRALIB
LIB:[LIB.DIGS]GRALIB.OLB is the load library containing DIGS routines.
We recommend that you execute  @LIB:[LIB.DIGS]SETUP, then link with
DIGS_LIBRARY:GRALIB.OLB
2 PP
The mechanism for viewing the graphics described  in  DIGF  files  is 
the  Post Processor  (PP).   A  PP reads the data in the DIGF, and a
command stream either from an interactive terminal or from  a  Device 
Independent  Graphics  Indirect Commands file (DIGIC).  It responds to
the command stream either by plotting the data directly on the target
device, or by producing a device-specific file which is routed to the
device for output at the end of PP execution. 

The specification of DIGF files for VAX PP's is as described above for 
programs linked  using GRALIB.  In addition, the first parameter on the
command line that executes the PP can be the name of the desired DIGF. 
This  parameter  overrides the default of DIGF.DAT. 

If no special assignment is made, a PP will open a file named DIGIC.CMD 
on  the current default area.  The name of the DIGIC may be specified by
defining a file name as in the following example: 

$ DEFINE  DIGIC  filename

Note that you may specify any extension in the above example,  but  DGC 
is  the recommended  file  type  extension.   In  addition,  the second
parameter on the command line that executes the PP can be the name of
the  desired  DIGIC.   This parameter  overrides  the  default  of 
DIGIC.CMD and any previous assignment of logical name DIGIC, but only
for  the  duration  of  that execution of the PP. 

If it is desired to execute the DIGIC file immediately, PRINTPP allows
the user to specify GO as the third parameter. If this is not done, then
the PP expects that commands will be entered from  the keyboard 
interactively.  This is the recommended manner of entering commands to
PP's that will be executed in a command procedure either  interactively 
or  via BATCH.  It is recommended that the last instruction in the DIGIC
be QUIT. Command parameters  may  be delimited  by  a comma or a single
space. Two spaces or two commas in a row are equivalent to a zero
parameter. 
3 Printronix
The PRINTPP Printronix plotting post processor which expects that the
symbol PLOT will be defined by the user, perhaps by inclusion of the
command @LIB:[LIB.DIGS]SETUP in the LOGIN.COM file. The recommended
definition of PLOT is: 

$ PLOT :== PRINT/QUEUE=DIGS_PRINT:/NOFEED/DELETE

The /DELETE parameter is  optional. The  queue name for any standard
Printronix printer could be substituted if  a different destination is
desired. 

Both commands produce a file named by logical DIGS_SCRATCH, with a
default name of SYS$LOGIN:PXOUT.GRA.  This file contains  the characters
needed to produce the requested plots on a Printronix printer.  These
files can be quite large.  Careful attention to their management is
suggested. 

PRINTPP can be instructed to rasterize any area  up  to  13.0  inches 
by  17.0 inches.  It may optionally skip to top of form between plots. 
It may optionally queue the output to the printer specified in the PLOT
symbol  on  exit.

Parameters for PRINTPP may be entered via logical names as in example
below: 

$ DEFINE DIGS_XMAX number
$ DEFINE DIGS_YMAX number
$ DEFINE DIGS_FEED (Y / N)
$ DEFINE DIGS_QUEUE (Y / N)

The command line for PRINTPP looks like:

$ PRINTPP P1 P2 P3 P4 P5 P6 P7

P1          DIGF specification.
P2          DIGIC specification.
P3          GO if DIGIC is to be executed immediately, else blank or "".
P4          XMAX, real number between 0.0 and 13.0, number of inches to be
            rasterized in the X direction.
P5          YMAX, Real number between 0.0 and 17.0, number of inches to be
            rasterized in the Y direction.
P6          FEED, either Y or N, If Y, then PRINTPPV will insert  a  formfeed
            in  the plot after each DEINIT call (usually after each PLOT).
P7          QUEUE, either Y or N, If Y, then PRINTPPV will automatically
            execute  the symbol  PLOT at end of execution to queue the output
            file to the printer.  If N, PRINTPPV will type out the name and
            version number of the created file prior to end of execution.

In addition to the above, PRINTPP can also  be  instructed  not  to 
produce  a DIGS-style banner page by this definition: 

$ DEFINE DIGS_BANNER N

If this logical is not defined, PRINTPPV will produce a banner by
default. 
3 PREVU
Except as noted above, PREVU conforms to both SP-12 and J-01.

The command line for PREVU looks like:

$ PREVU P1 P2 P3

P1          DIGF specification.
P2          DIGIC specification.

PREVU will display color DIGF's on the Envision terminal. Use  of
HARDWARE  characters  requires  that the terminal be in GRAPH MODE.  For
further information on setting up this device  ,  see  the "Models  220 
and  230  Color Graphics  Terminals Reference Manual", HN-0053.

2 Logicals
The following logical names are defined by LIB:[LIB.DIGS]SETUP.COM  .
DIGS:

DIGS_EXE     - Directory where executable files are kept.
DIGS_LIBRARY - Directory where object libraries are kept.
DIGS_PRINT   - Default plotting Printronix
2 EXAMPLE
The following example program illustrate the basic use of DIGS:
      PROGRAM SPHERE            !DRAW PICTURE OF SPHERE
C**
C** AUTHOR: A. KRZYWDZINSKI
C**
C** LIBRARY OF VARIABLES:
C**
C**  A        COEFFICIENT( (X-XOR)**2/A/A+(Y-YOR)**2/B/B=1)
C**  ALFA     ANGLE IN RADIANS
C**  B        COEFFICIENT(SEE VARIABLE A)
C**  DA       CONSTANT (INCREMENT OF A)


C**  DALFA    CONSTANT (INCREMENT OF ALFA)
C**  DOD      WHAT SHOULD BE ADDED TO Y
C**  DX       INCREMENT OF X VALUE
C**  DY       -----""----- Y --"--
C**  I,J      ARGUMENTS OF DOLOOPS
C**  PI       VALUE OF PI
C**  R        VALUE OF THE RADIUS
C**  X,Y      X AND Y AXIS
C**  XOR,YOR  STARTING POINTS FOR PLOT
C**
C
C CALL PLTSIZ TO SET SIZE OF PLOT PRIOR TO INITDV
C
      CALL PLTSIZ(11.,8.5)
C
C CALL INITDV TO INITIALIZE THE DIGF
C     (SINCE THE NDEV PARAMETER = 0)
C
      CALL INITDV(0,0)
      R=3.
      PI=ACOS(-1.)
      DALFA=PI/26.
      ALFA=DALFA
      XOR=5.5
      YOR=4.25
C
C USE PLOTTO TO PLOT A BORDER AROUND THE PLOT
C
      CALL PLOTTO(0.,0.,3)
      CALL PLOTTO(11.,0.,2)
      CALL PLOTTO(11.,8.5,2)
      CALL PLOTTO(0.,8.5,2)
      CALL PLOTTO(0.,0.,2)
C
C NOW BEGIN PLOTTING THE SPHERE - SPHERE MADE UP OF ELIPSES
C
C PLOTIF IS USED TO PLACE THE LINE SEGMENTS WHICH MAKE UP
C THE DESCRIBED ELIPSES INTO THE DIGF
C
      DO 1 I=1,26
      X=XOR-R*SIN(ALFA)
      DOD=R*COS(ALFA)
      Y=YOR+DOD
      CALL PLOTIF(X,Y,3)
      A=XOR-X
      B=A*.25
      DX=A/38.
      DO 2 J=1,152
      IF(J-76)3,3,4
    3 X=X+DX
      Y=F(XOR,YOR,X,A,B,1.)+DOD
      CALL PLOTIF(X,Y,2)
      GO TO 2
    4 X=X-DX
      Y=F(XOR,YOR,X,A,B,-1.)+DOD
      CALL PLOTIF(X,Y,2)
    2 CONTINUE


    1 ALFA=ALFA+DALFA
      B=3.
      DY=3./38.
      A=0.
      DA=3./7.
      DO 5 I=1,8
      X=XOR
      Y=YOR+3.
      CALL PLOTIF(X,Y,3)
      DO 6 J=1,152
      IF(J-76)7,7,8
    7 Y=Y-DY
      X=F(YOR,XOR,Y,B,A,1.)
      CALL PLOTIF(X,Y,2)
      GO TO 6
 8    Y=Y+DY
      X=F(YOR,XOR,Y,B,A,-1.)
      CALL PLOTIF(X,Y,2)
    6 CONTINUE
    5 A=A+DA
C
C NOW WE ARE ALL DONE WITH THE PLOT AND USE DEINIT TO CLOSE
C THE DIGF GRACEFULLY...
C
      CALL DEINIT
      CALL EXIT
      END
C
      FUNCTION F(XOR,YOR,X,A,B,W)
      IF(A.EQ.0.)GO TO 1
      F=W*B*SQRT(ABS(1.-(X-XOR)**2./A/A))+YOR
      RETURN
    1 F=0.
      RETURN
      END

The above program is compiled and linked as follows:

$!   Compile the program (using default compiler
$ FORTRAN  SPHERE
$!   Link the object file with GRALIB
$ LINK  SPHERE,LIB:[LIB.DIGS]GRALIB/LIBRARY
$!   Specify the metafile with DIGF logical, then run SPHERE
$ DEFINE/USER  DIGF  SPHERE.DGF
$ RUN SPHERE
$!   See that the digf has been created
$ DIRECTORY/SIZE SPHERE.DGF
Directory USR$ROOT4:[BURCH.DIGS]
SPHERE.DGF;1           63
Total of 1 file, 63 blocks.
$!   Run the post processor to rasterize and
$!     output the picture
$ DEFINE/USER  DIGF  SPHERE.DGF
$ PRINTPP
PRINTPP - PRINTRONIX POST PROCESSOR FOR DIGS
COMMAND
PLOT
FILE HEADER  VERSION  1
BURCH     BURCH 2-FEB-84  10:04:47
COMMAND
QUIT
  Job 379 entered on queue TTC6
FORTRAN STOP
$!   GREAT!, Go to the printronix and pick it up...
$ LOGOUT
