home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d2xx / d267 / diglib.lha / Diglib / diglib.zoo / diglib / diglib.doc < prev    next >
Text File  |  1989-06-20  |  172KB  |  5,650 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. A M I G A - D I G L I B
  16.  
  17.  
  18. Amiga Device Independent Graphics Library
  19.  
  20.  
  21. Hal R. Brand Craig R. Wuest James R. Locker
  22.  
  23. June 20, 1989
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. CONTENTS
  53.  
  54.  
  55. CHAPTER 1       THE COMMERCIAL                                  1
  56.  
  57. CHAPTER 2       INTRODUCTION                                    2
  58.  
  59. CHAPTER 3       INSTALLATION GUIDE                              3
  60.         3.1     MACHINE REQUIREMENTS                            3
  61.         3.2     DISTRIBUTION DISKS                              3
  62.         3.3     INSTALLATION INSTRUCTIONS                       4
  63.         3.4     DEVICE NUMBERS                                  4
  64.         3.5     EDITING GSDRVR                                  5
  65.  
  66. CHAPTER 4       Amiga-DIGLIB DIVISION                           6
  67.  
  68. CHAPTER 5       Amiga-DIGLIB COORDINATES                        7
  69.  
  70. CHAPTER 6       CHARACTER PLOTTING                              9
  71.  
  72. CHAPTER 7       HANDLING DEVICES OF DIFFERENT SIZES            10
  73.  
  74. CHAPTER 8       INTERACTIVE USE                                13
  75.  
  76. CHAPTER 9       PLTLIB COMPATIBILITY                           14
  77.  
  78. CHAPTER 10      DIFFERENCES BETWEEN DIGLIB AND Amiga-DIGLIB    16
  79.  
  80. CHAPTER 11      Amiga-DIGLIB COMMON BLOCKS                     17
  81.         11.1    GCDCHR.PRM                                     18
  82.         11.2    GCVPOS.PRM                                     19
  83.         11.3    PLTCLP.PRM                                     20
  84.  
  85. CHAPTER 12      Amiga-DIGLIB STANDARD DEVICE DRIVER NOTES      21
  86.         12.1    HIRES INTERLACED DRIVERS                       21
  87.         12.2    POSTSCRIPT DRIVER                              21
  88.  
  89. CHAPTER 13      PROGRAMMING EXAMPLE                            22
  90.  
  91. CHAPTER 14      SUBROUTINE DESCRIPTIONS                        24
  92.         14.1    STRINGS                                        24
  93.         14.2    FUNCTION LISTING                               25
  94.         14.3    ALPHABETICAL LISTING                           28
  95.  
  96. CHAPTER 15      GUIDE TO WRITING A DEVICE DRIVER               103
  97.         15.1    INTRODUCTION                                   103
  98.         15.2    STANDARD DEVICE DRIVER FUNCTIONS               104
  99.         15.3    EXTENDED DEVICE DRIVER FUNCTIONS               107
  100.         15.4    DEVICE DRIVER EXAMPLES                         111
  101.         15.5    DEVICE DRIVER ARGUMENTS                        111
  102.  
  103.  
  104.  
  105. .fo=/-#-/
  106. .pn=1
  107. CHAPTER 1
  108. THE COMMERCIAL
  109.  
  110.  
  111.       Amiga-DIGLIB is a free product brought to you by Hal R.Brand and Craig R. Wuest courtesy of the Lawrence Livermore National Laboratory. Since Amiga-DIGLIB was provided to you free (or nearly so), it is my sincere hope that Amiga-DIGLIB will be freely circulated, and enhancements will be also. To aid in this effort         of mutual exchange, please send me (Craig Wuest, L-84) any Amiga-DIGLIB software you believe would be of general use to the Amiga-DIGLIB user community. I will evaluate it (and possibly modify it) and will distribute and maintain it if I also believe it is worth distributing with Amiga-DIGLIB.
  112.  
  113. NOTICE
  114.            This computer code material was prepared as an account
  115.            of work sponsored by the United States Government.
  116.            Neither the United States nor the United States
  117.            Department of Energy, nor any of their employees, nor
  118.            any of their contractors, subcontractors, or their
  119.            employees, makes any warranty, express or implied, or
  120.            assumes any legal liability or responsibility for the
  121.            accuracy, completeness, or usefulness of any informa-
  122.            tion, apparatus, product or process disclosed, or rep-
  123.            resents that its use would not infringe privately
  124.            owned rights.
  125.  
  126.       The version of DIGLIB provided with this document is an enhanced and debugged version of the original copy that I received from Dr. Wuest. 
  127. A Polar plotting routine has been added, Amiga display generation has been made algorithmic, and numerous bugs, mostly related to the way that AbSoft Fortran for the Amiga does memory allocation, have been fixed.  At the time of this writing, Dr. Wuest has indicated that he is too busy to adequately support Diglib, so I have chosen to do so in order to satisfy my own needs.  -- Jim Locker, SofTech Inc.
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. CHAPTER 2
  141. INTRODUCTION
  142.  
  143.      Amiga-DIGLIB is a port of the popular graphics package DIGLIB written by Hal Brand for use on PDP-11's and VAX's. The package has been ported to the Amiga environment using Absoft AC/Fortran. I have taken Hal's advice and plagiarized all I could including most of this documentation manual. If you have any problems with DIGLIB contact Hal Brand, if you have problems with the Amiga port contact Craig Wuest. Conversion of existing programs from DIGLIB to Amiga-DIGLIB should be very easy. Chapter 10 contains information pertaining to the differences between the two packages.
  144.  
  145.      Amiga-DIGLIB (Amiga Device Independent Graphics LIBrary) is a collection of FORTRAN callable subroutines designed with the following goals:
  146.  
  147.        1.  Easily usable by the casual graphics programmer for 2D
  148.            and limited 3D plotting.
  149.  
  150.        2.  Device independent (as much as possible).
  151.  
  152.        3.  Small and reasonably fast.
  153.  
  154.        4.  Device drivers are as simple as possible, and therefore
  155.            easy to write, and device drivers may be written in FOR-
  156.            TRAN when desired.
  157.  
  158.        5.  Compatible (as much as possible) with PLTLIB. This is a
  159.            historical artifact that no one now needs be concerned
  160.            with except former PLTLIB users.
  161.  
  162.        6.  Maintainable.
  163.  
  164.        7.  Compatible with AmigaDOS, and Intuition.
  165.  
  166.        8.  Compatible with Absoft AC/FORTRAN (F77).
  167.  
  168.      Drivers are being added to Amiga-DIGLIB as the need arises.  Before you reject Amiga-DIGLIB because of the lack of a graphics device driver, or you embark on writing a graphics device driver for Amiga-DIGLIB, please check the Amiga-DIGLIB distribution kit as there may be a driver there that has not yet been included into the installation procedures and documentation. Drivers all start with the letters "GD" and then generally have the product number, i.e. GD13HI is the High Resolution Interlaced driver for 13" monitors, such as the Amiga 1080.  If you spot a likely candidate, just list the file and the documentation at the top will confirm or deny your suspicion. If you don't find the driver you need, then read chapter 15 and coerce an existing driver that is close into the driver you need. Remember, Plagiarize, plagiarize, plagiarize!
  169.  
  170. CHAPTER 3
  171. INSTALLATION GUIDE
  172.  
  173. 3.1  MACHINE REQUIREMENTS
  174.  
  175.      The programs provided in this package require an Amiga, or Turbo Amiga. A monitor is also required for plots to be viewed on the screen. A minimum of 512kb of RAM is required. Extra RAM memory or a hard disk is strongly recommended, but then anybody attempting to compile Fortran would benefit from the decreased compile and link  time anyway. Turbo users should compile any sources with the -p  option.  Statically linking main programs to Amiga-DIGLIB is highly  recommended.  Significant speedup in display of plots will be achieved  in this way.  Linking from the floppy disks can take quite a long time  so be prepared for a wait unless you have enough RAM to work with.
  176.  
  177. 3.2  DISTRIBUTION DISKS
  178.  
  179.      This package is distributed on one 3.5 inch floppy diskette, labeled DiglibDisk.
  180.  
  181.       DiglibDisk:
  182.  
  183.                  README.DOC           Any late breaking news.
  184.                  AmigaDIGLIB.doc      The documentation for
  185.                                       Amiga-DIGLIB.
  186.                  AmigaDIGLIB.fmt      Scribble! format file
  187.                  COMPILE.BAT          Compilation program for
  188.                                       Amiga-DIGLIB.
  189.                  COMPILE1.BAT         Compilation program for
  190.                                       Turbo-Amigas.
  191.                  MAKE.BAT             A batch file used to build
  192.                                       Amiga-DIGLIB library.
  193.                  #?.FOR               The Amiga-DIGLIB library source
  194.                                       files.
  195.  
  196.                  #?.PRM               INCLUDE files containing 
  197.                                       Amiga-DIGLIB common blocks and
  198.                                       variable declarations.
  199.  
  200.                  GRAPH.INC            INCLUDE file for amiga graphics.
  201.                  INTUIT.INC           INCLUDE file for amiga intuition.
  202.                  EXEC.INC             INCLUDE file for amiga executive.
  203.  
  204.                  amiga.sub            Enhanced version of the Absoft
  205.                                       release, with SetRGB4 activated.
  206.                  loc.sub              Needed for DIGLIB.
  207.  
  208.                  SKELTN.FTN           The skeleton for a device driver.
  209. 3.3  INSTALLATION INSTRUCTIONS
  210.  
  211.      1.  Copy the contents of the disk to RAM:.  F77 
  212.          and F77LIB can also be copied to RAM: for faster execution.
  213.  
  214.      2.  The COMPILE batch file assumes that Amiga-DIGLIB is to be
  215.          installed on the current directory, preferably RAM:,
  216.          if this is incorrect please edit COMPILE.BAT. Then copy the
  217.          COMPILE batch file correct for your machine into RAM:  Type:
  218.  
  219. EXECUTE COMPILE.BAT
  220.          The program will compile and produce .SUB object code for 
  221.          all the Amiga-DIGLIB sources.
  222.  
  223.      3.  Use the MAKE batch file to create and assemble the object
  224.          modules into the library DIGLIB. Type:
  225.  
  226. EXECUTE MAKE.BAT
  227.          The MAKE batch file assumes that the object files are in
  228.          the current directory and will produce the library DIGLIB
  229.          in the same directory.
  230.  
  231. 3.4  DEVICE NUMBERS
  232.  
  233.      Amiga-DIGLIB uses device numbers to refer to graphics devices. The correspondence between device number and physical graphic device is determined by the subroutine GSDRVR. Basically, GSDRVR is a multiplexer (or dispatcher) that directs the graphic commands to the currently selected device driver. Each installation will have its own correspondence between device numbers and graphic devices. It is very strongly recommended that the device numbers be assigned starting with 1 and continuing through the integers to the Nth device numbered N. This is most straight forward numbering scheme, and the best scheme for making use of GSDNAM. Also, any other scheme will break SELDEV.
  234.  
  235.      Each installation may have its own correspondence between device numbers and graphic devices. Amiga-DIGLIB provides on-line access to the device names that correspond to the device numbers through the GSDNAM subroutine. The most common use of GSDNAM is to construct menus at execution time of the devices available.
  236.  
  237.      This release of Amiga-DIGLIB supports a standard Amiga CRT driver.  This driver, known as GD13HI, employs algorithmic screen generation based  upon information contained in the system structure GfxBase.  Thus, it supports all Amiga CRTs, including PAL and NTSC as well as the new higher resolution display modes.  The driver requires version 1.2 or higher of AmigaDOS.  There is no need to alter GSDRVR or GSDNAM unless you need to support a device other than this.  Future device drivers under development  include a PostScript driver for Apple Laserwriter Printers and an  HP7475 Pen Plotter driver.
  238.  
  239.      Thus, any program that makes proper use of GSDNAM can be linked with an Amiga-DIGLIB with any array of devices and still present the proper menu of devices available.
  240.  
  241.      The person who installs Amiga-DIGLIB can edit GSDRVR to properly reflect the target system configuration. This means editing both subroutines contained in the file GSDRVR.FOR.
  242.  
  243.  
  244. 3.5  EDITING GSDRVR
  245.  
  246.      The file GSDRVR.FOR must be edited to correct the subroutines GSDRVR and GSDNAM to match your installation of Amiga-DIGLIB.  The subroutine GSDRVR makes the procedural connection from device numbers to graphics device drivers and the subroutine GSDNAM makes the procedural connection from device numbers to graphics device names.
  247.  
  248.      GSDRVR has two main functions: 1) make sure the selected graphics device driver exists, and 2) call the selected graphics device driver. As stated before, the correspondence between device numbers and physical graphics devices is entirely up to you!!! You can choose to use any number you wish to represent a particular physical graphics device. However, I very strongly suggest that you arbitrarily assign your most used graphics device the number 1, then assign then next most often used device the number 2, etc. for all your graphics devices. This makes writing GSDRVR easier (you can use a GOTO instead of a bunch of IFs). It is also consistent with the scheme that nearly everybody uses. Also, it is the only way to make any real use of the GSDNAM subroutine.
  249.      The function that subroutine GSDRVR must perform is:
  250.  
  251.      * If "IDEV" is not a valid graphics device number, then
  252.      * if "IFXN" is 7 (Get Device Characteristics), then
  253.        set second argument (X) equal to zero,
  254.      * return
  255.  
  256.      * Pass control to the graphics device driver you want
  257.        selected by the number found in "IDEV". (This is usually
  258.        done by a computed GOTO.)
  259.  
  260.      The subroutine GSDNAM is actually optional, but strongly         recommended. GSDNAM only function is:
  261.  
  262.      * If "IDEV" is a valid graphics device number, then
  263.      * return the device name as an Amiga-DIGLIB string of 39
  264.        characters or less
  265.      * Else
  266.      * return a "null" (zero length) string as the device
  267.        name.
  268.  
  269.      A sample version of GSDRVR and GSDNAM is provided as part of the distribution kit. It is suggested that the sample file GSDRVR be edited rather than starting anew.
  270.  
  271. CHAPTER 4
  272. Amiga-DIGLIB DIVISION
  273.  
  274.  
  275.  
  276.      Amiga-DIGLIB has been divided into two main parts: the low level package, and the high level package. The low level package is concerned with simple but general graphics functions, i.e. drawing lines and characters. The high level package is concerned with producing two dimensional plots suitable for scientific data presentation. The high level package is built upon the low level package and is a good example of the use of the low level Amiga-DIGLIB routines.
  277.  
  278.      The low level package routines are: DEVSEL, BGNPLT, ENDPLT, RLSDEV, and all routines that start with the letter "G". In fact, routines that start with the letters "GD" are drivers, "GC" are common block definitions, and "GS" are general graphics routines. The four previously enumerated routines that don't begin with the letter "G" are basically device control.
  279.  
  280.      The high level package routines are named according to the function they preform, and so follow no convention. Care should be taken to avoid possible routine name conflicts with these routines. The most like candidates for name conflicts are: SCALE, SYMBOL, TRACE, and CURVE.
  281.  
  282.      In addition to the standard high level package routines documented here, Amiga-DIGLIB is distributed with some extra high level graphics routines. The most notable are PURJOY and CONTOR. These routines provide for 3D surface display and contour respectively. They are documented in the code file. They are not officially supported as part of Amiga-DIGLIB, but I have much confidence in them, and I will try to correct any bugs reported.
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303. CHAPTER 5
  304. Amiga-DIGLIB COORDINATES
  305.  
  306.  
  307.      Amiga-DIGLIB makes use of three coordinate systems, and Amiga-DIGLIB drivers make use of one additional coordinate system. The coordinate systems are:
  308.  
  309.               1.  World coordinates,
  310.  
  311.               2.  Virtual coordinates,
  312.  
  313.               3.  Absolute coordinates (expressed in centimeters),
  314.  
  315.               4.  Device coordinates.
  316.  
  317.      Only virtual and world coordinates are normally accessible to application programs. Absolute coordinates are used as input to Amiga-DIGLIB device drivers and are subject to clipping to the target device drivers screen space. Device coordinates vary from graphics device to graphics device and are generated by the appropriate Amiga-DIGLIB graphics device driver.
  318.  
  319.  
  320. World Coordinates
  321.  
  322.      World coordinates are provided through the "high level" graphics subroutines. World coordinates may have any units the user chooses. World coordinates are converted to virtual coordinates using the subroutine SCALE. In most instances, user written plotting subroutines need never call SCALE.
  323.  
  324.  
  325. Virtual Coordinates
  326.  
  327.      Virtual coordinates is the basic coordinate system of Amiga-DIGLIB. All the low level graphics subroutines work in virtual coordinates. All character generation is done in virtual coordinates. Virtual coordinates are converted to absolute coordinates before being sent to the graphics device. The virtual coordinates are first rotated. These rotated values are then scaled independently. Finally, independent translation factors are added.
  328.  
  329.      Xabs = Xscale * ( COS(angle) * Xvirt + SIN(angle) * Yvirt ))
  330.                      + Xtran
  331.      Yabs = Yscale * ( COS(angle) * Yvirt - SIN(angle) * Xvirt ))
  332.                      + Ytran
  333.  
  334.      By default, the rotation is zero degrees, the X and Y scale factors are set to 1.0, and the X and Y axis translations are set to zero. Thus, by default, absolute and virtual coordinates are identical. By providing a built-in mechanism for rotating, scaling, and/or translating coordinates, a plot generated for a particular device can easily be redisplayed on another device regardless of the size of the plotting areas of the graphic devices. In addition, it becomes trivial to rotate the entire plot by some arbitrary angle, or even to produce a mirror reflec  tion of the plot. It is also very simple to "pan" and "zoom" over a large plot or collection of plots (see GSETDP and GSWNDO).  Since "pan" and "zoom" are implemented by Amiga-DIGLIB, the zooming is done to the precision of real numbers, and so detail is retained during the zooming process.
  335.  
  336.      Virtual coordinates can also be used for window/viewporting. Thus, you can use any portion of the screen and have the virtual coordinates run between any values you choose. (See GSWNDO for more information).
  337.  
  338.  
  339. Absolute coordinates
  340.  
  341.      Absolute coordinates are the only coordinates passed to the graphics device drivers. During the GIN operation, the device driver is expected to return absolute device coordinates. Absolute coordinates are chosen so that the point (0.0,0.0) is at the lower left corner of the graphic device. The upper right corner is the point (XLENCM,YLENCM) where XLENCM and YLENCM are the X axis (width) length in centimeters, and the Y axis (height) length in centimeters, respectively. (To find the value of XLENCM and YLENCM, use the Amiga-DIGLIB functions GSXLCM() and GSYLCM(), respectively). Thus absolute coordinates are interchangeable with centimeter coordinates on the device. Line style generation is done by Amiga-DIGLIB software in absolute coordinates. It should be noted that Amiga-DIGLIB filters the absolute coordinates before they are sent to the graphic device drivers so that only those coordinates representable on the graphics device are ever transmitted to the graphics device driver. Amiga-DIGLIB also filters out unnecessary "moves" so that only those moves necessary are sent to the device driver. This improves device performance, but means that "moves" are buffered by Amiga-DIGLIB, and so GSMOVE (with or without ENDPLT) can NOT be used to position the "beam" on graphic terminals.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360. CHAPTER 6
  361. CHARACTER PLOTTING
  362.  
  363.  
  364.      Amiga-DIGLIB provides a number of subroutines and functions to aid you in plotting characters and character strings. Amiga-DIGLIB supports character string plotting through the GSPSTR subroutine. GSPSTR plots the character string using characters of the current size (height) and orientation. These parameters are set via the GSSETC subroutine. Sometimes, it is nice to know what the width of the characters is for centering purposes and the like. Amiga-DIGLIB provides a single function, GSLENS, which returns the length of the string argument it was given.
  365.  
  366.      Amiga-DIGLIB uses a simple algorithm for plotting strings. The first character of the string is plotted in the current size and orientation with the bottom left of its character cell being the last specified coordinate. Thus, to plot a string whose first character's character cell is at position (A,B), call GSMOVE(A,B) then GSPSTR(string). This gives left justified strings (when plotted horizontally - rotation of zero degrees). The function GSLENS can be used for plotting centered and right justified strings.
  367.  
  368.      Remember that Amiga-DIGLIB supports descenders. Thus, a lower case character that is a descender (g,j,p,q,y) will dip below the character cell. Thus, a good spacing for lines of graphics text is twice (2X) the character height. Tightly spaced lines can be placed at 1.5X the character height.
  369.  
  370.      Finally, the Amiga-DIGLIB stick font is mechanically spaced, that is, all the characters have the same width. However, the alternate fonts available under VMS are proportionally spaced. Thus, religious use of GSLENS is required, and many simple character placement calculations that worked well with the Amiga-DIGLIB stick font will have to be upgraded to properly use the alternate fonts.
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388. CHAPTER 7
  389. HANDLING DEVICES OF DIFFERENT SIZES
  390.  
  391.  
  392.      Amiga-DIGLIB uses virtual coordinates as the base level interface coordinate system. Absolute coordinates are never used by the user and should generally be forgotten. This is especially true when the transformation from Virtual to Absolute coordinates is the default transformation because in this case, Virtual coordinates are identical to Absolute coordinates. Since most users operate in this mode, they can think of virtual coordinates as being screen coordinates and need never worry about Absolute coordinates.
  393.  
  394.      Amiga-DIGLIB's use of Virtual coordinates (corresponding usually to centimeter screen coordinates) has advantages and disadvantages. By acknowledging the true device size, users can draw circle that truly appear to be circles and not ellipses. (Note: this requires a properly adjusted graphics device.) It also has the advantage of allowing drawings that must be "to scale" to be drawn as such without any trickery.
  395.  
  396.      The disadvantage of using virtual coordinates is lack of device independence in codes that use absolute numbers for coordinates. For example, if a user does a GSMOVE(25.0,25.0) followed by a GSDRAW(30.0,30.0), then this line will appear only on those graphics devices that are larger that 25.0 cm. square. Most likely, what the user wanted was to draw a line in the upper right hand corner of the device regardless of its size. For this type of approach, the "normalized" coordinate system used by SIGGRAPH-CORE is best suited. Amiga-DIGLIB allows you to work in a normalized coordinate system if you wish by providing two functions,GSXLCM and GSYLCM, that return the currently selected device's X axis length and Y axis length in centimeters respectively. Because virtual coordinates usually are screen centimeters, thesefunctional values can be used to scale the "normalized" coordinates to virtual coordinates. For example, a program section to draw a box enclosing the lower left 25 percent of the screen could be written as:
  397.  
  398.               X50 = 0.5*GSXLCM()
  399.               Y50 = 0.5*GSYLCM()
  400.               CALL GSMOVE(0.0,0.0)
  401.               CALL GSDRAW(X50,0.0)
  402.               CALL GSDRAW(X50,Y50)
  403.               CALL GSDRAW(0.0,Y50)
  404.               CALL GSDRAW(0.0,0.0)
  405.  
  406.      Note that the upper right corner of a box that encloses 25 percent of the screen is at the middle of the screen, thus the factor 0.5! If one wanted the largest square that could fit on the screen:
  407.  
  408.  
  409.  
  410.  
  411.               SQ = AMIN1(GSXLCM(),GSYLCM())
  412.               CALL GSMOVE(0.0,0.0)
  413.               CALL GSDRAW(SQ,0.0)
  414.               CALL GSDRAW(SQ,SQ)
  415.               CALL GSDRAW(0.0,SQ)
  416.               CALL GSDRAW(0.0,0.0)
  417.  
  418.  
  419.      Thus, Amiga-DIGLIB can easily handle devices in a device size independent manner, while at the same time allowing the user to make allowance for the device size and aspect ratio.
  420.  
  421.      Amiga-DIGLIB's high level package (MAPSIZ, MAPIT, CURVE, etc.) make allowances for device size even easier. Here, MAPSIZ and MAPSZ2 allow the user to specify screen locations as a percentage of full screen size in both the X and Y directions.
  422.  
  423.      A final problem incurred with Amiga-DIGLIB and varying device sizes is the axes produced by MAPIT will vary in length depending on the device size. Normally, this is not a problem, however, in some cases, it is necessary or desirable to have the X axis produced by MAPIT be the same on-screen length as the Y axis produced by MAPIT. This can easily be done by making the difference between the X length of the plotting box and the Y length of the plotting box equal a "magic number". This magic number comes from the way Amiga-DIGLIB allows space for the axis frame title, tick marks and labels, axis labels, etc. Thus, this "magic number" is not a constant, but must be computed given the character size and tick length that will be used by MAPIT. The following code computes this "magic number" into the variable YGRTR and then allocates as much of the screen as possible, while requiring the X axis length from MAPIT to equal the Y axis length.
  424.  
  425.               INCLUDE GCDPRM.PRM
  426.               ...
  427.               CSIZE = GOODCS(0.3)
  428.               TICKLN = 0.9*CSIZE
  429.               WIDTH = GSLENS('0'//CHAR(0))
  430.               XBORDR = 0.25/XS
  431.               YBORDR = 0.25/YS
  432.               YGRTR = 4.25*CSIZE+AMAX1(CSIZE/2.0,TICKLN) -
  433.              1   (1.5*(ILABSZ()+0.25)*WIDTH+AMAX1(0.0,TICKLN)) +
  434.              2   2.0*(YBORDR-XBORDR)
  435.               SIZE = AMIN1(GSXLCM(),GSYLCM()-YGRTR)
  436.               CALL MAPPRM(0.0,SIZE,0.0,SIZE+YGRTR,CSIZE,
  437.              1            TICKLN,.FALSE.)
  438.               CALL MAPIT(XMIN,XMAX,YMIN,YMAX,'X'//CHAR(0),
  439.              1           'Y'//CHAR(0),'TITLE'//CHAR(0),16+32+256)
  440.  
  441.  
  442.      Note that ILABSZ is an undocumented function known only to the internals of the Amiga-DIGLIB high level package. Note also, that MAPIT has been called with the ragged axis flags set so that the axes will end where desired in most cases. However, since MAPIT sometimes likes to extend ragged axis when they end very near tick marks, it is necessary to override this feature, which is what the additional value of 256 does. Remember, all this is only useful if you are careful to choose (XMAX-XMIN) = (YMAX-YMIN)!!!!! Also, you will get more pleasing axes frames if you choose XMIN, XMAX, YMIN, and YMAX so that they are nice round numbers.
  443.  
  444.      Finally, note that YGRTR is the magic number for the case where there is to be no second Y axis. When there is to be a second Y axis, then use YGRTR2 as given below:
  445.  
  446.               WIDTH = GSLENS('0'//CHAR(0))
  447.               YGRTR2 = 4.25*CSIZE + AMAX1(CSIZE/2.0,TICKLN) -
  448.              1 (2.5*(ILABSZ()+0.25)*WIDTH+2.0*AMAX1(0.0,TICKLN)+
  449.              2 2.0*CSIZE)DR-XBORDR)
  450.  
  451.      Obviously, in the computation of YGRTR and YGRTR2, the AMAX1 operation is not necessary as the previous code has chosen TICKLN to be greater than zero. However, the AMAX1 is needed for generality since negative tick lengths are permitted by MAPPRM and MAPIT - they yield plots where the tick mark sticks into the plotting area.
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482. CHAPTER 8
  483. INTERACTIVE USE
  484.  
  485.      Amiga-DIGLIB is designed to make interactive graphics very easy. The drivers were designed to make sure that graphics terminals behave well in an interactive environment, and Amiga-DIGLIB itself has a number of routines for supporting interactive graphics. The most commonly used subroutine with interactive graphics is ENDPLT. This subroutine should be called when ever it is necessary for the user to observe the entire plot. Remember that Amiga-DIGLIB buffers graphics commands to provide increased performance (also necessary for interactive graphics), and ENDPLT forces any buffered graphics commands to the graphics device. Thus, before a program asks the user questions that require him to make decision from the graphics, the program must call ENDPLT to ensure that all the graphics have been displayed.
  486.  
  487.      The most commonly used interaction, however, is not questions, but graphics input. Not all devices support graphics input, but most do. Amiga-DIGLIB provides two methods of graphical interaction. The first follows the old 4010 GIN protocol where a cursor is displayed whenever graphics input is desired, the cursor is flown around by the user, and the GIN operation is terminated by the user pressing a terminal key. In this mode, Amiga-DIGLIB returns the virtual (or world) coordinates of the digitized point selected, and the ASCII character struck that terminated the GIN sequence. This mode of graphics input is accessed through the GSGIN subroutine.
  488.  
  489.      The second form to graphics input makes use of the "buttons" or "switches" common found on the pointing devices of many new graphics systems such as joysticks, mice, track-balls, digitizing pads, etc. In this interaction mode, a cursor is displayed and is flown around by user interaction with the pointing device. However, unlike the 4010 GIN, the operation is terminated by the user "pressing a button" (more generally, changing the state of the buttons or switches) on the pointing device. The new state of the buttons or switches is returned to the caller. This mode of graphics input is accessed through the GSCRSR subroutine.
  490.  
  491.      It should be noted that not all devices are capable of supporting either or both of these graphics input operations. Thus, they are not required of an Amiga-DIGLIB device driver. However, the utility of graphics input is such that it is implemented whenever the graphics device supports it. The main problem is which form of graphics input is implemented. Amiga-DIGLIB takes some of this worry off the programmer by supplying a subroutine, GSINPT, that uses GSCRSR if available, of if not, uses GSGIN if available. The only limitation of GSINPT is that only the X,Y coordinates are selected and a binary selection flag" is returned to the user. 
  492.  
  493.      Finally, Amiga-DIGLIB supports graphics input  from world coordinates through the subroutines CURSOR and GRAFIN. CURSOR uses GSGIN and GRAFIN uses GSINPT and only differs from them in returning world coordinates instead for virtual coordinates.
  494. CHAPTER 9
  495. PLTLIB COMPATIBILITY
  496.  
  497.  
  498.      PLTLIB was an early graphics package that Hal Brand distributed. It worked only on the Tektronix 4025 and 4027 graphic terminals. This section is included only for those PLTLIB users that wish to convert to Amiga-DIGLIB. Readers who never used PLTLIB are strongly advised to ignore this section.
  499.  
  500.      As was mentioned before, Amiga-DIGLIB is largely based upon PLTLIB. Most of the high level subroutines (those that work in world coordinates) are unchanged from the point of view of the caller. The low level graphics (those that work with virtual coordinates) are similar to PLTLIB, but codes that made heavy use of PLTLIB low level subroutines will definitely need modification.
  501.  
  502.      The following correspondence exists between PLTLIB and Amiga-         DIGLIB:
  503.  
  504.                  PLTLIB          Amiga-DIGLIB equivalent
  505.                  --------        -----------------------
  506.                  ALLOCG          MAPPRM,MAPSET,MAPSIZ,PLTBOX,FULMAP
  507.                  ALLOCW          none
  508.                  CCOLOR          GSCOLR
  509.                  CLLINE          CLLINE
  510.                  COMMNT          none
  511.                  CURSOR          CURSOR
  512.                  DFNCOL          none
  513.                  DRAW            GSDRAW
  514.                  ERASEG          BGNPLT
  515.                  ERASEW          none
  516.                  GIN             GSGIN
  517.                  LABLE           GSPSTR
  518.                  MAPIT           MAPIT
  519.                  MINMAX          MINMAX
  520.                  MIXCOL          GSDRGB
  521.                  PLTMTY          ENDPLT
  522.                  POINTC          POINTC
  523.                  POINTS          POINTS
  524.                  POSNB           GSMOVE
  525.                  RPOSNB          none (GSMOVE)
  526.                  SCALE           SCALE
  527.                  SETLIN          GSLTYP
  528.                  TRACCY          TRACCY
  529.                  TRACE           TRACE
  530.                  TRACEC          TRACEC
  531.                  TRACEY          TRACEY
  532.                  TXTCOL          GSCOLR
  533.                  VECTOR          none (GSDRAW)
  534.  
  535.      Those users who liked the ability of PLTLIB to fully manipulate the 4025 will probably be disappointed with Amiga-DIGLIB. In the name of device independence the total control over the 4025 afforded by PLTLIB was dropped by Amiga-DIGLIB. Amiga-DIGLIB always (and uncontrollably) allocates 30 lines of workspace window, and uses lines 1 thru 30, columns 1 thru 80 for the graphic region. Amiga-DIGLIB then places multiple plots within the graphic region by using translation factors. Amiga-DIGLIB's strong point over PLTLIB is the device independence. If you only have 4025s and expect that 4025s will be your only graphics device, then PLTLIB may be a better choice than Amiga-DIGLIB.
  536.  
  537. NOTE
  538.                You can modify the placement of the graphics area in
  539.                the workspace, but it must remain 30 lines by 80 col-
  540.                umns. Thus, after calling "DEVSEL" you may send the
  541.                4025 a command to erase the workspace and redefine the
  542.                graphics area somewhere else. For those wishing to
  543.                modify the size of the graphics area, I suggest you
  544.                contact Hal R. Brand.
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577. CHAPTER 10
  578. DIFFERENCES BETWEEN DIGLIB AND Amiga-DIGLIB
  579.  
  580.      The package Amiga-DIGLIB is a port for DIGLIB version 3 taken from the NESD VAX. There are very few known differences between the two packages. If you find any incompatibilities please let me know about them.
  581.  
  582.      1.  All real variables passed to Amiga-DIGLIB must be defined
  583.          as REAL*4, this is the default for the Absoft AC/Fortran
  584.          compiler.
  585.  
  586.      2.  All integer variables passed to Amiga-DIGLIB must be de-
  587.          fined as INTEGER*4, this is the default for the Absoft
  588.          AC/Fortran compiler.
  589.  
  590.      3.  There is no support for multiple fonts in Amiga-DIGLIB
  591.          (i.e. GsFont is not available).
  592.  
  593.      4.  There is support for the user to define the displayed
  594.          color corresponding to a color number (i.e. GsDrgb is
  595.          available).  The hue/lightness/saturation method of de-
  596.          fining color is not supported on the Amiga.
  597.  
  598.      5.  All character arrays and strings must be defined as zero
  599.          terminated. This is done by following the last quote of
  600.          the definition by a //CHAR(0) (// denotes character con-
  601.          catenation).
  602.  
  603. STRNG = 'THIS A ZERO TERMINATED STRING'//CHAR(0)
  604.      6.  Amiga-DOS does not support a screen dump.  However there
  605.          are public domain screen dump routines available as well
  606.          as commercial packages.  I will attempt to evaluate a PD
  607.          screen dump routine for inclusion with the Amiga-DIGLIB
  608.          package.
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623. CHAPTER 11
  624. Amiga-DIGLIB COMMON BLOCKS
  625.  
  626.  
  627.      Amiga-DIGLIB comes with a number of files with the extension "PRM". These files are common block descriptors used by Amiga-DIGLIB. Some of them are useful to application programmers. The PRM files that may be of use are:
  628.  
  629.      1.  GCDCHR.PRM     - Current device parameters
  630.  
  631.      2.  GCVPOS.PRM     - Current position in virtual coordinates
  632.  
  633.      3.  PLTCLP.PRM     - Limits chosen by MAPIT
  634.  
  635.      4.  GCBIG.PRM      - Master Common and variable declaration
  636.                           block to be INCLUDEd in the user's main
  637.                           program.  F77 does not explicitly save
  638.                           variables in COMMON from one subroutine
  639.                           to the next unless the SAVE statement is
  640.                           used or all the COMMONs are declared in 
  641.                           the user's main program or the -h option
  642.                           is used when compiling all the sources in
  643.                           DIGLIB.
  644.  
  645.      5.  GCCOMN.PRM     - Common blocks and variable assignments from
  646.                           GCBIG.PRM.  Used when a main program needs to
  647.                           separate the character stroke data block from
  648.                           the COMMON statements because of EQUIVALENCE
  649.                           statement ordering in the program
  650.  
  651.      6.  GCDAT.PRM      - Character stroke data block from GCBIG.PRM. See
  652.                           GCCOMN.PRM for usage.
  653.  
  654.      Users would be best off to use the editor to insert these files into their sources.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670. 11.1  GCDCHR.PRM
  671.  
  672.  
  673.         Variable        Description
  674.                  ---------------------------------------------------------
  675.         DEVID           * type: real
  676.                         * Device ID.   Unique to each graphics
  677.                           device. Only current use is that a zero
  678.                           indicates no such device.
  679.  
  680.         XLENCM          * type: real
  681.                         * The graphic device's X-axis length in cm.
  682.  
  683.         YLENCM          * type: real
  684.                         * The graphic device's Y-axis length in
  685.                           cm.
  686.  
  687.         XRES            * type: real
  688.                         * The graphic device's X-axis resolution
  689.                           in graphics units per cm.
  690.  
  691.         YRES            * type: real
  692.                         * The graphic device's Y-axis resolution
  693.                           in graphic units per cm.
  694.  
  695.         NDCLRS          * type: integer
  696.                         * The number of foreground colors avail-
  697.                           able on this device. (Always >= 1)
  698.  
  699.         IDVBTS          * type: integer
  700.                         * The device characteristics bits.
  701.  
  702.         NFLINE          * type: integer
  703.                         * The number of lines to skip plus 1
  704.                           while performing software fill. Basi-
  705.                           cally an indication of the (virtual)
  706.                           pen width.
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721. 11.2  GCVPOS.PRM
  722.  
  723.  
  724.         Variable        Description
  725.                  ---------------------------------------------------------
  726.         XVPOS           * type: real
  727.                         * The current virtual X position.
  728.  
  729.         YVPOS           * type: real
  730.                         * The current virtual Y position.
  731.  
  732.         LMOVED          * type: string
  733.                         * TRUE if GSMOVE called since last
  734.                           GSDRAW.
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772. 11.3  PLTCLP.PRM
  773.  
  774.  
  775.         Variable        Description
  776.                  ---------------------------------------------------------
  777.         XMIN            * type: real
  778.                         * The value chosen by MAPIT at the left
  779.                           of the X-axis.
  780.  
  781.         XMAX            * type: real
  782.                         * The value chosen by MAPIT at the right
  783.                           of the X-axis.
  784.  
  785.         YMIN            * type: real
  786.                         * The value chosen by MAPIT at the bottom
  787.                           of the Y-axis.
  788.  
  789.         YMAX            * type: real
  790.                         * The value chosen by MAPIT at the top of
  791.                           the Y-axis.
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823. CHAPTER 12
  824. Amiga-DIGLIB STANDARD DEVICE DRIVER NOTES
  825.  
  826.  
  827.      The following list is not necessarily a complete list of all the available device drivers. As with most software projects, Amiga- DIGLIB suffers from the problem that the software advances faster than the documentation. Thus, users are strongly encouraged to look at all source files beginning with the two letters GD as these source files will contain the device drivers before concluding that Amiga-DIGLIB has come to you without a particular driver.
  828.  
  829.  
  830. 12.1  HIRES INTERLACED DRIVERS
  831.  
  832.      The hires interlaced driver is capable of displaying sixteen colors on a 640x400 screen. The screen can be dragged down or switched to the back at any time by using the appropriate gadgets.  It is necessary to set the stack up to at least 50000 to avoid spurious crashes.  Also in the event of a heap space overflow message you should set the heap of an executable program up to 100000. Finally, the Amiga can only support a few open interlaced screens before it runs out of chip memory.  Keep this in mind when writing programs that open more than one screen or window at a time.
  833.  
  834.      This driver uses an algorithmic screen generation technique which works equally well on all NTSC and PAL display devices, as well as the new Amiga displays.  The only requirement is that the display type must be supported by and correctly defined in Intuition.
  835.  
  836.      You may select a title which will be placed in the title block of your display window by typing "w_title = "My Title"//CHAR(0)" prior to commencing the plot.
  837.  
  838. 12.2  POSTSCRIPT DEVICE DRIVERS - ***Tentative***
  839.  
  840.       This driver operates by writing an ASCII text file that contains the proper command sequences to make a plot. The file is written to POST.DIG, and when RLSDEV is called, the file is closed. The file POST.DIG can then be transferred to the postscript device. The following example assumes that an APPLE LASERWRITER is connected to the serial port.  Use Preferences to set the serial port as:
  841.  
  842.                      BAUD 9600
  843.                      PARITY NONE
  844.                      8 BIT WORD SIZE
  845.                      1 STOP BIT
  846.  
  847.  
  848. Then type:
  849.                      COPY POST.DIG SER:
  850.  
  851.      One final note: When printed singly, all works fine. However, if two or more POST.DIG files are concatenated and then printed, they will be printed all on one page. To overcome this problem, I suggest that you prepare a file with only a form-feed (CTRL/L) in it, and concatenate the POST.DIG files together by intervening the form-feed file.
  852.  
  853.  
  854. CHAPTER 13
  855. PROGRAMMING EXAMPLE
  856.  
  857.  
  858.      The following FORTRAN program is a general shell into which all graphics programs should fit.
  859.  
  860.                  .
  861.                  .
  862.                  .
  863.          C
  864.          C       START OF GRAPHICS
  865.  
  866.          C       SET THE DISPLAY TITLE (NB VARIABLE IS CASE SENSITIVE)
  867.  
  868.                  w_title = "My Plot Title"//CHAR(0)
  869.          C
  870.                  CALL SELDEV(ILUN)
  871.          C
  872.          C       ERASE THE SCREEN OR GET A NEW PIECE OF PAPER
  873.          C
  874.                  CALL BGNPLT
  875.          C
  876.          C       Amiga-DIGLIB APPLICATION SPECIFIC GRAPHICS HERE
  877.          C
  878.                  .
  879.                  .
  880.                  .
  881.          C
  882.          C       MAKE SURE ALL GRAPHICS HAVE BEEN OUTPUT TO THE DEVICE
  883.          C       SINCE WE ARE ALL DONE GRAPHING BY THIS POINT.
  884.          C
  885.                  CALL ENDPLT
  886.                  .
  887.                  .
  888.                  .
  889.          C
  890.          C       PROGRAM EXIT
  891.          C
  892.                  CALL RLSDEV
  893.                  STOP
  894.                  END
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906. High level graphics programming example:
  907.                    PROGRAM DEMO
  908.          C
  909.                  DIMENSION T(101), Y(101)
  910.                  INCLUDE GRAPH.INC        ! AMIGA GRAPHICS LIBRARY
  911.                  INCLUDE INTUIT.INC       ! AMIGA INTUITION LIBRARY
  912.                  INCLUDE EXEC.INC         ! AMIGA EXECUTIVE LIBRARY
  913.          C       DECLARE ALL COMMON BLOCKS HERE TO SAVE THEIR
  914.          C       CONTENTS IN ALL SUBSEQUENT SUBROUTINE CALLS
  915.                  INCLUDE GCBIG.INC
  916.                  DATA NPTS /101/
  917.          C
  918.          C       GENERATE AN EXPONENTIAL DECAY CURVE
  919.          C
  920.                  TMIN = 0.0
  921.                  TMAX = 20.0
  922.                  DT = (TMAX-TMIN)/(NPTS-1)
  923.                  DO 100 I=1,NPTS
  924.                  T(I) = TMIN + DT*(I-1)
  925.          100     Y(I) = 100.0*EXP(-T(I)/5.0)
  926.          C
  927.          C       SELECT THE GRAPHICS DEVICE
  928.                  CALL SELDEV(4)
  929.                  CALL BGNPLT
  930.          C
  931.          C       USE WHOLE SCREEN FOR PLOT AND LET Amiga-DIGLIB PICK
  932.          C       CHARACER SIZE
  933.          C
  934.                  CALL MAPSIZ(0.0,100.0,0.0,100.0,0.0)
  935.          C
  936.          C       FIND Y LIMITS
  937.          C
  938.                  CALL MINMAX(Y,NPTS,YMIN,YMAX)
  939.          C
  940.          C       GENERATE THE AXES WITH LABLES
  941.          C
  942.                  CALL MAPIT(TMIN,TMAX,YMIN,YMAX,'TIME IN
  943.                 1           SEC.'//CHAR(0),'100*EXP(-T/5)'//CHAR(0)
  944.                 2           ,'EXPONENTIAL DECAY CURVE'//CHAR(0),0)
  945.          C
  946.          C       PLOT THE CURVE
  947.          C
  948.                  CALL TRACE(T,Y,NPTS)
  949.          C
  950.          C       END OF PLOTTING FOR NOW
  951.          C
  952.                  CALL ENDPLT
  953.                  CALL RLSDEV
  954.                  STOP
  955.                  END
  956. CHAPTER 14
  957. SUBROUTINE DESCRIPTIONS
  958.  
  959.  
  960. 14.1  STRINGS
  961.  
  962.            ALL REFERENCES TO "STRING" VARIABLES OR CONSTANTS
  963.            REFER TO "NULL" (CHAR(0)) TERMINATED STRINGS AS 
  964.            SUPPORTED BY F77!!!
  965.  
  966.     On the Amiga with Absoft AC/FORTRAN strings are implemented as CHARACTER*1 arrays. Thus, for a variable length string of up to 80 characters called MYSTR use:
  967.  
  968. CHARACTER*1 MYSTR(82)
  969.     The reason for a dimension of 82 is that 1 extra byte is needed for the zero byte terminator, thus 81 bytes are required. For performance (and other reasons) it is best to always force CHARACTER arrays to have an even number of elements, thus 81 is "rounded up" to 82. Absoft AC/FORTRAN allows you to define a zero terminated string by following the ending quote with a CHAR(0).
  970.  
  971.     CALL MAPIT(TMIN,TMAX,YMIN,YMAX,'TIME IN SEC.'//CHAR(0),
  972.    1   '100*EXP(-T/5)'//CHAR(0),'EXPONENTIAL DECAY CURVE'//CHAR(0),0)
  973.  
  974.      Use these NULL terminated strings for all character arrays and strings used by Amiga-DIGLIB.
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997. 14.2  FUNCTION LISTING
  998.  
  999. Complete Graphs
  1000. ---------------
  1001. BarGra  -- Bar graph plot
  1002. ConTor  -- Contour plotter
  1003. PurJoy  -- Plot a three-dimensional view of F(x,y)
  1004. Polar   -- Do a polar plot in either R-theta mode, or X+IY mode
  1005.  
  1006. Graph Initialization
  1007. --------------------
  1008. SelDev  -- Menued selection of Graphics device
  1009. DevSel  -- Select a specific Graphics device
  1010. BgnPlt  -- Create a fresh plotting surface
  1011.  
  1012. Graph Termination
  1013. -----------------
  1014. EndPlt  -- Empty the plotting buffer so the plot can be seen
  1015. RlsDev  -- Release a graphics device
  1016.  
  1017. Drawing Primitives
  1018. ------------------
  1019. GsDraw  -- Draw a line from the current point to the given point
  1020.            (virtual)
  1021. GsMove  -- Move to point (virtual)
  1022.  
  1023. Line Primitives
  1024. ---------------
  1025. ClLine  -- Draw line (world; clipped)
  1026.  
  1027. Polygon Primitives
  1028. ------------------
  1029. GsFill  -- Draw a filled polygon
  1030. GsPoly  -- Draw hollow polygon
  1031. Hatch   -- Fill a polygon with lines at an angle
  1032.  
  1033. Character Drawing
  1034. -----------------
  1035. GsPstr  -- Print a string
  1036. GsLens  -- Length of string (virtual)
  1037. CszMap  -- Character sized picked by MapIt
  1038. GoodCs  -- Get the nicest character size close a desired one
  1039. GsSetc  -- Select character size and rotation
  1040.  
  1041. Graphics Input
  1042. --------------
  1043. Cursor  -- Cursor position (world) and selected character
  1044. GrafIn  -- Cursor position (world) and selection flag
  1045. GsCrsr  -- Cursor position (virtual) and button state
  1046. GsGin   -- Cursor position (virtual) and pick character
  1047. GsInpt  -- Generic cursor position (uses GsGin or GsCrsr)
  1048. GsWait  -- Wait for mouse click on CloseWindow Gadget
  1049. Axes
  1050. ----
  1051. MapIt   -- Draw axes and label them
  1052. MapSml  -- Less capable version of MapIt
  1053. SyAxis  -- Draw a second Y axis
  1054. MinMax  -- Find the minimum and maximum of an array
  1055. GsXlcm  -- Length of the X axis (absolute)
  1056. GsYlcm  -- Length of the Y axis (absolute)
  1057.  
  1058. Transformations
  1059. ---------------
  1060. GSetdp  -- Set virtual to absolute transformation
  1061. GsWndo  -- Set virtual to absolute transformation
  1062. RstMap  -- Restore saved world to virtual coordinate transforma-
  1063.            tion
  1064. SavMap  -- Save world to virtual coordinate transformation
  1065. Scale   -- Converts world to virtual coordinates
  1066.  
  1067. Curve Drawing
  1068. -------------
  1069. Curve   -- Connect world points in X,Y arrays with lines & sym-
  1070.            bols (clipping)
  1071. CurveY  -- Connect world points in Y array with lines & symbols
  1072.            (clipping)
  1073. TracCY  -- Connect world points in Y array with lines (clipping)
  1074.  
  1075. Trace   -- Connect world points in X,Y arrays with lines (no
  1076.            clipping)
  1077. TraceC  -- Connect world points in X,Y arrays with lines (clip-
  1078.            ping)
  1079. TraceY  -- Connect world points in Y array with lines (no clip-
  1080.            ping)
  1081.  
  1082. Device Selection
  1083. ----------------
  1084. DevSel  -- Select the display device for plotting
  1085. GsDnam  -- Get the device name from a device number
  1086. SelDev  -- Interactively select a graphics device from a list
  1087.  
  1088. Screen Allocation
  1089. -----------------
  1090. FulMap  -- Allocate the entire plotting surface for graphics
  1091. MapPrm  -- Set virtual screen size for MapIt
  1092. MapSet  -- Set percent screen size for MapIt
  1093. MapSiz  -- Set percent axes graphics area for MapIt
  1094. MapSz2  -- Set percent axes graphics area for MapIt with space
  1095.            for 2nd Y axis
  1096. PltBox  -- Set virtual graphics area for Mapit
  1097. PltBx2  -- Set virtual graphics area for mapit with space for 2nd
  1098.            Y axis
  1099.  
  1100. Line Characteristics
  1101. --------------------
  1102. GsColr  -- Select a plotting color
  1103. GsDlns  -- Create broken line style
  1104. GsLtyp  -- Select line type
  1105.  
  1106. Point Plotting
  1107. --------------
  1108. PointC  -- Plot X,Y coordinates as triangles (clipping)
  1109. Points  -- Plot X,Y coordinates as triangles (no clipping)
  1110. Symbol  -- Draw a centered symbol
  1111.  
  1112. Screen Dump
  1113. -----------
  1114. Dump    -- Generic screen dump to printer or file ***Tentative*** 
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151. 14.3  ALPHABETICAL LISTING
  1152.  
  1153.  
  1154.                                    BARGRA
  1155.  
  1156.  
  1157. Usage:     CALL BARGRA(XLOW,XHIGH,NOBARS,IMXPTS,X,
  1158.           1           SXLAB,SYLAB,STITLE,TYPE)
  1159.  
  1160.  
  1161. Purpose:   This routine makes a bar graph (frequency graph) from
  1162.            an array of real data.
  1163.  
  1164.  
  1165. Arguments:
  1166.  
  1167.      Input
  1168.  
  1169.         XLOW  :         * REAL*4 CONSTANT OR VARIABLE.
  1170.                         * THE LOW LIMIT FOR THE X-AXIS. MUST HAVE
  1171.                           XLOW <= X(I) FOR ALL I.
  1172.  
  1173.         XHIGH :         * REAL*4 CONSTANT OR VARIABLE.
  1174.                         * THE HIGH LIMIT FOR THE X-AXIS. MUST
  1175.                           HAVE X(I) <= XHIGH FOR ALL I.
  1176.  
  1177.         NOBARS:         * INTEGER CONSTANT OR VARIABLE.
  1178.                         * THE NUMBER OF BARS TO DRAW
  1179.                           1 <= *NOBARS* <= 200 SEE LOCAL VARIABLE
  1180.                           *IMXC*.
  1181.  
  1182.         IMXPTS:         * INTEGER CONSTANT OR VARIABLE.
  1183.                         * THE DIMENSION OF ARRAY *X*.
  1184.  
  1185.         X     :         * REAL*4 VARIABLE.
  1186.                         * THE ARRAY OF REAL DATA TO GRAPH.
  1187.  
  1188.         SXLAB :         * STRING CONSTANT OR VARIABLE.
  1189.                         * THE X-AXIS LABEL.
  1190.  
  1191.         SYLAB :         * STRING CONSTANT OR VARIABLE.
  1192.                         * THE Y-AXIS LABEL.
  1193.  
  1194.         STITLE:         * STRING CONSTANT OR VARIABLE.
  1195.                         * THE TITLE.
  1196.  
  1197.         TYPE  :         * INTEGER CONSTANT OR VARIABLE.
  1198.                         * THE AXIS FLAG. SEE *Amiga-DIGLIB* DOCUMEN-
  1199.                           TATION.
  1200.  
  1201.  
  1202.      Output
  1203.  
  1204.         None.
  1205.  
  1206. Programming notes:
  1207.  
  1208.         *  This routine does all the calls to Amiga-DIGLIB necessary
  1209.            to do the plot EXCEPT for a call to DEVSEL. This way
  1210.            the calling program can choose the device.
  1211.         *  Amiga-DIGLIB's MAPIT routine uses its own rules for the
  1212.            actual lowest and highest values on the axes.  They
  1213.            always include the users values. If you wish to move
  1214.            the bar graph away from the left and/or (imaginary)
  1215.            right y axis do the following:
  1216.  
  1217.             Let S = (XH - XL) / NOBARS
  1218.             where XH = max X(i)
  1219.             and XL = min X(i).
  1220.             Now set XLOW = XL - N * S
  1221.                     XHIGH = XH + M * S
  1222.             where N,M are chosen at your discretion.
  1223.  
  1224.            MAKE SURE THAT XLOW <= X(I) <= XHIGH FOR ALL I.
  1225.  
  1226.  
  1227.  
  1228.  
  1229.                                    BARGR2
  1230.  
  1231. Usage:     CALL BARGRA(XLOW,XHIGH,NOBARS,IMXPTS,IMYPTS,
  1232.           1           SXLAB,SYLAB,STITLE,TYPE,COLIST)
  1233.  
  1234.  
  1235. Purpose:   This routine makes a bar graph (frequency graph) from
  1236.            an array of real data.
  1237.  
  1238.  
  1239. Arguments:
  1240.  
  1241.      Input
  1242.  
  1243.         XLOW  :         * REAL*4 CONSTANT OR VARIABLE.
  1244.                         * THE LOW LIMIT FOR THE X-AXIS. MUST HAVE
  1245.                           XLOW <= X(I) FOR ALL I.
  1246.  
  1247.         XHIGH :         * REAL*4 CONSTANT OR VARIABLE.
  1248.                         * THE HIGH LIMIT FOR THE X-AXIS. MUST
  1249.                           HAVE X(I) <= XHIGH FOR ALL I.
  1250.  
  1251.         NOBARS:         * INTEGER CONSTANT OR VARIABLE.
  1252.                         * THE NUMBER OF BARS TO DRAW
  1253.                           1 <= *NOBARS* <= 512 SEE LOCAL VARIABLE
  1254.                           *IMXC*.
  1255.  
  1256.         IMXPTS:         * INTEGER CONSTANT OR VARIABLE.
  1257.                         * THE DIMENSION OF ARRAY *X*.
  1258.  
  1259.         IMYPTS:         * INTEGER CONSTANT OR VARIABLE.
  1260.                         * THE Y DIMENSION OF ARRAY *X*.
  1261.                         * ALSO THE NUMBER OF BAR GRAPHS TO BE
  1262.                           PLACED ON EACH PLOT. (MAX 8)
  1263.  
  1264.         X     :         * REAL*4 VARIABLE.
  1265.                         * THE ARRAY OF REAL DATA TO GRAPH.
  1266.  
  1267.         SXLAB :         * STRING CONSTANT OR VARIABLE.
  1268.                         * THE X-AXIS LABEL.
  1269.  
  1270.         SYLAB :         * STRING CONSTANT OR VARIABLE.
  1271.                         * THE Y-AXIS LABEL.
  1272.  
  1273.         STITLE:         * STRING CONSTANT OR VARIABLE.
  1274.                         * THE TITLE.
  1275.  
  1276.         TYPE  :         * INTEGER CONSTANT OR VARIABLE.
  1277.                         * THE AXIS FLAG. SEE *Amiga-DIGLIB* DOCUMEN-
  1278.                           TATION.
  1279.  
  1280.         COLIST:         * INTEGER CONSTANT OR VARIABLE.
  1281.                         * AN ARRAY OF PEN COLORS TO BE USED WITH 
  1282.                           EACH OF THE BAR GRAPHS PLACED ON ONE PLOT
  1283.  
  1284.  
  1285.      Output
  1286.  
  1287.         None.
  1288.  
  1289. Programming notes:
  1290.  
  1291.         *  This routine does all the calls to Amiga-DIGLIB necessary
  1292.            to do the plot EXCEPT for a call to DEVSEL. This way
  1293.            the calling program can choose the device.
  1294.         *  Amiga-DIGLIB's MAPIT routine uses its own rules for the
  1295.            actual lowest and highest values on the axes.  They
  1296.            always include the users values. If you wish to move
  1297.            the bar graph away from the left and/or (imaginary)
  1298.            right y axis do the following:
  1299.  
  1300.             Let S = (XH - XL) / NOBARS
  1301.             where XH = max X(i)
  1302.             and XL = min X(i).
  1303.             Now set XLOW = XL - N * S
  1304.                     XHIGH = XH + M * S
  1305.             where N,M are chosen at your discretion.
  1306.  
  1307.            MAKE SURE THAT XLOW <= X(I) <= XHIGH FOR ALL I.
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354. BGNPLT
  1355.  
  1356. Usage:     CALL BGNPLT
  1357.  
  1358.  
  1359. Purpose:   This subroutine creates a fresh plotting surface. For
  1360.            CRT devices it creates a new screen. For pen plot-
  1361.            ters, the paper is advanced to the next plotting page.
  1362.            It also resets the color mapping of colors zero
  1363.            through seven to their default values and resets the
  1364.            current drawing color to one.
  1365.  
  1366.  
  1367. Arguments: None.
  1368.  
  1369.  
  1370. Programming notes:
  1371.  
  1372.         *  Colors 0 thru 7 are set to black (background), white 
  1373.            (foreground), red, green, blue, yellow, magenta, cyan,
  1374.            respectively. This only applies to devices that can set
  1375.            their colors, i.e. color raster devices with lookup tables.
  1376.  
  1377.         *  The current drawing color is set to foreground (color
  1378.            1).
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404. CLLINE
  1405.  
  1406. Usage:     CALL CLLINE(WORLDX1,WORLDY1,WORLDX2,WORLDY2)
  1407.  
  1408.  
  1409. Purpose:   This subroutine draws a line between two points given
  1410.            in world coordinates. Any portion of the line that
  1411.            lies out side the current axis frame plotted by MAPIT
  1412.            is not displayed.
  1413.  
  1414.  
  1415. Arguments:
  1416.  
  1417.      Input
  1418.  
  1419.         WORLDX1         * type: real constant or variable.
  1420.                         * The x position in world coordinates of
  1421.                           the first endpoint of the line.
  1422.  
  1423.         WORLDY1         * type: real constant or variable.
  1424.                         * The y position in world coordinates of
  1425.                           the first endpoint of the line.
  1426.  
  1427.         WORLDX2         * type: real constant or variable.
  1428.                         * The x position in world coordinates of
  1429.                           the second endpoint of the line.
  1430.  
  1431.         WORLDY2         * type: real constant or variable.
  1432.                         * The x position in world coordinates of
  1433.                           the second endpoint of the line.
  1434.  
  1435.      Output
  1436.  
  1437.          None.
  1438.  
  1439.  
  1440. Programming notes:
  1441.  
  1442.         *  MAPIT must be called prior to using CLLINE.
  1443.  
  1444.         *  The axis frame defined by MAPIT is described by the
  1445.            COMMON block named PLTCLP.
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454. CONTOR
  1455. Usage:     CALL CONTOR(Z,NZ,IZ,MX,MY,X1,XMX,Y1,YMY,NL,CL)
  1456.  
  1457.  
  1458. Purpose:   THIS SUBROUTINE WILL PRODUCE A CONTOUR PLOT OF THE
  1459.            FUNCTION DEFINED BY Z(I,J) = F(X(I),Y(J)). IT IS
  1460.            ASSUMED THAT A CALL TO "MAPIT" HAS ALREADY BEEN MADE
  1461.            TO ESTABLISH THE COORDINATE AXIS (X,Y), WITH X LIMITS
  1462.            COVERING THE RANGE X1 TO XMX, AND Y LIMITS COVERING
  1463.            THE RANGE Y1 TO YMY.
  1464.  
  1465.  
  1466. Arguments:
  1467.  
  1468.      Input
  1469.  
  1470.         Z               * Type: real array.
  1471.                         * The values of the function to contour:
  1472.                           Z(I,J) = F(Xi,Yj) where:
  1473.                              Xi = X1 + (i-1)*(XMX-X1)/(MX-1)
  1474.                              Yj = Y1 + (j-1)*(YMX-Y1)/(MY-1)
  1475.  
  1476.         MX              * Type: integer constant or variable.
  1477.                         * The number of X grid points.
  1478.  
  1479.         X1              * Type: real constant or variable.
  1480.                         * The minimum X value.
  1481.  
  1482.         XMX             * Type: real constant or variable.
  1483.                         * The maximum X value.
  1484.  
  1485.         MY              * Type: integer constant or variable.
  1486.                         * The number of Y grid points.
  1487.  
  1488.         Y1              * Type: real constant or variable.
  1489.                         * The minimum Y value.
  1490.  
  1491.         YMY             * Type: real constant or variable.
  1492.                         * The maximum Y value.
  1493.  
  1494.         NL              * Type: integer constant or variable.
  1495.                         * The number of contour levels.
  1496.  
  1497.         CL              * Type: real array.
  1498.                         * The contour levels to draw. (Same units
  1499.                           as F() or Z().)
  1500.  
  1501.         IZ              * Type: characer array.
  1502.                         * Used internally for working storage.
  1503.  
  1504.         NZ              * Type: integer constant or variable.
  1505.                         * The first dimension of the array Z -not
  1506.                           necessarily equal to MX, but MX <= NZ.
  1507.      Output
  1508.  
  1509.         None.
  1510.  
  1511.  
  1512. Programming Notes:
  1513.  
  1514.         None.
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555. CSZMAP
  1556.  
  1557. Usage:     CSIZE = CSZMAP()
  1558.  
  1559.  
  1560. Purpose:   This real function returns the character size to be
  1561.            used by MAPIT. This character size can be specified by
  1562.            the following routines: FULMAP, MAPPRM, MAPSET, MAP-
  1563.            SIZ, MAPSZ2, PLTBOX, and PLTBX2.
  1564.  
  1565.  
  1566. Arguments: None.
  1567.  
  1568.  
  1569. Programming notes:
  1570.  
  1571.         *  CSZMAP is useful when two plots are to have the same
  1572.            character sizes, and MAPSIZ, MAPSZ2, PLTBOX, or PLTBX2
  1573.            has chosen the character size.
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605. CURSOR
  1606.  
  1607.          Usage:     CALL CURSOR(WORLDX,WORLDY,CHAR)
  1608.  
  1609.  
  1610. Purpose:   This subroutine reads the position of the cursor using
  1611.            GSGIN and returns the cursor position in world coordi-
  1612.            nates. The character value of the pick character is
  1613.            also returned.
  1614.  
  1615.  
  1616. Arguments:
  1617.  
  1618.      Input
  1619.  
  1620.         None.
  1621.  
  1622.      Output
  1623.  
  1624.         WORLDX          * type: real variable.
  1625.                         * The variable to receive the X world
  1626.                           coordinate of the cursor.
  1627.  
  1628.         WORLDY          * type: real variable.
  1629.                         * The variable to receive the Y world
  1630.                           coordinate of the cursor.
  1631.  
  1632.         CHAR            * type: character variable.
  1633.                         * The variable to receive the ASCII value
  1634.                           of the pick character.
  1635.  
  1636.  
  1637. Programming notes:
  1638.  
  1639.         *  This subroutines uses GSGIN to actually read the cur-
  1640.            sor position.
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.                         CURVE
  1656.  
  1657.  
  1658. Usage:     CALL CURVE(X,Y,NPTS,ISYMNO,SYMSIZ,NPBSYM)
  1659.  
  1660.  
  1661. Purpose:   This subroutine is very similar in function to TRACEC
  1662.            It connects the points (X(i),Y(i)) with a line of the
  1663.            current line type, and then places the selected symbol
  1664.            on the curve at the desired interval.
  1665.  
  1666.  
  1667. Arguments:
  1668.  
  1669.      Input
  1670.  
  1671.         X               * type: real array.
  1672.                         * The ordered X values to connect.
  1673.  
  1674.         Y               * type: real array.
  1675.                         * The ordered Y values to connect.
  1676.  
  1677.         NPTS            * type: integer constant or variable.
  1678.                         * The number of (X,Y) points to connect.
  1679.  
  1680.         ISYMNO          * type: integer constant or variable.
  1681.                         * The number of the centered symbol to
  1682.                           place on the curve:
  1683.                              0 ==> no symbol,
  1684.                              1 ==> triangle,
  1685.                              2 ==> box,
  1686.                              3 ==> diamond,
  1687.                              4 ==> hour glass.
  1688.  
  1689.         SYMSIZ          * type: real constant or variable.
  1690.                         * The symbol height in virtual coordi-
  1691.                           nates.
  1692.  
  1693.         NPBSYM          * type: integer constant or variable.
  1694.                         * The spacing of the symbols. The symbols
  1695.                           are placed at every NPBSYM points along
  1696.                           the curve.
  1697.  
  1698.      Output
  1699.  
  1700.         None.
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706. Programming notes:
  1707.  
  1708.         *  Like TRACEC, CURVE does not plot any points that lie
  1709.            outside the world coordinates established by
  1710.            MAPIT.
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.                                   CURVEY
  1758.  
  1759.  
  1760. Usage:     CALL CURVEY(XMIN,XMAX,Y,NPTS,ISYMNO,SYMSIZ,NPBSYM)
  1761.  
  1762.  
  1763. Purpose:   This subroutine is very similar in function to TRACCY.
  1764.            It connects the points (X(i),Y(i)) with a line of the
  1765.            current line type, and then places the selected symbol
  1766.            on the curve at the desired interval. The values of
  1767.            X(i) are calculated as:
  1768.                 X(i) = XMIN + (i-1)*(XMAX-XMIN)/(NPTS-1)
  1769.  
  1770.  
  1771. Arguments:
  1772.  
  1773. Input
  1774.  
  1775.         XMIN            * type: real constant or variable.
  1776.                         * The value of X corresponding to Y(1).
  1777.  
  1778.         XMAX            * type: real constant or variable.
  1779.                         * The value of X corresponding to
  1780.                           Y(NPTS).
  1781.  
  1782.         Y               * type: real array.
  1783.                         * The ordered Y values to connect.
  1784.  
  1785.         NPTS            * type: integer constant or variable.
  1786.                         * The number of (X,Y) points to connect.
  1787.  
  1788.         ISYMNO          * type: integer constant or variable.
  1789.                         * The number of the centered symbol to
  1790.                           place on the curve:
  1791.                              0 ==> no symbol,
  1792.                              1 ==> triangle,
  1793.                              2 ==> square,
  1794.                              3 ==> diamond,
  1795.                              4 ==> hour glass.
  1796.  
  1797.         SYMSIZ          * type: real constant or variable.
  1798.                         * The symbol height in virtual coordi-
  1799.                           nates.
  1800.  
  1801.         NPBSYM          * type: integer constant or variable.
  1802.                         * The spacing of the symbols. The symbols
  1803.                           are placed at every NPBSYM points along
  1804.                           the curve.
  1805.  
  1806.  
  1807.  
  1808.      Output
  1809.  
  1810.         None.
  1811.  
  1812.  
  1813.  
  1814. Programming notes:
  1815.  
  1816.         *  Like TRACEC, CURVE does not plot any points that lie
  1817.            outside the world coordinates established by
  1818.            MAPIT.
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.                                   DEVSEL
  1860.  
  1861.  
  1862. Usage:     CALL DEVSEL(IDEVICE,LUN,IERR)
  1863.  
  1864.  
  1865. Purpose:   This subroutine selects the current display device.
  1866.            The device selected when DEVSEL is called is released.
  1867.            All low level display parameters are reset by DEVSEL.
  1868.            This includes the current line type, any user defined
  1869.            line styles, the current color for drawing, the trans-
  1870.            formation from virtual to absolute coordinates (thus
  1871.            any window/viewports), the character size and orienta-
  1872.            tion, and the color map for colors 0 to 15.
  1873.  
  1874.  
  1875. Arguments:
  1876.  
  1877.      Input
  1878.  
  1879.         IDEVICE         * type: integer constant of variable.
  1880.                         * The device number of the device to
  1881.                           select.
  1882.  
  1883.         LUN             * type: integer constant or variable.
  1884.                         * The logical unit number on which I/O is
  1885.                           to take place to the graphics device.
  1886.  
  1887.      Output
  1888.  
  1889.         IERR            * type: integer variable.
  1890.                         * An error flag:
  1891.                              0 ===> device selected
  1892.                              -1 ==> no such device on this sys-
  1893.                                     tem.
  1894.                              1 ===> Assign to graphics device
  1895.                                     failed. If device is share-
  1896.                                     able, this usually indicates
  1897.                                     another users is using indi-
  1898.                                     cates another users is using
  1899.                                     the device.
  1900.                              2 ===> Assign to user's terminal
  1901.                                     failed.
  1902.                              3 ===> Unable to open a scratch or
  1903.                                     temporary file.
  1904.                              4-9==> reserved.>9 ==>IERR is Amiga-
  1905.                                     DIGLIB device driver spe-
  1906.                                     cific.
  1907.  
  1908.  
  1909.  
  1910. Programming notes:
  1911.  
  1912.         *  DEVSEL has the effect of calling:
  1913.               CALL GSETDP(0.0,1.0,1.0,0.0,0.0)
  1914.               CALL GSSETC(GOODCS(0.3),0.0)
  1915.               CALL GSLTYP(1)
  1916.               CALL GSCOLR(1,IERR)
  1917.            and of setting colors 0 thru 15 to background, fore-
  1918.            ground, red, green, blue, yellow, magenta, cyan, etc.
  1919.            respectively.
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.                                    DUMP
  1962.  
  1963.  
  1964. Usage:     CALL DUMP
  1965.  
  1966.  
  1967. Purpose:   This subroutine causes the screen to be dumped to a
  1968.            printer or file.
  1969.  
  1970.  
  1971. Arguments:
  1972.  
  1973.         None.
  1974.  
  1975.  
  1976. Programming notes:
  1977.  
  1978.         None.
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.                                   ENDPLT
  2013.  
  2014.  
  2015. Usage:     CALL ENDPLT
  2016.  
  2017.  
  2018. Purpose:   This subroutine causes the buffer of graphics commands
  2019.            to be emptied. It is generally called at the end of
  2020.            all plotting. However, in interactive applications, it
  2021.            is nearly always necessary to use ENDPLT previous to
  2022.            any operator interaction with the graphics to make
  2023.            sure the entire picture is displayed.  Amiga-DIGLIB uses
  2024.            ENDPLT to wait for the user to close the graphics window
  2025.            by clicking the mouse cursor in the close window gadget.
  2026.  
  2027. Arguments:
  2028.  
  2029.         None.
  2030.  
  2031.  
  2032. Programming notes:
  2033.  
  2034.         *  Although some graphic device drivers do not buffer the
  2035.            graphic commands, it is good programming practice to
  2036.            include the proper ENDPLT calls.
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.                                   FULMAP
  2065.  
  2066.  
  2067. Usage:     CALL FULMAP
  2068.  
  2069.  
  2070. Purpose:   This subroutine allocates the entire plotting surface
  2071.            (screen) for use by MAPIT. A small border is provided.
  2072.            FULMAP provides a device independent method of using
  2073.            the entire plotting surface.
  2074.  
  2075.  
  2076. Arguments:
  2077.  
  2078.      None.
  2079.  
  2080.    
  2081. Programming notes:
  2082.  
  2083.         *  FULMAP is equivalent to PLTLIB's ALLOCG(1,30,1,80).
  2084.  
  2085.         *  FULMAP does not allow room for the right-hand side Y
  2086.            axis.
  2087.  
  2088.         *  The character size of the plot is the same as would be
  2089.            chosen by MAPSIZ(0.0,100.0,0.0,100.0,0.0).
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.                                   GOODCS
  2116.  
  2117.  
  2118. Usage:     CSIZE = GOODCS(APPROXSIZE)
  2119.  
  2120.  
  2121. Purpose:   This real function returns the "good" character size
  2122.            for the currently selected device that is close to the
  2123.            size APPROXSIZE. Because of device resolution, charac-
  2124.            ters drawn certain sizes will not appear nearly as
  2125.            nice as characters drawn slightly smaller or larger.
  2126.            GOODCS gives the user a way to select a good character
  2127.            size when appearance of the characters is critical.
  2128.  
  2129.  
  2130. Arguments:
  2131.  
  2132.      Input
  2133.  
  2134.         APPROXSIZE      * type: real constant or variable.
  2135.                         * The approximate character height in
  2136.                           virtual coordinates.
  2137.  
  2138.      Output
  2139.  
  2140.         GOODCS          * Type: real variable.
  2141.                         * The "good" character size for the cur-
  2142.                           rently selected device in virtual coor-
  2143.                           dinates.
  2144.  
  2145.  
  2146. Programming notes:
  2147.  
  2148.        *  Character size in Amiga-DIGLIB is the height of capital
  2149.           letters.
  2150.  
  2151.        *  GOODCS will not function properly when:
  2152.             1) Used with devices whose X resolution is not equal
  2153.                to it's Y resolution.
  2154.             2) Used with the X scale factor not equal to the Y
  2155.                scale factor in the virtual to absolute coordinate
  2156.                transformation.
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.                                   GRAFIN
  2167.  
  2168.  
  2169. Usage:     CALL GRAFIN(WORLDX,WORLDY,LFLAG)
  2170.  
  2171.  
  2172. Purpose:   This subroutine reads the position of the cursor using
  2173.            GSINPT and returns the cursor position in world coor-
  2174.            dinates. The selection flag is also returned from
  2175.            GSINPT.
  2176.  
  2177.  
  2178. Arguments:
  2179.  
  2180.      Input
  2181.  
  2182.         None.
  2183.  
  2184.      Output
  2185.  
  2186.         WORLDX          * type: real variable.
  2187.                         * The variable to receive the X world
  2188.                           coordinate of the cursor.
  2189.  
  2190.         WORLDY          * type: real variable.
  2191.                         * The variable to receive the Y world
  2192.                           coordinate of the cursor.
  2193.  
  2194.         LFLAG           * type: logical variable.
  2195.                         * The selection flag. See GSINPT for the
  2196.                           definition of this flag.
  2197.  
  2198.  
  2199. Programming notes:
  2200.  
  2201.         *  This subroutines uses GSINPT to actually read the cur-
  2202.            sor position.
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.                                   GSCOLR
  2218.  
  2219.  
  2220. Usage:     CALL GSCOLR(ICOLOR,IERR)
  2221.  
  2222.  
  2223. Purpose:   This subroutine sets the current plotting color on
  2224.            devices that support multiple colors, or drawing in
  2225.            the background color.
  2226.  
  2227.  
  2228. Arguments:
  2229.  
  2230.      Input
  2231.  
  2232.         ICOLOR          * type: integer constant or variable.
  2233.                         * The number of the color to select.
  2234.  
  2235.      Output
  2236.  
  2237.         IERR            * type: integer variable.
  2238.                         * An error flag:
  2239.                              0 ===> color set
  2240.                              -1 ==> unable to set given color.
  2241.  
  2242.  
  2243. Programming notes:
  2244.  
  2245.         *  The background color is color 0.
  2246.  
  2247.         *  The foreground color is color 1.
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.                                   GSCRSR
  2269.  
  2270. Usage:     CALL GSCRSR(X,Y,IBUTTN,IERR)
  2271.  
  2272. Purpose:   This subroutine causes a graphics input operation to
  2273.            take place. A cursor that the user can fly around
  2274.            until he has selected the proper location. When the
  2275.            proper location has been designated, the user "presses
  2276.            a button" (more generally, changes the state of the
  2277.            buttons or switches) on the pointing device. This ter-
  2278.            minates the graphics input operation, and the cursor
  2279.            is removed if possible.
  2280.  
  2281. Arguments:
  2282.  
  2283.      Input
  2284.  
  2285.         None
  2286.  
  2287.      Output
  2288.  
  2289.         X               * Type: real variable.
  2290.                         * The X position selected in virtual
  2291.                           coordinates.
  2292.  
  2293.         Y               * Type: real variable.
  2294.                         * The Y position selected in virtual
  2295.                           coordinates.
  2296.  
  2297.         IBUTTN          * Type: integer variable.
  2298.                         * The new button state.
  2299.  
  2300.         IERR            * Type: integer variable.
  2301.                         * An error flag:
  2302.                              0 ===> graphics input operation
  2303.                                     successful.
  2304.                              -1 ==> device does not support
  2305.                                     graphics input.
  2306.  
  2307. Programming Notes:
  2308.  
  2309.         *  The buttons are numbered from 1 to N. (See the indi-
  2310.            vidual device driver documentation for the number
  2311.            scheme.) The state of the buttons is returned as an
  2312.            integer with the N least significant bits encoding the
  2313.            button state. The correspondence between bit and but-
  2314.            ton is: Bit = 2**(button-1). A bit value of one means
  2315.            the button/switch is pressed/set. A value of zero
  2316.            means the button/switch is not-pressed/clear.
  2317.  
  2318.                                   GSDLNS
  2319.  
  2320.  
  2321. Usage:     CALL GSDLNS(ILTYPE,ON1,OFF1,ON2,OFF2 )
  2322.  
  2323.  
  2324. Purpose:   This subroutine permits the broken line styles to be
  2325.            defined by the user. Note, user defined line styles
  2326.            are restored to the default values by DEVSEL.
  2327.  
  2328.  
  2329. Arguments:
  2330.  
  2331.      Input
  2332.  
  2333.         ILTYPE          * Type: integer constant or variable.
  2334.                         * The broken line type number to define.
  2335.                           2<= ILTYPE <=4.
  2336.  
  2337.         ON1             * Type: real constant or variable.
  2338.                         * The length in absolute coordinates of
  2339.                           the first segment of the line style;
  2340.                           drawn "with the pen down".
  2341.  
  2342.         OFF1            * Type: real constant or variable.
  2343.                         * The length in absolute coordinates of
  2344.                           the second segment of the line style;
  2345.                           drawn "with the pen up".
  2346.  
  2347.         ON2             * Type: real constant or variable.
  2348.                         * The length in absolute coordinates of
  2349.                           the third segment of the line style;
  2350.                           drawn "with the pen down".
  2351.  
  2352.         OFF2            * Type: real constant or variable.
  2353.                         * The length in absolute coordinates of
  2354.                           the fourth segment of the line style;
  2355.                           drawn "with the pen up".
  2356.  
  2357.      Output
  2358.  
  2359.         None
  2360.  
  2361.  
  2362. Programming Notes:
  2363.  
  2364.         *  Line styles defined using GSDLNS are reset to the
  2365.            default line styles by DEVSEL.
  2366.  
  2367.         *  Specifying ILTYPE outside the range [2..4] will do
  2368.            nothing.
  2369.         *  The default values are:
  2370.  
  2371.                ILTYPE  ON1     OFF1    ON2     OFF2
  2372.                    2    0.5     0.50    0.5     0.5
  2373.                    3    0.25    0.25    0.25    0.25
  2374.                    4    0.5     0.25    0.25    0.25
  2375.            Since these are absolute coordinates, they are in cen-
  2376.            timeters.
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.                                   GSDNAM
  2421.  
  2422.  
  2423. Usage:     CALL GSDNAM(IDEV,DNAME)
  2424.  
  2425.  
  2426. Purpose:   This subroutine returns the device name that corre-
  2427.            sponds to the given device number. The name is
  2428.            returned as a standard Amiga-DIGLIB string.
  2429.  
  2430.  
  2431. Arguments:
  2432.  
  2433.      Input
  2434.  
  2435.         IDEV            * type: integer constant or variable.
  2436.                         * The device number for which the device
  2437.                           name is desired.
  2438.  
  2439.      Output
  2440.  
  2441.         DNAME           * type: string variable.
  2442.                         * The device name expressed as 39 charac-
  2443.                           ters or less. If there is no such
  2444.                           device, a null string is returned.
  2445.  
  2446.  
  2447. Programming notes:
  2448.  
  2449.         None.
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.                                    GSDRAW
  2472.  
  2473.  
  2474. Usage:     CALL GSDRAW(X,Y)
  2475.  
  2476.  
  2477. Purpose:   This subroutine draws a line from the current point to
  2478.            the point (X,Y) in virtual coordinates.
  2479.  
  2480.  
  2481. Arguments:
  2482.  
  2483.      Input
  2484.  
  2485.         X               * type: real constant or variable.
  2486.                         * The x virtual coordinate.
  2487.  
  2488.         Y               * type: real constant or variable.
  2489.                         * The y virtual coordinate.
  2490.  
  2491.      Output
  2492.  
  2493.         None.
  2494.  
  2495.  
  2496. Programming notes:
  2497.  
  2498.         None.
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.                                   GSETDP
  2523.  
  2524.  
  2525. Usage:     CALL GSETDP(ANGLE,XSCALE,YSCALE,XTRAN,YTRAN)
  2526.  
  2527.  
  2528. Purpose:   This subroutine sets the transformation parameters for
  2529.            converting virtual coordinates to absolute coordi-
  2530.            nates. Virtual coordinates are transformed to absolute
  2531.            coordinates in three ordered steps: rotation, scaling,
  2532.            then translation.
  2533.  
  2534.  
  2535. Arguments:
  2536.  
  2537.      Input
  2538.  
  2539.         ANGLE           * type: real constant or variable.
  2540.                         * The rotation angle of the virtual to
  2541.                           absolute transformation.
  2542.  
  2543.         XSCALE          * type: real constant or variable.
  2544.                         * The absolute x direction scale factor.
  2545.  
  2546.         YSCALE          * type: real constant or variable.
  2547.                         * The absolute y direction scale factor.
  2548.  
  2549.         XTRAN           * type: real constant or variable.
  2550.                         * The absolute x direction translation in
  2551.                           cm.
  2552.  
  2553.         YTRAN           * type: real constant or variable.
  2554.                         * The absolute y direction translation in
  2555.                           cm.
  2556.  
  2557.      Output
  2558.  
  2559.         None.
  2560.  
  2561.  
  2562. Programming notes:
  2563.  
  2564.         *  The transformation is calculated as follows:
  2565.            xtemp = Xvirtual*COS(angle) + Yvirtual*SIN(angle)
  2566.            ytemp = Yvirtual*COS(angle) - Xvirtual*SIN(angle)
  2567.            Xabsolute = xscale*xtemp + xtran
  2568.            Yabsolute = yscale*ytemp + ytran
  2569.  
  2570.         *  Notice that PAN and ZOOM are easily accomplished by
  2571.            proper manipulation of the scale factors (zoom) and
  2572.            the translation factors (pan).
  2573.                                   GSFILL
  2574.  
  2575.  
  2576. Usage:     CALL GSFILL(XVERTS,YVERTS,NUMPTS,TX,TY)
  2577.  
  2578.  
  2579. Purpose:   This subroutine draws a solid filled polygon. The ver-
  2580.            tices may be given in either clockwise or counter-
  2581.            clockwise order. The polygon need not be convex.
  2582.  
  2583.  
  2584. Arguments:
  2585.  
  2586.      Input
  2587.  
  2588.         XVERTS          * type: real array.
  2589.                         * The X vertices of the polygon in vir-
  2590.                           tual coordinates.
  2591.  
  2592.         YVERTS          * type: real array.
  2593.                         * The Y vertices of the polygon in vir-
  2594.                           tual coordinates.
  2595.  
  2596.         NUMPTS          * type: integer constant or variable.
  2597.                         * The number of vertices in the polygon.
  2598.  
  2599.      Output
  2600.  
  2601.         TX              * type: real array.
  2602.                         * Working array of NUMPTS elements. (The
  2603.                           absolute X coordinates of the vertices
  2604.                           are stored here.)
  2605.  
  2606.         TY              * type: real array.
  2607.                         * Working array of NUMPTS elements. (The
  2608.                           absolute Y coordinates of the vertices
  2609.                           are stored here.)
  2610.  
  2611. Programming notes:
  2612.  
  2613.         *  Hardware fill is used if possible, otherwise a soft-
  2614.            ware algorithm is used.
  2615.  
  2616.         *  Convex polygons are better than concave ones because
  2617.            some hardware will only handle convex polygons.
  2618.  
  2619.         *  Self-intersecting polygons are of dubious value. It is
  2620.            not guaranteed that the software algorithm used by Amiga-
  2621.            DIGLIB will match the hardware algorithm of all Amiga-
  2622.            DIGLIB devices. Thus, two devices may produce differ-
  2623.            ently filled self-intersecting polygons.
  2624.                                   GSGIN
  2625.  
  2626.  
  2627. Usage:     CALL GSGIN(XPOSN,YPOSN,BCHAR,IERR)
  2628.  
  2629.  
  2630. Purpose:   This subroutine performs a Graphics INput (GIN) oper-
  2631.            ation from the currently selected device.
  2632.  
  2633.  
  2634. Arguments:
  2635.  
  2636.      Input
  2637.  
  2638.         None.
  2639.  
  2640.      Output
  2641.  
  2642.         XPOSN           * type: real variable.
  2643.                         * The x position of the cursor selected
  2644.                           by the user in virtual coordinates.
  2645.  
  2646.         YPOSN           * type: real variable.
  2647.                         * The y position of the cursor selected
  2648.                           by the user in virtual coordinates.
  2649.  
  2650.         BCHAR           * type: byte variable.
  2651.                         * The "pick" character entered by the
  2652.                           user to denote the proper placement of
  2653.                           the cursor.
  2654.  
  2655.         IERR            * type: integer variable.
  2656.                         * An error flag:
  2657.                              0 ===> GIN operation successful.
  2658.                              -1 ==> device does not support GIN.
  2659.  
  2660.  
  2661. Programming notes:
  2662.  
  2663.         *  A GIN operation consists of the following steps:
  2664.             1) The cursor is made to appear on the graphics
  2665.                device (if possible).
  2666.             2) The user positions the cursor to the desired loca-
  2667.                tion.
  2668.             3) The user strikes a key at the terminal keyboard or
  2669.                at the graphic device keyboard if one exists.
  2670.             4) The cursor position is read along with the key the
  2671.                user struck.
  2672.             5) The cursor is removed from the graphic device (if
  2673.                possible).
  2674.  
  2675.             6) The absolute cursor coordinates are converted to
  2676.                virtual coordinates.
  2677.             7) The virtual coordinate location of the cursor, and
  2678.                the ASCII character struck by the user are
  2679.                returned to the caller.
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.                                   GSINPT
  2727.  
  2728.  
  2729. Usage:     CALL GSINPT(X,Y,LFLAG,IERR)
  2730.  
  2731.  
  2732. Purpose:   This subroutine performs a "generic" graphics input
  2733.            using either GSCRSR or GSGIN, whichever is available.
  2734.            When both are available, then GSCRSR is used.
  2735.  
  2736.  
  2737. Arguments:
  2738.  
  2739.      Input
  2740.  
  2741.         None.
  2742.  
  2743.      Output
  2744.  
  2745.         X               * type: real variable.
  2746.                         * The X coordinate selected in virtual
  2747.                           coordinates.
  2748.  
  2749.         Y               * type: real variable.
  2750.                         * The Y coordinate selected in virtual
  2751.                           coordinates.
  2752.  
  2753.         LFLAG           * type: logical variable.
  2754.                         * A flag that some users may find useful.
  2755.                           LFLAG = .TRUE. when:
  2756.                              GSCRSR used and button 1 state is
  2757.                                     pressed.
  2758.                              GSGIN used and space bar pressed.
  2759.                              LFLAG = .FALSE. otherwise.
  2760.  
  2761.         IERR            * type: integer variable.
  2762.                         * An error flag:
  2763.                              0 ===> graphics input operation
  2764.                                     successful.
  2765.                              -1 ==> device does not support
  2766.                                     graphis input.
  2767.  
  2768.  
  2769. Programming notes:
  2770.  
  2771.         None.
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.                                   GSLENS
  2778.  
  2779.  
  2780. Usage:     VLEN = GSLENS(BSTRNG)
  2781.  
  2782.  
  2783. Purpose:   This function calculates the length of the input
  2784.            string in virtual coordinates assuming the current
  2785.            character size.
  2786.  
  2787.  
  2788. Arguments:
  2789.  
  2790.      Input
  2791.  
  2792.         BSTRNG          * type: string.
  2793.  
  2794.      Output
  2795.  
  2796.         GSLENS          * type: real variable.
  2797.                         * The length of the string in virtual
  2798.                           coordinates when plotted in the current
  2799.                           character size.
  2800.  
  2801.  
  2802. Programming notes:
  2803.  
  2804.         None.
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.                                   GSLTYP
  2829.  
  2830.  
  2831. Usage:     CALL GSLTYP(LINTYP)
  2832.  
  2833.  
  2834. Purpose:   This subroutine selects the current line type. Four
  2835.            line types are available:
  2836.             1) solid
  2837.             2) long dash - user definable
  2838.             3) short dash - user definable
  2839.             4) dot dash - user definable
  2840.            The line type is reset to 1 by DEVSEL.
  2841.  
  2842.  
  2843. Arguments:
  2844.  
  2845.      Input
  2846.  
  2847.         LINTYP          * Type: integer constant or variable.
  2848.                         * The line type number:
  2849.                              1 ==> solid
  2850.                              2 ==> long dash
  2851.                              3 ==> short dash
  2852.                              4 ==> dot dash
  2853.  
  2854.      Output
  2855.  
  2856.         None.
  2857.  
  2858.  
  2859. Programming notes:
  2860.  
  2861.         *  Calls to GSMOVE will restart the current line style to
  2862.            the beginning, but calls to GSDRAW do not. Thus, a
  2863.            curve will appear to be composed of a continuous line
  2864.            in the current line style if and only if no GSMOVEs
  2865.            intervene the GSDRAWs used to trace the curve.
  2866.  
  2867.         *  The line type is reset to 1 by DEVSEL.
  2868.  
  2869.         *  Line styles are generated in absolute coordinates, and
  2870.            so are not effected by windowing/viewporting.
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.                                   GSMOVE
  2880.  
  2881.  
  2882. Usage:     CALL GSMOVE(X,Y)
  2883.  
  2884.  
  2885. Purpose:   This subroutine moves the graphic position from its
  2886.            current location to the new location (X,Y). The
  2887.            new location is expressed in virtual coordinates.
  2888.  
  2889.  
  2890. Arguments:
  2891.  
  2892.      Input
  2893.  
  2894.         X               * type: real constant or variable.
  2895.                         * The virtual x coordinate to move to.
  2896.  
  2897.         Y               * type: real constant or variable.
  2898.                         * The virtual y coordinate to move to.
  2899.  
  2900.      Output
  2901.  
  2902.         None.
  2903.  
  2904.  
  2905. Programming notes:
  2906.  
  2907.         *  GSMOVE replaces PLTLIB's POSNB and RPOSNB.
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.                                   GSPOLY
  2931.  
  2932.  
  2933. Usage:     CALL GSPOLY(XVERTS,YVERTS,NUMPTS)
  2934.  
  2935.  
  2936. Purpose:   This subroutine draws a polygon boundary. The vertices
  2937.            may be given in either clockwise or counter-clockwise
  2938.            order. The polygon need not be convex.
  2939.  
  2940.  
  2941. Arguments:
  2942.  
  2943.      Input
  2944.  
  2945.         XVERTS          * type: real array.
  2946.                         * The X vertices of the polygon in vir-
  2947.                           tual coordinates.
  2948.  
  2949.         YVERTS          * type: real array.
  2950.                         * The Y vertices of the polygon in vir-
  2951.                           tual coordinates.
  2952.  
  2953.         NUMPTS          * type: integer constant or variable.
  2954.                         * The number of vertices in the polygon.
  2955.  
  2956.      Output
  2957.  
  2958.         None.
  2959.  
  2960.  
  2961. Programming notes:
  2962.  
  2963.         None.
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.                                   GSPSTR
  2982.  
  2983.  
  2984. Usage:     CALL GSPSTR(LABEL)
  2985.  
  2986.  
  2987. Purpose:   This subroutine plots a string of characters starting
  2988.            at the current (X,Y) location. The lower left corner
  2989.            of the first character cell is located at (X,Y). The
  2990.            string is plotted in the current character size and at
  2991.            the current character rotation as specified by the
  2992.            last call to GSSETC. The characters are plotted in the
  2993.            font last selected by GSFONT (VMS only) but this may
  2994.            be temporarily overridden by the insertion of "change
  2995.            font blips" to the string.
  2996.  
  2997.  
  2998. Arguments:
  2999.  
  3000.      Input
  3001.  
  3002.         LABEL           * String constant or variable.
  3003.                         * The string to plot.
  3004.                         * Null terminated.
  3005.  
  3006.      Output
  3007.  
  3008.         None.
  3009.  
  3010.  
  3011. Programming Notes:
  3012.  
  3013.         *  The default character size is 0.3 centimeters.
  3014.  
  3015.         *  The default character orientation is 0 degrees, i.e.
  3016.            characters left-to-right horizontally.
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.                                   GSSETC
  3033.  
  3034.  
  3035. Usage:     CALL GSSETC(CSIZE,CANGLE)
  3036.  
  3037.  
  3038. Purpose:   This subroutine sets the character size and rotation
  3039.            parameters to be used in subsequent character gener-
  3040.            ation.
  3041.  
  3042.  
  3043. Arguments:
  3044.  
  3045.      Input
  3046.  
  3047.         CSIZE           * type: real constant or variable.
  3048.                         * The height of capital letters in vir-
  3049.                           tual coordinates.
  3050.  
  3051.         CANGLE          * type: real constant or variable.
  3052.                         * The angle in degrees at which the char-
  3053.                           acters are to be rotated. The angle is
  3054.                           measured from the positive x axis in
  3055.                           virtual coordinates.
  3056.  
  3057.      Output
  3058.  
  3059.         None.
  3060.  
  3061.  
  3062. Programming notes:
  3063.  
  3064.         *  Note that characters are drawn in virtual coordinates,
  3065.            and so are subject to the virtual to absolute coordi-
  3066.            nate transformation.
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.                                   GSWNDO
  3084.  
  3085.  
  3086. Usage:     CALL GSWNDO(UXL,UXH,UYL,UYH,XAOFF,YAOFF,XAWDTH,YAHIGH)
  3087.  
  3088.  
  3089. Purpose:   This subroutine is an alternate method of selecting
  3090.            the virtual to absolute coordinate transformation. It
  3091.            also provides for clipping of all graphics to be
  3092.            within the absolute area on the screen specified. The
  3093.            first four parameters establish the range of virtual
  3094.            coordinates the user wishes to use. The remaining four
  3095.            parameters establish the rectangular region on the
  3096.            screen into which the virtual coordinates are to be
  3097.            mapped. For example:
  3098.               CALL GSWNDO(-1.0,1.0,-1.0,1.0,0.5,0.5,10.0,10.0)
  3099.            will map the rectangular region of the screen bounded
  3100.            by (0.5,0.5) and (10.5,10.5) to correspond to the vir-
  3101.            tual coordinate area bounded by (-1.0,-1.0) and
  3102.            (1.0,1.0). All graphics outside the 10 cm. square area
  3103.            bounded to (0.5,0.5) and (10.5,10.5) will be clipped.
  3104.  
  3105. Arguments:
  3106.  
  3107.      Input
  3108.  
  3109.         UXL             * Type: real constant or variable.
  3110.                         * The X lower bound for virtual coordi-
  3111.                           nates.
  3112.  
  3113.         UXH             * Type: real constant or variable.
  3114.                         * The X upper bound for virtual coordi-
  3115.                           nates.
  3116.  
  3117.         UYL             * Type: real constant or variable.
  3118.                         * The Y lower bound for virtual coordi-
  3119.                           nates.
  3120.  
  3121.         UYH             * Type: real constant or variable.
  3122.                         * The Y upper bound for virtual coordi-
  3123.                           nates.
  3124.  
  3125.         XAOFF           * Type: real constant or variable.
  3126.                         * The X offset of the absolute rectangu-
  3127.                           lar area on the screen into which to
  3128.                           map the virtual coordinates.
  3129.  
  3130.         YAOFF           * Type: real constant or variable.
  3131.                         * The Y offset of the absolute rectangu-
  3132.                           lar area on the screen into which to
  3133.                           map the virtual coordinates.
  3134.         XAWDTH          * Type: real constant or variable.
  3135.                         * The width in absolute coordinates of
  3136.                           the rectangular region into which to
  3137.                           map the virtual coordinates.
  3138.  
  3139.         YAHIGH          * Type: real constant or variable.
  3140.                         * The height in absolute coordinates of
  3141.                           the rectangular region into which to
  3142.                           map the virtual coordinates.
  3143.  
  3144.      Output
  3145.  
  3146.         None.
  3147.  
  3148.  
  3149. Programming Notes:
  3150.  
  3151.         *  If (UXH-UXL)/XAWDTH is not equal to (UYH-UYL)/YAHIGH
  3152.            then you can expect some distortion in shapes. This
  3153.            will be especially noticeable in graphics characters,
  3154.            square, and circles.
  3155.  
  3156.         *  DEVSEL resets the window/viewport to:
  3157.            CALL GSWNDO(0.0,GSXLCM(),0.0,GSYLCM(),0.0,0.0,
  3158.                        GSXLCM(),GSYLCM())
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.                                   GSXLCM
  3186.  
  3187.  
  3188. Usage:     XLENGTH = GSXLCM()
  3189.  
  3190.  
  3191. Purpose:   This real valued function returns the length of the
  3192.            currently selected device's X axis in centimeters.
  3193.  
  3194.  
  3195. Arguments:
  3196.  
  3197.      Input
  3198.  
  3199.         None.
  3200.  
  3201.      Output
  3202.  
  3203.         None.
  3204.  
  3205.      Functional Result
  3206.  
  3207.         GSXLCM          * type: real variable.
  3208.                         * The length of the currently selected
  3209.                           device's X axis in centimeters.
  3210.  
  3211.  
  3212. Programming notes:
  3213.  
  3214.         None.
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.                                   GSWAIT
  3237.  
  3238.  
  3239.  Usage:     CALL GSWAIT
  3240.  
  3241.  
  3242.  Purpose:   This function is normally imbedded in the ENDPLT routine
  3243.             and waits for the user to click the closewindow gadget
  3244.             to return to the CLI screen and window.  It may be useful
  3245.             in some cases as a stand alone call in a program.
  3246.  
  3247.  
  3248.  Arguments:
  3249.  
  3250.       Input
  3251.  
  3252.           None.
  3253.  
  3254.       Output
  3255.              
  3256.           None.
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.                                GSYLCM
  3288.  
  3289.  
  3290. Usage:     YLENGTH = GSYLCM()
  3291.  
  3292.  
  3293. Purpose:   This real valued function returns the length of the
  3294.            currently selected device's Y axis in centimeters.
  3295.  
  3296.  
  3297. Arguments:
  3298.  
  3299.      Input
  3300.  
  3301.         None.
  3302.  
  3303.      Output
  3304.  
  3305.         None.
  3306.  
  3307.      Functional Result
  3308.  
  3309.         GSYLCM          * type: real variable.
  3310.                         * The length of the currently selected
  3311.                           devices Y axis in centimeters.
  3312.  
  3313.  
  3314. Programming notes:
  3315.  
  3316.         None.
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.                                   HATCH
  3339.  
  3340.  
  3341. Usage:     CALL HATCH(XVERT,YVERT,NUMPTS,ANGLE,SPACNG,IFLAGS,
  3342.                       TEMP1,TEMP2)
  3343.  
  3344.  
  3345. Purpose:   This subroutine fills a polygon or set of polygons and
  3346.            optionally draws their boundary. The polygon(s) can be
  3347.            filled with any density of fill lines running at any
  3348.            angle. Note that calling this routine twice with dif-
  3349.            ferent ANGLE parameters will give cross hatching.
  3350.  
  3351.  
  3352. Arguments:
  3353.  
  3354.      Input
  3355.  
  3356.         XVERT           * type: real array.
  3357.                         * Array of X vertices of the polygon. If
  3358.                           greater than or equal to 1.0E38, then
  3359.                           not a vertex, but rather a flag to sig-
  3360.                           nal the end of a polygon. The next
  3361.                           polygon starts at the next array ele-
  3362.                           ment.
  3363.  
  3364.         YVERT           * type: real array.
  3365.                         * Array of Y vertices of the polygon.
  3366.  
  3367.         NUMPTS          * type: integer constant or variable.
  3368.                         * The maximum subscript of the XVERT and
  3369.                           YVERT arrays defining the polygons.
  3370.                           Note that when only one polygon is
  3371.                           described, NUMPTS is the number of ver-
  3372.                           tices in the polygon. When "N" polygons
  3373.                           are described by XVERT and YVERT, the
  3374.                           NUMPTS is the sum of the total number
  3375.                           of vertices and "N-1", since "N-1"
  3376.                           polygon separators are needed.
  3377.  
  3378.         ANGLE           * type: real constant or variable.
  3379.                         * The angle of the fill lines measured
  3380.                           counter-clockwise from the positive x
  3381.                           axis.
  3382.  
  3383.         SPACNG          * type: real constant or variable.
  3384.                         * The spacing between the fill lines in
  3385.                           virtual coordinates (usually centime-
  3386.                           ters).
  3387.  
  3388.  
  3389.         IFLAGS          * type: integer constant or variable.
  3390.                         * An operation control flag that controls
  3391.                           whether the polygonal boundary(s) are
  3392.                           drawn, and whether XVERT and YVERT are
  3393.                           interpreted as virtual or world coordi-
  3394.                           nated:
  3395.                              0 ==> Boundary not drawn, virtual
  3396.                                     coordinate.
  3397.                              1 ==> Boundary drawn, virtual coor-
  3398.                                     dinate.
  3399.                              2 ==> Boundary not drawn, world
  3400.                                     coordinate.
  3401.                              3 ==> Boundary drawn, world coordi-
  3402.                                     nate.
  3403.  
  3404.         TEMP1           * type: real array.
  3405.                         * Work array for HATCH. Up to NUMPTS ele-
  3406.                           ments will be overwritten.
  3407.  
  3408.         TEMP2           * type: real array.
  3409.                         * Second work array for HATCH. Up to
  3410.                           NUMPTS elements will be overwritten.
  3411.  
  3412.      Output
  3413.  
  3414.         none.
  3415.  
  3416.  
  3417. Programming notes:
  3418.  
  3419.         *  The value in the YVERT(I) that corresponds to
  3420.            XVERT(I)=1.0E38 is ignored.
  3421.  
  3422.         *  GSFILL may be more appropriate in many cases.
  3423.  
  3424.         *  The multiple polygon fill capability can be used to
  3425.            fill an area and still leave some part (typically a
  3426.            box) within the area unfilled. To do this, simply spe-
  3427.            cify the polygon you want filled followed by
  3428.            XVERT(I)=1.0E38, then specify the box (polygon) in the
  3429.            interior that is to remain unfilled.
  3430.  
  3431.         *  A good value for the SPACNG parameter to obtain a
  3432.            solid fill can be computed using the values found in
  3433.            the common block GCDCHR as follows:
  3434.  
  3435.                         SPACNG = FLOAT(NFLINE)/YRES
  3436.  
  3437.  
  3438.  
  3439.  
  3440.                                   MAPIT
  3441.  
  3442.  
  3443. Usage:     CALL MAPIT(XMIN,XMAX,YMIN,YMAX,XLABEL,YLABEL,
  3444.                       TITLE,IOPTNS)
  3445.  
  3446.  
  3447. Purpose:   This subroutine draws the X and Y axes with labeled
  3448.            tick marks. It also labels the axes and places a title
  3449.            string above the top of the Y axis, centered over the
  3450.            X axis. Optionally, the axes can be linear or logar-
  3451.            ithmic. Grid lines at the tick marks can also be
  3452.            optionally produced. For those who like to enclose the
  3453.            plotting area, the X axis with tick labels can be
  3454.            duplicated at the top of the plot, and similarly, the
  3455.            Y axis can be duplicated at the right of the plot.
  3456.  
  3457.  
  3458. Arguments:
  3459.  
  3460.      Input
  3461.  
  3462.         XMIN            * type: real constant or variable.
  3463.                         * Minimum limit for the X axis in world
  3464.                           coordinates.
  3465.  
  3466.         XMAX            * type: real constant or variable.
  3467.                         * Maximum limit for the X axis in world
  3468.                           coordinates.
  3469.  
  3470.         YMIN            * type: real constant or variable.
  3471.                         * Minimum limit for the Y axis in world
  3472.                           coordinates.
  3473.  
  3474.         YMAX            * type: real constant or variable.
  3475.                         * Maximum limit for the Y axis in world
  3476.                           coordinates.
  3477.  
  3478.         XLABEL          * type: string literal or string vari-
  3479.                           able.
  3480.                         * The X axis label. This string is cen-
  3481.                           tered below the X axis.
  3482.  
  3483.         YLABEL          * type: string literal or string vari-
  3484.                           able.
  3485.                         * The Y axis label. This string is cen-
  3486.                           tered to the left of the Y axis and is
  3487.                           written at 90 degrees.
  3488.  
  3489.  
  3490.  
  3491.         TITLE           * type: string literal or string vari-
  3492.                           able.
  3493.                         * The plot title. This string is centered
  3494.                           over the X axis above the top of the Y
  3495.                           axis.
  3496.         IOPTNS          * type: integer constant or variable.
  3497.                         * The axes options. This value is com-
  3498.                           puted by summing the values of the
  3499.                           individual option values:
  3500.                              1 ===> Log X axis, not linear X
  3501.                                     axis.
  3502.                              2 ===> Log Y axis, not linear Y
  3503.                                     axis.
  3504.                              4 ===> Include X axis grid lines.
  3505.                              8 ===> Include Y axis grid lines.
  3506.                              16 ==> Allow X axis not to end on
  3507.                                     tick marks. Only applies to
  3508.                                     linear X axis.
  3509.                              32 ==> Allow Y axis not to end on
  3510.                                     tick marks. Only applies to
  3511.                                     linear Y axis.
  3512.                              64 ==> Place unlabeled X axis at top
  3513.                                     of plotting area.
  3514.                              128 => Place unlabeled Y axis at
  3515.                                     right of plotting area.
  3516.                              256 => Override MAPITs extension of
  3517.                                     axes that end close to tick
  3518.                                     marks. Only valid with 16,
  3519.                                     32, or both. This option can
  3520.                                     lead to "poor" looking axes
  3521.                                     frames so it's use is not
  3522.                                     recommended.
  3523.                              512 => Don't plot X axis tick
  3524.                                     labels.
  3525.                              1024 > Don't plot Y axis tick
  3526.                                     labels.
  3527.  
  3528.      Output
  3529.  
  3530.         None.
  3531.  
  3532.  
  3533. Programming notes:
  3534.  
  3535.         *  The default (IOPTNS=0) axes are linear X, linear Y, no
  3536.            X or Y grid lines, axes that end on tick marks, and no
  3537.            duplicated axes.
  3538.  
  3539.  
  3540.  
  3541.  
  3542.         *  If you are planning to add a second Y axis with
  3543.            SYAXIS, then you must call MAPSZ2 or PLTSZ2 instead of
  3544.            FULMAP, MAPSIZ, or PLTSIZ. In addition, it is sug-
  3545.            gested that the Y axis not be duplicated at the right
  3546.            of the plotting area.
  3547.  
  3548.         *  A negative value for the tick length (as specified to
  3549.            MAPPRM or MAPSET) will yield ticks that stick into the
  3550.            plotting area, not out of the plotting area.
  3551.         *  If you desire the on-screen axis length of the X and Y
  3552.            axes be equal, see the section titled "HANDLING
  3553.            DEVICES OF DIFFERENT SIZES".
  3554.  
  3555.         *  The algorithm that allows linear axes to end on non-
  3556.            tickmarks only does so when the axis would end less
  3557.            than 80% from the next tick mark, i.e. if the tick
  3558.            interval chosen was 10 and the axis was to end on x1,
  3559.            x2, ..., x7 (where x is any digit), then the axis
  3560.            would not be extended, but if the axis ended on x8, or
  3561.            x9, then it would be extended to (x+1)0. You can over-
  3562.            ride this automatic extension by adding 256 to IOPTNS.
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.                                   MAPPRM
  3594.  
  3595.  
  3596. Usage:     CALL MAPPRM(XLEFT,XRIGHT,YBOTOM,YTOP,CSIZE,
  3597.                        TICKLN,LRAXIS)
  3598.  
  3599.  
  3600. Purpose:   This subroutine sets parameters used by MAPIT in draw-
  3601.            ing the world coordinate axes. Identical to MAPSET
  3602.            except that the plotting area is specified in virtual
  3603.            coordinates not in percentage of the full screen.
  3604.  
  3605.  
  3606. Arguments:
  3607.  
  3608.      Input
  3609.  
  3610.         XLEFT           * type: real constant or variable.
  3611.                         * The left limit of the box which bounds
  3612.                           the plotting area in virtual coordi-
  3613.                           nates.
  3614.  
  3615.         XRIGHT          * type: real constant or variable.
  3616.                         * The right limit of the box which bounds
  3617.                           the plotting area in virtual coordi-
  3618.                           nates.
  3619.  
  3620.         YBOT            * type: real constant or variable.
  3621.                         * The lower limit of the box which bounds
  3622.                           the plotting area in virtual coordi-
  3623.                           nates.
  3624.  
  3625.         YTOP            * type: real constant or variable.
  3626.                         * The upper limit of the box which bounds
  3627.                           the plotting area in virtual coordi-
  3628.                           nates.
  3629.  
  3630.         CSIZE           * type: real constant or variable.
  3631.                         * The character size to use for tick
  3632.                           labels, axes labels, and the title.
  3633.  
  3634.         TICKLN          * type: real constant or variable.
  3635.                         * The length of the ticks:
  3636.                              A positive value yields ticks out-
  3637.                                     side the plotting area.
  3638.                              A negative value yields ticks inside
  3639.                                     the plotting area.
  3640.  
  3641.  
  3642.  
  3643.  
  3644.         LRAXIS          * type: logical*2 constant or variable.
  3645.                         * A flag indicating whether room should
  3646.                           be provided for a second Y axis to be
  3647.                           placed at the right edge of the plot.
  3648.                              .TRUE. ==> provide room for second Y
  3649.                                         axis.
  3650.                              .FALSE.==> do not provide room.
  3651.  
  3652.      Output
  3653.  
  3654.         None.
  3655.  
  3656.  
  3657. Programming notes:
  3658.  
  3659.         *  All values are in virtual coordinates.
  3660.  
  3661.         *  A negative value for the tick length TICKLN will yield
  3662.            ticks that stick into the plotting area, not out of
  3663.            the plotting area.
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.                                   MAPSET
  3696.  
  3697.  
  3698. Usage:     CALL MAPSET(XLEFT,XRIGHT,YBOTOM,YTOP,CSIZE,
  3699.                        TICKLN,LRAXIS)
  3700.  
  3701.  
  3702. Purpose:   This subroutine sets parameters used by MAPIT in draw-
  3703.            ing the world coordinate axes. Identical to MAPPRM
  3704.            except plotting area limits are in percentage of full
  3705.            screen, not in virtual coordinates.
  3706.  
  3707.  
  3708. Arguments:
  3709.  
  3710.      Input
  3711.  
  3712.         XLEFT           * type: real constant or variable.
  3713.                         * The left limit of the box which bounds
  3714.                           the plotting area in percentage of full
  3715.                           screen.
  3716.  
  3717.         XRIGHT          * type: real constant or variable.
  3718.                         * The right limit of the box which bounds
  3719.                           the plotting area in percentage of full
  3720.                           screen.
  3721.  
  3722.         YBOT            * type: real constant or variable.
  3723.                         * The lower limit of the box which bounds
  3724.                           the plotting area in percentage of full
  3725.                           screen.
  3726.  
  3727.         YTOP            * type: real constant or variable.
  3728.                         * The upper limit of the box which bounds
  3729.                           the plotting area in percentage of full
  3730.                           screen.
  3731.  
  3732.         CSIZE           * type: real constant or variable.
  3733.                         * The character size to use for tick
  3734.                           labels, axes labels, and the title.
  3735.  
  3736.         TICKLN          * type: real constant or variable.
  3737.                         * The length of the ticks:
  3738.                              A positive value yields ticks out-
  3739.                                     side the plotting area.
  3740.                              A negative value yields ticks inside
  3741.                                     the plotting area.
  3742.  
  3743.  
  3744.  
  3745.  
  3746.         LRAXIS          * type: logical*2 constant or variable.
  3747.                         * A flag indicating whether room should
  3748.                           be provided for a second Y axis to be
  3749.                           placed at the right edge of the plot.
  3750.                              .TRUE. ==> provide room for second Y
  3751.                                         axis.
  3752.                              .FALSE.==> do not provide room.
  3753.      Output
  3754.  
  3755.         None.
  3756.  
  3757.  
  3758. Programming notes:
  3759.  
  3760.         *  A negative value for the tick length TICKLN will yield
  3761.            ticks that stick into the plotting area, not out of
  3762.            the plotting area.
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.                                   MAPSIZ
  3798.  
  3799.  
  3800. Usage:     CALL MAPSIZ(XLEFT,XRIGHT,YBOTOM,YTOP,CHRSIZ)
  3801.  
  3802.  
  3803. Purpose:   This subroutine specifies the region of the graphics
  3804.            area where MAPIT is to place the 2D axes. This subrou-
  3805.            tine allows the user to define the region of the
  3806.            graphic area in a device independent manner.
  3807.  
  3808.  
  3809. Arguments:
  3810.  
  3811.      Input
  3812.  
  3813.         XLEFT           * type: real constant or variable.
  3814.                         * The left boundary of the region
  3815.                           expressed as a percent of the current
  3816.                           device's x axis length.
  3817.  
  3818.         XRIGHT          * type: real constant or variable.
  3819.                         * The right boundary of the region
  3820.                           expressed as a percent of the current
  3821.                           device's x axis length.
  3822.  
  3823.         YBOT            * type: real constant or variable.
  3824.                         * The bottom boundary of the region
  3825.                           expressed as a percent of the current
  3826.                           device's y axis length.
  3827.  
  3828.         YTOP            * type: real constant or variable.
  3829.                         * The top boundary of the region
  3830.                           expressed as a percent of the current
  3831.                           device's y axis length.
  3832.  
  3833.         CHRSIZ          * type: real constant or variable.
  3834.                         * The character size for the labeling. If
  3835.                           zero, then the character size will be
  3836.                           chosen for the caller.
  3837.  
  3838.      Output
  3839.  
  3840.         None.
  3841.  
  3842. Programming notes:
  3843.  
  3844.         *  This subroutine converts percentages of the device
  3845.            axes lengths into virtual coordinates. The user should
  3846.            keep this in mind when defining any virtual to abso-
  3847.            lute coordinate transformations.
  3848.         *  Then MAPSIZ chooses the labeling character size using
  3849.            the following algorithm:
  3850.               CSIZE = GOODCS(AMIN1(XMAX-XMIN,YMAX-YMIN)/80.0)
  3851.  
  3852.         *  The tick length selected is 90% of the character size.
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.                                   MAPSML
  3900.  
  3901.  
  3902. Usage:     CALL MAPSML(XMIN,XMAX,YMIN,YMAX,XLABEL,YLABEL,
  3903.                        TITLE,IOPTNS)
  3904.  
  3905.  
  3906. Purpose:   This subroutine draws the X and Y axes with labeled
  3907.            tick marks. It also labels the axes and places a title
  3908.            string above the top of the Y axis, centered over the
  3909.            X axis. MAPSML is a subset of MAPIT with limited capa-
  3910.            bilities. However, it occupies only 60% as much space
  3911.            (not including the fact that it does not need LOGLAB
  3912.            and LAXIS) as MAPIT. It is designed for users who have
  3913.            space problems and can afford to give up:
  3914.               1) Log axes option,
  3915.               2) Grid lines option,
  3916.               3) Duplicated axes at the top and right of the
  3917.               plot.
  3918.            (Note: MAPSML is still compatible with SYAXIS.)
  3919.  
  3920.                                    NOTE:
  3921.            MAPSML is only a commented out version of MAPIT. Thus
  3922.            you can edit it (by removing certain comment lines) to
  3923.            re-enstate any of the above "lost" options and still
  3924.            get a net savings. Comments in MAPSML tell how to re-
  3925.            enstate the options.
  3926.  
  3927.  
  3928. Arguments:
  3929.  
  3930.      Input
  3931.  
  3932.         XMIN            * type: real constant or variable.
  3933.                         * Minimum limit for the X axis in world
  3934.                           coordinates.
  3935.  
  3936.         XMAX            * type: real constant or variable.
  3937.                         * Maximum limit for the X axis in world
  3938.                           coordinates.
  3939.  
  3940.         YMIN            * type: real constant or variable.
  3941.                         * Minimum limit for the Y axis in world
  3942.                           coordinates.
  3943.  
  3944.         YMAX            * type: real constant or variable.
  3945.                         * Maximum limit for the Y axis in world
  3946.                           coordinates.
  3947.  
  3948.  
  3949.  
  3950.         XLABEL          * type: string literal or string vari-
  3951.                           able.
  3952.                         * The X axis label. This string is cen-
  3953.                           tered below the X axis.
  3954.  
  3955.         Y LABEL         * type: string literal or string vari-
  3956.                           able.
  3957.                         * The Y axis label. This string is cen-
  3958.                           tered to the left of the Y axis and is
  3959.                           written at 90 degrees.
  3960.  
  3961.         TITLE           * type: string literal or string vari-
  3962.                           able.
  3963.                         * The plot title. This string is centered
  3964.                           over the X axis above the top of the Y
  3965.                           axis.
  3966.  
  3967.         IOPTNS          * type: integer constant or variable.
  3968.                         * The axes options. This value is com-
  3969.                           puted by summing the values of the
  3970.                           individual option values:
  3971.                              16 ==> Allow X axis not to end on
  3972.                                     tick marks
  3973.                              32 ==> Allow Y axis not to end on
  3974.                                     tick marks
  3975.  
  3976.      Output
  3977.  
  3978.         None.
  3979.  
  3980.  
  3981. Programming notes:
  3982.  
  3983.         None.
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.                                   MAPSZ2
  4002.  
  4003.  
  4004. Usage:     CALL MAPSZ2(XLEFT,XRIGHT,YBOTOM,YTOP,CHRSIZ)
  4005.  
  4006.  
  4007. Purpose:   This subroutine specifies the region of the graphics
  4008.            area where MAPIT is to place the 2D axes. Not all of
  4009.            the available area in the region is used. Some room is
  4010.            reserved so that a second Y axis can be placed at the
  4011.            right of the plot within the prescribed region. This
  4012.            subroutine allows the user to define the region of the
  4013.            graphic area in a device independent manner.
  4014.  
  4015.  
  4016. Arguments:
  4017.  
  4018.      Input
  4019.  
  4020.         XLEFT           * type: real constant or variable.
  4021.                         * The left boundary of the region
  4022.                           expressed as a percent of the current
  4023.                           device's x axis length.
  4024.  
  4025.         XRIGHT          * type: real constant or variable.
  4026.                         * The right boundary of the region
  4027.                           expressed as a percent of the current
  4028.                           device's x axis length.
  4029.  
  4030.         YBOT            * type: real constant or variable.
  4031.                         * The bottom boundary of the region
  4032.                           expressed as a percent of the current
  4033.                           device's y axis length.
  4034.  
  4035.         YTOP            * type: real constant or variable.
  4036.                         * The top boundary of the region
  4037.                           expressed as a percent of the current
  4038.                           device's y axis length.
  4039.  
  4040.         CHRSIZ          * type: real constant or variable.
  4041.                         * The character size for the labeling. If
  4042.                           zero, then the character size will be
  4043.                           chosen for the caller.
  4044.  
  4045.      Output
  4046.  
  4047.         None.
  4048.  
  4049.  
  4050.  
  4051.  
  4052. Programming notes:
  4053.  
  4054.         *  This subroutine converts percentages of the device
  4055.            axes lengths into virtual coordinates. The user should
  4056.            keep this in mind when defining any virtual to abso-
  4057.            lute coordinate transformations.
  4058.         *  When MAPSZ2 chooses the labeling character size using
  4059.            the following algorithm:
  4060.               CSIZE = GOODCS(AMIN1(XMAX-XMIN,YMAX-YMIN)/80.0)
  4061.         *  The tick length selected is 90% of the character size.
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.                                    MINMAX
  4104.  
  4105.  
  4106. Usage:     CALL MINMAX(ARRAY,NUMPTS,VALMIN,VALMAX)
  4107.  
  4108.  
  4109. Purpose:   This subroutine returns the minimum and maximum value
  4110.            found in an array of real numbers.
  4111.  
  4112.  
  4113. Arguments:
  4114.  
  4115.      Input
  4116.  
  4117.         ARRAY           * type: real array.
  4118.                         * The array to search for the minimum and
  4119.                           maximum value.
  4120.  
  4121.         NUMPTS          * type: integer constant or variable.
  4122.                         * The number of elements in the array.
  4123.  
  4124.      Output
  4125.  
  4126.         VALMIN          * type: real variable.
  4127.                         * The minimum value found in the array.
  4128.  
  4129.         VALMAX          * type: real variable.
  4130.                         * The maximum value found in the array.
  4131.  
  4132.  
  4133. Programming notes:
  4134.  
  4135.         *  This subroutine is not a graphics subroutine. However,
  4136.            it is very often useful to know the minimum and maxi-
  4137.            mum value found in a array of X or Y coordinates, and
  4138.            this subroutine provides a simple and clear method for
  4139.            doing just that.
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.                                   PLTBOX
  4155.  
  4156.  
  4157. Usage:     CALL PLTBOX(XLEFT,XRIGHT,YBOTOM,YTOP)
  4158.  
  4159.  
  4160. Purpose:   This subroutine specifies the region of the graphics
  4161.            area where MAPIT is to place the 2D axes. This subrou-
  4162.            tine allows the user to specify the region in virtual
  4163.            coordinates.
  4164.  
  4165.  
  4166. Arguments:
  4167.  
  4168.      Input
  4169.  
  4170.         XLEFT           * type: real constant or variable.
  4171.                         * The left limit of the box which bounds
  4172.                           the plotting region.
  4173.  
  4174.         XRIGHT          * type: real constant or variable.
  4175.                         * The right limit of the box which bounds
  4176.                           the plotting region.
  4177.  
  4178.         YBOT            * type: real constant or variable.
  4179.                         * The lower limit of the box which bounds
  4180.                           the plotting region.
  4181.  
  4182.         YTOP            * type: real constant or variable.
  4183.                         * The upper limit of the box which bounds
  4184.                           the plotting region.
  4185.  
  4186.      Output
  4187.  
  4188.         None.
  4189.  
  4190.  
  4191. Programming notes:
  4192.  
  4193.         *  PLTBOX selects the labeling character size as follows:
  4194.             CSIZE = GOODCS(AMIN1(XRIGHT-XLEFT,YTOP-YBOTOM)/80.0)
  4195.  
  4196.         *  The tick length selected is 90% of the character size.
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.                                   PLTBX2
  4206.  
  4207.  
  4208. Usage:     CALL PLTBX2(XLEFT,XRIGHT,YBOTOM,YTOP)
  4209.  
  4210.  
  4211. Purpose:   This subroutine specifies the region of the graphics
  4212.            area where MAPIT is to place the 2D axes. Not all of
  4213.            the specified region is used. Space is provided for a
  4214.            second Y axis to be drawn at the edge of the X axis by
  4215.            SYAXIS. This subroutine allows the user to specify the
  4216.            region in virtual coordinates.
  4217.  
  4218.  
  4219. Arguments:
  4220.  
  4221.      Input
  4222.  
  4223.         XLEFT           * type: real constant or variable.
  4224.                         * The left limit of the box which bounds
  4225.                           the plotting region.
  4226.  
  4227.         XRIGHT          * type: real constant or variable.
  4228.                         * The right limit of the box which bounds
  4229.                           the plotting region.
  4230.  
  4231.         YBOT            * type: real constant or variable.
  4232.                         * The lower limit of the box which bounds
  4233.                           the plotting region.
  4234.  
  4235.         YTOP            * type: real constant or variable.
  4236.                         * The upper limit of the box which bounds
  4237.                           the plotting region.
  4238.  
  4239.      Output
  4240.  
  4241.         None.
  4242.  
  4243.  
  4244. Programming notes:
  4245.  
  4246.         *  PLTBX2 selects the labeling character size as follows:
  4247.             CSIZE = GOODCS(AMIN1(XRIGHT-XLEFT,YTOP-YBOTOM)/80.0)
  4248.  
  4249.         *  The tick length selected is 90% of the character size.
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.                                   POINTC
  4257.  
  4258.  
  4259. Usage:     CALL POINTC(XARRAY,YARRAY,NUMPTS)
  4260.  
  4261.  
  4262. Purpose:   This subroutine displays the points contained in the
  4263.            input arrays as discrete points represented by cen-
  4264.            tered diamond figures. Any points outside the axis
  4265.            frame are not plotted.
  4266.  
  4267.  
  4268. Arguments:
  4269.  
  4270.      Input
  4271.  
  4272.         XARRAY          * type: real array.
  4273.                         * The array of X world coordinates of the
  4274.                           points.
  4275.  
  4276.         YARRAY          * type: real array.
  4277.                         * The array of corresponding Y world
  4278.                           coordinates.
  4279.  
  4280.         NUMPTS          * type: integer constant or variable.
  4281.                         * The number of points to display.
  4282.  
  4283.      Output
  4284.  
  4285.         None.
  4286.  
  4287.  
  4288. Programming notes:
  4289.  
  4290.         *  MAPIT must be called before using POINTC.
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.                                   POINTS
  4308.  
  4309.  
  4310. Usage:     CALL POINTS(XARRAY,YARRAY,NUMPTS)
  4311.  
  4312.  
  4313. Purpose:   This subroutines displays the points contained in the
  4314.            input arrays as discrete points represented by cen-
  4315.            tered diamond figures.
  4316.  
  4317.  
  4318. Arguments:
  4319.  
  4320.      Input
  4321.  
  4322.         XARRAY          * type: real array.
  4323.                         * The array of X world coordinates of the
  4324.                           points.
  4325.  
  4326.         YARRAY          * type: real array.
  4327.                         * The array of corresponding Y world
  4328.                           coordinates.
  4329.  
  4330.         NUMPTS          * type: integer constant or variable.
  4331.                         * The number of points to display.
  4332.  
  4333.      Output
  4334.  
  4335.         None.
  4336.  
  4337.  
  4338. Programming notes:
  4339.  
  4340.         *  MAPIT must be called before using POINTS.
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.                                   POLAR
  4359.  
  4360. Usage:   Call POLAR(RADIAL,RR,THETA,DATA,MODE,NUM,ISYMNO,SYMSIZ,
  4361.                NPBSYM,PLTLAB)
  4362.  
  4363. Purpose:  This routine generates a polar plot under user control in
  4364.           one of two modes.  In the first mode, the input data rep-
  4365.           resents a real plot in the form R, Theta where Theta is in
  4366.           degrees.  In the second mode, the input data represents X-Y
  4367.           data where the plot is a complex plane plot of the form Z=
  4368.           X+ IY.  In all cases, the data type input is single precision
  4369.           Real variables. 
  4370.  
  4371.   AUTHOR: JIM LOCKER, SOFTECH INC.
  4372.           MAY 1989
  4373.  
  4374. Arguments:
  4375.  
  4376. Input
  4377.  
  4378.        RADIAL: * Type: Real*4
  4379.                * This is the maximum radius to be plotted.  If the plot
  4380.                  is an R-theta plot, this should be the largest value in
  4381.                  the R array.  If this is an X+IY plot, RADIAL should 
  4382.                  have the value SQRT(X**2)+Y**2))
  4383.  
  4384.        RR:     * Type: Real*4 Array, dimensioned (NUM) long 
  4385.                * RR contains either the radial information for an R-Theta
  4386.                  plot, or the X information for an X+IY plot.
  4387.  
  4388.        THETA:  * Type: Real*4 array, dimensioned (NUM) long.
  4389.                * Theta contains either the angular information (in 
  4390.                  degrees) for an R-theta plot, or the Y information for
  4391.                  an X+IY plot.
  4392.  
  4393.        MODE:   * Type: Integer*2 array dimensioned (8).
  4394.                * General Parameters:
  4395.  
  4396.                    MODE(1) CONTROLS THE TYPE OF DATA AND WHETHER OR NOT
  4397.                            AXES/RANGE RINGS ARE DRAWN
  4398.  
  4399.                    MODE(1)= 1 INDICATES R-THETA INFORMATION AND THE PLOT
  4400.                               IS TYPE REAL
  4401.  
  4402.                    MODE(1)= 2 INDICATES REAL-IMAGINARY TYPE INFORMATION
  4403.                               AND THE PLOT REPRESENTS A COMPLEX PLANE
  4404.                               PLOT
  4405.  
  4406.                   IF MODE(1)= 1, RR IS AN ARRAY OF RADIAL INFORMATION
  4407.                   AND THETA IS AN ARRAY OF ANGULAR INFORMATION
  4408.                   CORRESPONDING TO THE RADIAL INFORMATION
  4409.  
  4410.                   IF MODE(1)= 2, RR IS THE REAL DATA
  4411.                   AND THETA IS THE IMAGINARY DATA SO THAT THE DATA SET IS
  4412.                   OF THE FORM X+IY
  4413.  
  4414.                   MODE(1) = 3 IS LIKE MODE(1) = 1 EXCEPT NO AXES OR RANGE
  4415.                               RINGS ARE DRAWN.
  4416.  
  4417.                   MODE(1) = 4 IS LIKE MODE(1) = 2 EXCEPT NO AXES OR RANGE
  4418.                               RINGS.
  4419.  
  4420.                   MODE(2) CONTROLS THE SCALE OF THE PLOT
  4421.  
  4422.                   MODE(2) = 1 INDICATES A LINEAR RADIAL SCALE
  4423.  
  4424.                   MODE(2) = 2 INDICATES A LOGARITHMIC RADIAL SCALE
  4425.  
  4426.                   MODE(3) TELLS THE NUMBER OF RANGE RINGS TO DRAW.  IN
  4427.                           LINEAR RADIAL MODE, THIS IS THE NUMBER THAT
  4428.                           WILL BE DRAWN.  IN LOGARITHMIC MODE, THIS IS
  4429.                           THE NUMBER THAT WILL BE DRAWN PER DECADE.
  4430.  
  4431.                   MODE(4) DICTATES THE STYLE OF THE LINE FOR RANGE RINGS,
  4432.                           FOLLOWING DIGLIB CONVENTION.
  4433.  
  4434.                   MODE(5) TELLS WHETHER OR NOT RADIAL TICK MARKS ARE TO
  4435.                           BE USED.  IF MODE(5) = 0, NO RADIAL TICK MARKS.
  4436.                           IFMODE(5) .GT. 0, THEN OUTWARD POINTING TICKS
  4437.                           AT DEGREE INCREMENTS SPECIFIED BY THE VALUE IN
  4438.                           MODE(5).  IFMODE(5) .LT. 0, THEN INWARD
  4439.                           POINTING TICKS.
  4440.  
  4441.                   MODE(6) SPECIFIES THE COLOR OF THE AXES, RANGE RINGS,
  4442.                           AND TICK MARKS
  4443.  
  4444.                   MODE(7) SPECIFIES THE COLOR OF THE DATA
  4445.  
  4446.                   MODE(8) SPECIFIES THE LINE STYLE OF THE DATA, FOLLOWING
  4447.                           DIGLIB CONVENTION
  4448.  
  4449.       NUM         * Type: Integer*4
  4450.                   * NUM IS THE NUMBER OF DATA POINTS TO BE PLOTTED
  4451.  
  4452.       DATA        * Type: Real*4
  4453.                   * DATA IS A WORKSPACE PASSED FROM THE CALLING ROUTINE
  4454.                     IT MUST BE DIMENSIONED BY THE CALLING ROUTINE TO BE
  4455.                     AT LEAST NUM*2 LONG
  4456.  
  4457.      ISYMNO       * Type:Integer*4
  4458.                   * ISYMNO IS THE CODE FOR THE SYMBOLS TO DRAW
  4459.  
  4460.      SYMSIZ       * Type: Integer*4
  4461.                   * SYMSIZ IS THE SIZE OF THE SYMBOLS TO DRAW
  4462.  
  4463.      NPBSYM       * Type: Integer*4
  4464.                   * NPBSYM IS THE NUMBER OF DATA POINTS TO SKIP BETWEEN
  4465.                     SYMBOLS
  4466.  
  4467.      PLTLAB       * Type: String Constant or label
  4468.                   * THE PLOT LABEL
  4469.  
  4470.   Output:
  4471.  
  4472.       None.
  4473.  
  4474. Programming notes:
  4475.  
  4476. MAPSIZ must be called before attempting to use POLAR
  4477.  
  4478.                                   PURJOY
  4479.  
  4480.  
  4481. Usage:     CALL PURJOY(Z,IZDIM1,IZ,KX,KY,CAMLOC,XYLIM,
  4482.                        XLAB,YLAB,ZLAB,CSIZE,MARPLT)
  4483.  
  4484.  
  4485. Purpose:   This subroutine will plot a function Z=F(X,Y) as a
  4486.            lined surface. The function must be defined on a regu-
  4487.            lar grid. This routine will optionally remove hidden
  4488.            lines.
  4489.  
  4490.  
  4491. Arguments:
  4492.  
  4493.      Input
  4494.  
  4495.         Z               * Type: real array.
  4496.                         * The function values: Z(I,J)=F(Xi,Yj),
  4497.                           where
  4498.                              Xi = XMIN + (i-1)*(XMAX-XMIN)/(KX-1)
  4499.                              Yj = YMIN + (j-1)*(YMAX-YMIN)/(KY-1)
  4500.  
  4501.         IZDIM1          * Type: integer constant or variable.
  4502.                         * The first dimension of the Z array -not
  4503.                           necessarily the number of X values.
  4504.  
  4505.         IZ              * Type: character array.
  4506.                         * A working array of bytes dimensioned
  4507.                           at least KX*KY long.
  4508.  
  4509.         KX              * Type: integer constant or variable.
  4510.                         * The number of X values in the Z array.
  4511.                           KX <= IZDIM1 of course.
  4512.  
  4513.         KY              * Type: integer constant or variable.
  4514.                         * The number of Y values in the Z array.
  4515.  
  4516.         CAMLOC          * Type: real array.
  4517.                         * The relative location of the viewer in
  4518.                           space. The viewer always faces toward
  4519.                           the center of the surface.
  4520.                              CAMLOC(1) = distance from surface in
  4521.                                     units the same as those of Z.
  4522.                              CAMLOC(2) = angle between the viewer
  4523.                                     and the X axis in degrees.
  4524.                                     Usually, multiples of 30 or
  4525.                                     45 degrees are best.
  4526.  
  4527.  
  4528.  
  4529.                              CAMLOC(3) = angle between the viewer
  4530.                                     and the XY plane located at
  4531.                                     Z=(ZMIN+ZMAX)/2 in degrees.
  4532.                                     Thus 90 degrees is directly
  4533.                                     above the surface - an unex-
  4534.                                     citing picture!   Usually the
  4535.                                     angle is selected near 45
  4536.                                     degrees.
  4537.  
  4538.         XYLIM           * Type: real two dimensional array dimen-
  4539.                           sioned (2,6).
  4540.                         * General parameters:
  4541.                              XYLIM(1,1) = XMIN ==> the minimum
  4542.                                     value of X.
  4543.                              XYLIM(2,1) = XMAX ==> the maximum
  4544.                                     value of X.
  4545.                              XYLIM(1,2) = YMIN ==> the minimum
  4546.                                     value of Y.
  4547.                              XYLIM(2,2) = YMAX ==> the maximum
  4548.                                     value of Y.
  4549.                              Note: Z(I,J) = F(Xi,Yj) where:
  4550.                              Xi=XMIN+(i-1)*(XMAX-XMIN)/(KX-1)
  4551.                              Yj=YMIN+(j-1)*(YMAX-YMIN)/(KY-1)
  4552.                              XYLIM(1,3) = ZMIN ==> the minimum
  4553.                              XYLIM(1,3) = ZMIN ==> the minimum
  4554.                                     value of Z.
  4555.                              XYLIM(2,3) = ZMAX ==> the maximum
  4556.                                     value of Z. These Z values
  4557.                                     define the range of Z values
  4558.                                     to fit on the screen.   It is
  4559.                                     strongly advised that ZMIN
  4560.                                     and ZMAX bound Z(I,J).
  4561.                              XYLIM(1,4) = X/Z axis length ratio.
  4562.                                     If this parameter is 0, then
  4563.                                     X and Z are assumed to have
  4564.                                     the same units, so their rel-
  4565.                                     ative lengths will be in pro-
  4566.                                     portion to their ranges. If
  4567.                                     this parameter is nonzero,
  4568.                                     then the X axis will be
  4569.                                     XYLIM(1,4) times as long as
  4570.                                     the Z axis.
  4571.                              XYLIM(2,4) = Y/Z axis length ratio.
  4572.                                     Same as XYLIM(1,4), but for Y
  4573.                                     axis.
  4574.                              XYLIM(1,5) = plot width in virtual
  4575.                                     coordinates
  4576.  
  4577.  
  4578.  
  4579.  
  4580.                              XYLIM(2,5) = plot height in virtual
  4581.                                     coord. Note: The plot is
  4582.                                     expanded/contracted until it
  4583.                                     all fits within the box def-
  4584.                                     ined by XYLIM(1,5) and
  4585.                                     XYLIM(2,5).
  4586.                              XYLIM(1,6) = virtual X coord. of the
  4587.                                     lower left corner of the plot
  4588.                                     box.
  4589.                              XYLIM(2,6) = virtual Y coord. of the
  4590.                                     lower left corner of the box.
  4591.  
  4592.  
  4593.         XLAB            * Type: string constant or variable.
  4594.                         * The X axis lable.
  4595.  
  4596.         YLAB            * Type: string constant or variable.
  4597.                         * The Y axis lable.
  4598.  
  4599.         ZLAB            * Type: string constant or variable.
  4600.                         * The Z axis lable.
  4601.  
  4602.         CSIZE           * Type: real constant or variable.
  4603.                         * The character size in virtual coord.
  4604.                           for the tick mark lables and the axis
  4605.                           lables.
  4606.  
  4607.         MARPLT          * Type: integer constant or variable.
  4608.                         * Hidden line flag:
  4609.                              0 ==> draw all lines, hidden or not.
  4610.                              1 ==> suppress all lines hidden by
  4611.                                     the surface, but display both
  4612.                                     the top and bottom of the
  4613.                                     surface
  4614.                              3 ==> suppress all lines hidden by
  4615.                                     the surface, and all lines
  4616.                                     showing the bottom of the
  4617.                                     surface.
  4618.                              Add 4 to MARPLT if you do not want
  4619.                                     the axes nor the ticks
  4620.                                     labeled.  This is useful on
  4621.                                     small plots.
  4622.  
  4623.  
  4624.      Output
  4625.  
  4626.         None.
  4627.  
  4628.  
  4629.  
  4630.  
  4631.                                   RLSDEV
  4632.  
  4633.  
  4634. Usage:     CALL RLSDEV
  4635.  
  4636.  
  4637. Purpose:   This subroutine releases the current device. After
  4638.            this subroutine is called, you must call DEVSEL before
  4639.            calling any other Amiga-DIGLIB subroutine. The purpose of
  4640.            "RLSDEV" is to make sure your graphics device is
  4641.            restored to a proper working state. This subroutine
  4642.            should be called before exiting by any program that
  4643.            uses Amiga-DIGLIB. RLSDEV closes the screen created by
  4644.            DEVSEL.
  4645.  
  4646.  
  4647.  
  4648. Arguments: None.
  4649.  
  4650.  
  4651. Programming notes:
  4652.  
  4653.         *  It is highly recommended that you use RLSDEV.
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659.  
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.                                   RSTMAP
  4684.  
  4685.  
  4686. Usage:     CALL RSTMAP(AREA)
  4687.  
  4688.  
  4689. Purpose:   This subroutine restores a world to virtual coordinate
  4690.            transformation that was previously saved using SAVMAP.
  4691.  
  4692.  
  4693. Arguments:
  4694.  
  4695.      Input
  4696.  
  4697.         None.
  4698.  
  4699.      Output
  4700.  
  4701.         AREA            * type: real array of 15 elements.
  4702.                         * The array of world to virtual coordi-
  4703.                           nates transf. values previously saved
  4704.                           by SAVMAP.
  4705.  
  4706.  
  4707. Programming notes:
  4708.  
  4709.         *  Very unpredictable things will happen if RSTMAP is fed
  4710.            anything but the same values output by SAVMAP.
  4711.  
  4712.         *  RSTMAP can be used to restore the mapping context for
  4713.            a plot with two Y axes (see SYAXIS) or to restore the
  4714.            mapping context to a entirely different plot.
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.                                   SAVMAP
  4735.  
  4736.  
  4737. Usage:     CALL SAVMAP(AREA)
  4738.  
  4739.  
  4740. Purpose:   This subroutine allows the caller to save the current
  4741.            world to virtual coordinate transformation and clip-
  4742.            ping information. This subroutine is generally only
  4743.            useful when the caller wishes to maintain more than
  4744.            one world coordinate system.
  4745.  
  4746.  
  4747. Arguments:
  4748.  
  4749.      Input
  4750.  
  4751.         None.
  4752.  
  4753.      Output
  4754.  
  4755.         AREA            * type: real array of at least 15 ele-
  4756.                           ments.
  4757.                         * The area in which to store the current
  4758.                           world to virtual coordinate transforma-
  4759.                           tion.
  4760.  
  4761.  
  4762. Programming notes:
  4763.  
  4764.         *  This subroutine is very useful when the user has two Y
  4765.            axes on a single plot and is using SYAXIS.
  4766.  
  4767.         *  This subroutine is very useful when the user desires
  4768.            to display two separate plots on the same device, or
  4769.            on different devices, and wishes to move back and
  4770.            forth between the plots.
  4771.  
  4772.         *  The subroutine RSTMAP restores the world to virtual
  4773.            transformation saved by SAVMAP.
  4774.  
  4775.  
  4776.  
  4777.  
  4778.  
  4779.  
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.                                   SCALE
  4786.  
  4787.  
  4788. Usage      CALL SCALE(WORLDX,WORLDY,VIRTX,VIRTY)
  4789.  
  4790.  
  4791. Purpose:   This subroutine converts world coordinates to virtual
  4792.            coordinates.
  4793.  
  4794.  
  4795. Arguments:
  4796.  
  4797.      Input
  4798.  
  4799.         WORLDX          * type: real constant or variable.
  4800.                         * The x value in world coordinates to
  4801.                           convert.
  4802.  
  4803.         WORLDY          * type: real constant or variable.
  4804.                         * The y value in world coordinates to
  4805.                           convert.
  4806.  
  4807.      Output
  4808.  
  4809.         VIRTX           * type: real variable.
  4810.                         * The corresponding x value in virtual
  4811.                           coordinates.
  4812.  
  4813.         VIRTY           * type: real variable.
  4814.                         * The corresponding y value in virtual
  4815.                           coordinates.
  4816.  
  4817.  
  4818. Programming notes:
  4819.  
  4820.         *  This subroutine is equivalent to PLTLIB's SCALE. The
  4821.            only difference is that real values (the virtual coor-
  4822.            dinates) are returned instead of integer values (4025
  4823.            device coordinates).
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.                                   SELDEV
  4837.  
  4838.  
  4839. Usage:     CALL SELDEV(LUN)
  4840.  
  4841.  
  4842. Purpose:   SelDev displays the names of the devices available on
  4843.            the computer along with the associated device number.
  4844.            It then asks for the number of the device you wish to
  4845.            use. If that device is not available, it tells you so
  4846.            and asks for another device to use.
  4847.  
  4848.  
  4849. Argument:
  4850.  
  4851.      Input
  4852.  
  4853.         Lun   :         * integer constant or variable.
  4854.                         * It is the logical unit number to be
  4855.                           used by the graphics device.
  4856.  
  4857.      Output
  4858.  
  4859.         None.
  4860.  
  4861.  
  4862. Programming Notes:
  4863.  
  4864.         *  SelDev uses GsDname to obtain the name of a device
  4865.            from its device number. It uses DevSel to set the out-
  4866.            put device once a device number has been entered from
  4867.            the keyboard. If no devices are available, you are
  4868.            stuck!
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.                                   SYAXIS
  4888.  
  4889.  
  4890. Usage:     CALL SYAXIS(YLOW,YHIGH,YLAB,IAXES)
  4891.  
  4892.  
  4893. Purpose:   This subroutine places a second Y axis on the current
  4894.            plot. The current world to virtual coordinate trans-
  4895.            formation is overwritten with the new Y axis values.
  4896.  
  4897. Arguments:
  4898.  
  4899.      Input
  4900.  
  4901.         YLOW            * type: real constant or variable.
  4902.                         * Minimum limit for the second Y-axis in
  4903.                           world coordinates.
  4904.  
  4905.         YHIGH           * type: real constant or variable.
  4906.                         * Maximum limit for the second Y-axis in
  4907.                           world coordinates.
  4908.  
  4909.         YLAB            * type: string constant or variable.
  4910.                         * Second Y-axis label.
  4911.  
  4912.         IAXES           * type: integer constant or variable.
  4913.                         * Axes type as per MAPIT, but X-axis
  4914.                           information is ignored.
  4915.  
  4916.      Output
  4917.  
  4918.         None.
  4919.  
  4920.  
  4921. Programming notes:
  4922.  
  4923.         *  The second Y axis will not be contained in the speci-
  4924.            fied plotting region if the region was defined by MAP-
  4925.            SIZ, FULMAP, PLTBOX, MAPPRM(,,,,,,.FALSE.), or MAP-
  4926.            SET(,,,,,,.FALSE.).
  4927.  
  4928.         *  The second Y axis will be contained in the specified
  4929.            plotting region if the region was defined by MAPSZ2,
  4930.            PLTBX2, MAPPRM(,,,,,,,.TRUE.), or MAP-
  4931.            SET(,,,,,,.TRUE.).
  4932.  
  4933.         *  SYAXIS overwrites the Y axis portion of the current
  4934.            world to virtual coordinate transformation.   If the
  4935.            users desires to retain the old transformation, he
  4936.            should save it with SAVMAP.
  4937.                                   SYMBOL
  4938.  
  4939.  
  4940. Usage:     CALL SYMBOL(ISYMNO,SYMSIZ)
  4941.  
  4942.  
  4943. Purpose:   This subroutine places a centered symbol at the cur-
  4944.            rent location in the desired size. There are currently
  4945.            4 symbols defined. You are welcome to edit the file
  4946.            and create more.
  4947.  
  4948.  
  4949. Arguments:
  4950.  
  4951.      Input
  4952.  
  4953.         ISYMNO          * type: integer constant or variable.
  4954.                         * The number of the symbol to draw:
  4955.                              1 ==> triangle,
  4956.                              2 ==> square,
  4957.                              3 ==> diamond,
  4958.                              4 ==> hour glass.
  4959.  
  4960.         SYMSIZ          * type: real constant or variable.
  4961.                         * The height (size) of the symbol in vir-
  4962.                           tual coordinates.
  4963.  
  4964.      Output
  4965.  
  4966.         None.
  4967.  
  4968.  
  4969. Programming Notes:
  4970.  
  4971.         *  To place symbol number 2 at (X,Y) in world coordi-
  4972.            nates:
  4973.  
  4974.            CALL SCALE(X,Y,VX,VY)  CONVERT WORLD TO VIRTUAL COORD
  4975.            CALL GSMOVE(VX,VY)
  4976.            CALL SYMBOL(2,0.4)     SYMBOL 2, SIZE IS 0.4
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.                                   TRACCY
  4989.  
  4990.  
  4991. Usage:     CALL TRACCY(XMIN,XMAX,YARRAY,NUMPTS)
  4992.  
  4993.  
  4994. Purpose:   This subroutine connects the world coordinate points
  4995.            with straight lines. The X values of the points are
  4996.            assumed to be equally spaced between XMIN and XMAX.
  4997.            Any lines that lie outside the axes frame are not dis-
  4998.            played.
  4999.  
  5000.  
  5001. Arguments:
  5002.  
  5003.      Input
  5004.  
  5005.         XMIN            * type: real constant or variable.
  5006.                         * The world X coordinate of the first
  5007.                           point.
  5008.  
  5009.         XMAX            * type: real constant or variable.
  5010.                         * The world X coordinate of the last
  5011.                           point.
  5012.  
  5013.         YARRAY          * type: real array.
  5014.                         * The array of corresponding Y world
  5015.                           coordinates.
  5016.  
  5017.         NUMPTS          * type: integer constant or variable.
  5018.                         * The number of points to connect.
  5019.  
  5020.      Output
  5021.  
  5022.         None.
  5023.  
  5024.  
  5025. Programming notes:
  5026.  
  5027.         *  MAPIT must be called before using TRACCY.
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.                                   TRACE
  5040.  
  5041.  
  5042. Usage:     CALL TRACE(XARRAY,YARRAY,NUMPTS)
  5043.  
  5044.  
  5045. Purpose:   This subroutine connects the world coordinate points
  5046.            given with straight lines. If enough points are given,
  5047.            the curve formed will appear nearly smooth.
  5048.  
  5049.  
  5050. Arguments:
  5051.  
  5052.      Input
  5053.  
  5054.         XARRAY          * type: real array.
  5055.                         * The array of X world coordinates of the
  5056.                           points.
  5057.  
  5058.         YARRAY          * type: real array.
  5059.                         * The array of corresponding Y world
  5060.                           coordinates.
  5061.  
  5062.         NUMPTS          * type: integer constant or variable.
  5063.                         * The number of points to connect.
  5064.  
  5065.      Output
  5066.  
  5067.         None.
  5068.  
  5069.  
  5070. Programming notes:
  5071.  
  5072.         *  MAPIT must be called before using TRACE.
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.                                   TRACEC
  5091.  
  5092.  
  5093. Usage:     CALL TRACEC(XARRAY,YARRAY,NUMPTS)
  5094.  
  5095.  
  5096. Purpose:   This subroutine connects the world coordinate points
  5097.            given with straight lines. If enough points are given,
  5098.            the resultant curve will appear smooth. Any lines that
  5099.            lie outside the axes frame are not displayed.
  5100.  
  5101.  
  5102. Arguments:
  5103.  
  5104.      Input
  5105.  
  5106.         XARRAY          * type: real array.
  5107.                         * The array of X world coordinates of the
  5108.                           points.
  5109.  
  5110.         YARRAY          * type: real array.
  5111.                         * The array of corresponding Y world
  5112.                           coordinates.
  5113.  
  5114.         NUMPTS          * type: integer constant or variable.
  5115.                         * The number of points to connect.
  5116.  
  5117.      Output
  5118.  
  5119.         None.
  5120.  
  5121.  
  5122. Programming notes:
  5123.  
  5124.         *  MAPIT must be called before using TRACEC.
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.                                   TRACEY
  5142.  
  5143.  
  5144. Usage:     CALL TRACEY(XMIN,XMAX,YARRAY,NUMPTS)
  5145.  
  5146.  
  5147. Purpose:   This subroutine connects the world coordinate points
  5148.            with straight lines. The X values of the points are
  5149.            assumed to be equally spaced between XMIN and XMAX.
  5150.  
  5151.  
  5152. Arguments:
  5153.  
  5154.      Input
  5155.  
  5156.         XMIN            * type: real constant or variable.
  5157.                         * The world X coordinate of the first
  5158.                           point.
  5159.  
  5160.         XMAX            * type: real constant or variable.
  5161.                         * The world X coordinate of the last
  5162.                           point.
  5163.  
  5164.         YARRAY          * type: real array.
  5165.                         * The array of corresponding Y world
  5166.                           coordinates.
  5167.  
  5168.         NUMPTS          * type: integer constant or variable.
  5169.                         * The number of points to connect.
  5170.  
  5171.      Output
  5172.  
  5173.         None.
  5174.  
  5175.  
  5176. Programming notes:
  5177.  
  5178.         *  MAPIT must be called before using TRACEY.
  5179.  
  5180.  
  5181.  
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192. CHAPTER 15
  5193. GUIDE TO WRITING A DEVICE DRIVER
  5194.  
  5195. 15.1 INTRODUCTION
  5196.  
  5197.      This documentation is intended for anyone who desires to add a graphics device driver to Amiga-DIGLIB. It is assumed that the reader is proficient in FORTRAN or MACRO and has some knowledge of graphics. In addition, the reader should become intimately familiar with the target graphics device.
  5198.  
  5199.      I request that debugged Amiga-DIGLIB device drivers be forwarded to Craig Wuest, L-84 for distribution and maintenance. Yes, that is right! You write it, I'll distribute and maintain it to the best of my ability and available time. Please send a floppy with the graphic driver to Craig Wuest L-84. I will make a copy and return your floppy ASAP. Note also, that before embarking on an adventure through graphic device driver land, it will probably be very useful to check with Craig Wuest x32909 to see if such a driver already exists, or whether there is a very similar driver which can be modified. It is nearly always easier to make minor modifications than to start from scratch.
  5200.  
  5201.      Amiga-DIGLIB was written to be as device independent as possible. Accordingly, it was assumed that the graphics device was only capable of performing two simple graphics primitives: move and draw. Amiga-DIGLIB does, however, provide for some "extended" primitives such as: set color, graphics input, and define color. Because Amiga-DIGLIB only uses move and draw, authors of graphics device drivers need not worry about character generation, line types, etc. Amiga-DIGLIB performs these functions using only move and draw.
  5202.  
  5203.      Amiga-DIGLIB graphics device drivers basically perform two
  5204.      functions:
  5205.  
  5206.      1.  Formatting of graphics commands, and
  5207.  
  5208.      2.  Outputting of the formatted graphics commands.
  5209.  
  5210.      Formatting of graphics commands is very device specific, and will not be discussed here. See the programming manual for your graphics device for this information. Output of the formatted graphics commands is, however, common among all Amiga-DIGLIB drivers in the sense that all Amiga-DIGLIB drivers either handle the I/O themselves, or pass of the formatted graphics commands to the
  5211. operating system to be output. All Amiga-DIGLIB graphics device drivers that drive graphic terminals use the terminal I/O capability of the operating system to perform the output operation.
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218. 15.2 STANDARD DEVICE DRIVER FUNCTIONS
  5219.  
  5220.      Amiga-DIGLIB device drivers must perform 7 basic graphics primitives:
  5221.  
  5222.      1.  Initialize the graphics device and prepare it for graph-
  5223.          ics commands.
  5224.  
  5225.      2.  Prepare a fresh plotting surface on the graphics device
  5226.          and reset the drawing parameters to the "initial state".
  5227.  
  5228.      3.  Move from the current (X,Y) position to a new (X,Y)
  5229.          position without drawing a line.
  5230.  
  5231.      4.  Draw a line from the current (X,Y) position to a new
  5232.          (X,Y) position (in the current color).
  5233.  
  5234.      5.  Transmit any graphics commands formatted, but not yet
  5235.          output to the graphics device.
  5236.  
  5237.      6.  Release the graphics device.
  5238.  
  5239.      7.  Return to the caller information about this graphics
  5240.          device (Device Characteristics Values).
  5241.  
  5242.  
  5243.  
  5244. INITIALIZE - function 1
  5245.  
  5246.      To initialize a graphics device, the graphics driver should first take exclusive control of that device on a multi-user system. Then the device should be sent commands to prepare the device for the commands that the graphics driver will generate. Commands should also be included to set any special parameters
  5247. (i.e. line types) the device may have to the proper values. If possible, the initialize function should not erase the screen. This will allow for multiple programs to all draw on the same "drawing surface". Sometimes, to initialize the device requires the screen to be erased. If that is the case, just document it as a feature.
  5248.  
  5249.      On color devices, initialize should set the desired background color and foreground color for future drawing if possible. In addition, for devices with definable color sets, initialize should set color 2 to be red, color 3 to be green, color 4 to be blue, color 5 to be yellow, color 6 to be magenta, and color 7 to be cyan. Unless you definitely want a different foreground/background color scheme, color 0 (background) should be set to black, and color 1 (foreground) to white.
  5250.  
  5251.      Initialize is also responsible for returning an error indicator when the device can not be selected, or some other problem exists.
  5252.  
  5253.  
  5254.  
  5255. BEGIN PLOT - function 2
  5256.  
  5257.      The begin plot function should erase the screen or (more generally) prepare a fresh plotting surface on the graphics device (i.e. advance the page on a plotter, etc.). In addition, it should set colors 0 to 7 to their proper default values (black, white, red, green, blue, yellow, magenta, cyan respectively). It should also set the current drawing color to color 1. Care should be taken to make sure that the driver's perception of the state of the device remains consistent with the device's state. Usually, it is necessary to either force out any commands left in the command buffer (if one is maintained) or to send commands/set state memory variables to make sure that consistancy is maintained. For example, if the driver remembers the current position that the device is going to draw from, it is typically updated when a command is buffered for the device. If this buffer is discarded instead of being sent to the device by BGNPLT (as is done in some Amiga-DIGLIB drivers), then care must be taken to ensure that any possible device states that the driver perceived as changed but really weren't are made consistent!
  5258.  
  5259.  
  5260. MOVE and DRAW - functions 3 and 4
  5261.  
  5262.      Amiga-DIGLIB always works in centimeter coordinates as far as the graphics device drivers are concerned. Thus all coordinates that flow into or out of the graphics device driver are in centimeters. Also, Amiga-DIGLIB performs clipping of all coordinates based on the device's Device Characteristics Values, eliminating all coordinates that lie outside the graphics devices accessible area.
  5263.  
  5264.  
  5265. ENDPLT - function 5
  5266.  
  5267.      It is often desirable to buffer the graphics commands before sending them to the graphics device. In fact, a good size buffer will usually increase the graphics throughput because of the overhead of the operating system for I/O. The problem with buffering graphics commands is that some will almost always remain
  5268. in the buffer after the last graphics subroutine has been called and the plot will be incomplete. Amiga-DIGLIB solves this problem by requiring the user to call ENDPLT. ENDPLT then calls the graphics driver with function code 5. The graphics driver should then send out the last buffer (even though it is not yet full).
  5269.  
  5270.  
  5271. RELEASE DEVICE - function 6
  5272.  
  5273.      Release device is the antithesis to initialize device. The function of release device is to return the graphics device to its initial state, or atleast to something close to its initial state. Release device should not erase the graphics (if possible).
  5274.  
  5275.  
  5276.  
  5277. RETURN DEVICE CHARACTERISTICS - function 7
  5278.  
  5279.      The definitions of each of the 8 device characteristics values is given in section 16.5. The 4 values "X axis length", "Y axis length", "X axis resolution", and "Y axis resolution" are simple to determine by consulting the graphics device specifications, or by measurement and calculation. However, when using the measurement and calculation method, the following pitfall exists:
  5280.  
  5281.      1.  Because the graphics device is out of adjustment, the X
  5282.          resolution and the Y resolution appear different, and
  5283.  
  5284.      2.  Due to roundoff and measurement errors, the product of
  5285.          the resolution times the screen size when rounded is
  5286.          greater than the device's maximum addressable point.
  5287.  
  5288.      The problem with 1) is that when a 45 degree line is drawn, it will truly be drawn at 45 degrees, but the user will not think so because the line is jagging every once in a while along its length. My solution to this problem is to set the "X axis resolution" and "Y axis resolution" to the same value unless it is specifically known that they should be different. Lines drawn at 45 degrees may not be exactly 45 degrees, but the user will think so, and so you are not plagued by users thinking the driver is sick!
  5289.  
  5290.      The problem with 2) is that lines drawn at the supposed right and/or top of the screen get clipped, or worse, the device driver will get passed a coordinate that is outside the device's addressable range.
  5291.  
  5292.      The solution to this problem is to average the X and Y resolution to get a single resolution for both X and Y unless it is specifically known that the X and Y resolution are different. Then, using the device's maximum addressable points in X and Y, and the resolution, back calculate the axis lengths.
  5293.  
  5294.      Example:
  5295.            Measurement yields an X axis length of 15.7 centime-
  5296.            ters and a Y axis length of 10.4 cm.  The device coor-
  5297.            dinate ranges are 0 to 639 in X, and 0 to 419 in Y.
  5298.            So:
  5299.               X axis resolution is 40.7 graphic units per cen-
  5300.               timeter Y axis resolution is 40.3 graphic units per
  5301.               cm. averaging, we get 40.5 GU/CM.
  5302.            Thus, we set:
  5303.               X axis resolution = 40.5 GU/CM.
  5304.               Y axis resolution = 40.5 GU/CM.
  5305.               X axis length = 639/40.5 = 15.7778 CM.
  5306.               Y axis length = 419/40.5 = 10.3457 CM.
  5307.  
  5308.      The 8th returned value also requires some discussion. This value is new to Amiga-DIGLIB V3 and its support of hardware/software polygon fill. For devices that do not support solid filled polygons, Amiga-DIGLIB's polygon primitive GSFILL contains a software polygon fill algorithm. The algorithm can handle any polygon (but maybe not the way you want, intersecting polygons are of dubious value in my opinion). The 8th device characteristic value only pertains to device characteristic value only pertains to the software fill algorithm. It tells the software fill algorithm just how dense to draw the horizontal lines that fill the polygon. You should choose this value via trial and error. I suggest choosing it large and working down. The way to get a first guess is to estimate the width of the plotter pen in resolution (graphics) units. Thus, for a pen that drew a line 2 mm. thick, on a plotter with 0.5 mm. per graphics unit, a good first guess would be 2.0/0.5 = 4. Thus, drawing every 4th line (skipping 3) should still produce an acceptable solid fill. Note that this parameter should always be one (1) when the size of the (virtual) pen is 1 graphic unit as is the case with all raster scan devices.
  5309.  
  5310.      Since this 8th device characteristic value is new, DEVSEL will automatically default it to be 1 if the device driver returns only 7 values.  However, this is a backward compatibility feature, and all new Amiga-DIGLIB device drivers should return all 8 values!
  5311.  
  5312.  
  5313. 15.3 EXTENDED DEVICE DRIVER FUNCTIONS
  5314.  
  5315.      In addition to the 7 basic graphic primitives, Amiga-DIGLIB defines 6 extended functions that you may optionally implement. Amiga-DIGLIB graphics device drivers may implement none, all, or any combination of these functions.
  5316.  
  5317.      1.  8) Set current drawing color or intensity.
  5318.  
  5319.      2.  9) Graphics input with pick character.
  5320.  
  5321.      3.  10) Define a color numbers visual value using RGB coor-
  5322.          dinates.
  5323.  
  5324.      4.  11) Define a color numbers visual value using HLS coor-
  5325.          dinates.
  5326.  
  5327.      5.  12) Graphics input with device dependant "button" input.
  5328.  
  5329.      6.  1024+N) Draw a solid filled polygon of N sides I suggest
  5330.          implementing 8) and either 9) or 12) if possible. Amiga-
  5331.          DIGLIB has a software polygon fill algorithm, so you can
  5332.          get filled polygons regardless of whether you implement
  5333.          the polygon fill section. However, hardware (firmware)
  5334.          fills are typically much faster.
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344. SET COLOR - function 8
  5345.  
  5346.      Amiga-DIGLIB uses numbers to express the color it wants to use. The Amiga-DIGLIB color convention is:
  5347.  
  5348.            0       is the background color (usually black)
  5349.            1       is the primary foreground color (usually white
  5350.                    if possible)
  5351.            2==>n   are the secondary foreground colors
  5352.  
  5353. default colors are:
  5354.  
  5355.            0       Black                   4       Blue
  5356.            1       White                   5       Yellow
  5357.            2       Red                     6       Magenta
  5358.            3       Green                   7       Cyan
  5359.            8 - 15  System Default
  5360.  
  5361.      If your graphics device has fixed colors, then the graphics driver should map the Amiga-DIGLIB colors numbers into the graphics devices color numbers so that the proper color correspondence exists.
  5362.  
  5363.  
  5364. GRAPHICS INPUT WITH PICK CHARACTER - function 9
  5365.  
  5366.      This function requires a keyboard, since it must return a "pick character". This is no problem with graphics terminals, but with graphics heads, there is often no keyboard for getting the "pick character". This can be handled by using the interactive terminal keyboard. I admit this is a kludge, but there seems no
  5367. alternative.
  5368.  
  5369.      To perform a graphics input with pick character operation, the following steps are necessary:
  5370.  
  5371.      1.  Make the graphic cursor visible if it is not always vis-
  5372.          ible,
  5373.  
  5374.      2.  Allow the user to position the graphic cursor,
  5375.  
  5376.      3.  When the user strikes a character at the graphics key-
  5377.          board, read the graphic cursor position,
  5378.  
  5379.      4.  Return the character struck, the X position (in cm.) and
  5380.          the Y position (in cm.) of the graphic cursor, and
  5381.  
  5382.      5.  Make the graphic cursor invisible if possible.
  5383.  
  5384.      If your graphic device does not have a keyboard, then the
  5385. user's terminal is the logical choice.
  5386.  
  5387.  
  5388. DEFINE COLOR USING RGB - function 10
  5389.  
  5390. Amiga-DIGLIB provides a mechanism for selecting the color associated with by Amiga-DIGLIB color number using the (Red, Green, Blue) color coordinate system.
  5391.  
  5392.  
  5393. DEFINE COLOR USING HLS - function 11
  5394.  
  5395.      Amiga-DIGLIB does not provide a mechanism for selecting the color associated with any Amiga-DIGLIB color number using the (Hue, Lightness, Saturation) color coordinate system.
  5396.  
  5397.  
  5398. GRAPHICS INPUT WITH BUTTON INPUT - function 12
  5399.  
  5400.      This form of graphics input is designed for graphics devices that use mice, digitizers, joysticks, or the like. Theoretically, the pointing device contains a set of buttons, any or all of which may be "pressed" or otherwise caused to change binary state. When a state change occurs, the graphics input operation
  5401. is concluded, and the new state of the buttons is returned. The buttons are numbered from 1 to N for a N button device. The state of each button is represented by a bit in the "button state" returned variable. The correspondence between buttons and bits is: 
  5402.  
  5403.           Bit = 2**(n-1) 
  5404.  
  5405. Where n is the button number.
  5406.      A bit value of one means the button is "set" or "pressed", and zero means the corresponding button is "clear" or "not pressed".
  5407.  
  5408.      For devices that support both graphics input with "pick character" and graphics input with "button" input, it is desirable to use different cursors if possible. This will allow the user to determine what action is necessary to terminate the graphics input.
  5409.  
  5410.      To perform a graphics input with button input operation, the ollowing steps are necessary:
  5411.  
  5412.      1.  Make the graphic (button) cursor visible if it is not
  5413.          always visible,
  5414.  
  5415.      2.  Allow the user to position the graphic cursor,
  5416.  
  5417.      3.  When the selects the current position by pressing a
  5418.          "button", read the graphic cursor position,
  5419.  
  5420.      4.  Return the button state after the button was pressed,
  5421.          the X position (in cm.) and the Y position (in cm.) of
  5422.          the graphic cursor, and
  5423.  
  5424.      5.  Make the graphic (button) cursor invisible if possible.
  5425. DRAW SOLID FILLED POLYGON - function 1024+N
  5426.  
  5427.      The number of vertices are passed in as a part of the function code. I realize this is unorthodox, but everything else requires too much overhead. Two sophistications of hardware fill are supported by Amiga-DIGLIB. The first is the simple "convex polygon fill". The second is the "any polygon fill". Some devices can only handle convex (non-intersecting) polygons. If you set the DEVICE CHARACTERISTICS bit telling Amiga-DIGLIB that the device can only handle convex polygons, Amiga-DIGLIB will supply software fill for the concave polygons, and call the driver for the convex polygons.
  5428.  
  5429. DEVICE CHARACTERISTICS and the EXTENDED FUNCTIONS
  5430.  
  5431.      All implementators of primitives 8, 10, 11 and/or 1024+N need be aware of the interaction of these primitives with the Device Characteristics Values (primitive 7). Device characteristics value number 6 is the number of foreground colors. This includes color 1 but not color 0. All devices have atleast one foreground color. In addition, device characteristics value 7 has the 2 bit set if the device is capable of writing in the backround color (color 0). Pen plotters and storage tubes are not capable of writing in the background color, but most other graphic devices can handle this function. Let's take the example
  5432. of the Tektronix 4027 terminal to see how the device characteristics values (color only) are set. A 4027 has the ability to display 8 colors simultaneously, out of a palate of 64 total colors. In addition, the 4027 has a programmable Look-Up Table (LUT) so that colors may be defined. Reading the manual, we find that colors may be define by both RGB and HLS. Thus we would:
  5433.  
  5434.      1.  Implement primitive 8,
  5435.  
  5436.      2.  Implement primitives 10 and 11,
  5437.  
  5438.      3.  Set device characteristics value 6 to 7 foreground col-
  5439.          ors (one of the 8 colors must be background), and
  5440.  
  5441.      4.  Set device characteristics value 7 to 1+4+32+64+128.
  5442.  
  5443.      Note that we added 4 to the value of device characteristics value 7. This reflects the fact that the 4027 can draw in the background color (erasing color).
  5444.  
  5445.      If we were to implement the polygon fill section of the 4027 driver, we would set bit 7 of the device characteristics bit (value 256) and leave bit 8 (value 512) clear because the Tek. 4027 can handle polygons all polygons.
  5446.  
  5447.      Before you start writing an Amiga-DIGLIB device driver, you should first arm yourself with a good programmers manual for the target graphics device. Then, find an Amiga-DIGLIB driver for a similar device and plagiarize, plagiarize, plagiarize! Make sure you don't just kludge it though.
  5448.  
  5449.  
  5450.  
  5451. 15.4 DEVICE DRIVER EXAMPLES
  5452.  
  5453.      The file "SKELTN.FTN" gives a skeleton graphics device driver written in FORTRAN that may be edited with an editor and used as a starting point for writing an Amiga-DIGLIB graphics device driver. However, there is no reason that this skeleton need be used at all, nor even that the device driver be written in FORTRAN as opposed to MACRO. In addition to "SKELTN.FTN", I have included the file "GD13HI.FOR" and "GD12HI.FOR which are working drivers.
  5454.  
  5455.                               NOTE
  5456.  
  5457.        By convention, all graphics device driver names start
  5458.        with the letters "GD" for Graphic Driver.
  5459.  
  5460.  
  5461. 15.5 DEVICE DRIVER ARGUMENTS
  5462.  
  5463.      The graphics device driver has 3 arguments:
  5464.  
  5465.      1.  The graphics function to be performed,
  5466.  
  5467.      2.  A real array whose  meaning  is  dependant  on  the
  5468.          graphics function to be performed, and
  5469.  
  5470.      3.  A real array whose  meaning  is  dependant  on  the
  5471.          graphics function to be performed.
  5472.  
  5473.      INPUT
  5474.  
  5475.         IFXN            * TYPE: INTEGER CONSTANT OR VARIABLE.
  5476.                         * THE GRAPHICS FUNCTION TO PERFORM:
  5477.                              1 ===> INITIALIZE THE GRAPHICS DEVICE
  5478.                                     TO PREPARE IT FOR GRAPHICS
  5479.                                     (AND ON MULTI-USER SYSTEMS,
  5480.                                     TAKE EXCLUSIVE CONTROL OF THE
  5481.                                     DEVICE.)
  5482.                              2 ===> OBTAIN A FRESH PLOTTING SUR-
  5483.                                     FACE ON THE GRAPHICS DEVICE.
  5484.                              3 ===> MOVE TO A NEW POSITION (X,Y),
  5485.                                     WHERE THE UNITS OF BOTH X AND
  5486.                                     Y ARE IN CENTIMETERS.
  5487.                              4 ===> DRAW A LINE TO THE POSITION
  5488.                                     (X,Y), WHERE THE UNITS OF X
  5489.                                     AND Y ARE IN CENTIMETERS.
  5490.                              5 ===> TRANSMIT ANY BUFFERED GRAPHICS
  5491.                                     COMMANDS THAT HAVE NOT YET
  5492.                                     BEEN TRANSMITTED TO THE
  5493.                                     GRAPHICS DEVICE.
  5494.                              6 ===> RELEASE CONTROL OF THE GRAPH-
  5495.                                     ICS DEVICE.
  5496.                              7 ===> RETURN TO THE CALLER THE
  5497.                                     DEVICE CHARACTERISTICS OF
  5498.                                     THIS DEVICE.
  5499.                              8 ===> SET THE CURRENT DRAWING
  5500.                                     COLOR.
  5501.                              9 ===> PERFORM A GRAPHICS INPUT WITH
  5502.                                     PICK CHARACTER OPERATION,
  5503.                                     RETURNING THE USER SELECTED
  5504.                                     LOCATION (X,Y) WITH X AND Y
  5505.                                     SPECIFIED IN CENTIMETERS.
  5506.                              10 ==> SET THE VISUAL COLOR ASSOCI-
  5507.                                     ATED WITH A SPECIFIED COLOR
  5508.                                     NUMBER TO THE RGB VALUE PRO-
  5509.                                     VIDED.
  5510.                              11 ==> SET THE VISUAL COLOR ASSOCI-
  5511.                                     ATED WITH A SPECIFIED COLOR
  5512.                                     NUMBER TO THE HLS VALUE PRO-
  5513.                                     VIDED.
  5514.                              1024+N==> DRAW FILLED POLYGON HAVING
  5515.                                     N SIDES.
  5516.  
  5517.         XA              * TYPE: REAL ARRAY.
  5518.                         * DEPENDANT OF THE GRAPHICS FUNCTION
  5519.                           GIVEN BY "IFXN".
  5520.                              1 ===> XA(1) IS RT-11 CHANNEL NUMBER
  5521.                                     ON WHICH TO PERFORM I/O, OR
  5522.                                     RSX-11M LOGICAL UNIT NUMBER
  5523.                                     ON WHICH TO PERFORM I/O.
  5524.                                     XA(2) --> XA(7) UNUSED.
  5525.                              2 ===> XA(1) --> XA(7) UNUSED.
  5526.                              3 ===> XA(1) IS THE X COORDINATE IN
  5527.                                     CM. FOR THE MOVE OPERATION.
  5528.                                     XA(2) --> XA(7) UNUSED.
  5529.                              4 ===> XA(1) IS THE X COORDINATE IN
  5530.                                     CM. FOR THE DRAW OPERATION.
  5531.                                     XA(2) --> XA(7) UNUSED.
  5532.                              5 ===> XA(1) --> XA(7) UNUSED.
  5533.                              6 ===> XA(1) --> XA(7) UNUSED.
  5534.                              7 ===> XA(1) --> XA(7) UNUSED.
  5535.                              8 ===> XA(1) IS COLOR FOR SUBSEQUENT
  5536.                                     LINES. XA(2) --> XA(7)
  5537.                                     UNUSED.
  5538.                              9 ===> XA(1) --> XA(7) UNUSED.
  5539.                              10 ==> XA(1) IS THE COLOR TO DEFINE.
  5540.                              11 ==> XA(1) IS THE COLOR TO DEFINE.
  5541.                              12 ==> XA(1) --> XA(7) UNUSED.
  5542.                              1024+N ==> XA(1) --> XA(N) X VER-
  5543.                                     TICES OF POLYGON.
  5544.  
  5545.  
  5546.  
  5547.  
  5548.         YA              * TYPE: REAL ARRAY
  5549.                         * DEPENDANT OF THE GRAPHICS FUNCTION
  5550.                           GIVEN BY "IFXN".
  5551.                              1 ===> YA(1) IS THE ERROR FLAG FOR
  5552.                                     DEVICE SELECTION:
  5553.                                          0 ==> NO ERRORS
  5554.                                         >0 ==> ERROR
  5555.                                     YA(2) --> YA(3) UNUSED.
  5556.                              2 ===> YA(1) --> YA(3) UNUSED.
  5557.                              3 ===> YA(1) IS THE Y COORDINATE IN
  5558.                                     CM. FOR THE MOVE OPERATION.
  5559.                                     YA(2) --> YA(3) UNUSED.
  5560.                              4 ===> YA(1) IS THE Y COORDINATE IN
  5561.                                     CM. FOR THE DRAW OPERATION.
  5562.                                     YA(2) --> YA(3) UNUSED.
  5563.                              5 ===> YA(1) --> YA(3) UNUSED.
  5564.                              6 ===> YA(1) --> YA(3) UNUSED.
  5565.                              7 ===> YA(1) --> YA(3) UNUSED.
  5566.                              8 ===> YA(1) --> YA(3) UNUSED.
  5567.                              9 ===> YA(1) --> YA(3) UNUSED.
  5568.                              10 ==> YA(1) IS % RED COMPONENT OF
  5569.                                     COLOR.  YA(2) IS % GREEN COM-
  5570.                                     PONENT OF COLOR. YA(3) IS %
  5571.                                     BLUE COMPONENT OF COLOR.
  5572.                              11 ==> YA(1) IS THE HUE (0-360).
  5573.                                     YA(2) IS THE LIGHTNESS
  5574.                                     (0-100). YA(3) IS THE SATURA-
  5575.                                     TION (0-100).
  5576.                              12 ==> YA(1) --> YA(3) UNUSED.
  5577.                              1024+N ==> YA(1) --> YA(N) Y VER-
  5578.                                     TICES OF POLYGON.
  5579.  
  5580.      OUTPUT
  5581.  
  5582.         XA              * TYPE: REAL ARRAY.
  5583.                         * DEPENDANT OF THE GRAPHICS FUNCTION
  5584.                           GIVEN BY "IFXN".
  5585.                              1 ===> XA(1) --> XA(7) UNUSED.
  5586.                              2 ===> XA(1) --> XA(7) UNUSED.
  5587.                              3 ===> XA(1) --> XA(7) UNUSED.
  5588.                              4 ===> XA(1) --> XA(7) UNUSED.
  5589.                              5 ===> XA(1) --> XA(7) UNUSED.
  5590.                              6 ===> XA(1) --> XA(7) UNUSED.
  5591.                              7 ===> XA(1) --> XA(7) ARE SET TO
  5592.                                     THIS DEVICES CHARACTERISTIC
  5593.                                     WORDS:
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.            XA(1) = DEVICE ID. (A UNIQUE DEVICE NUMBER OBTAINED
  5600.                    FROM HAL BRAND X26312.
  5601.            XA(2) = X AXIS LENGTH OF THIS DEVICE IN CM.
  5602.            XA(3) = Y AXIS LENGTH IN CM.
  5603.            XA(4) = X AXIS RESOLUTION IN GRAPHICS UNITS (GU) PER
  5604.                    CENTIMETER.
  5605.            XA(5) = Y AXIS RESOLUTION IN GU/CM.
  5606.            XA(6) = NUMBER OF AVAILABLE FOREGROUND COLORS ON THIS
  5607.                    DEVICE.
  5608.            XA(7) = DEVICE CHARACTERISTICS BITS. THE SUM OF:
  5609.                         0 IF STROKE (PLOTTER) DEVICE.
  5610.                         1 IF RASTER DEVICE.
  5611.                         2 IF DVST (STORAGE TUBE)
  5612.                         3 PRINTER/PLOTTER
  5613.                         4 IF DRAWING IN THE BACKGROUND COLOR
  5614.                           (COLOR 0) IS AVAILABLE.
  5615.                         8 IF DEVICE IS A HARDCOPY DEVICE.
  5616.                         16 IF DEVICE IS A SHAREABLE DEVICE.
  5617.                         32 DEVICE'S COLORS ARE HLS SELECTABLE.
  5618.                         64 DEVICE'S COLORS ARE RGB SELECTABLE.
  5619.                         128 GRAPHICS INPUT WITH "PICK CHARACTER"
  5620.                         IS AVAILABLE.
  5621.                         256 DEVICE DRAWS FILLED POLYGONS.
  5622.                         512 DEVICE REQUIRES CONVEX POLYGONS.
  5623.                         1024 GRAPHICS INPUT WITH BUTTONS IS AVAILABLE.
  5624.            XA(8) = 1 + THE NUMBER OF SCAN LINES TO SKIP WHILE
  5625.                    DOING A SOFTWARE POLYGON FILL. THIS VALUE IS
  5626.                    USED TO TAKE ACCOUNT OF THE FACT THAT PLOTTERS
  5627.                    HAVE PENS THAT ARE TYPICALLY MANY TIMES
  5628.                    THICKER THAN THE PLOTTER STEP SIZE. THIS PAR-
  5629.                    AMETER SHOULD BE ONE FOR ALL RASTER DEVICES.
  5630.                    NOTE: FOR BACKWARDS COMPATIBILITY,  THIS VALUE
  5631.                    IS DEFAULTED TO ONE, SO ANY DRIVER THAT
  5632.                    RETURNS ON THE FIRST 7 ARRAY ELEMENTS WILL GET
  5633.                    THIS VALUE SET TO 1.
  5634.                              8 ===> XA(1) = PICK CHARACTER FROM
  5635.                                     GRAPHICS DEVICE OR FROM TER-
  5636.                                     MINAL. XA(2) = X COORDINATE
  5637.                                     SELECTED IN CM. XA(3) = Y
  5638.                                     COORDINATE SELECTED IN CM.
  5639.                                     XA(4) --> XA(7) UNUSED.
  5640.                              9 ===> XA(1) --> XA(7) UNUSED.
  5641.                              10 ==> XA(1) --> XA(7) UNUSED.
  5642.                              11 ==> XA(1) --> XA(7) UNUSED.
  5643.                              12 ==> XA(1) = BUTTON BITS FROM
  5644.                                     GRAPHICS DEVICE XA(2) = X
  5645.                                     COORDINATE SELECTED IN CM.
  5646.                                     XA(3) = Y COORDINATE SELECTED
  5647.                                     IN CM. XA(4) --> XA(7)
  5648.                                     UNUSED.
  5649.                              1024+N ==> XA(1) --> XA(N) UNUSED.
  5650.