   24998-19010 REV.2420 <840424.1122>                                                              GRAPHICS 1000/II Version 2.0                           Advanced Graphics Package                             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                                            AGP Demo Software                        Description of the AGP Demo Software        $ Upon receiving  the AGP software,  the user  may wish to  use the  $ $ demonstration software to verify the integrity of the AGP system.  $ $ The demo software can also be useful as a starting point for user  $ $ program development. The  software includes the source  code for  $ $ two  programs that  demonstrate  many AGP  calls,  and  a set  of  $ $ subroutines that use AGP to draw  both labeled and unlabeled axes  $ 	 and grids.  	     $ The two  demonstration programs  require a  work station  program  $ $ named wsp.run which  needs to be configured  and loaded according  $ $ to the work  station available. For the  first program, "house",  $ $ the wsp program (wsp.run) must contain the device handler for the  $ $ graphic display device. The wsp program (wsp.run) for the second  $ $ program, "view",  requires the  device handlers  for the  graphic  $ $ display  device,  alphanumeric  device, keyboard  device,  and  a  $ $ button device  with at least eight  buttons. (An HP 2623A  or HP  $ $ 2627A  could  satisfy  all   these  requirements.)  These  device  $ $ handlers could  be loaded  into one wsp  program, which  could be  $ $ used by both  demo programs. The following example  shows how to  $ $ link  up  a wsp  for  the  HP  2623  terminal that  includes  the  $ $ alphanumeric,  button,  keyboard,  and  graphics  logical  device  $  handlers:                CI> link         link: re, wsp.rel          link: se, wsplb.lib          link: se, a0001.lib          link: se, b0001.lib          link: se, k0001.lib          link: se, d0019.lib          link: se, didd.lib         link: en, wsp.run            $ In  addition, AGP  requires  the monitor  program,  zmntr, to  be  $  loaded and available. An RTE-A zmntr example follows:                 CI> link  
       link: su 
        link: re, zmntl.rel          link: en, zmntr.run        $ If  you  are   using  RTE-6/VM  relocate  zmntr.rel   instead  of  $         1                   	 zmntl.rel.  	          The House Program       $ The  program  house  is  a  simple,  non-interactive  application  $ $ program which simulates a tour of  a house. Initially, the house  $ $ is rotated  as if the viewer  were walking around the  outside of  $ $ the house.  Next, the house grows  larger as if the  viewer were  $ $ approaching and entering it. After  a revolution from within the  $ $ house, the entire cycle is  repeated, terminating with the viewer  $  looking out the house's front door.        $ The FORTRAN source for the program house is "house_agp.ftn". The  $ $ following  example shows  how to  compile  house_agp.ftn from  CI  $ $ using FTN7X compiler defaults for the list and relocatable files:  $             CI> ftn7x house_agp.ftn - -        $ Next, link the house relocatable and  search the AGP user program  $  library. A link example follows:                          CI> link         link: re, house_agp.rel          link: se, uplib.lib          link: en, house_agp.run            $ Refer to the AGP System Supplement for HP 1000, the AGP Reference  $ $ Manual,  the FORTRAN  77 Reference  Manual and  the RTE-A/6  Link  $ $ Reference Manual  for more information  on compiling  and linking  $ 
 graphics programs.  
      Once loaded, the house program can be run by typing:                 CI> house_agp.run       $ The house  program is  internally coded to  use the  work station  $ $ program named  wsp.run and  to direct its  output to  LU (logical  $ $ unit)  1.  If  these  are not  suitable,  house_agp.ftn  can  be  $  modified before being compiled.        $ A Pascal  version of  the house  program is  also included.  The  $ $ Pascal  source for  the program  house  is "house_agp.pas".  The  $ $ example  below compiles,  links  and  executes the  Pascal  house  $  program:               CI> pascal house_agp.pas - -               1                   
       CI> link 
      link: re, house_agp.rel        link: se, uplib.lib        link: en, house_agp.run               CI> house_agp.run            $ Refer to the AGP System Supplement for HP 1000, the AGP Reference  $ $ Manual, the Pascal  Reference Manual and the  RTE-A/6 Link Manual  $ $ for more information on compiling  and linking graphics programs.  $         $ As with house_agp.ftn,  house_agp.pas is internally coded  to use  $ $ the work station  program named wsp.run and to  direct its output  $ $ to LU (logical unit)  1. If these are not suitable,  they can be  $  modified before the source is compiled.         The View Program        $ Unlike  house,   the  second  demonstration  program,   view,  is  $ $ interactive. It  can be used not  only for initial  startup, but  $ $ also  for learning  3D  viewing  transformations by  manipulating  $ $ parameters  interactively.  The  view program  will  prove  most  $ $ useful after  reading the viewing  transformation chapter  in the  $ 
 AGP User's Guide.   
     $ The FORTRAN source  for the program view  is "view_agp.ftn". The  $ $ following example shows how to compile view_agp.ftn from CI using  $ ! FTN7X compiler defaults for the list and relocatable files:  !            CI> ftn7x view_agp.ftn - -        $ Next, link the view relocatable,  searching the AGP user library.  $  A link example follows:                CI> link         link: re, view_agp.rel         link: se, uplib.lib          link: en, view_agp.run       $ Refer to the AGP System Supplement for HP 1000, the AGP 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 view program can be run by typing:               CI> view_agp.run       $ Since  the view  program uses  the button  (softkey) device,  the  $         1                   $ buttons must be able  to be defined by the view  program. If the  $ $ buttons are  displayed on the  terminal before  running view_agp,  $ $ 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.  Initially,  two images  of  a house  are  $ $ displayed the reference house and  the view house. The reference  $ $ house  is  a fixed  image  that  indicates  the location  of  the  $ $ graphics window  in space relative  to the reference  house. The  $ $ view house  is displayed on the  right side of the  display. The  $ $ program  then enters  an interactive  phase  in which  individual  $ $ viewing  transformation parameters  are  chosen  with the  button  $ $ input device and  modified with the keyboard  input device. Note  $ $ that multiple values input on a  single line must be separated by  $ $ spaces  or  unpredictable  results may  occur.  When  a  viewing  $ $ parameter  is  changed,  the  window is  erased  and  redrawn  to  $ $ indicate its new  location relative to the  reference house. The  $ $ view house image is removed and redrawn showing the new projected  $  image of the reference house.        $ The view  program is  internally coded  to use  the work  station  $ $ program named  wsp.run and  to direct its  output to  LU (logical  $ $ unit) 1.  If this is not  suitable, they may be  modified before  $  the source is compiled.                 AXES, LAXES, GRID and LGRID Software        $ The  file chart_agp.ftn  contains  FORTRAN  source code  for  the  $ $ following entry points  which can be called from  any AGP 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      # This source can be compiled by entering the following command:   #             CI> ftn7x chartagp.ftn - -           $ The  suboutines  AXES,  GRID,  LAXES, and  LGRID  have  the  same  $ $ parameter lists.  They assume that the  AGP system and  at least  $ $ one work  station are  correctly initialized.  In addition,  the  $ $ LAXES and LGRID subroutines assume that  a software text font and  $ $ a  software character  character size  have  been selected.  AGP  $ $ attributes  and   viewing  transformations  such   as  linestyle,  $ $ character sizes, windows,  and viewports can be  changed by these  $ $ calls,  but they  are  restored to  their  former  values at  the  $         1                    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  software 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.             The calling sequence is the same for all the calls:           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)               1                   $ 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 integer  value, even  $ $            though it is type real in the parameter list. If XMJC  $             = 1.0, then all X tics are major.           YMJC[REAL; INPUT]        $            YMJC, defined  in world coordinates, gives  the number  $ $            of tic  spacing intervals between  major tic  marks on  $ $            the Y-axis. This  should have an integer  value, even  $ $            though it is type real in the parameter list. If YMJC  $             = 1.0, then all Y tics are major.           TSIZE[REAL; INPUT]                1                   $            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  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 or displayed 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                  