home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / fortran77_210 / library / docs / drawf < prev    next >
Encoding:
Text File  |  1994-01-30  |  7.4 KB  |  186 lines

  1.                Contents of DRAWFILE library  8 Dec 91
  2.  
  3.   ************************************************************************
  4.  
  5.                     C O P Y R I G H T    N O T I C E
  6.  
  7.                      Copyright D.J & K.M. Crennell,          
  8.               P.O. Box 64, Didcot, Oxon, OX11 0TH.
  9.  
  10.  This software is in the Public Domain and may not be sold or included in any
  11.  program that will be sold, without written permission from the authors.
  12.  
  13.  The authors must be given credit in any publications using this software.
  14.  
  15.  The software may be copied and distributed as long as no changes are made
  16.  and this copyright notice is included. Please send any suggested
  17.  improvements to the authors. 
  18.  
  19.  In no circumstances shall the authors be liable for any damage, loss of
  20.  profits, or any indirect or consequential loss arising out of the use of
  21.  this software or inability to use this software, even if they have been
  22.  advised of the possibility of such loss.
  23.  
  24.  The authors do their best to ensure that this library is distributed virus
  25.  free.
  26.   ************************************************************************
  27.  
  28.   This library is in Fortran77 and the source is stored in f77.DrawF
  29.  
  30.    **** Warning this library is still being developed. Routines prefixed
  31.                  with a * have not been tested.  ****
  32.  
  33.  
  34.   All routines in this library begin with the prefix DR
  35.  
  36.  To make a Draw File, call the steering routine DRFILE. This will then call
  37. the user routines, one for each type of object.
  38.  
  39.  
  40.  SUBROUTINE DRFILE(PSIZE,FNAME,IER)
  41. Control routine, calls the user routines to make the co-ordinate pairs for
  42. path objects, the characters for text objects etc. and writes the
  43. Drawfile FNAME.  IER is returned zero for a good write, otherwise contains
  44. the error number. PSIZE is a character *3 page size, allowed types are:
  45.     Flag value  character    size
  46.         0        blank       that of the largest object
  47.         1          A4L       297,210  mm    
  48.         2          A4P       210,297  mm
  49.         3          A5L       210,148  mm
  50.         4          A5P       148,210  mm
  51.  IER returns 5 if object too big for page requested
  52.  
  53.  There is an internal labelled common 
  54.  
  55.       COMMON/DR/LP,SCALE,MINPX,MINPY,MAXPX,MAXPY,
  56.      1    MINBOX,MINBOY,MAXBOX,MAXBOY,LBUF(1024)
  57.  LP is page size flag in table above
  58.  SCALE is 1mm in internal Draw units (PRM p1489)  SCALE=180*256/25.4
  59.  MINPX,MAXPX etc are bounding box for whole picture (A4 by default)
  60.  MINBOX,MAXBOX etc are bounding box for the current object
  61.  LBUF is buffer for storing the constructed of DrawFile object in memory
  62.  
  63.                User Routines
  64.  
  65.  There is a routine for each draw object type which should be written by the
  66.  user for each type needed. They each return a count of points or
  67.  characters; on the first call, this count is zero on entry. They return the
  68.  count 0 or negative when there are no more objects to be converted.
  69.  
  70.  SUBROUTINE DRPOL(ARRAY,MAXPR,NPTS,L1,L2,L3,L4,IER)   
  71.  
  72.  Sets up a polyline. 
  73.  Defines lines for a 'Path Object' as NPTS co-ordinate pairs in the 
  74.  2 dimensional array, ARRAY(2,MAXPR). NPTS is returned.
  75.  The user should check that <= MAXPR pairs are stored in ARRAY.
  76.  The Ith x,y pair is stored in ARRAY(1,I),ARRAY(2,I).
  77.  
  78.  To make a polygon, make the first and last points the same.
  79.  
  80.  The units are mm, which are scaled to 'Draw' units within the package before writing out.
  81.  
  82.   L1,L2,L3 are the 1st three words of a Path object (se PRM p 1793)
  83.  
  84.   L1 = -1 if not filled, otherwise = colour of fill as Red Green Blue
  85.   e.g=?IBBGGRR00   where BB= hex value for amount of blue required   
  86.  
  87.   L2 = colour of outline (0=black)
  88.  
  89.   L3 = line width  0=minimum width
  90.  
  91.   L4 = is related to the fourth word, the joint specification is fixed,
  92.        there are 5 line styles, corresponding to the ones in Draw
  93.        0 solid line  (default set on entry)
  94.        1,2,3 dashes/spaces increasing size
  95.        4 dash dot pattern
  96.  
  97.   On the first call, on entry these are set to the defaults above; on other
  98. calls they are unchanged.                
  99.   
  100.   IER = error return, user should set this to 99 when one of their error
  101.         conditions is found
  102.  
  103.  SUBROUTINE DRCHAR(CHARAY,MAXCHR,NCHARS,L1,L2,L3,L4,XL,YL,IER)
  104.  User subroutine which puts NCHARS ( NCHARS < MAXCHR) characters into 
  105.  array CHARAY, and sets up lower left corner of start of text.
  106.  
  107.  L1 = text colour (0)        (specified as in DRPOL above)
  108.  L2= hint colour (?IFFFFFF00)
  109.  L3=font no (style) (0)
  110.  L4= font size in 'points' (12) (assumed same for x and y)
  111.  
  112.   On the first call, on entry these are set to the defaults above;
  113.   on other calls they are unchanged.                
  114.  
  115.  XL,YL = lower left corner of start of text units are mm
  116.  
  117.  IER  = error return, user should set this to 98 either when one of their
  118.  own error conditions is found or they want >MAXCHR characters
  119.  
  120. *SUBROUTINE DR???  (for other object types not written yet)
  121.  
  122.               DR Library Utility routines 
  123.  
  124.  
  125.  SUBROUTINE DRCHEK(IER)
  126.  checks that the object size is less than the page size, otherwise sets
  127.  IER=5 on return
  128.  
  129.  SUBROUTINE DRHEAD(IER)
  130.   sets up the 10 word header for the Drawfile in LBUF, sets LB, length of
  131.  LBUF used so far, puts the page size in MINPX etc. using the 1st parameter
  132.  of DRFILE, writes out the header to FNAME
  133.  
  134. *SUBROUTINE DROBJ(ARRAY,NWDS,IER)
  135.  writes out the NWDS os ARRAY contining an object set up by the user
  136.  
  137.  SUBROUTINE DRPATH(ARRAY,NPTS,L1,L2,L3,L4,IER)
  138.  creates a DRAW Path Object in LBUF from the NPTS co-ordinate pairs in ARRAY
  139.  setup by user routine DRPOL returns:
  140.    dimensions of bounding box stored in MINBOX etc in COMMON/DR
  141.    IER error flag 0 for a good write, otherwise contains error number
  142.  appends this object to the file
  143.  
  144.  SUBROUTINE DRPIC(MBUF,LB,ARRAY,NPTS)
  145. Copies the NPTS co-ordinate pairs stored in ARRAY into MBUF, scaling them to
  146. mm and integers, preceding them with a command, MOVE (2) for the first
  147. one, and a DRAW (8) for the others. Appends a zero word to terminate the
  148. object. Returns LB the position in MBUF of the last word stored.
  149.  
  150.  SUBROUTINE DRTEXT(CHARAY,NCHARS,L1,L2,L3,L4,XL,YL,IER)
  151.  Creates a DRAW Text Object from the NCHARS characters in CHARAY
  152.  L1,L2 are colours of text, L3 font number, L4 size (same for x and y)
  153.  XL,YL lower left corner of text in the picture, IER =error return
  154.  
  155.                   DR File handling utilites
  156.  
  157.  SUBROUTINE DRWRIT(LBUF,NWORDS,IWORD,IER)
  158.   Writes the NWORDS of array LBUF out to the file opened by DROPEN
  159.   depending on the value of IWORD
  160.  
  161.   IWORD >= 0 writes at word IWORD
  162.   IWORD <0 appends to the file (note: if a previous call has repositioned the file, this need not be at the end. You have been warned!)
  163.  
  164.   IER = error flag returned 0 for a good write, otherwise error number
  165.   
  166.  SUBROUTINE DROPEN(FNAME,IER)
  167.   Opens the file FNAME  ready for writing (an entry point in DRWRIT)
  168.   IER =0 for a successful open, otherwise is error number
  169.  
  170.  SUBROUTINE DRCLOS                                                  
  171.   Closes  the file FNAME  and makes it filetype of Drawfile (AFF)
  172.   (an entry point in DRWRIT)
  173.  
  174.  SUBROUTINE SAVMEM(LBUF,LB,FNAME,IER)
  175.   Writes an array LBUF of length LB words to filename FNAME using SWIF77 
  176.    (no longer used in DrawF)
  177.    
  178.   Error message numbers and meanings
  179.    No  routine  meaning
  180.    1    DROPEN  illegal pathname, cannot open the file 
  181.    2    DROPEN  file already open, cannot reopen it
  182.    3    DRWRIT  file not open, cannot write
  183.    4    DRWRIT  disc full, cannot write
  184.    5    DRCHEK  path object found too big for page bounding box
  185.    6    DRTEXT  text object too big from DRCHEK
  186.   99    DRPOL   Error in User routine