.qa UGSYS This is a collection of routines available for graphics. They are device independent, and a large number of devices are supported. They are contained in directory: .i5;SYS$UGSYS: .br;You may prefer the routines in TOPDRAWER which are easier to use. You can also use some PLOT10 emulation routines. .qb Plot10 There are a set of PLOT10 emulation routines available in library: .i5;SYS$UGSYS:UGTEKPL .br;It includes the routines: .s.br;Windows: .i5;VWINDO(XMIN,DX,YMIN,DY), DWINDO(XMIN,XMAX,YMIN,YMAX), .i10;This sets the window in user units. .i5;SWINDO(IXMIN,IDX,IYMIN,IDY), TWINDO(IXMIN,IXMAX,IYMIN,IYMAX), .i10;Set window in screen units. .br;Absolute draw: .i5;MOVABS(IX,IY), MOVREL(IdX,IdY), DRWABS(IX,IY), DRWREL(IdX,IdY), PNTABS(IX,IY), PNTREL(Idx,Idy), DSHABS(IX,IY,L), DSHREL(IdX,IdY,L) .i10;L=############0,######1,########2,######3,#######4 .i10;Structure=Solid,#Dotted,#Dot-Dash,#Dashed,#Daashed .br;Relative draw (User units): .i5;MOVEA(X,Y), MOVER(dX,dY), DRAWA(X,Y), DRAWR(dX,dY), POINTA(X,Y), POINTR(DX,DY), DASHA(X,Y,L), DASHR(dX,dY,L) .br;Scaling: .i5;RROTAT(DEGREES) - Rotate relative draw by specified angle. .i10;This applies only to DRAWR, DASHR, POINTR .i5;RSCALE(FACTOR) - Multiply coordinates by FACTOR. .br;Initialize: .i5;INITT(ISPEED) - Initialize at beginning .i5;FINITT(IX,IY) - Finish all plots .i5;TERM(ITERM,ISCREEN[1024,4096]) - Set terminal type + range .br;Cursor: .i5;SCURSR(ICHAR,IX,IY) - Get cursor in absolute coordinates .i5;VCURSR(ICHAR,X,Y) - Get cursor in "Window" user units .br;Screen: .i5;HOME - Put cursor to upper left corner .i5;ERASE - Erase, no cursor movement .i5;NEWPAGE - Erase & put cursor home .br;Get Status: .i5;SEETRM(ISPEED,ITERM,ICSIZE,ISCREEN[1024,4096]) .i5;SEETW(IXMIN,IXMAX,IYMIN,IYMAX) - Get screen coor. of window. .i5;SEEDW(XMIN,XMAX,YMIN,YMAX) - Get user window coordinates. .br;Character strings: .i5;ANCHO(ICHAR) - Single char plot .i5;AOUTST(NCHAR,IARRAY) - Plot NCHAR from IARRAY .i5;ANSTR(ISIZE,IARRAY) - Plot characters in array in A1 format or 1 char/word .BR;Character sizes: .i5;CSIZE(ICSIZE[1-4]) .i10;Characters/line#73,#80,#120,#132 .i10;ICSIZE=##########1,##2,###3,###4 .br;Buffer status: .i5;TSEND - Dumps the buffer. .br;Input: .i5;AINST(Nchar,IARRAY) .s Note: There are some differences from "true" PLOT10 routines. Only 3 line structures (L=0-3) are supported for DASH,DSH routines. All character strings must be output by the character string routines. Absolute MOV,DRW do not wrap around, and long strings of characters do not automatically wrap. .qb Parameters Various parameters are used in the routines. They have the same general form for all subroutines. .list 0 .le;OPTIONS - A character string containing the options to use. .le;SEGMENT - The graphic segment to use. This is generally defined as: .i5;INTEGER*4 SEGMENT(NSEG) .els 0 .qb Subroutines .qc list__of__subroutines .list 0 .s.c;^*Graphic segment generation\* .le;UGINIT - Clear and initialize graphic segment .le;UGMARK - Add a marker to a segment .le;UGPMRK - Add a number of markers to a segment .le;UGLINE - Add a line to a segment .le;UPPLIN - Add a number of lines to a segment .le;UGTEXT - Add text to a segment .le;UGXTXT - Add extended text to a segment .le;UGDEFL - Set default values .if 1985 .le;UGPFIL - Fill a polygon .s.c;^*3 dimensional segment generation\* .le;UG3MRK - Draw a single marker .le;UG3LIN - Draw a single line segment .le;UG3PMK - Draw several markers .le;UG3PLN - Draw several line segments .le;UG3TXT - Text placed in 3 dimensional space .endif 1985 .s.c;^*Graphic device control\* .le;UGOPEN - Open a device and make it ready for use .le;UGCLOS - Close a device and terminate use .le;UGSLCT - Select a device for use .le;UGMCTL - Miscellaneous control .s.c;^*Picture control\* .le;UGWRIT - Transmit a segment to a device .le;UGPICT - Manipulate segments (add,delete etc.) .s.c;^*Interactive input\* .le;UGENAB - Enables an input control unit .le;UGDSAB - Disables an input unit .le;UGEVNT - Gets input .le;UGECTL - Misc. special input operations .s.c;^*Controlling viewing window\* .le;UGDSPC - Define physical drawing space .le;UGWDOW - Map a window onto the drawing space .le;UGSHLD - Define shielded areas (not lines drawn) .if 1985 .s.c;^*3 dimensional viewing window\* .le;UG3WRD - Define 3 dimensional window .le;UG3TRN - Define 3 dimensional transformation .endif 1985 .s.c;^*Extended character set\* .le;UGFONT - Selects the font to use .le;UGCTOL - This allows user to transform the character set .s.c;^*Miscellaneous routines\* .le;UGRERR - The error handling routine .le;UGXERR - An optional user written error handler .le;UGOPTN - The options scanning routine .s.c;^*Pool of algorithms\* .le;UGCNVF - Number conversion .le;UGTRAN - Calculates 3 Dimensional projection matrix .le;UGPROJ - Convert 3 dimensional to 2 d projection .le;UGLNAX - Linear Axis generation .le;UGLGAX - Logarithmic axis generation .le;UGLNDX - Linear tick data generation .le;UGLGDX - Logarithmic tick data generation .le;UGXHCH - Cross hatching a polygon .le;UGCNTL - Contour plots .le;UGMESH - Mesh surface plot .le;UG2DHG - 3 dimensional histogram plot. ("Block plot") .els 0 .qc UGCLOS .x Closing graphics devices This closes a graphics device, and terminates use of it. This is necessary to complete the last picture, write the final buffer, and release the memory used by this device. .i5.tt4;CALL UGCLOS(OPTIONS) .x Subroutine>UGCLOS .br;OPTIONS may be one of the following: .list 0 .le;ALL - All graphics devices are closed. .x Options>ALL .le;NOCLEAR - display is not cleared on termination. .x Options>CLEAR .els 0 .qc UGCNVF .x Conversion of numbers This subroutine converts a floating point number to a character string. .i5;UGCNVF(FNUMBER,IDEC,STRING,NBLANK) .list 0 INPUT: .le;FNUMBER - The number to convert .le;IDEC - The number of significant decimal places (0-10) .i5;=0 No decimal point appears in string .br;OUTPUT: .le;STRING - The string containing the number .le;NBLANK - The number of non blank characters in the string .els 0 .qc UGCTOL .x Character string plotting This accepts primary and secondary character string input and supplies the resulting line segments as output. These are suitable as input to UGPLIN. The programmer may transform them to create slanted lettering, perspective views and so on. .i5.tt4;CALL UGCTOL(OPTIONS,X,Y,PRITEXT,SECTXT, .x Subroutine>UGCTOL .i5;NSIZE,XARRAY,YARRAY,NCOORD,IBITS) .list 0 INPUT: .le;OPTIONS: .list 0 .le;SIZE= - Character size (Default:.015) .x Options>SIZE .le;ANGLE= - Angle in degrees of character string with respect to X. .x Options>ANGLE Positive angles rotate counter-clockwise. .le;LEFT - X,Y give coordinates of left side of string. .x Options>LEFT (position of center of left character) (Default:LEFT) .le;RIGHT - X,Y give coordinates of the right side of string. .x Options>RIGHT .le;CENTER - X,Y give coordinates of the center of the string. .x Options>CENTER .le;FIXSIZE,NOFXSIZ - These set fixed, or proportional spacing .x Proportional spacing .x Options>FIXSIZE .le;LAST,NEXT - Suppresses the stroke generation. .i5;XARRAY(1),YARRAY(1) = Coordinate of last or what would be the next character in the string. .els 0 .le;X,Y - The coordinate of the text modified by LEFT,RIGHT or CENTER. .le;PRITXT - The primary text string. see:UGXTXT .le;SECTXT - The secondary text string .le;NSIZE - The number of elements in arrays XARRAY,YARRAY, and IBITS .s;OUTPUT: .le;XARRAY - The X coordinates of the end points of the line segments .le;YARRAY - The Y coordinates .le;NCOORD - The number of coordinates actually stored in the arrays. .le;IBITS - A bit string to store the blanking bits .els 0 .s;ERRORS: .list 0 .le;The string lengths are invalid. They must be in the range 1 to 1024. .le;There is not enough space in the output arrays for the generated line segments. .els 0 .qc UGDEFL .x Setting default values This sets new default values for many options. .i5.tt4;CALL UGDEFL(OPTIONS,IARRAY,XARRAY) .x Subroutine>UGDEFL .qd options .list 0 .le;RESET - set all options to original default .x Options>RESET .le;SET - set options from arrays .x Options>SET .le;MARK=n (n=0-9) selects a plotting symbol DEFAULT=point .x Options>MARK see:UGMARK .le;SIZE=ff - Size of symbol relative to window .x Options>SIZE .le;DSIZE=ff - Size of symbol relative to default drawing space. 1/DSIZE is the number of characters/screen assiming a square screen. (Default: DSIZE=.015) .x Options>DSIZE .le;structure: SOLID, DASHED, DOTTED, DOTDASH, DAASHED .br;DAASHED is a long dash. .x Structure .le;intensity: VDIM, DIM, MEDIUM, BRIGHT, VBRIGHT .x Intensity .le;color: WHITE, RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN .x Color .le;attributes: BLINK, STEADY .x Attributes .le;ANGLE=ff - Angle of text in degrees with respect to .x Options>ANGLE horizontal in counterclockwise direction. ANGLE=90.0 makes the text go from bottom to top. (Default: ANGLE=0.0) .le;Method of generation: .list 0 .x Character generation .le;HARDGN - Hardware generator must be used whether sizes match properly. .x Options>HARDGN .le;NORMGN - Hardware generator will be used if sizes match properly. .x Options>NORMGN (DEFAULT) .le;SOFTGN - Use only software generator .x Options>SOFTGN .els 0 .le;string position: .list 0 .le;LEFT - X,Y refers to left part of string (DEFAULT) .x Options>LEFT .le;CENTER - X,Y is at center of string. .x Options>CENTER .le;RIGHT - X,Y is at right side of string. .x Options>RIGHT .els 0 .le;character spacing: .list 0 .le;FIXSIZE - Same spacing for all characters. .x Proportional spacing .x Options>FIXSIZE .le;NOFXSIZ - Proportionally space the characters. .els 0 .els 0 .qd IARRAY This is used to set all defaults if the "SET" options is used. .list 0 .le;IARRAY(1) - Intensity (1-5) VDIM to VBRIGHT .x Intensity .le;IARRAY(2) - Color (1-7) .x Color .br;####1, ##2, ####3, ###4, #####5, ######6, ###7 .br;WHITE, RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN .le;IARRAY(3) - Blink .x Attributes .br;#####1, ####2 .br;STEADY, BLINK .le;IARRAY(4) - Mark value (0-9) -1=simple point .x Options>MARK .x Markers see:UGMARK .le;IARRAY(5) - Line structure .x Structure .br;####1, #####2, #####3, ######4, ######5 .br;SOLID, DASHED, DOTTED, DOTDASH, DAASHED .le;IARRAY(6) - Justification value .br;###1, ####2, #####3 .br;LEFT, RIGHT, CENTER .x Options>LEFT .x Options>CENTER .x Options>RIGHT .le;IARRAY(7) - Hardware generation .x Options>HARDGN .x Options>NORMGN .x Options>SOFTGN .x Character generation .br;#####1, #####2, #####3 .br;NORMGN, HARDGN, SOFTGN .le;IARRAY(8) - Character spacing .br;######1, ######2 .br;NOFXSIZ, FIXSIZE .x Proportional spacing .x Options>FIXSIZE .els 0 .qd XARRAY This is used to set defaults if the "SET" option is used. .list 0 .le;XARRAY(1) - Character SIZE (0.0 means DSIZE is default) .le;XARRAY(2) - Character DSIZE (0.0 means size is default) .els 0 .qc UGDSAB .x Disable interactive controls This disables interactive control units on devices. .i5.tt4;CALL UGDSAB(OPTIONS) .x Subroutine>UGDSAB .s;For the options see: UGENAB. .qc UGDSPC .x Initialize drawing space .x Aspect ratio This initializes drawing space and defines the aspect ratio of picture. This may not be called after the first graphic segment is transmitted to a device. This routine may be called after the picture has been cleared, before a graphic segment is transmitted. .i5.tt4;CALL UGDSPC(OPTIONS,XSIZE,YSIZE,AFF) .x Subroutine>UGDSPC .list 0 .le;OPTIONS: .list 0 .le;GET - Drawing space parameters are retrieved and put into the params. .x Options>GET .le;PUT - Drawing space parameters are set. .x Options>PUT .els 0 .le;XSIZE - Size of picture in the X direction in arbitrary units. .le;YSIZE - Size of picture in Y direction .le;AFF - (0.0 to 1.0) .i5;1.0 means X,Y SIZE must be honored exactly .i5;0.0 means X,Y SIZE may adjust them freely .i5;In between values adjust the amount of freedom UGSYS has to adjust the size. .els 1 After UGDSPC is called, The physical drawing space and window go from (0,0) to (XSIZE,YSIZE) If UGDSPC is not called, then the default is X/YSIZE=1.0. .s;ERRORS: .list 0 .le;- Subroutine called after first graphic segment was written .le;- PUT option - Picture size or affinity are invalid .els 0 .qc UGFONT .x Font selection .i5;CALL UGFONT(Options) .x Subroutine>UGFONT .s.list 0;Options: .le;SINPLEX - Selects the simplex font (fast) .le;DUPLEX - Selects the duplex font (slow, but elegant) .els 0 .qc UGENAB .x Enable interactive controls This enables interactive control units on devices. .i5.tt4;CALL UGENAB(OPTIONS) .x Subroutine>UGENAB .s;OPTIONS: .list 0 .le;KEYBOARD - enable the keyboard on the device .x Options>KEYBOARD .le;PICK - enable the pick control .x Options>PICK This returns the identification of the segment picked. An example is a light pen. .le;BUTTON - enable the button control unit .x Options>BUTTON .le;STROKE - enable the stroke control unit .x Options>STROKE This returns a sequence of positions. Examples of such devices are RAND tablets, joysticks, and track balls. .le;LOCATOR - enable the locator control unit. .x Options>LOCATOR This returns an X,Y coordinate. EXamples are touch panels, mice, joysticks, track balls, cursor controls. .le;VALUATOR - enable the valuator control unit. .x Options>VALUATOR This returns a value from 0.0 to 1.0. An example is a control dial. .els 0 .qc UGECTL .x Input parameter selection This sets up parameters related to input on a graphic device. .i5.tt4;CALL UGECTL(OPTIONS,STRING,IARRAY,XARRAY,YARRAY) .x Subroutine>UGECTL .s OPTIONS: .list 0 .le;KEYBOARD - Sets initial values .x Options>KEYBOARD .i5;INPUT: .i5;STRING = Initial buffer contents .i5;XARRAY(1),YARRAY(1)=location of string .i5;IARRAY(1)=Maximum number of keyboard input characters ?? (Default:128) .le;LOCASE - Normally keyboard input is transformed to uppercase. This .x Options>LOCASE allows lowercase input. .le;BUTTON= - Specifies lights to set on. value is a binary .x Options>BUTTON string (0 or 1) with 1 setting the light on. .le;STROKE .x Options>STROKE .i5;IARRAY(1)=Maximum number of strokes to report .le;LOCATOR - This causes the locator control unit to be read. .x Options>LOCATOR .i5;OUTPUT: .i5;XARRAY(1),YARRAY(1)=Coordinates of locator .if Bonner .i5;IARRAY(1)=Button number or key pushed .endif Bonner .le;VALUATOR= .i5;OUTPUT: .i5;XARRAY(1)=The value (0.0 to 1.0) .els 0 .qc UGEVNT .x Getting interactive input This retrieves data from an input device. An event is when the user finishes an input operation. This can be pushing a button, hitting "Return" at the keyboard, and so on. .i5.tt4;CALL UGEVNT(OPTIONS,TIME,STRING,IARRAY,XARRAY,YARRAY) .x Subroutine>UGEVNT .list 0 .br;INPUT: .le;OPTIONS - This parameter is not used. .le;TIME - The length of time to wait for an event (Floating point) .i5;TIME > 0 the routine waits for this time or until an event occurs. .i5;TIME = 0 the routine checks for input and if none returns immediately .i5;TIME < 0 the routine waits for the next event (maybe forever) .br;OUTPUT: .le;STRING - Contains typed in characters. .le;IARRAY - Contains integer information .i5;IARRAY(1) = The event type .le;XARRAY - Contains X coordinates .le;YARRAY - Contains Y coordinates .els 0 .qd Keyboard .list 0 .le;IARRAY(1)=1 .le;IARRAY(2)=Number of characters typed .le;STRING=The characters typed .els 0 The maximum string length may be set with the KEYBOARD option in UGECTL .qd Pick .list 0 .le;IARRAY(1)=2 .le;IARRAY(2)=IDENT of the selected graphic segment .els 0 .qd Button .list 0 .le;IARRAY(1)=3 .le;IARRAY(2)=Index of the button pushed .els 0 .qd Stroke .list 0 .le;IARRAY(1)=4 .le;IARRAY(2)=Number of stroke end points .le;XARRAY=X coordinates of the end points .le;YARRAY=Y coordinates of the end points .els 0 The STROKE option in UGECTL controls the maximum number of stroke end points returned. .qc UGINFO .x Status information This inquires about the status of the UGSYS and determines the properties of a graphics device. .i5.tt4;CALL UGINFO(OPTIONS,STRING,IARRAY,XARRAY) .x Subroutine>UGINFO .list 0 .br;INPUT: .le;OPTIONS: .list 0 .le;OPENDEV - IARRAY(1) = number of open devices .br; - IARRAY(2)... = Identifications of the open devices .le;ACTDEV - IARRAY(1) = IDENT of the active device .le;SEGDFL - IARRAY,XARRAY are set to the segment defaults. For their definitions see UGDEFL .c;^*Status of currently active device\* .le;DEVTYPE - The STRING is set to the current open device type. A 7 character name + a blank are returned. .le;ILEVEL - IARRAY(1) is set to the current interactive level .i10;##############1, ####2, ##########3 .i10;non-interactive, Slave, Interactive .le;DMEDIUM - IARRAY(2) is set the the drawing medium .i10;###########1, ##########2, ######3 .i10;non-erasable, raster-scan, refresh .le;CONTROLS - IARRAY(1) - (8) are set to the interactive controls available on the active device. Zero means not available .br;IARRAY:#######1, ###2, ######3, #####4, ######5, ########6 .br;#######Keyboard, pick, buttons, stroke, locator, valuators .le;ECONTROLS - IARRAY(1) - (8) indicate which controls are enabled. Zero means not enabled. .le;EXTENSIONS - IARRAY(1) - (4) indicate any indefinite extensions Zero indicates no extension. .br;IARRAY:####1, ####2, #####3, #####4 .br;#######Low X, Low Y, High X, High Y .s For example a drum plotter returns IARRAY(3)=1 with all the rest zero. A terminal would return all zeroes. .le;DSPCSIZE - XARRAY(1,2) are the number of centimeters per unit in current window. .le;WDOWSIZE - XARRAY(1,2) are the window size in centimeters. .els 0 .br;OUTPUT: .le;STRING - A string to hold output values. .le;IARRAY - An integer array to hold output values. .le;XARRAY - A floating point array to hold output X,Y values. .els 0 .qc UGINIT .x Initializing a segment This clears and initializes a graphic segment. .i5.tt4;CALL UGINIT(OPTIONS,SEGMENT,NSEGM) .x Subroutine>UGINIT .list 0 .le;OPTIONS - A character string containing one of the following: .list 0 .le;CLEAR - graphic segment is cleared (DEFAULT) .x Options>CLEAR .le;RESET - graphic segment is made ready for data. .x Options>RESET Normally this is used after the segment has been read from a file. .le;CONTINUE - clear the segment, but retain the last data line. .x Options>CONTINUE .els 0 .le;SEGMENT - The segment to be initialized .le;NSEGM - The length of the segment (minimum=10) .i5;INTEGER*4 SEGMENT(NSEGM) .els 0 .s;ERRORS: .list 0 .le;- Segment length too small .els 0 .qc UGLINE .x Line drawing This adds the end point of a line segment to the graphic segment. .i5.tt4;CALL UGLINE(OPTIONS,X,Y,IBLANK,SEGMENT) .x Subroutine>UGLINE .list 0 .le;OPTIONS - How to draw the line .list 0 .le;structure: SOLID, DASHED, DOTTED, DOTDASH, DAASHED .x Structure .le;intensity: VDIM, DIM, MEDIUM, BRIGHT, VBRIGHT .x Intensity .le;color: WHITE, RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN .x Color .le;attributes: BLINK, STEADY .x Attributes .le;PICKID= - pick identification of line. .x Options>PICKID .els 0 .le;X - The floating point value for the X coordinate of the line .le;Y - The Y coordinate .le;IBLANK = 0 Blanked line .br; = 1 Drawn line .le;SEGMENT - The graphic segment to use .els 0 .qc UGMARK .x Symbol plotting This adds a single marker symbol to a segment. .i5.tt4;CALL UGMARK(OPTIONS,X,Y,SEGMENT) .x Subroutine>UGMARK .list 0 .le;OPTIONS - character string containing and of following: .list 0 .le;MARK=n (n=0-9) selects a plotting symbol DEFAULT=point .x Options>MARK .le;SIZE=ff - Size of symbol relative to window .x Options>DSIZE .le;DSIZE=ff - Size of symbol relative to default drawing space .x Options>DSIZE (Default: DSIZE=.015) .le;intensity: VDIM, DIM, MEDIUM, BRIGHT, VBRIGHT .x Intensity .le;color: WHITE, RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN .x Color .le;attributes: BLINK, STEADY .x Attributes .le;PICKID= - pick identification of marker. .x Options>PICKID .els 0 .le;X - X coordinate of center of marker .le;Y - Y coordinate .le;SEGMENT - Graphic segment to add marker to .els 0 .qd MARK .list 0 .le;Vertical cross (+) .le;Diagonal cross (X) .le;Diamond .le;Square .le;Fancy diamond .le;Fancy Square .le;Fancy vertical cross .le;Fancy diagonal cross .le;Octagon .els 0 .qc UGMCTL .x Control, miscellaneous This performs a variety of miscellaneous control operations. .i5.tt4;CALL UGMCTL(OPTIONS,STRING,IARRAY,XARRAY) .x Subroutine>UGMCTL .s;OPTIONS: .list 0 .le;ERRUNIT= - The Fortran unit number for error messages .le;ERRMAX= - The maximum number of errors before the error message is suppressed. (Default:8) .le;BEEP - Sound the alarm on the currently active device. (slave, and interactive devices only) .els 0 The other parameters are not used at present. .qc UGOPEN .x Open graphics device This opens a graphic device and makes it ready for use. This routine must be called before a device is used. Normally your program only opens a device once. .i5.tt4;CALL UGOPEN(OPTIONS,IDENT) .x Subroutine>UGOPEN .list 0 .le;OPTIONS - device type, and device dependent information. For more information see:DEVICES. .le;IDENT - Identification number to be used whenever you wish to select this device. Each device must have a unique non zero IDENT. .els 0 .s;ERRORS: .list 0 .le;- Invalid graphic device .le;- Invalid IDENT - it must not be zero .le;- Duplicate IDENT - A device is already open for this IDENT .le;- Too may graphic devices open (maximum=8) .le;- Graphic device is not available - You must relink .le;- Graphic device can not be opened. (check output file spec) .le;- More than 1 fully interactive device opened. .els .qc UGOPTN This scans an option string and the results are put into the output structure. .i5.tt4;CALL UGOPTN(OPTIONS,INDATA,EXDATA) .x Subroutine>UGOPTN .p For further information see the UGSYS Programming manual. .if 1985 .qc UGPFIL .x Polygon fill This fills in a simple closed polygon. Edges may not cross each other. If a closing vertex is not specified the initial vertex is assumed the same as the last. .i5.tt4;CALL UGPFIL(OPTIONS,XARRAY,YARRAY,NCCORD,SEGMENT) .x Subroutine>UGPFIL .s.list 0 .le;OPTIONS .list 0 .le;intensity: VDIM, DIM, MEDIUM, BRIGHT, VBRIGHT .x Intensity .le;color: WHITE, RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN .x Color .le;attributes: BLINK, STEADY .x Attributes .le;PICKID= - pick identification of polygon fill. .x Options>PICKID .els 0 .le;XARRAY - An array of X coordinates defining the end points of the line. .le;YARRAY - An array of Y coordinates .le;NCOORD - Size of XARRAY,YARRAY .le;SEGMENT - The segment to add markers to .els 0 .endif 1985 .qc UGPICT .x Segement manipulation This manipulates individual segments in a picture. .i5.tt4;CALL UGPICT(OPTIONS,IDENT) .x Subroutine>UGPICT .list 0 .le;ONIONS: .list 0 .le;CLEAR - Delete the specified segment. If IDENT=0 entire picture is cleared .x Options>CLEAR .le;WINDOW - If used with CLEAR the current window is cleared. .x Options>WINDOW .le;PICK,NOPICK - Change the PICK accessibility of a segment .x Options>PICK .le;OMIT,INCLUDE - Change the omit,include status of a segment .x Options>OMIT .x Options>INCLUDE .le;ON,OFF - Turn display on or off. .x Options>ON/OFF .le;ALIAS= You may setup an 8 character alias for a picture name, for .x Options>ALIAS displays that have named pictures. .els 0 .le;IDENT - The identification of the specific segment being manipulated. .els 0 .qc UGPLIN .x Line drawing This draws a number of line segments. .i5.tt4;CALL UGPLIN(OPTIONS,XARRAY,YARRAY,NCOORD,IBITS,NBITS,SEGMENT) .x Subroutine>UGPLIN .list 0 .le;OPTIONS - Same as UGLINE .le;XARRAY - An array of X coordinates defining the end points of the line. .le;YARRAY - An array of Y coordinates .le;NCOORD - Size of XARRAY,YARRAY .le;IBITS = 0 Blanked line .br; = 1 Drawn line .br; = array of bits to control plotting .br;Each bit controls blanking for a line segment. .le;NBITS = Number of blanking bits .br; > 0 - Bits are packed 1/word first bit=_#0 .br; < 0 - Bits are packed 32/word first bit =_#31 .br; Bits are selected cyclically brom BBITS. .br; UGSYS always blanks to the first point. .br;IBITS=1,NBITS=1 - Draws the entire curve. .le;SEGMENT - The segment to add markers to .els 0 .qd example This show you how to draw a cross centered on 0.5,0.5 with dotted lines. .s.lm+5.nf REAL X(4),Y(4) c c X,Y segments 1,3 are drawn c 2 is blanked c INTEGER IBITS DATA X/0.,1.,0.,1./ DATA Y/0.,1.,1.,0./ IBITS=IBSET(0,31)+IBSET(0,29) CALL UGPLIN('DOTTED',X,Y,4,IBITS,-3,SEGMENT) .x Subroutine>UGPLIN .s.i-5;or.... INTEGER IBITS(3) DATA IBITS/1,0,1/ CALL UGPLIN('DOTTED',X,Y,4,IBITS,3,SEGMENT) .x Subroutine>UGPLIN .s.i-5;or.... .i5;This illustrates cyclic use of bits .s IBITS=IBSET(0,31) CALL UGPLIN('DOTTED',X,Y,4,IBITS,-2,SEGMENT) .x Subroutine>UGPLIN .s.i5;or... INTEGER IBITS(2) DATA IBITS/1,0/ CALL UGPLIN('DOTTED',X,Y,4,IBITS,2,SEGMENT) .x Subroutine>UGPLIN .lm.f .qc UGPMRK .x Symbol plotting This adds a number of markers to the segment. .i5.tt4;CALL UGPMRK(OPTIONS,XARRAY,YARRAY,NCOORD,SEGMENT) .x Subroutine>UGPMRK .p .list 0 .le;OPTIONS - Same as UGMARK .le;XARRAY - An array of X coordinates for the marker of size NCOORD .le;YARRAY - An array of Y coordinates .le;NCOORD - Size of XARRAY,YARRAY .le;SEGMENT - The segment to add markers to .els 0 .qc UGPROJ .x Project 3-d to 2-d This uses the output of UGTRAN to project 3 dimensional data onto a 2 dimensional screen. .i5;UGPROJ(TRANS,PT3D,PT2D) .list 0 INPUT: .le;TRANS - The output of UGTRAN .le;PT3D(3) - X,Y,Z of a data point .br;OUTPUT: .le;PT2D(2) - X,Y of the projection .els .qc UGRERR This calls the UGSYS error processor .i5.tt4;CALL UGRERR(LEVEL,SNAME,INDEX) .x Subroutine>UGRERR .list 0 .le;LEVEL - Severity of error .i5;1 = minor - Save error information .i5;2 = normal - print message, and count error .i5;3 = Severe - print message and terminate program .i5;4 = Terminal - print message and terminate with memory dump/traceback .le;SNAME - 8 character with the subroutine name .le;INDEX - Error code (1-19) .els 0 .qc UGSHLD .x Shielded areas This defines up to 4 shielded areas. Any markers, lines or text that strays into a shielded area is eliminated. Hardware generated characters however are not properly shielded. .i5.tt4;CALL UGSHLD(OPTIONS,XYARRAY) .x Subroutine>UGSHLD .list 0 .le;OPTIONS: .list 0 .le;PUT - Set the parameters defining the shielded area. .le;GET - Retrieve the parameters of a shield .le;DELETE - Delete a shield .le;SHIELD= - Select the shield number to manipulate (1-4) (Default:1) .els 0 .le;XYARRAY(2,2) = array defining the rectangular shielded area. .br;XYARRAY:##1,1, ##2,1, ###1,2, ###2,2 .br;########Low X, Low Y, High X, High Y .els 0 .s;ERRORS: .list 0 .le;Shield parameter is incorrect the low value > high value .le;The index of the shield is incorrect. .els 0 .qc UGSLCT .x Select graphics device This selects a graphics device for output. .i5.tt4;CALL UGSLCT(OPTIONS,IDENT) .x Subroutine>UGSLCT .list 0 .le;OPTIONS - Not used .le;IDENT - The identification of the device to be used. see:UGOPEN. .els 0 .s;ERRORS: .list 0 .le;- IDENT is invalid, no such graphic device is open .els 0 .qc UGTEXT .x Text plotting Adds text to the graphic segment. .i5.tt4;CALL UGTEXT(OPTIONS,X,Y,TEXT,SEGMENT) .x Subroutine>UGTEXT .list 0 .le;OPTIONS - any of the following: .list 0 .le;SIZE=ff - Size of each character relative to window .x Options>DSIZE .le;DSIZE=ff - Size of each character relative to default drawing space .x Options>DSIZE (Default: DSIZE=.015) .le;ANGLE=ff - Angle of text in degrees with respect to .x Options>ANGLE horizontal in counterclockwise direction. ANGLE=90.0 makes the text go from top to bottom. (Default: ANGLE=0.0) .le;Method of generation: .list 0 .x Character generation .le;HARDGN - Hardware generator must be used whether sizes match properly. .x Options>HARDGN .le;NORMGN - Hardware generator will be used if sizes match properly. .x Options>NORMGN (DEFAULT) .le;SOFTGN - Use only software generator .x Options>SOFTGN .els 0 .le;string position: .list 0 .le;LEFT - X,Y refers to left part of string (DEFAULT) .x Options>LEFT .le;CENTER - X,Y is at center of string. .x Options>CENTER .le;RIGHT - X,Y is at right side of string. .x Options>RIGHT .els 0 .le;character spacing: .list 0 .le;FIXSIZE - Same spacing for all characters. .x Proportional spacing .x Options>FIXSIZE .le;NOFXSIZ - Proportionally space the characters. .els 0 .le;intensity: VDIM, DIM, MEDIUM, BRIGHT, VBRIGHT .x Intensity .le;color: WHITE, RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN .x Color .le;attributes: BLINK, STEADY .x Attributes .le;PICKID= - pick identification of text. .x Options>PICKID .els 0 .le;X - The X position of the text. This is modified by string position option. .le;Y - The Y position of the text (center of char) .le;TEXT - character string containing the text. The length must be in the range 1 to 1024. .le;SEGMENT - Segment to add the text to. .els 0 .s;ERRORS: .list 0 .le;- Invalid string length .els 0 .qc UGTRAN .x Transformation matrix calculation This routine calculates a 3 dimensional transformation matrix. This matrix maybe used to take a 3 dimensional data point and transforms it to a 2 dimensional point using a perspective transformations. (as you would look at it or as a camera would "see" it) The actual transformation is done by routine UGPROJ .i5.tt4;CALL UGTRAN(OPTIONS,REFP,VDIR,HDIF,UDIR,SCRD,SCRZ,TRANS) .x Subroutine>UGTRAN .list 0 .br;INPUT: .le;OPTIONS: .list 0 .le;PARALLEL - Transform using a parallel projections .le;EYED= - Eye separation for making stereo pairs .le;XLO= - X coordinate at left hand of screen (Default:0.0) .le;XHI= - X coordinate at right hand of screen (Default:1.0) .le;YLO= - Y coordinate at bottom of screen (Default:0.0) .le;YHI= - Y coordinate at top of screen (Default:1.0) .le;TOLER= - Tolerance used to detect singularities (Default:0.0001) .els 0 .le;REFF(3) - Reference point to view data from .le;VDIR(3) - Vector from the reference point to the screen. .le;HDIR(3) - Vector in screen defining the horizontal direction (X) .le;UDIR(3) - Vector defining the Y (up) direction in screen If zero (0,0,0) then it is defined as perpendicular to VDIR and HDIR. .le;SCRD - Distance from REFF to screen .le;SCRZ - Size of screen (square) .br;OUTPUT: TRANS(31) - Contains the 3 by 4 projection matrix as well as normalized copies of the input parameters. .els 0 .qc UGWDOW .x Window mapping This maps a window onto the physical drawing space. See UGDSPC. The actual mapping occurs when the segment is written. .i5.tt4;CALL UGWDOW(OPTIONS,VIEW,WIDOW) .x Subroutine>UGWDOW .list 0 .le;OPTIONS: .list 0 .le;GET - Window parameters are retrieved and put into VIEW,WINDOW .le;PUT - Window parameters are set from VIEW,WINDOW .els 0 .le;VIEW(2,2) - Contains the physical dimensions of the window in the physical drawing space as defined by UGDSPC. It UGDSPC has not been called the default drawing space is 0.0 to 1.0. .br;VIEW:##1,1, ##2,1, ###1,2, ###2,2 .br;#####Low X, Low Y, High X, High Y .le;WINDOW(2,2) - An array which defines a rectangle in the world coordinates (Your drawing units). .br;WINDOW:##1,1, ##2,1, ###1,2, ###2,2 .br;########Low X, Low Y, High X, High Y .els 0 .s;ERRORS: .list 0 .le;- View port params are incorrect. Low values must be less than High. .le;- Incorrect view port drawing overlay. The view port must lie within the drawing space. .le;- The window parameter is incorrect. .els 0 .qc UGWRIT .x Transmit graphic segment This transmits a graphic segment to a display device. At this time the windows are applied to the graph. .i5.tt4;CALL UGWRIT(OPTIONS,IDENT,SEGMENT) .x Subroutine>UGWRIT .list 0 .le;OPTIONS: .list 0 .le;PICK - make the segment available to a pick device. (refresh display) (Default:NOPICK) .le;OMIT - leave segment in OMIT state (Default:INCLUDE) .le;ERASE - This segment erases a previously transmitted segment. This can only be done with raster displays. You must either keep the previous segment, or regenerate it with identical windows. .els 0 .le;IDENT - Identification number for the device .le;SEGMENT - Segment to transmit .els 0 .s;ERRORS: .list 0 .le;- Display file is not large enough for entire segment .le;- Graphic segment contains invalid data .els 0 .qc UGXERR This is a user written error subroutine. Whenever an error is detected this routine is called. You may make up your own routine to intercept errors and change the way in which they are handled. For example you can make error corrections to turn fatal errors to non fatal. A skeleton routine would be: .lm+5.nf SUBROUTINE UGXERR(LEVEL,SNAME,INDEX) INTEGER LEVEL,INDEX CHARACTER*8 SNAME END .lm.f.s PARAMETERS: .list 0 .le;LEVEL - Seriousness of the error .le;SNAME - Character variable containing the name of the calling routine. .le;INDEX - The error code. (1-19) .els 0 Before the user error processing routine exits it may signal that no further error processing is needed by setting LEVEL to zero. .qc UGXHCH .x Cross hatching This is used to plot a cross hatched region. It uses a user supplied routine to actually do the plotting. For more information on them see UXLNAX .i5.tt4;CALL UGXHCH(OPTIONS,LINSUB,XARRAY,YARRAY,NPTS,WKARRAY,NSIZE) .x Subroutine>UGXHCH .list 0 .le;OPTIONS: .list 0 .le;SPACING= - The spacing between cross hatched lines (Default:0.02) .le;ANGLE= - The cross hatch angle in degrees (Default:45.0) .x Options>ANGLE .le;X= - The X coordinate through which a line will pass (Default:XARRAY(1)) .le;Y= - The Y coordinate through which a line will pass (Default:YARRAY(1)) .le;TOLER= The internal tolerance (Default:0.0001) .els 0 .le;LINSUB - Entry point of the routine to draw the lines .le;XARRAY(NPTS) - Floating point array containing the X coordinates of the end points of the line segments that bound the region. .le;YARRAY(NPTS) - The Y coordinates .le;NPTS - The number of end points .le;WKAREA(NSIZE) - A work area array .le;NSIZE - Size of the work area. It must be at least as large as the number of intersections between the boundary and the cross hatch lines. .els 0 .qc UGCNTR .x Contour plots This is used to plot contour lines. It uses two user supplied routines to actually do the plotting. For more information on them see UXLNAX .i5.tt4;CALL UGCNTR(OPTIONS,LINSUB,TXTSUB,XYARRAY,NPTSX,NPTSY .x Subroutine>UGCNTR .i5;CNTRLO,CNTRRHI,NCNTR,WDAREA,NSIZE) .list 0 .le;OPTIONS: .list 0 .le;NSCL= - The number of secondary contour lines between primary lines (Default:0). .le;TOLER= The internal tolerance (Default:0.0001) .els 0 .le;LINSUB - Entry point of the routine to draw the lines .le;XYARRAY(NPTSX,MPTSY) - Floating point array containing the Z values corresponding to X,Y. The format of the array is as follows. .i5;XYARRAY(2,1)-(NPTSX,1) contain the X values monotonically increasing .i5;XYARRAY(1,2)-(1,MPTSY) contain the Y values monotonically increasing .i5;XYARRAY(2,2)-(NPTSX,MPTSY) contain the corresponding Z values .s.nf.lm+7 -- X1 X2 X3 .... XN Y1 Z11 Z21 Z31.... ZN1 Y2 Z12 Z22 Z32.... Z1N ............ YM Z1M Z2M Z3M.... ZMN .f.lm.s .le;NPTSX - Number of X points .le;MPTSY - Number of Y points .le;CNTRLO - Lowest value of the contour to plot .le;CNTRHI - Highest value of the contour to plot .le;NCNTR - Number of primary contours .le;WKAREA(NSIZE) - A work area array .le;NSIZE - Size of the work area. It should be as large as NPTSX*MPTSY/15. .els 0 .qc UGMESH This generates a parallel or perspective view of a 3 dimensional mesh surface with hidden lines eliminated. The hidden line removal is an approximation an may fail for large mesh sizes. It uses a user written routine to actually do the plotting. for more information see UXLNAX .i5.tt4;CALL UGMESH(OPTIONS,LINSUB,XYARRAY,NSIZX,MSIZY, .x Subroutine>UGMESH .i5;TRANS,WKAREA,NSIZE) .list 0 .le;OPTIONS: .list 0 .le;LOWER - Indicates the under side of the surface is generated .le;NOCCMN - This options suppresses duplicate lines for efficiency such as when both upper and lower surfaces are generated. .le;TOLER= The internal tolerance (Default:0.0001) .els 0 .le;LINSUB - Entry point of the routine to draw the lines .le;XYARRAY(NPTSX,MPTSY) - Floating point array containing the Z values corresponding to X,Y. The format of the array is as follows. .i5;XYARRAY(2,1)-(NPTSX,1) contain the X values monotonically increasing .i5;XYARRAY(1,2)-(1,MPTSY) contain the Y values monotonically increasing .i5;XYARRAY(2,2)-(NPTSX,MPTSY) contain the corresponding Z values .s.nf.lm+7 -- X1 X2 X3 .... XN Y1 Z11 Z21 Z31.... ZN1 Y2 Z12 Z22 Z32.... Z1N ............ YM Z1M Z2M Z3M.... ZMN .f.lm.s .le;NPTSX - Number of X points .le;MPTSY - Number of Y points .le;TRANS(31) - Array containing the 3 dimensional transformation. This is the output of routine UGTRAN. Normally the eye point is to the side, and HDIR, and UDIR are zero vectors. .le;WKAREA(NSIZE) - A work area array .le;NSIZE - Size of the work area. It should be as large as NPTSX*MPTSY*15. .els 0 .qc UG2DHG This generates a parallel or perspective view of a 3 dimensional histogram "block plot" with hidden lines eliminated. The hidden line removal is an approximation an may fail for large mesh sizes. It uses a user written routine to actually do the plotting. for more information see UXLNAX .i5.tt4;CALL UG2DHG(OPTIONS,LINSUB,XYARRAY,NSIZX,MSIZY, .x Subroutine>UG2DHG .i5;TRANS,WKAREA,NSIZE) .list 0 .le;OPTIONS: .list 0 .le;TOLER= The internal tolerance (Default:0.0001) .els 0 .le;LINSUB - Entry point of the routine to draw the lines .le;XYARRAY(NPTSX,MPTSY) - Floating point array containing the Z values corresponding to X,Y. The format of the array is as follows. .i5;XYARRAY(2,1)-(NPTSX,1) contain the X values monotonically increasing .i5;XYARRAY(1,2)-(1,MPTSY) contain the Y values monotonically increasing .i5;XYARRAY(2,2)-(NPTSX,MPTSY) contain the corresponding Z values .s.nf.lm+7 -- X1 X2 X3 .... XN Y1 Z11 Z21 Z31.... ZN1 Y2 Z12 Z22 Z32.... Z1N ............ YM Z1M Z2M Z3M.... ZMN .f.lm.s .le;NPTSX - Number of X points .le;MPTSY - Number of Y points .le;TRANS(31) - Array containing the 3 dimensional transformation. This is the output of routine UGTRAN. Normally the eye point is to the side, and HDIR, and UDIR are zero vectors. .le;WKAREA(NSIZE) - A work area array .le;NSIZE - Size of the work area. It should be as large as NPTSX*MPTSY*15. .els 0 .qc UGXTXT This subroutine adds extended text to a graphic segment. Two strings are used to specify extended text. The first is the approximate text, the second consists of modifiers. The modifiers determine the format of the output. .i5.tt4;CALL UGXTXT(OPTIONS,X,Y,PTEXT,STEXT,SEGMENT) .x Subroutine>UGXTXT .list 0 .le;OPTIONS - See UGTEXT .le;X - The X position of the string .le;Y - The Y position of the string .le;PTEXT - The primary text string. .le;STEXT - The secondary text string to modify the primary one. .le;SEGMENT - The segment to put the text into. .els 0 .s;ERRORS: .list 0 .le;- Invalid string length The string length must be in the range 1 to 1024. .els 0 .qc UGLGAX This generates a logarithmic axis with labels and tick marks. You must supply 2 routines TXTSUB, and LINSUB for doing the actual drawing. .i5.tt4;CALL UGLGAX(OPTIONS,LINSUB,TXTSUB,IFLAG, .x Subroutine>UGLGAX .i5;XLO,YLO,XHI,YHI,FLOLAB,FHILAB,NLAB) .list 0 .le;OPTIONS: .list 0 .le;LSTM= - Length of the labeled tick marks on left side of axis. (Default:0.01*length of axis) .le;RSTM= - Length of labeled tick marks to right of axis (Default:0.01*length of axis) .le;NSTM= - Number of secondary tick marks between labeled ticks. These are 3/4 the length of the labeled ticks. (Default:0) .els 0 .le;LINSUB - Entry point of the line segment and point routines .le;TXTSUB - Entry point of the text routine .le;IFLAG - Flag supplied to TXTSUB routine .le;XLO - X coordinate of low end of axis .le;YLO - Y coordinate of low end of axis .le;XHI - X coordinate of high end of axis .le;YHI - Y coordinate of high end of axis .le;FLOLAB - Value for low end of axis (floating point) .le;FHILAB - Value at high end of axis .els 0 You must supply the LINSUB and TXTSUB routines. For more information see UGLNAX. .qc UGLGDX This is an aid in using UGLGAX. This routine calculates a "good" set of numbers to use when labeling the axes. You supply the extent of the data and UGLGAX provides the input parameters for UGLGAX. The ticks will all be placed at rounded numbers. .i5.tt4;CALL UGLGDX(FLODATA,FHIDATA,MINLAB,MAXLAB, .x Subroutine>UGLGDX .i5;FLOLAB,FHILAB,NLAB) .list 0 INPUT: .le;FLODATA - Lowest data to plot .le;FHIDATA - Highest data to plot .le;MINLAB - Minimum number of labeled ticks to produce .le;MAXLAB - Maximum number of labeled ticks to produce .br;OUTPUT: .le;FLOLAB - Lowest labeled tic .le;FHILAB - Highest labeled tic .le;NLAB - Number of labeled ticks .els 0 .qc UGLNAX This generates linear axis with labels and tick marks. You must supply 2 routines TXTSUB, and LINSUB for doing the actual drawing. .i5.tt4;CALL UGLNAX(OPTIONS,LINSUB,TXTSUB,IFLAG, .x Subroutine>UGLNAX .i5;XLO,YLO,XHI,YHI,FLOLAB,FHILAB,NLAB) .list 0 .le;OPTIONS: .list 0 .le;LSTM= - Length of the labeled tick marks on left side of axis. (Default:0.01*length of axis) .le;RSTM= - Length of labeled tick marks to right of axis (Default:0.01*length of axis) .le;NSTM= - Number of secondary tick marks between labeled ticks. These are 3/4 the length of the labeled ticks. (Default:0) .els 0 .le;LINSUB - Entry point of the line segment and point routines .le;TXTSUB - Entry point of the text routine .le;IFLAG - Flag supplied to TXTSUB routine .le;XLO - X coordinate of low end of axis .le;YLO - Y coordinate of low end of axis .le;XHI - X coordinate of high end of axis .le;YHI - Y coordinate of high end of axis .le;FLOLAB - Value for low end of axis (floating point) .le;FHILAB - Value at high end of axis .els 0 You must supply the LINSUB and TXTSUB routines. .qd LINSUB .nf.lm+7 SUBROUTINE LINSUB(X,Y,IBIT) .lm c c Plot all tick marks c .lm+7 REAL X,Y INTEGER IBIT PARAMETER (NSEG=1000) COMMON /PLOT/SEGM INTEGER*4 SEGM(NSEG) ! Define segment IF(IBIT .le. 1) THEN ! Major tick ? CALL UGLINE(' ',X,Y,IBIT,SEGM) ! Major ticks-Hi intensity .x Subroutine>UGLINE ELSE CALL UGLINE('VDIM',X,Y,IBIT,SEGM) ! Minor ticks-low intensity .x Subroutine>UGLINE ENDIF END .f.lm .list 0 .le;X - .le;IBIT - Blanking bit (0,1) .br;or (2,3) for secondary tick marks. .els 0 .qd TXTSUB .nf.lm+7 SUBROUTINE TXTSUB(X,Y,VALUE,IFLAG) .lm c c Write the numeric values c IFLAG=1 for X, 2 for Y c .lm+7 PARAMETER (NSEG=1000) COMMON /PLOT/SEGM CHARACTER*10 STRG ! String with number INTEGER IFLAG,LENG INTEGER*4 SEGM(NSEG) ! Define segment REAL X,Y,VALUE INTEGER IFLAG IF(IFLAG .eq. 1) THEN ! X axis CALL UGCNVF(VALUE,3,STRG,LENG) ! Convert and .x Subroutine>UGCNVF CALL UGTEXT('CENTER,SIZE=0.15',XCRD,YCRD-0.2) ! Plot X value .x Subroutine>UGTEXT ELSE CALL UGCNVF(VALUE,3,STRG,LENG) ! Convert and .x Subroutine>UGCNVF CALL UGTEXT('RIGHT,SIZE=0.15',XCRD-0.2,YCRD) ! Plot Y value .x Subroutine>UGTEXT ENDIF END .lm.f TXTSUB must convert the number VALUE to a character string and plot it at the correct offset from X,Y. .qc UGLNDX This is an aid in using UGLNAX. This routine calculates a "good" set of numbers to use when labeling the axes. You supply the extent of the data and UGLNAX provides the input parameters for UGLNAX. The ticks will all be placed at rounded numbers. .i5.tt4;CALL UGLNDX(FLODATA,FHIDATA,MINLAB,MAXLAB, .x Subroutine>UGLNDX .i5;FLOLAB,FHILAB,NLAB) .list 0 INPUT: .le;FLODATA - Lowest data to plot .le;FHIDATA - Highest data to plot .le;MINLAB - Minimum number of labeled ticks to produce .le;MAXLAB - Maximum number of labeled ticks to produce .br;OUTPUT: .le;FLOLAB - Lowest labeled tic .le;FHILAB - Highest labeled tic .le;NLAB - Number of labeled ticks .els 0 .if 1985 .qc UG3LIN This draws a line segment in 3 dimensional space. .i5.tt4;CALL UG3LIN(OPTIONS,X,Y,Z,IBLANK,SEGMENT) .x Subroutine>UG3LIN .list 0 .le;OPTIONS - Same as UGLINE, but no structure is allowed. .le;X - An X coordinate defining the end point of the line. .le;Y - A Y coordinate .le;Z - A Z coordinate .le;NCOORD - Size of XARRAY,YARRAY,ZARRAY .le;IBLANK = 0 Blanked line .br; = 1 Drawn line .le;SEGMENT - The segment to add markers to .els 0 .qc UG3MRK This adds a marker to the segment in 3 dimensional space. .i5.tt4;CALL UG3MRK(OPTIONS,X,Y,Z,SEGMENT) .x Subroutine>UG3MRK .p .list 0 .le;OPTIONS - Same as UGMARK, but no marker number is allowed. only single points are plotted. .le;X - An X coordinate for the marker of size NCOORD .le;Y - A Y coordinate .le;Z - A Z coordinate .le;SEGMENT - The segment to add markers to .els 0 .qc UG3PLN This draws a number of line segments in 3 dimensional space. .i5.tt4;CALL UG3PLN(OPTIONS,XARRAY,YARRAY,ZARRAY,NCOORD,IBITS,NBITS,SEGMENT) .x Subroutine>UG3PLN .list 0 .le;OPTIONS - Same as UGLINE, but no structure is allowed. .le;XARRAY - An array of X coordinates defining the end points of the line. .le;YARRAY - An array of Y coordinates .le;ZARRAY - An array of Z coordinates .le;NCOORD - Size of XARRAY,YARRAY,ZARRAY .le;IBITS = 0 Blanked line .br; = 1 Drawn line .br; = array of bits to control plotting .le;NBITS = Number of blanking bits .br; > 0 - Bits are packed 1/word first bit=_#0 .br; < 0 - Bits are packed 32/word first bit =_#31 .le;SEGMENT - The segment to add markers to .els 0 .qc UG3PMK This adds a number of markers to the segment in 3 dimensional space. .i5.tt4;CALL UG3PMK(OPTIONS,XARRAY,YARRAY,ZARRAY,NCOORD,SEGMENT) .x Subroutine>UG3PMK .p .list 0 .le;OPTIONS - Same as UGMARK, but no marker number is allowed. only points are plotted. .le;XARRAY - An array of X coordinates for the marker of size NCOORD .le;YARRAY - An array of Y coordinates .le;ZARRAY - An array of Z coordinates .le;NCOORD - Size of XARRAY,YARRAY .le;SEGMENT - The segment to add markers to .els 0 .qc UG3TRN Defines a 3 to 2 dimensional transformation. .i5.tt4;UG3TRN(OPTIONS,OBJVOL,EYEPT,UPDIR,PFLAG) .s .list 0 .le;OPTIONS: .list 0 .le;GET - Options are being retrieved from UGS. .le;PUT - Options are being supplied to UGS. .els 0 .le;OBJVOL(3,2) - Array defining the low, high X of the object volume. This must lie inside the world volume. .br;OBJVOL:##1,1, ##2,1, ##1,3, ###1,2, ###2,2, ###2,3 .br;#######Low X, Low Y, Low Z, High X, High Y, High Z .le;EYEPT(3) - Eye point in space This must lie inside the world volume. .le;UPDIR(3) - Vector pointing in the upward direction .le;PFLAG - Specifies the projection type (0.0 to 1.0) .i5;0 - Parallel projection .i5;Positive - Specifies the near scissoring plane along a line from eye to center of the volume. 1.0 is at the center of the object, while near zero is near to the eye. (Suggested:#0.1) .els 0 .qc UG3TXT Adds text to the graphic segment. Only hardware character generation is used. .i5.tt4;CALL UG3TXT(OPTIONS,X,Y,Z,TEXT,SEGMENT) .x Subroutine>UG3TXT .list 0 .le;OPTIONS - any of the following: .list 0 .le;SIZE=ff - Size of each character relative to window .x Options>DSIZE .le;DSIZE=ff - Size of each character relative to default drawing space .x Options>DSIZE (Default: DSIZE=.015) .le;ANGLE=ff - Angle of text in degrees with respect to .x Options>ANGLE horizontal in counterclockwise direction. ANGLE=90.0 makes the text go from top to bottom. (Default: ANGLE=0.0) .le;Method of generation: .list 0 .le;string position: .list 0 .le;LEFT - X,Y refers to left part of string (DEFAULT) .x Options>LEFT .le;CENTER - X,Y is at center of string. .x Options>CENTER .le;RIGHT - X,Y is at right side of string. .x Options>RIGHT .els 0 .le;character spacing: .list 0 .le;FIXSIZE - Same spacing for all characters. .x Proportional spacing .x Options>FIXSIZE .le;NOFXSIZ - Proportionally space the characters. .els 0 .le;intensity: VDIM, DIM, MEDIUM, BRIGHT, VBRIGHT .x Intensity .le;color: WHITE, RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN .x Color .le;attributes: BLINK, STEADY .x Attributes .els 0 .le;X - The X position of the text. This is modified by string position option. .le;Y - The Y position of the text (center of char) .le;TEXT - character string containing the text. The length must be in the range 1 to 1024. .le;SEGMENT - Segment to add the text to. .els 0 .s;ERRORS: .list 0 .le;- Invalid string length .els 0 .qc UG3WRD Defines 3 dimensional viewport and world volume. This may be called after UGOPEN, or UGPICT and the first call to UGWRIT. .i5;CALL UG3WRD(OPTIONS,VPRT3D,WORLD_VOL) .x Subroutine>UG3WRD .endif 1985 .s.list 0 .le;OPTIONS: .list 0 .le;GET - Options are being retrieved from UGS. .le;PUT - Options are being supplied to UGS. .els 0 .le;VPRT3D(2,2) - Extent of the 2 dimensional view port with respect to the drawing space. .br;VPRT3D:##1,1, ##2,1, ###1,2, ###2,2 .br;#######Low X, Low Y, High X, High Y .le;WORLD_VOL(3,2) - Extent of the world volume. All vectors extending outside the word volume are clipped. .br;WORLD_VOL:##1,1, ##2,1, ##1,3, ###1,2, ###2,2, ###2,3 .br;#######Low X, Low Y, Low Z, High X, High Y, High Z .els .qb Devices .qc list__of__devices .list 0 .le;CALFICH - CALCOMP microfilm recorder .le;SDDXCOW - SLC Console on Wheels .le;SEQGIGI - Display file for DEC GIGI color graphics terminal .le;SDDGIGI - Interactive DEC GIGI or VT-240 .le;SDDGRIN - GRINNELL GMR-27 slave display .le;IMPRT10 - IMAGEN IMPRINT-10 Laser Printer/plotter .le;PRNTRNX - Printronix (Model MVP) printer/plotter .le;SEQ4010 - Display file for Tektronix 4010 terminals .le;SDD4010 - Slave Tektronix 4010 terminal .le;TEK4010 - Interactive Tektronix 4010 terminal .le;SEQ4027 - Display file for Tektronix 4027 color terminals .le;SDD4027 - Slave Tektronix 4027 terminal .le;TEK4027 - Interactive Tektronix 4027 terminal .le;UGSIXEL - Sixel plot device (LA-50, LA-100, LN-03, VT-240) .le;VEP12FF - Versatec printer/plotter with fanfold paper .le;PDEVUGS - Graphic pseudo-device - data is unprocessed segments .le;PDEVLIN - Graphic pseudo-device - data is transformed segments .le;PDEVSVR - Graphic pseudo-device - data is raster graphics .els 0 .QC GIGI This is a raster scan color display with keyboard and locator. The routines for this can also be used for a VT-240 color monitor as it uses the same protocol (REGIS). The VT-240 can only reproduce 3 colors (RED,GREEN,BLUE). It may be operated in non-interactive, slave or interactive modes. It has a resolution of 768 by 480. It supports hardware characters ranging in size from 85 to 5 characters/line. .S .BR;Interactive#- DECGIGI .br;Slave#######- SDDGIGI .br;Sequential##- SEQGIGI .s;Options: .list 0 .s.c;^*Non-interactive\* .le;DDNAME= - Name of output file (up to 64 chars.) for noninteractive use. If the interactive driver is selected, it is automatically made non interactive if a file name is specified. .if IBM (Default:UGDEVICE) .else IBM (Default:UGDEVICE.DAT) .endif IBM .le;PICTID= - First four characters for picture ID (Default:PICT) .br;######= NONE - No ID or ALIAS is output .le;PICTSQ= - Numeric value that is incremented for each picture. The 4 digit number (0-9999) is appended to end of PICTID value to form the picture name. (Default:1) .ifnot IBM .s.c;^*Interactive and Slave\* .le;CHANNEL= - This selects the terminal name for interactive or slave device. (Default:TT) .endif IBM .els 0 .qc Grinnell This is a slave raster graphics device only. Options are: .list 0 .s.c;^*Interactive and Slave\* .le;CHANNEL= - Identification of I/O controller (Default:GRA0) .le;UNITS= - Selects the monitors to use. This is sum of the display units (1,2,4...). (Default:1) .le;BWTYPE= - Selects black and white monitor type. (Default:1) .i10;1 = 1 memory plane no look-up .i10;2 = 2 memory planes no look-up .i10;3 = 2 memory planew with look-up .le;COLTYPE= - Selects the type of color monitor. .i10;1 = 4 memory planes (7 colors 2 levels) .i10;2 = 4 memory planes (7 colors + blink mode) .i10;3 = 3 memory planes (color, intensity, blink) .i10;4 = Same as 2 but with look up table. .le;XMAX= Maximum raster value (Default:511) .le;YMAX= Maximum raster value (Default:511) .le;CSIZ= Character spacing. (Default:7) .le;EXTCHR - Indicates the controller produces extended char. set. .le;REPCHR - Character data replaces existing data .le;XSIZ= - Size of monitor in cm (Default:25.4) .le;YSIZ= - Size of monitor in cm (Default:25.4) .els .QC Metafile The modules PDEVUGS and PDEVUGSX in SYS$UGSYS: may be linked with your program to allow your program to write a device independent metafile. This file may be interpreted by programs PDEVUGSN or PDEVUGSI and sent to an appropriate device. The metafile device is named: .i5;PDEVUGS .qc Tek4010 This is for Tektronics 4010 terminals and suitable emulators. It is either a storage display or a raster scan device. It may be operated in non-interactive, slave or interactive modes. 35 lines of 72 characters are supported by hardware. .if Bonner Some emulators support raster scan features as ERASE. .endif Bonner .BR;Interactive#- TEK4010 .br;Slave#######- SDD4010 .br;Sequential##- SEQ4010 .s Options: .list 0 .le;DDNAME= - Name of output file (up to 64 chars.) If this is a file name the driver is automatically noninteractive. .if IBM (Default:UGDEVICE) .else IBM (Default:UGDEVICE.DAT) .endif IBM .le;PICTID= - First four characters for picture ID (Default:PICT) .br;######= NONE - No ID or ALIAS is output .le;PICTSQ= - Numeric value that is incremented for each picture. The 4 digit number (0-9999) is appended to end of PICTID value to form the picture name. (Default:1) .le;BAUDRATE= - Noninteractive mode only (Default:2400) .ifnot IBM .le;CHANNEL= - This selects the terminal name for interactive or slave device. (Default:TT) .endif IBM .IF BONNER .s.c;^*Interactive and Non\* .le;HIRES,LORES - These select either 4096 or 1024 addressing modes. The 1024 mode is faster, while the 4096 mode gives better resolution for terminals that support it. .le;SOFTST/HARDST - Disables/Enables hardware line structure. HARDST is automatically selected for terminals that support it. .ENDIF BONNER .ELS 0 .qd Terminals .LIST 0 .le;RADM3A - Defines terminal as ADM-3A with Retrographics. Old version of retrographics may only be used a maximum baud rate of 1200 or data will be lost. .if Bonner This is a raster device. ERASE option for UGWRITE is supported. At the completion of each segment normal terminal mode is restored. (Default:SOFTST,LORES) .endif Bonner .le;RVT100 - Defines terminal as VT-100 with Retrographics. For this terminal DSIZE=0.01641 instead of the usual default. This terminal supports 80 characters/line instead of 72. (DSIZE=0.01641) .if Bonner This is a raster device. ERASE and Hardware line structure are supported. At the completion of each segment normal terminal mode is restored. This 4010 emulator uses different codes to erase lines than the ADM-3A. The resolution is 240 by 640. (Default:HARDST,LORES) .LE;RVT100A - The terminal is a VT-100 with high resolution Retrographics. This is identical to RVT100 except for the character positioning. The actual resolutin is about 480 by 640. (Default:HARDST,LORES) .le;VIS102 - The terminal is a Visual-102 This is a raster device. ERASE and Hardware line structure are supported. At the completion of each segment normal terminal mode is restored. This type and RVT100 are the same except for character size. The number of characters per line is 76 or DSIZE=0.0173 (Default:HARDST,LORES) (Default:HARDST,LORES) .le;VT240 - This defines the terminal as a Digital Equipment VT-240 This is a raster device. ERASE and Hardware line structure are supported. Two levels of intensity are supported. The high intensity is selected by either BRIGHT or VBRIGHT. It has 4 harware character sizes (73,80,120,132 chars/line). (DSIZE=0.01798,0.01641,0.01094,0.00995) The terminal is returned to VT-240 mode only when the screen is cleared or the device is closed. The escape sequences used to enter and exit 4010 mode are different for the VT-240 from all other terminals. (Default:HARDST,HIRES) .le;SEL100XL - THis is for the Selanar HiREZ 100XL terminal. This can also be used by the Plessy graphics terminal. This is a raster device. ERASE and Hardware line structure are supported. At the completion of each segment normal terminal mode is restored. The default mode is 4096 addressing. It has 4 harware character sizes (73,80,120,132 chars/line). (DSIZE=0.01798,0.01641,.01094,0.00995 (Default:HARDST,HIRES) .le;TEK4014 - This is for the Tektronix 4014/15 terminal. It has 4096 addressing and hardware line structure. It has 4 harware character sizes (73,80,120,132 chars/line). (DSIZE=0.01798,0.01641,0.01094,0.00995) (Default:HARDST,HIRES) .endif Bonner .els 1 .qc UGSIXEL This is a non-interactive device only. .s;Options: .list 0 .le;DDNAME= - Name of output file (up to 64 chars.) for noninteractive use. (Default:UGDEVICE.DAT) .;le;GENIL - Simulate intensity level changes by different line widths. .le;ROTAXIS - Normally the X axis is along the long side of the page or screen. This option rotates the picture so X is along the short side of the page or screen. .le;MAXNSA= - Size in words of the blocks of memory to accumulate line segments. This should not normally be changed. (Default:1024) .le;LA50 - Produces output for a Digital Equipment LA-50 or LA-100 dot matrix printer. If you have 8.5 inch wide paper in your LA-100 you should use this option. The size is 10.0 by 8.0" (25.4 by 20.32cm) 1152 by 720 pixels. The LA50 plots may be extended in the X direction, or Y if rotated. This is controlled by LENGTH parameter. (Default) .le;LA100 - Produces output for a Digital Equipment LA-100 dot matrix printer. The plot may be extended in the Y direction or X if rotated. The size is 13.0 by 8.0" (33.02 by 20.32cm) 1872 by 720 pixels. .le;LN03 - Produces output for a Digital Equipment LN-03 laser printer. The size is 10 by 8" (25.4 by 20.32cm) 750 by 1200 pixels. This will produce a plot that looks similar to the LA-50 plots. The pixel size ratio is 2 to 1. The resolution is better than MED, but worse than HI. .le;LN03HI - Produces high resolution output for a Digital Equipment LN-03 laser printer. The pixel size ratio is 3 to 1. The size is 10 by 8" 1000 by 2400 pixels. .le;LN03MED - Produces medium resolution output for a Digital Equipment LN-03 laser printer. The pixel size ratio is 1.25 to 1. The size is 10 by 8" 750 by 800 pixels. .le;LN03LO - Produces low resolution output for a Digital Equipment LN-03 laser printer. The pixel size ratio is 1 to 1 which may give a more pleasing result than other resolutions. The size is 10 by 8" 750 by 600 pixels. .le;VT240 - Produces output for a Digital Equipment VT-240 terminal. The size is 10.24 by 7.9" or (26 by 20.07cm) 800 by 240 pixels. .LE;LENGTH=nnn - Maximum length in cm. If the device is only 25.4 cm (10") long and you specify LENGTH=30. the actual size will be 25.4. This parameter may be used for extra long plots on the LA-50, LA-100 printers. .le;INCHES/PIXELS - This modifies the units of length. If not specified the units are centimeters. .le;NOCLEAR - This suppresses the clearing of the device. Normally formfeed is placed at the beginning of each plot and at the end of the last plot. With no clear, the formfeeds are omitted. This is useful if the resulting plot is to be imbedded into text, printed on the same device. .le;NORESET - The LN-03 is normally reset at the beginning of the plots, and this command prevents the reset. This command as well as NOCLEAR are needed for producing plots to be imbedded into text on the LN-03 If the LN-03 is not reset, the printer parameters set by the previous user may interfere with your plots. .le;DECGIGI,SDDGIGI, and SEQGIGI are combined into 1 program DECGIGI. .els 0 .s.note ^*Warning\* The LN-03 printer has limited memory and if a "dense" graph is printed with high resolution, the memory may not be adequate. Any resolution other than HI should work on an LN-03 with a single RAM cartridge. High resolution is probably only useful for small plots. The higher resolution plots take longer to generate, and they occupy more disk space. .end note .qd extension The plot may be extended for printers such as the LA-50 and LA-100 which support continuous forms. This is accomplished with the XSIZE and YSIZE parameters. For example you wish to have a plot with a Y size of 8" and an X size of 20". You specify XSIZE=50.8,YSIZE=25.4. For an LA-50 this is all that is necessary. For an LA-100 you also need to rotate the axis so you specify ROTAXIS. .qc Versatec This is a non-interactive device only. The plotting space is 10.55" by 7.8" (26.8cm by 19.81cm) 2110 by 1560 pixels. .s;Options: .list 0 .le;DDNAME= - Name of output file (up to 64 chars.) for noninteractive use. .if IBM (Default:UGDEVICE) .else IBM (Default:UGDEVICE.DAT) .endif IBM .le;GENIL - Simulate intensity level changes by different line widths. This option increases the time to produce a plot. .le;ROTAXIS - Normally the X axis is along the long side of the page (11 inches). This rotates the picture so X is along the short side of the page (8.5 inches) .le;TOPMAR = - Selects the top margin value. This should be 0 for model 1200 and 75 for V80. (Default:0) .le;MAXNSA= - Size in words of the blocks of memory to accumulate line segments. This should not normally be changed. (Default:1024) .if IBM .le;LINEMX= - The line multiplicity. This should not normally be changed. (Default:32) .endif IBM .if bonner .le;LENGTH= - The length in cm of the paper. This is allows plots to bleed over the perforations on fanfold paper. (Default:18.81) .le;INCHES/PIXELS - This modifies the units of length. If not specified the units are centimeters. .endif bonner .els 0 .note The file format for VAX and IBM computers are very different so files can not be transferred from one computer type to the other. .end note .req "in:Ugfont" .qb Linking The various routines must be selected an linked to your program. All routines are in directory SYS$UGSYS. You will need the NUCLEUS subroutines, and the OBJLIB library routines. You must select either the SIMPLEX or DUPLEX character set, and the devices you wish to use. You may have both SIMPLEX and DUPLEX characters. The SIMPLEX and DUPLEX routines must be linked after the NUCLEUS and before the OBJLIB. .p For example you wish to use the TEK-4010 interactively and the Versatec with fan fold paper, and the metafile driver. The link command will look like: .nf .i5;_$ LINK ... + - .i7;SYS$UGSYS:NUCLEUS+ - .i7;SYS$UGSYS:SIMPLEX+DUPLEX+ - .i7;SYS$UGSYS:TEK4010+VEP12FF+PDEVUGS+PDEVUGSX+ - .i7;SYS$UGSYS:OBJLIB/LIBRARY .qb Errors Errors are handled by subroutine UGRERR, and an optional user supplied routine UGXERR. The meaning of error codes 1-10 vary depending on the routine. They are listed with the routines. Error codes 11-19 are the same for groups of routines. They are tabulated below: .list 0 .number list 11 .le;- Segment overflow .le;- Graphic device is not open .le;- Invalid operation for active device .le;- Extended char module not available .le;- Attempt to read a disabled control unit on a device. .els 0 .qb Programs Several programs are available for creating and manipulating plots. They are: .list 0 .le;TOPDRAW - Creates plots using your data See the separate documentation on TOPDRAW .le;PDEVUGSI - Outputs plots created by UGSYS. This takes device independent pictures and outputs them. .els 0 .qb changes Original sources were written by: .c text Robert C. Beach Computation Research Group Stanford Linear Accelerator Center Stanford, California 94305 .end center .s;Modifications: .s.c;March 1986 - J. Clement .list 0 .le;TEK4010, DECGIGI substantially rewritten for efficiency. .le;TEK4010 - VT240, TEK4014 VIS102, and SEL100XL support added. .le;TEK4010 - Hardware line structure and high resolution support added. .le;TEK4010,UGECTL,DECGIGI - Support for passing key pressed during locator function. .le;TEK4010 - Removed software intensity support as it looked bad on some emulators, and added hardware point plot. .le;UGSIXEL - New driver added for processing SIXEL graphics. .le;UGOPEN,UGZ002 - Modified to add SIXEL driver. .le;VEP12FF - Modified for length parameter. INCHES/PIXELS modifiers added. .le;UGNMCV - Number converstion routine added. .le;TEK4010 - Multiple hardware char sizes added for 4014/SEL100/VT240 Character offsets corrected for RVT100. RVT100A added for High resolution Retrographics boards. .le;DECGIGI - Character offsets corrected for VT-240. This centers the characters nicely. Some optimization performed to speed up the plots. .le;TEK4010 - Merged SEQ4010,SDD4010,TEK4010 into 1 module. .le;UGZ004-7,UGOPTN,TEK4010,VEP12FF,UGSIXEL - Macro code changed to properly set up PSECTS for sharable library. .els 0 .qb Author Written: January 1986 .nf.lm+10 J. Clement Bonner Nuclear Lab Rice University Box 1892 Houston, Tx 77251 .lm .s Extracted from: .lm+10 CGTM number 203 The Unified Graphics System For Fortran 77 Programming Manual .s.i-5;and CGTM 204 The Unified Graphics System For Fortran 77 Graphics Algorithms Manual .s.i-5;by: Robert C. Beach Computation Research Group Stanford Linear Accelerator Center Stanford, California 94305 .;P.O. Box 4349, Bin 88 .;FTS - 461-9300 x 2861 .f