home *** CD-ROM | disk | FTP | other *** search
- PROGRAM TDRAW
- C Test program for the Draw library
- C to make !DRAW files from Fortran 77
- C needs 'utils' and 'DrawF' libraries
- C creates a Draw file called 'freddy' in the CSD
- C
- CHARACTER *40 FILNAM
- CHARACTER *3 PSIZE
- DATA FILNAM/'Freddy'/
- DATA PSIZE/'A4L'/
- CALL DRFILE(PSIZE,FILNAM,IER)
- PRINT *,' IER=',IER
- STOP 'TOK'
- END
- SUBROUTINE DRCHAR(CHARAY,MAXCHR,NCHARS,L1,L2,L3,L4,XL,YL,IER)
- C adds user text to the picture
- C L1,L2 are colours of text, L3 font number, L4 size (same for x and y)
- C XL,YL lower left corner of text in the picture, IER =error return
- CHARACTER *(*) CHARAY
- IER=0
- IF(NCHARS.EQ.0)INIT=-1
- C 1st call NCHARS =0
- INIT=INIT+1
- IF(INIT-1)2,10,20
- C put a word just below the square in default colours
- 2 CHARAY(1:5)='Below'
- NCHARS=5
- XL=60.
- YL=40.
- RETURN
- 10 CHARAY(1:4)='Draw'
- NCHARS=4
- XL=60.
- YL=110.
- L1=?I0077FF00
- L2=?I0000FF00
- L4=8
- RETURN
- 20 NCHARS=-1
- RETURN
- END
- SUBROUTINE DRPOL(ARRAY,MAXPR,NPTS,L1,L2,L3,L4,IER)
- C User routine sets up co-ordinate pairs for lines into ARRAY
- C assume units mm MAXPR max no of Pairs, NPTS returned
- DIMENSION ARRAY(2,MAXPR)
- IER=0
- IF(NPTS.EQ.0)INIT=-1
- C 1st call NPTS =0
- INIT=INIT+1
- IF(INIT-1)2,10,20
- C draw a square just inside an A5 portrait box
- 2 ARRAY(1,1)= 1.
- ARRAY(2,1)= 1.
- ARRAY(1,2)= 1.
- ARRAY(2,2)=209.
- ARRAY(1,3)=139.
- ARRAY(2,3)=209.
- ARRAY(1,4)=139.
- ARRAY(2,4)= 1.
- ARRAY(1,5)=ARRAY(1,1)
- ARRAY(2,5)=ARRAY(2,1)
- NPTS=5
- C use default line and colours
- RETURN
- C make filled polygon colour blue
- 10 ARRAY(1,1)= 50.
- ARRAY(2,1)= 50.
- ARRAY(1,2)= 50.
- ARRAY(2,2)=100.
- ARRAY(1,3)=100.
- ARRAY(2,3)=100.
- ARRAY(1,4)=100.
- ARRAY(2,4)= 50.
- IF(MAXPR.LT.5)THEN
- C see whether there is enough space to store these points
- IER=99
- RETURN
- ENDIF
- ARRAY(1,5)=ARRAY(1,1)
- ARRAY(2,5)=ARRAY(2,1)
- C make a square 50,50 to 100,100
- NPTS=5
- C fill square in blue
- L1=?IFF000000
- RETURN
- C red line 2nd
- 20 IF(INIT.GT.3)GOTO30
- ARRAY(1,1)=50.
- ARRAY(2,1)=10.
- ARRAY(1,2)=130.
- ARRAY(2,2)=48.
- NPTS=2
- C ask for line not filled
- L1=-1
- L2=?I0000FF00
- C ask for wide dashes
- L4=3
- RETURN
- 30 ARRAY(1,1)=50.
- ARRAY(2,1)=10.
- ARRAY(1,2)=30.
- ARRAY(2,2)=100.
- NPTS=2
- C ask for line not filled
- L1=-1
- L2=?I00FF0000
- C ask for dashes and dots
- L4=4
- C only 4 objects here, tell DRFILE no more
- IF(INIT.GE.5)NPTS=-1
- RETURN
- END
-