   24998-19009 REV.2420 <840424.1354>                                                              GRAPHICS 1000/II Version 2.0                     Device-independent Graphics Library                             Demo Software Guide                                                                         NOTICE          $ The information contained  in this document is  subject to change  $  without notice.        $ HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS  $ $ MATERIAL, INCLUDING, BUT  NOT LIMITED TO, THE  IMPLIED WARRANTIES  $ $ OF  MERCHANTABILITY   AND  FITNESS  FOR  A   PARTICULAR  PURPOSE.  $ $ Hewlett-Packard shall not  be liable for errors  contained herein  $ $ or for  incidental consequential damages  in connection  with the  $  furnishing, performance or use of this material.       $ Hewlett-Packard  assumes   no  responsibility  for  the   use  or  $ $ reliability of its software on equipment that is not furnished by  $  Hewlett-Packard.       $ This document contains proprietary information which is protected  $ $ by copyright. All rights are reserved. No part of this document  $ $ may be photocopied or reproduced without prior written consent of  $  Hewlett-Packard Company.                                                                                    Copyright (c) 1984 by HEWLETT-PACKARD COMPANY                           1                                            DGL Demo Software                        Description of the DGL Demo Software        $ Upon receiving  the DGL software,  the user  may wish to  use the  $ $ demonstration software provided,  to verify the integrity  of the  $ $ DGL system. It may  also be useful as a starting  point for user  $ $ program  development. The  demonstration  software includes  the  $ $ source code for a set of subroutines  which uses DGL to plot axes  $ $ and  grids  (both labeled  and  unlabeled)  and a  program  which  $  demonstrates the use of many DGL calls.                 The Graph Program       $ Graph enables a  user to interactively request a  linear graph be  $ $ drawn.  Different elements  of the  graph  can be  interactively  $ 
 defined including:   
                graph data values            tic mark spacing and linestyle             graph label name and label position            labeled/unlabeled axes             grid, grid line spacing and linestyle       $ Or a default graph with default data values can be requested. By  $ $ selecting different buttons,  the user indicates the  function to  $ $ be  performed.  For  example,  the default  graph  is  drawn  by  $  selecting the "Plot graph" button.       $ Graph demonstrates the  use of the button,  keyboard, and locator  $ $ as  input logical  devices,  and  the alphanumeric  and  graphics  $ $ displays  as  output  logical  devices.  If  a  locator  is  not  $ $ available, the  graph program will  not allow the  positioning of  $  the graph label.       $ The FORTRAN  source for the  program graph  is found in  the file  $ $ "graph_dgl.ftn"  The  FORTRAN  source  for   the  axes  and  grid  $ $ subroutine  set  is  found  in  the  file  "chart_dgl.ftn".  The  $ $ following  example shows  how to  compile these  sources from  CI  $ $ using FTN7X compiler defaults for the list and relocatable files.  $              CI> ftn7x graph_dgl.ftn - -            CI> ftn7x chart_dgl.ftn - -       $ Next, link  the graph  relocatable with  the appropriate  button,  $         1                   $ keyboard,  locator,  alphanumeric  and   display  handlers.  The  $ $ following  example links  graph so  that  it will  operate on  an  $ $ HP2623A graphics terminal.  Note that graph is not  a CDS (code  $ $ and data separation) program and therefore the graphics libraries  $  searched are not CDS.                  CI> link         link: re, graph_dgl.rel          link: re, chart_dgl.rel          link: se, a0001.lib          link: se, b0001.lib          link: se, k0001.lib          link: se, l0019.lib          link: se, d0019.lib          link: se, didd.lib         link: en, graph.run            $ The user should  refer to the DGL System Supplement  for HP 1000,  $ $ the DGL Reference Manual, the FORTRAN 77 Reference Manual and the  $ $ RTE-A/6 Link Manual for more information on compiling and linking  $ 
 graphics programs.  
      Once loaded, the graph program can be run by typing:                 CI> graph_dgl.run       $ Since the  graph program  uses the  button (softkey)  device, the  $ $ buttons must be able to be defined  by the graph program. If the  $ $ buttons are displayed  on the terminal before  running graph_dgl,  $ $ turn them off. To  turn off the button displays on  the 2623 and  $ $ 2627 terminals press the  shift key and the aids key  at the same  $ $ time. Reference the terminal manual for your particular terminal  $ $ for more information. The graph program  is coded to perform all  $ $ I/O to  the work station  at LU (logical  unit) 1. The  user can  $ $ change the LU value before  compiling by changing the appropriate  $  data statements in graph_dgl.ftn.             AXES, LAXES, GRID and LGRID Software        $ chart_dgl.ftn  contains  source  code  for  the  following  entry  $ $ points, which can  be called from any DGL  application program to  $  demonstrate the drawing of rectilinear plots:                AXES   -  Draw axes            GRID   -  Draw axes with grid            LAXES  -  Draw axes with labels            LGRID  -  Draw axes with grid and labels      $ Note that the  graph program uses these subroutines  to make it's  $         1                    graphs.        $ Subroutines AXES, GRID, LAXES, and  LGRID have the same parameter  $ $ lists. They assume that the DGL system is correctly initialized.  $ $ DGL  attributes and  viewing transformations  such as  linestyle,  $ $ character sizes, windows,  and viewports may be  changed by these  $ $ calls  but  they are  restored  to  their  former values  at  the  $  completion of these calls.       $ The following functions  are performed by AXES,  GRID, LAXES, and  $  LGRID:        $    1)Draw X  and Y axes  with boundaries  the same as  the user  $ $        defined window. The  origin of both axes  is specified in  $         the call. Linestyle 1 is used for the axes.            $    2)Draw  the  tic marks  on  the  axes.  The tic  marks  are  $ $        linearly spaced about the origin so  that a major tic mark  $ $        falls on the origin. Major tic  marks or a combination of  $         major and minor tic marks are drawn.            ! In addition, the GRID and LGRID routines do the following:   !         #    1)Draw grid lines at the major tic marks in linestyle 1.   #     $    2)If tic size  is set to 0.0,  draw grid lines at  the minor  $         tic marks in linestyle 2.           $ All lines, i.e.  axes, tic marks and grid lines,  are clipped to  $ 
 the window.   
     $ LAXES and  LGRID label  the major tic  marks. Labels  are placed  $ $ outside of the  user defined window so that they  are outside the  $ $ graphics area.  The axes labels  are drawn using  hardware text.  $ $ It is the  user's responsibility to set  an appropriate character  $ $ size based on the magnitude of  the window so that characters are  $ $ readable and  labels do not overlap.  Also, the user  must leave  $ $ enough room  on the logical  display surface outside  the current  $ $ viewport to allow room for the  labels (i.e. the viewport cannot  $ $ fill the  entire view surface). This  room must be  left because  $ $ the labels are placed outside the  user defined viewport to which  $ $ the  window is  mapped. If  there is  no room  outside the  user  $ $ defined viewport  on a  side, labels are  drawn inside  the graph  $ $ area on that side. Labels are limited to 8 characters, including  $  the decimal point and minus sign.                    1                   $ The  calling  sequence  is  the same  for  all  the  calls.  The  $  following is an example of a FORTRAN calling sequence:                   CALL  AXES (XTIC,YTIC,XORG,YORG,XMJC,YMJC,TSIZE)         CALL LAXES (XTIC,YTIC,XORG,YORG,XMJC,YMJC,TSIZE)         CALL  GRID (XTIC,YTIC,XORG,YORG,XMJC,YMJC,TSIZE)         CALL LGRID (XTIC,YTIC,XORG,YORG,XMJC,YMJC,TSIZE)      $ The  parameters used  by AXES,  GRID,  LAXES, and  LGRID are  the  $ 	 following:   	         XTIC[REAL; INPUT]        $            XTIC, defined  in world  coordinates, specifies  units  $ $            between tic marks on the X  axis. If XTIC = 0.0, then  $             no tics will be drawn.            YTIC[REAL; INPUT]        $            YTIC, defined  in world  coordinates, specifies  units  $ $            between tic marks on the Y  axis. If YTIC = 0.0, then  $             no tics will be drawn.            XORG[REAL; INPUT]        $            XORG,  defined  in  world  coordinates,  gives  the  X  $ $            coordinate for  the origin  of the  axes. The  Y axis  $ $            will be drawn through this X coordinate, assuming that  $ $            it is  within the window.  If this coordinate  is not  $ $            within  the window,  the  Y axis  will  not be  drawn.  $ $            However, labels will appear if calling LAXES or LGRID.  $         YORG[REAL; INPUT]        $            YORG,  defined  in  world  coordinates,  gives  the  Y  $ $            coordinate for  the origin  of the  axes. The  X axis  $ $            will be drawn through this Y coordinate, assuming that  $ $            it is  within the window.  If this coordinate  is not  $ $            within  the window,  the  X axis  will  not be  drawn.  $ $            However, labels will appear if calling LAXES or LGRID.  $         XMJC[REAL; INPUT]        $            XMJC, defined  in world coordinates, gives  the number  $ $            of tic  spacing intervals between  major tic  marks on  $ $            the X axis. This should  have an integral value, even  $ $            though it is type real in the parameter list. If XMJC  $             = 1.0, then all X tics are major.        YMJC[REAL; INPUT]            1                   $            YMJC, defined  in world coordinates, gives  the number  $ $            of tic  spacing intervals between  major tic  marks on  $ $            the Y axis. This should  have an integral value, even  $ $            though it is type real in the parameter list. If YMJC  $             = 1.0, then all Y tics are major.           TSIZE[REAL; INPUT]        $            TSIZE,  defined  in  virtual  coordinates,  gives  the  $ $            length for minor tic marks.  Major tics are of length  $ $            twice TSIZE.  If TSIZE=0.0 in  the call to  GRID or  $ $            LGRID, then  linestyle 2  is used  to draw  minor grid  $ $            lines. Note that  the since the lengths  of the major  $ $            and  minor   tic  marks   are  specified   in  virtual  $ $            coordinates,  the physical  length of  a  tic mark  on  $ $            either side of the X-axis, as drawn on the final plot,  $ $            is the same as the  physical length of a corresponding  $             tic mark on either side of the Y-axis.                                                                                                                                                1                    Table of Contents                                                                                                                                                                                                                   1                  