| 1 |
C Copyright(C) 1999-2020, 2025 National Technology & Engineering Solutions |
| 2 |
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
C NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
C |
| 5 |
C See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
C VDMOVA VDMONI VDGNAM VBIQDV VBIQPK VDLINA VDTEXT VDPNTA VDPOLY VDIQCP VDSTOS |
| 8 |
C WMETMV WMETMO WMETGN WMETIV WMETQP WMETLN WMETTX WMETPT WMETPY WMETCP WMETOS |
| 9 |
|
| 10 |
C VDIQOS VDSTFC VDSTBC VDSTIN VDSTLS VDSTLW VDSTCS VDAABU VDALOC VDABGL VDAKGL |
| 11 |
C WMETIO WMETFC WMETBC WMETIN WMETLS WMETLW WMETCS WMETBU WMETLO WMETBL WMETKL |
| 12 |
|
| 13 |
C VDSTLA VDINIT VDFRAM VDTERM VDIQDC VDNWPG VDBELL VDWAIT VDBUFL VDSTCO VDIQCO |
| 14 |
C WMETLA WMETNT WMETFR WMETTR WMETDC WMETPG WMETBE WMETWT WMETFL WMETCO WMETIC |
| 15 |
|
| 16 |
C VDESCP VDIQES VDIQND VIMOVA VILINA VIPNTA VITEXT VIINIT VITERM VINWPG CDRCOM |
| 17 |
C WMETES WMETIE WMETID WMETIM WMETIL WMETIP WMETIX WMETII WMETIT WMETIG CDRCOM |
| 18 |
|
| 19 |
C VCJOB VCONOD VBERRH VDLOGE CDRWFS CDRRFS CDROFS CDROF3 CDRCFS CDROFF CDROAB |
| 20 |
C VCJOB VCONOD WMETER WMETLE WMETWF WMETRF WMETOF WMETO3 WMETCF WMETFF WMETAB |
| 21 |
|
| 22 |
C BGPBUF QMSBUF QMSBU1 DDCBUF H75BUF BTKBUF NMTBUF VBIMBF VBPKG VBDEV VDIQRS |
| 23 |
C WMETBF WMETQM WMETBF WMETBF WMETBF WMETBF WMETBF WMETIB WMETPK WMETDV WMETQR |
| 24 |
|
| 25 |
C VDSTMP VDSTRS VDSTRV VDBRGB VDFRGB VDPIXL VDPIXI VDRPIX VDRPXI VDRSCL VDIQCI |
| 26 |
C WMETMP WMETRS WMETRV WMETBG WMETFG WMETPX WMETPI WMETRP WMETRI WMETRL WMETCI |
| 27 |
|
| 28 |
C VBSTMP VIFRAM VCNDCM VCATTR VBINI1 VB2HLS VB2RGB VCCOLT VCCRPS VCSCAL VCDDIM |
| 29 |
C WMET01 WMET02 WMET03 WMET04 WMET05 WMET06 WMET07 WMET08 WMET09 WMET10 WMET11 |
| 30 |
|
| 31 |
C VIPOLY VBOUT |
| 32 |
C WMET12 WMET13 |
| 33 |
|
| 34 |
SUBROUTINE WMET01( IMAP ) |
| 35 |
integer*4 imap |
| 36 |
|
| 37 |
GOTO (1,2,3,4,5),IMAP |
| 38 |
|
| 39 |
CALL WMETMP('UNKNOWN') |
| 40 |
RETURN |
| 41 |
|
| 42 |
1 CALL WMETMP('1-TO-1') |
| 43 |
RETURN |
| 44 |
|
| 45 |
2 CALL WMETMP('REPLICATE') |
| 46 |
RETURN |
| 47 |
|
| 48 |
3 CALL WMETMP('VIRTUAL') |
| 49 |
RETURN |
| 50 |
|
| 51 |
4 CALL WMETMP('NODISTORT') |
| 52 |
RETURN |
| 53 |
|
| 54 |
5 CALL WMETMP('FREEFORM') |
| 55 |
RETURN |
| 56 |
|
| 57 |
END |
| 58 |
SUBROUTINE WMETRS(I1,I2) |
| 59 |
c************************************************************************* |
| 60 |
c This routine is to satisfy entry points used with raster vdi stuff |
| 61 |
c but not with regular vdi stuff. This is done so raster vdi programs |
| 62 |
c can link with regular vdi. |
| 63 |
c************************************************************************* |
| 64 |
INTEGER*4 i1, i2, i3 |
| 65 |
CHARACTER C1*(*) |
| 66 |
REAL*4 RA1(1),RA2(1),RA3(1) |
| 67 |
INTEGER*4 IA1(1),IA2(1) |
| 68 |
real*4 r1, r2, r3, r4 |
| 69 |
|
| 70 |
ENTRY WMETRV(R1,R2,R3,R4) |
| 71 |
ENTRY WMETMP(C1) |
| 72 |
ENTRY WMETPX(I1,I2,RA1,RA2,RA3,I3) |
| 73 |
ENTRY WMETRP(I1,I2,I3,RA1,RA2,RA3,IA1) |
| 74 |
ENTRY WMETPI(I1,I2,IA1,I3) |
| 75 |
ENTRY WMETRI(I1,I2,I3,IA1,IA2) |
| 76 |
ENTRY WMETQR(I1,RA1) |
| 77 |
ENTRY WMETRL |
| 78 |
ENTRY WMETFG(R1,R2,R3) |
| 79 |
ENTRY WMETBG(R1,R2,R3) |
| 80 |
ENTRY WMETCI(R1,R2,R3,I1) |
| 81 |
RETURN |
| 82 |
END |
| 83 |
SUBROUTINE WMETFR(ITYPE) |
| 84 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 85 |
|
| 86 |
C VDFRAM - Draw header or trailer frame |
| 87 |
|
| 88 |
C P. Watterberg - 27 Aug 81 |
| 89 |
|
| 90 |
C ENVIRONMENT -Computer-independent, system-independent, FORTRAN 77 |
| 91 |
|
| 92 |
C ENTRY CONDITIONS - ITYPE = 0 for header frame |
| 93 |
C = 1 for trailer frame |
| 94 |
|
| 95 |
C CALLS - VIFRAM |
| 96 |
|
| 97 |
C EXIT CONDITIONS - |
| 98 |
|
| 99 |
C NARRATIVE - Calls vifram to get time and date from the |
| 100 |
c system via the computer-dependent routine CDRTOD(entry |
| 101 |
c point in CDRJOB) and writes it on an identification frame. |
| 102 |
|
| 103 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 104 |
|
| 105 |
INTEGER*4 ITYPE |
| 106 |
|
| 107 |
CALL WMET02(ITYPE) |
| 108 |
RETURN |
| 109 |
END |
| 110 |
SUBROUTINE WMET02(ITYPE) |
| 111 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 112 |
|
| 113 |
C VIFRAM - Draw header or trailer frame |
| 114 |
|
| 115 |
C P. Watterberg - 27 Aug 81 |
| 116 |
|
| 117 |
C ENVIRONMENT -Computer-independent, system-independent, FORTRAN 77 |
| 118 |
|
| 119 |
C ENTRY CONDITIONS - ITYPE = 0 for header frame |
| 120 |
C = 1 for trailer frame |
| 121 |
|
| 122 |
C CALLS - |
| 123 |
|
| 124 |
C EXIT CONDITIONS - |
| 125 |
|
| 126 |
C NARRATIVE -NULL ROUTINE |
| 127 |
|
| 128 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 129 |
|
| 130 |
INTEGER*4 ITYPE |
| 131 |
|
| 132 |
RETURN |
| 133 |
END |
| 134 |
SUBROUTINE WMETGN(NAME) |
| 135 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 136 |
|
| 137 |
C VDGNAM -Name the graphics output file |
| 138 |
|
| 139 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 140 |
C Device-independent. |
| 141 |
|
| 142 |
C ENTRY CONDITIONS -NAME = character string; < 80 characters |
| 143 |
|
| 144 |
C CALLS |
| 145 |
|
| 146 |
C EXIT CONDITIONS -output graphics file is assigned the name NAME |
| 147 |
|
| 148 |
C NARRATIVE -This subroutine associates a file name with |
| 149 |
C the graphics output file (KOUTFL). If this |
| 150 |
C routine is not called, a system dependent |
| 151 |
C default name is used. VDGNAM must be called |
| 152 |
C before VDINIT. |
| 153 |
|
| 154 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 155 |
|
| 156 |
CHARACTER*(*) NAME |
| 157 |
INTEGER*4 LENGTH,ISTART,IEND,I |
| 158 |
LENGTH = MIN(LEN(NAME),132) |
| 159 |
C Strip off any leading blanks |
| 160 |
ISTART = 0 |
| 161 |
DO 10 I=1,LENGTH |
| 162 |
IF(NAME(I:I) .NE. ' ')THEN |
| 163 |
ISTART = I |
| 164 |
GOTO 11 |
| 165 |
ENDIF |
| 166 |
10 CONTINUE |
| 167 |
11 CONTINUE |
| 168 |
C Strip off trailing blanks |
| 169 |
IEND = 0 |
| 170 |
IF(ISTART.GT.0)THEN |
| 171 |
DO 20 I=LENGTH,1,-1 |
| 172 |
IF(NAME(I:I) .NE. ' ')THEN |
| 173 |
IEND = I |
| 174 |
GOTO 21 |
| 175 |
ENDIF |
| 176 |
20 CONTINUE |
| 177 |
ENDIF |
| 178 |
21 CONTINUE |
| 179 |
IF(ISTART .GT. 0)THEN |
| 180 |
LENGTH = IEND-ISTART+1 |
| 181 |
CALL CDRGNM(NAME(ISTART:IEND),LENGTH) |
| 182 |
ENDIF |
| 183 |
RETURN |
| 184 |
END |
| 185 |
SUBROUTINE WMETNT(ASPECT,JUSTIF) |
| 186 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 187 |
|
| 188 |
C VDINIT -Initialize SVDI. |
| 189 |
|
| 190 |
C R.W.Simons -08APR81 |
| 191 |
C 30SEP81 |
| 192 |
|
| 193 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 194 |
C Device-independent. |
| 195 |
|
| 196 |
C ENTRY CONDITIONS -ASPECT = real ratio of X dimension to Y dimension. |
| 197 |
C Range >0.0. Default: 0.0 (device dependent). |
| 198 |
C JUSTIF = integer justification of NDC space on the |
| 199 |
C device. Range 0-9. Default: 0 (device dependent). |
| 200 |
|
| 201 |
C CALLS -CDRJOB, VBERRH, VIINIT. |
| 202 |
|
| 203 |
C EXIT CONDITIONS -XNDCMX,YNDCMX = real NDC maximum valid values. |
| 204 |
C VECTOR = real array of default attribute values (all |
| 205 |
C device-dependent except VECTOR(4)=0.0). |
| 206 |
|
| 207 |
C NARRATIVE -This must be the first SVDI call made. All |
| 208 |
C attribute values, the color table, and current |
| 209 |
C position are set to appropriate defaults for the |
| 210 |
C device. All necessary input device initialization |
| 211 |
C is done. The screen is cleared or paper advanced |
| 212 |
C if necessary to guarantee a blank view surface for |
| 213 |
C drawing. |
| 214 |
|
| 215 |
C ASPECT specifies the ratio of the X dimension to the |
| 216 |
C Y dimension. Maximum NDC values (at least one of |
| 217 |
C which will be 1.0) are computed to give the ASPECT |
| 218 |
C specified. The default ASPECT (0.0) is device |
| 219 |
C dependent and equals the aspect ratio of the |
| 220 |
C physical device, except for variable aspect devices |
| 221 |
C (such as drum plotters) which are assigned a default |
| 222 |
C aspect of 1.0. The NDC rectangle is scaled until |
| 223 |
C one dimension fills the corresponding dimension of |
| 224 |
C the device. |
| 225 |
|
| 226 |
C JUSTIF determines where the rectangle is located on |
| 227 |
C the device as diagrammed below: |
| 228 |
C --------- |
| 229 |
C | 7 8 9 | |
| 230 |
C | 4 5 6 | |
| 231 |
C | 1 2 3 | |
| 232 |
C --------- |
| 233 |
C For example, JUSTIF = 7 indicates NDC space will be |
| 234 |
C upper left justified on the device. |
| 235 |
|
| 236 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 237 |
|
| 238 |
REAL*4 ASPECT |
| 239 |
INTEGER*4 JUSTIF |
| 240 |
|
| 241 |
CALL WMETII(ASPECT,JUSTIF) |
| 242 |
|
| 243 |
RETURN |
| 244 |
END |
| 245 |
SUBROUTINE WMETLE(ERRNUM,ERRSEV) |
| 246 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 247 |
|
| 248 |
C VDLOGE -Log Error. |
| 249 |
|
| 250 |
C R.W.Simons -08APR81 |
| 251 |
C K.M.Erickson -8OCT84 - add buffer flush |
| 252 |
|
| 253 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 254 |
C Device-independent. |
| 255 |
|
| 256 |
C ENTRY CONDITIONS -ERRNUM = integer error number. |
| 257 |
C ERRSEV = integer error severity. |
| 258 |
|
| 259 |
C CALLS -CDRTBK, VDBUFL |
| 260 |
|
| 261 |
C EXIT CONDITIONS - |
| 262 |
|
| 263 |
C NARRATIVE -Report error with message to user and possibly |
| 264 |
C terminate job depending on severity. Notice that |
| 265 |
C by judicious use of the error routines (see VBERRH) |
| 266 |
C it is possible to write very "nice" error routines |
| 267 |
C that, for example, only report the first two |
| 268 |
C occurrences of a particular error, or terminate |
| 269 |
C if more than 10 errors of a particular severity |
| 270 |
C occur. |
| 271 |
|
| 272 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 273 |
|
| 274 |
INTEGER ERRNUM |
| 275 |
INTEGER ERRSEV |
| 276 |
|
| 277 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 278 |
1KCOMTP |
| 279 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 280 |
1 KBAUD,KCOMTP |
| 281 |
|
| 282 |
C flush buffer before we do a write |
| 283 |
CALL WMETFL |
| 284 |
|
| 285 |
C WRITE THE ERROR TO THE LISTING. |
| 286 |
WRITE(KWRTFL,10)ERRNUM,ERRSEV |
| 287 |
10 FORMAT(' SVDI ERROR NUMBER ',I5,' SEVERITY CODE ',I5) |
| 288 |
|
| 289 |
C TRACEBACK. |
| 290 |
CALL CDRTBK |
| 291 |
|
| 292 |
RETURN |
| 293 |
END |
| 294 |
SUBROUTINE WMETID(XNDC,YNDC) |
| 295 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 296 |
|
| 297 |
C VDIQND -Inquire NDC Space. |
| 298 |
|
| 299 |
C R.W.Simons -08APR81 |
| 300 |
|
| 301 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 302 |
C Device-independent. |
| 303 |
|
| 304 |
C ENTRY CONDITIONS -XNDCMX,YNDCMX = real maximum valid NDC values. |
| 305 |
|
| 306 |
C CALLS - |
| 307 |
|
| 308 |
C EXIT CONDITIONS -XNDC,YNDC = real maximum valid NDC values (XNDCMX, |
| 309 |
C YNDCMX). |
| 310 |
|
| 311 |
C NARRATIVE -Return the maximum NDC values as set to realize the |
| 312 |
C aspect defined by VDINIT. |
| 313 |
|
| 314 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 315 |
|
| 316 |
REAL*4 XNDC,YNDC |
| 317 |
|
| 318 |
REAL*4 XNDCMX,YNDCMX |
| 319 |
COMMON /WMET03/ XNDCMX,YNDCMX |
| 320 |
|
| 321 |
C RETURN THE MAXIMUM VALID NDC VALUES. |
| 322 |
XNDC=XNDCMX |
| 323 |
YNDC=YNDCMX |
| 324 |
|
| 325 |
RETURN |
| 326 |
END |
| 327 |
SUBROUTINE WMETIO(ATTARR) |
| 328 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 329 |
|
| 330 |
C VDIQOS -Inquire Output Status (of Attributes). |
| 331 |
|
| 332 |
C K.M. ERICKSON -14 NOV 80 |
| 333 |
|
| 334 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 335 |
C Device-independent. |
| 336 |
|
| 337 |
C ENTRY CONDITIONS -VECTOR = real array of current attribute values. |
| 338 |
|
| 339 |
C CALLS - |
| 340 |
|
| 341 |
C EXIT CONDITIONS -ATTARR = real array of current attribute value |
| 342 |
C (VECTOR). |
| 343 |
|
| 344 |
C NARRATIVE -Return the current attribute values in ATTARR as |
| 345 |
C given below. |
| 346 |
C ATTARR(1)=Foreground Color |
| 347 |
C (2)=Background Color |
| 348 |
C (3)=Intensity |
| 349 |
C (4)=Line Style |
| 350 |
C (5)=Line Width |
| 351 |
C (6)=Character Box Y |
| 352 |
C (7)=Character Box X |
| 353 |
|
| 354 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 355 |
|
| 356 |
REAL*4 ATTARR(7) |
| 357 |
|
| 358 |
REAL*4 VECTOR(7) |
| 359 |
COMMON /WMET04/ VECTOR |
| 360 |
|
| 361 |
INTEGER*4 I |
| 362 |
|
| 363 |
DO 100 I=1,7 |
| 364 |
ATTARR(I)=VECTOR(I) |
| 365 |
100 CONTINUE |
| 366 |
|
| 367 |
RETURN |
| 368 |
END |
| 369 |
SUBROUTINE WMETLN(X,Y) |
| 370 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 371 |
|
| 372 |
C VDLINA -Line Absolute. |
| 373 |
|
| 374 |
C R.W.Simons -08APR81 |
| 375 |
|
| 376 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 377 |
C Device-independent. |
| 378 |
|
| 379 |
C ENTRY CONDITIONS -X,Y = real NDC position. |
| 380 |
|
| 381 |
C CALLS -VILINA. |
| 382 |
|
| 383 |
C EXIT CONDITIONS - |
| 384 |
|
| 385 |
C NARRATIVE -Draw a line from current position to absolute NDC |
| 386 |
C position X,Y and update current position. |
| 387 |
C Attributes foreground color, intensity, line style, |
| 388 |
C and line width apply. |
| 389 |
|
| 390 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 391 |
|
| 392 |
REAL*4 X,Y |
| 393 |
|
| 394 |
C THIS IS JUST A DUMMY ROUTINE WHICH DOES NOTHING BUT CALL VILINA. |
| 395 |
C THIS ORGANIZATION FACILITATES ADDING SECURITY MARKINGS TO SVDI. |
| 396 |
CALL WMETIL(X,Y) |
| 397 |
|
| 398 |
RETURN |
| 399 |
END |
| 400 |
SUBROUTINE WMETMO(ISTATE) |
| 401 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 402 |
|
| 403 |
C VDMONI -Logs Usage Information.. |
| 404 |
|
| 405 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 406 |
C Device-independent. |
| 407 |
|
| 408 |
C ENTRY CONDITIONS -ISTATE = 0 - initialization |
| 409 |
C 1 - new page |
| 410 |
C 2 - terminate |
| 411 |
|
| 412 |
C CALLS -CDRMON |
| 413 |
|
| 414 |
C EXIT CONDITIONS - |
| 415 |
|
| 416 |
c NARRATIVE -For ISTATE=0, job information is initialized, and |
| 417 |
C timers are initialized called by VIINIT. |
| 418 |
C ISTATE=1 will increment a common block page |
| 419 |
C counter called by VINWPG. |
| 420 |
C ISTATE=2 is called by VITERM and will cause |
| 421 |
C the collected usage monitoring information to |
| 422 |
C be written to a file. |
| 423 |
C Contains entry points VBPKG which will has |
| 424 |
C an 8 character parameter which will set a common |
| 425 |
C block variable specifying the package being used. |
| 426 |
C Entry point VBDEV has an 8 character parameter |
| 427 |
C which will set a common block variable specifying |
| 428 |
C the device being used. |
| 429 |
|
| 430 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 431 |
|
| 432 |
CHARACTER *8 C1,C2,MDEV,MPKG |
| 433 |
INTEGER ISTATE |
| 434 |
INTEGER*4 MPAGES |
| 435 |
SAVE MDEV,MPKG,MPAGES |
| 436 |
|
| 437 |
DATA MPKG /' '/ |
| 438 |
DATA MDEV /' '/ |
| 439 |
DATA MPAGES /0/ |
| 440 |
|
| 441 |
IF(ISTATE.EQ.0) THEN |
| 442 |
CALL CDRELA(0) |
| 443 |
ELSEIF (ISTATE.EQ.1) THEN |
| 444 |
MPAGES=MPAGES+1 |
| 445 |
ELSE |
| 446 |
CALL CDRELA(1) |
| 447 |
CALL CDRMON(MDEV,MPKG,MPAGES) |
| 448 |
ENDIF |
| 449 |
RETURN |
| 450 |
C Usage Monitoring Information |
| 451 |
|
| 452 |
ENTRY WMETPK (C1) |
| 453 |
MPKG = C1 |
| 454 |
RETURN |
| 455 |
ENTRY WMETDV (C2) |
| 456 |
MDEV = C2 |
| 457 |
RETURN |
| 458 |
ENTRY WMETQP(C1) |
| 459 |
C1 = MPKG |
| 460 |
RETURN |
| 461 |
ENTRY WMETIV(C2) |
| 462 |
C2 = MDEV |
| 463 |
RETURN |
| 464 |
END |
| 465 |
SUBROUTINE WMETMV(X,Y) |
| 466 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 467 |
|
| 468 |
C VDMOVA -Move Absolute. |
| 469 |
|
| 470 |
C R.W.Simons -08APR81 |
| 471 |
|
| 472 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 473 |
C Device-independent. |
| 474 |
|
| 475 |
C ENTRY CONDITIONS -X,Y = real NDC position. |
| 476 |
|
| 477 |
C CALLS -VIMOVA |
| 478 |
|
| 479 |
C EXIT CONDITIONS - |
| 480 |
|
| 481 |
C NARRATIVE -Set current position to absolute NDC position X,Y. |
| 482 |
|
| 483 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 484 |
|
| 485 |
REAL*4 X,Y |
| 486 |
|
| 487 |
C THIS IS JUST A DUMMY ROUTINE WHICH DOES NOTHING BUT CALL VIMOVA. |
| 488 |
C THIS ORGANIZATION FACILITATES ADDING SECURITY MARKINGS TO SVDI. |
| 489 |
CALL WMETIM(X,Y) |
| 490 |
|
| 491 |
RETURN |
| 492 |
END |
| 493 |
SUBROUTINE WMETPG |
| 494 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 495 |
|
| 496 |
C VDNWPG -New Page. |
| 497 |
|
| 498 |
C R.W.Simons -08APR81 |
| 499 |
|
| 500 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 501 |
C Device-independent. |
| 502 |
|
| 503 |
C ENTRY CONDITIONS - |
| 504 |
|
| 505 |
C CALLS -VINWPG. |
| 506 |
|
| 507 |
C EXIT CONDITIONS - |
| 508 |
|
| 509 |
C NARRATIVE -Physically advance the medium or clear the screen, |
| 510 |
C whichever is appropriate. Also flood the screen |
| 511 |
C with the background color on devices that support |
| 512 |
C this function. The current position is not changed. |
| 513 |
|
| 514 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 515 |
|
| 516 |
C THIS IS JUST A DUMMY ROUTINE WHICH DOES NOTHING BUT CALL VINWPG. |
| 517 |
C THIS ORGANIZATION FACILITATES ADDING SECURITY MARKINGS TO SVDI. |
| 518 |
CALL WMETIG |
| 519 |
|
| 520 |
RETURN |
| 521 |
END |
| 522 |
SUBROUTINE WMETPT(X,Y) |
| 523 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 524 |
|
| 525 |
C VDPNTA -Point Absolute. |
| 526 |
|
| 527 |
C R.W.Simons -08APR81 |
| 528 |
|
| 529 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 530 |
C Device-independent. |
| 531 |
|
| 532 |
C ENTRY CONDITIONS -X,Y = real NDC position. |
| 533 |
|
| 534 |
C CALLS -VIPNTA. |
| 535 |
|
| 536 |
C EXIT CONDITIONS - |
| 537 |
|
| 538 |
C NARRATIVE -Set current position to absolute NDC position X,Y |
| 539 |
C and put a visible point there. Attributes |
| 540 |
C foreground color and intensity apply. |
| 541 |
|
| 542 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 543 |
|
| 544 |
REAL*4 X,Y |
| 545 |
|
| 546 |
C THIS IS JUST A DUMMY ROUTINE WHICH DOES NOTHING BUT CALL VIPNTA. |
| 547 |
C THIS ORGANIZATION FACILITATES ADDING SECURITY MARKINGS TO SVDI. |
| 548 |
CALL WMETIP(X,Y) |
| 549 |
|
| 550 |
RETURN |
| 551 |
END |
| 552 |
SUBROUTINE WMETPY(XARRAY,YARRAY,NPTS) |
| 553 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 554 |
|
| 555 |
C VDPOLY -POLYGON FILL ROUTINE |
| 556 |
|
| 557 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 558 |
|
| 559 |
C ENTRY CONDITIONS -XARRAY-ARRAY OF X VALUES OF THE POLYGON |
| 560 |
C YARRAY-CORRESPONDING ARRAY OF Y VALUES |
| 561 |
C NPTS- NUMBER OF POINTS IN (XARRAY,YARRAY) |
| 562 |
|
| 563 |
C CALLS -VIPOLY |
| 564 |
|
| 565 |
C EXIT CONDITIONS - |
| 566 |
|
| 567 |
C NARRATIVE -The polygon defined by XARRAY,YARRAY will be drawn |
| 568 |
C and filled (constrained by any limitations of the |
| 569 |
C physical device -- see below). No checking will be |
| 570 |
C done -- all points will be passed to the device. |
| 571 |
C Current foreground color is used and the polygon |
| 572 |
C boundary is drawn using the solid line style. |
| 573 |
C VDI will close the polygon (i.e. the last point |
| 574 |
C will be connected to the first). |
| 575 |
|
| 576 |
C The level of support for this primitive is device- |
| 577 |
C dependent. The level of support is categorized |
| 578 |
C as follows: |
| 579 |
|
| 580 |
C Level 0 -- no polygon fill. Only the polygon |
| 581 |
C boundary is drawn. |
| 582 |
C Level 1 -- the device fills convex polygons. |
| 583 |
C Level 2 -- the device fills simple polygons (may |
| 584 |
C be concave but not self-crossing) |
| 585 |
C Level 3 -- full support for complex polygons (may |
| 586 |
C be self-crossing). In general, the interior of |
| 587 |
C a complex polygon is defined by the set of points |
| 588 |
C such that, for each point, when an imaginary line |
| 589 |
C is drawn to that point from a point far outside |
| 590 |
C the polygon, that line intersects the polygon |
| 591 |
C boundary an odd number of times. |
| 592 |
|
| 593 |
C Note that the level of support for a particular device |
| 594 |
C can be inquired using the function VDIQDC. |
| 595 |
|
| 596 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 597 |
|
| 598 |
INTEGER*4 NPTS |
| 599 |
REAL*4 XARRAY(NPTS),YARRAY(NPTS) |
| 600 |
|
| 601 |
C THIS IS JUST A DUMMY ROUTINE WHICH DOES NOTHING BUT CALL VIPOLY. |
| 602 |
C THIS ORGANIZATION FACILITATES ADDING SECURITY MARKINGS TO SVDI. |
| 603 |
CALL WMET12(XARRAY,YARRAY,NPTS) |
| 604 |
|
| 605 |
RETURN |
| 606 |
END |
| 607 |
SUBROUTINE WMETOS(ATTARR) |
| 608 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 609 |
|
| 610 |
C VDSTOS -Set Output Status (of Attributes). |
| 611 |
|
| 612 |
C K.M. ERICKSON -14 NOV 80 |
| 613 |
|
| 614 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 615 |
C Device-independent. |
| 616 |
|
| 617 |
C ENTRY CONDITIONS -ATTARR = real array of attribute values. |
| 618 |
|
| 619 |
C CALLS -VDSTBC,VDSTCS,VDSTFC,VDSTIN,VDSTLS,VDSTLW |
| 620 |
|
| 621 |
C EXIT CONDITIONS -VECTOR = real updated attribute values (ATTARR). |
| 622 |
|
| 623 |
C NARRATIVE -Set the attribute values from ATTARR as given below. |
| 624 |
C ATTARR(1)=Foreground Color |
| 625 |
C (2)=Background Color |
| 626 |
C (3)=Intensity |
| 627 |
C (4)=Line Style |
| 628 |
C (5)=Line Width |
| 629 |
C (6)=Character Box Y |
| 630 |
|
| 631 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 632 |
|
| 633 |
REAL*4 ATTARR(6) |
| 634 |
|
| 635 |
REAL*4 VECTOR(7) |
| 636 |
COMMON /WMET04/ VECTOR |
| 637 |
integer*4 i4 |
| 638 |
|
| 639 |
C CALL EACH OF THE INDIVIDUAL ATTRIBUTE SETTING ROUTINES. |
| 640 |
C CHECK FOR VALIDITY OF INPUT VALUES WILL BE DONE IN EACH INDIVIDUAL |
| 641 |
C ROUTINE. |
| 642 |
i4 = INT(ATTARR(1)) |
| 643 |
CALL WMETFC(i4) |
| 644 |
i4 = INT(ATTARR(2)) |
| 645 |
CALL WMETBC(i4) |
| 646 |
CALL WMETIN(ATTARR(3)) |
| 647 |
i4 = INT(ATTARR(4)) |
| 648 |
CALL WMETLS(i4) |
| 649 |
CALL WMETLW(ATTARR(5)) |
| 650 |
CALL WMETCS(ATTARR(6)) |
| 651 |
|
| 652 |
RETURN |
| 653 |
END |
| 654 |
SUBROUTINE WMETTR |
| 655 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 656 |
|
| 657 |
C VDTERM -Terminate SVDI. |
| 658 |
|
| 659 |
C R.W.Simons -08APR81 |
| 660 |
|
| 661 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 662 |
C Device-independent. |
| 663 |
|
| 664 |
C ENTRY CONDITIONS - |
| 665 |
|
| 666 |
C CALLS -VITERM. |
| 667 |
|
| 668 |
C EXIT CONDITIONS - |
| 669 |
|
| 670 |
C NARRATIVE -Terminate the SVDI by flushing buffers, etc. This |
| 671 |
C should be the last SVDI call made. |
| 672 |
|
| 673 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 674 |
|
| 675 |
C THIS IS JUST A DUMMY ROUTINE WHICH DOES NOTHING BUT CALL VITERM. |
| 676 |
C THIS ORGANIZATION FACILITATES ADDING SECURITY MARKINGS TO SVDI. |
| 677 |
CALL WMETIT |
| 678 |
|
| 679 |
RETURN |
| 680 |
END |
| 681 |
SUBROUTINE WMETTX(LENGTH,CHARS) |
| 682 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 683 |
|
| 684 |
C VDTEXT -Text from Array. |
| 685 |
|
| 686 |
C R.W.Simons -08APR81 |
| 687 |
|
| 688 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 689 |
C Device-independent. |
| 690 |
|
| 691 |
C ENTRY CONDITIONS -LENGTH = integer number of characters in CHARS. |
| 692 |
C Range 1-136. |
| 693 |
C CHARS = integer array of ASCII characters, one |
| 694 |
C character per array element, right justified. |
| 695 |
C Range 8,10,32-126. |
| 696 |
|
| 697 |
C CALLS -VITEXT. |
| 698 |
|
| 699 |
C EXIT CONDITIONS - |
| 700 |
|
| 701 |
C NARRATIVE -Draw LENGTH characters in CHARS, starting at |
| 702 |
C current position and update current position to |
| 703 |
C the point after the last character box where the |
| 704 |
C next character would begin. Current position |
| 705 |
C indicates the lower left corner of the first |
| 706 |
C character box. Only printable characters (32-126 |
| 707 |
C decimal) and backspace and linefeed are allowed. |
| 708 |
C All values in this range must produce "reasonable" |
| 709 |
C output; mapping lower; case to upper case letters is |
| 710 |
C considered reasonable. Attributes foreground color, |
| 711 |
C background color, intensity, and character size |
| 712 |
C apply. |
| 713 |
|
| 714 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 715 |
|
| 716 |
INTEGER*4 LENGTH,CHARS(136) |
| 717 |
|
| 718 |
C THIS IS JUST A DUMMY ROUTINE WHICH DOES NOTHING BUT CALL VITEXT. |
| 719 |
C THIS ORGANIZATION FACILITATES ADDING SECURITY NARKINGS TO SVDI. |
| 720 |
CALL WMETIX(LENGTH,CHARS) |
| 721 |
|
| 722 |
RETURN |
| 723 |
END |
| 724 |
SUBROUTINE WMETER(ERRNUM,ERRSEV) |
| 725 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 726 |
|
| 727 |
C VBERRH -Error Handler. |
| 728 |
|
| 729 |
C R.W.Simons -08APR81 |
| 730 |
C 30SEP81 |
| 731 |
|
| 732 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 733 |
C Device-independent. |
| 734 |
|
| 735 |
C ENTRY CONDITIONS -ERRNUM = integer error number. |
| 736 |
C ERRSEV = integer severity code. If > 12, error is |
| 737 |
C fatal. |
| 738 |
|
| 739 |
C CALLS -VDLOGE. |
| 740 |
|
| 741 |
C EXIT CONDITIONS - |
| 742 |
|
| 743 |
C NARRATIVE -An error will normally cause an error message to |
| 744 |
C be printed on the error output device and possible |
| 745 |
C termination of the program, unless a routine VBERRH |
| 746 |
C is supplied by the user. This routine will replace |
| 747 |
C the default VBERRH provided by the system. The |
| 748 |
C system supplied VBERRH calls VDLOGE before |
| 749 |
C returning. All versions of VBERRH, whether user- |
| 750 |
C supplied or default, must STOP on any error severity |
| 751 |
C greater than 12. |
| 752 |
|
| 753 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 754 |
|
| 755 |
INTEGER ERRNUM |
| 756 |
INTEGER ERRSEV |
| 757 |
|
| 758 |
C REPORT THE ERROR USING VDLOGE. |
| 759 |
CALL WMETLE(ERRNUM,ERRSEV) |
| 760 |
|
| 761 |
C CHECK FOR FATAL ERROR. |
| 762 |
IF(ERRSEV.GT.12) STOP |
| 763 |
|
| 764 |
RETURN |
| 765 |
END |
| 766 |
SUBROUTINE WMETBU(BTNNUM) |
| 767 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 768 |
|
| 769 |
C VDAABU -Await Any Button. |
| 770 |
|
| 771 |
C R.W.Simons -08APR81 |
| 772 |
|
| 773 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 774 |
C All Batch Devices. |
| 775 |
|
| 776 |
C ENTRY CONDITIONS - |
| 777 |
|
| 778 |
C CALLS - |
| 779 |
|
| 780 |
C EXIT CONDITIONS -BTNNUM = integer number of the button pressed. |
| 781 |
C Range 1 to a device dependent maximum which must be |
| 782 |
C at least 8. |
| 783 |
|
| 784 |
C NARRATIVE -When a button has been pressed, its integer button |
| 785 |
C number is returned in BTNNUM. This function flushes |
| 786 |
C the button buffer, if any. This function flushes |
| 787 |
C the output buffers before doing input. |
| 788 |
|
| 789 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 790 |
|
| 791 |
INTEGER*4 BTNNUM |
| 792 |
|
| 793 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 794 |
1KCOMTP |
| 795 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 796 |
1 KBAUD,KCOMTP |
| 797 |
|
| 798 |
C BATCH DEVICES DON'T NEED TO FLUSH BUFFERS. |
| 799 |
|
| 800 |
C READ A RECORD FROM COMPUTER DEPENDENT FILE KINFL IN I5 FORMAT. |
| 801 |
READ(KINFL,10) BTNNUM |
| 802 |
10 FORMAT(I5) |
| 803 |
|
| 804 |
C CHECK FOR VALID BTNNUM. |
| 805 |
C RANGE FOR BATCH DEVICES IS 1-99999. IF OUT OF RANGE, MAP IT BACK IN: |
| 806 |
C MAPPING (-1)-(-9999) TO 1-9999 AND MAPPING 0 TO 10000. |
| 807 |
IF(BTNNUM.LT.0) BTNNUM=-BTNNUM |
| 808 |
IF(BTNNUM.EQ.0) BTNNUM=10000 |
| 809 |
|
| 810 |
RETURN |
| 811 |
END |
| 812 |
SUBROUTINE WMETBL(BTNNUM,X,Y) |
| 813 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 814 |
|
| 815 |
C VDABGL -Await Button, Get Locator. |
| 816 |
|
| 817 |
C R.W.Simons -08APR81 |
| 818 |
|
| 819 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 820 |
C All Batch Devices. |
| 821 |
|
| 822 |
C ENTRY CONDITIONS - |
| 823 |
|
| 824 |
C CALLS - |
| 825 |
|
| 826 |
C EXIT CONDITIONS -BTNNUM = integer number of the button pressed. |
| 827 |
C Range 1 to a device dependent maximum that must be |
| 828 |
C at least 8. |
| 829 |
C X,Y = real NDC position of the locator. |
| 830 |
|
| 831 |
C NARRATIVE -Wait until a button is hit, then return the number |
| 832 |
C of the button in BTNNUM and the NDC value of the |
| 833 |
C locator in X,Y. This function flushes the output |
| 834 |
C buffers before doing input. |
| 835 |
|
| 836 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 837 |
|
| 838 |
REAL*4 X,Y |
| 839 |
INTEGER*4 BTNNUM |
| 840 |
|
| 841 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 842 |
1KCOMTP |
| 843 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 844 |
1 KBAUD,KCOMTP |
| 845 |
|
| 846 |
C BATCH DEVICES DON'T NEED TO FLUSH BUFFERS. |
| 847 |
|
| 848 |
C READ A RECORD FROM COMPUTER DEPENDENT FILE KINFL IN I5,2F10.7 FORMAT. |
| 849 |
READ(KINFL,10) BTNNUM,X,Y |
| 850 |
10 FORMAT(I5,2F10.7) |
| 851 |
|
| 852 |
C CHECK FOR VALID BTNNUM. |
| 853 |
C RANGE FOR BATCH DEVICES IS 1-99999. IF OUT OF RANGE, MAP IT BACK IN: |
| 854 |
C MAPPING (-1)-(-9999) TO 1-9999 AND MAPPING 0 TO 10000. |
| 855 |
IF(BTNNUM.LT.0) BTNNUM=-BTNNUM |
| 856 |
IF(BTNNUM.EQ.0) BTNNUM=10000 |
| 857 |
|
| 858 |
RETURN |
| 859 |
END |
| 860 |
SUBROUTINE WMETKL(CHAR,X,Y) |
| 861 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 862 |
|
| 863 |
C VDAKGL -Await Keyboard, Get Locator. |
| 864 |
|
| 865 |
C R.W.SIMONS -02DEC80 |
| 866 |
|
| 867 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 868 |
C All Batch Devices. |
| 869 |
|
| 870 |
C ENTRY CONDITIONS - |
| 871 |
|
| 872 |
C CALLS - |
| 873 |
|
| 874 |
C EXIT CONDITIONS -CHAR = integer ASCII character input from the |
| 875 |
C keyboard, right-justified, zero fill. Range 32-126. |
| 876 |
C X,Y = real NDC position of the locator. |
| 877 |
|
| 878 |
C NARRATIVE -Wait until a key is hit, then return the character |
| 879 |
C entered in CHAR and the NDC value of the locator |
| 880 |
C in X,Y. If the character entered does not fall in |
| 881 |
C the range 32-126, a blank(32) is returned in CHAR. |
| 882 |
C This function flushes the output buffers before |
| 883 |
C doing input. |
| 884 |
|
| 885 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 886 |
|
| 887 |
REAL*4 X,Y |
| 888 |
INTEGER*4 CHAR |
| 889 |
|
| 890 |
INTEGER*4 IN,CHR |
| 891 |
|
| 892 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 893 |
1KCOMTP |
| 894 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 895 |
1 KBAUD,KCOMTP |
| 896 |
|
| 897 |
C BATCH DEVICES DON'T NEED TO FLUSH BUFFERS. |
| 898 |
|
| 899 |
C READ A CHARACTER AND AN X,Y POSITION FROM COMPUTER DEPENDENT FILE |
| 900 |
C KINFL WITH FORMAT A1,2F10.7. |
| 901 |
READ(KINFL,10) CHR,X,Y |
| 902 |
10 FORMAT(A1,2F10.7) |
| 903 |
|
| 904 |
C CONVERT CHARACTER TO INTEGER ASCII AND CHECK FOR VALID RANGE. |
| 905 |
CALL CDR1CH(1,CHR,IN) |
| 906 |
CALL CDRCVT(IN,CHAR) |
| 907 |
IF(CHAR.LT.32.OR.CHAR.GT.126) CHAR=32 |
| 908 |
|
| 909 |
RETURN |
| 910 |
END |
| 911 |
SUBROUTINE WMETLO(X,Y) |
| 912 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 913 |
|
| 914 |
C VDALOC -Await Locator. |
| 915 |
|
| 916 |
C R.W.Simons -08APR81 |
| 917 |
|
| 918 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 919 |
C All Batch Devices. |
| 920 |
|
| 921 |
C ENTRY CONDITIONS - |
| 922 |
|
| 923 |
C CALLS - |
| 924 |
|
| 925 |
C EXIT CONDITIONS -X,Y = real NDC position of the locator. |
| 926 |
|
| 927 |
C NARRATIVE -Wait until the locator is positioned, then return |
| 928 |
C the NDC value of the locator in X,Y. The fact that |
| 929 |
C the locator is positioned can be signaled in a |
| 930 |
C variety of device dependent ways, such as clicking |
| 931 |
C the switch in a tablet pen, hitting a button, or |
| 932 |
C hitting a key on the keyboard. Any information |
| 933 |
C contained in this signal is ignored by this |
| 934 |
C function, as only the locator position is returned. |
| 935 |
C This function flushes the output buffers before |
| 936 |
C doing input. |
| 937 |
|
| 938 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 939 |
|
| 940 |
REAL*4 X,Y |
| 941 |
|
| 942 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 943 |
1KCOMTP |
| 944 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 945 |
1 KBAUD,KCOMTP |
| 946 |
|
| 947 |
C BATCH DEVICES DON'T NEED TO FLUSH BUFFERS. |
| 948 |
|
| 949 |
C READ AN X,Y POSITION FROM COMPUTER DEPENDENT FILE |
| 950 |
C KINFL WITH FORMAT 2F10.7. |
| 951 |
READ(KINFL,10) X,Y |
| 952 |
10 FORMAT(2F10.7) |
| 953 |
|
| 954 |
RETURN |
| 955 |
END |
| 956 |
SUBROUTINE WMETBE |
| 957 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 958 |
|
| 959 |
C VDBELL -Ring Bell |
| 960 |
|
| 961 |
C R.W.SIMONS -02DEC80 |
| 962 |
|
| 963 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 964 |
C All Batch Devices. |
| 965 |
|
| 966 |
C ENTRY CONDITIONS - |
| 967 |
|
| 968 |
C CALLS - |
| 969 |
|
| 970 |
C EXIT CONDITIONS - |
| 971 |
|
| 972 |
C NARRATIVE -Ring user's bell to get his attention. This |
| 973 |
C function is ignored by batch devices. |
| 974 |
|
| 975 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 976 |
|
| 977 |
C THIS FUNCTION IS IGNORED BY BATCH DEVICES. |
| 978 |
|
| 979 |
RETURN |
| 980 |
END |
| 981 |
SUBROUTINE WMETLA(LOCX,LOCY) |
| 982 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 983 |
|
| 984 |
C VDSTLA -Set Initial Locator Position. |
| 985 |
|
| 986 |
C R.W.Simons -08APR81 |
| 987 |
|
| 988 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 989 |
C All Batch Devices. |
| 990 |
|
| 991 |
C ENTRY CONDITIONS -LOCX,LOCY = real NDC position that the locator is |
| 992 |
C initialized to. |
| 993 |
|
| 994 |
C CALLS - |
| 995 |
|
| 996 |
C EXIT CONDITIONS - |
| 997 |
|
| 998 |
C NARRATIVE -Set the initial locator position (light pen tracking |
| 999 |
C cross, for example) each time this function is |
| 1000 |
C called. |
| 1001 |
|
| 1002 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1003 |
|
| 1004 |
REAL*4 LOCX,LOCY |
| 1005 |
|
| 1006 |
C BATCH DEVICES IGNORE THIS FUNCTION. |
| 1007 |
|
| 1008 |
RETURN |
| 1009 |
END |
| 1010 |
SUBROUTINE WMETWT |
| 1011 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1012 |
|
| 1013 |
C VDWAIT -Wait for User. |
| 1014 |
|
| 1015 |
C R.W.SIMONS -02DEC80 |
| 1016 |
|
| 1017 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1018 |
C All Batch Devices. |
| 1019 |
|
| 1020 |
C ENTRY CONDITIONS - |
| 1021 |
|
| 1022 |
C CALLS - |
| 1023 |
|
| 1024 |
C EXIT CONDITIONS - |
| 1025 |
|
| 1026 |
C NARRATIVE -Wait for the user to view the screen and signal he |
| 1027 |
C is done, normally by hitting any key. This function |
| 1028 |
C flushes the output buffers before doing input. |
| 1029 |
|
| 1030 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1031 |
|
| 1032 |
C BATCH DEVICES IGNORE THIS COMMAND. |
| 1033 |
|
| 1034 |
RETURN |
| 1035 |
END |
| 1036 |
SUBROUTINE WMET05(N,NSTR) |
| 1037 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1038 |
|
| 1039 |
C VBINI1 -Virtual Device Initialization String Output. |
| 1040 |
|
| 1041 |
C R.W.Simons -18MAY81 |
| 1042 |
|
| 1043 |
C ENVIRONMENT -Computer-independent, System-independent, FORTRAN 77 |
| 1044 |
C Hard Copy Format 1. |
| 1045 |
|
| 1046 |
C ENTRY CONDITIONS -N = integer number of words in NSTR. (max=4) |
| 1047 |
C NSTR = integer array containing the string to be |
| 1048 |
C converted and output. The last character must |
| 1049 |
C be the string terminator. |
| 1050 |
|
| 1051 |
C CALLS -CDRCVT,CDR1CH,VBOUT. |
| 1052 |
|
| 1053 |
C EXIT CONDITIONS - |
| 1054 |
|
| 1055 |
C NARRATIVE -This routine converts a string from |
| 1056 |
C internal computer-dependent format to |
| 1057 |
C ASCII and sends it to the device. |
| 1058 |
|
| 1059 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1060 |
|
| 1061 |
INTEGER N |
| 1062 |
INTEGER*4 NSTR(4) |
| 1063 |
integer i, j |
| 1064 |
integer*4 itemp |
| 1065 |
integer*4 itemp1, itemp2 |
| 1066 |
integer itemp8 |
| 1067 |
|
| 1068 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 1069 |
1KCOMTP |
| 1070 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 1071 |
1 KBAUD,KCOMTP |
| 1072 |
|
| 1073 |
C KTERM = STRING TERMINATOR CHARACTER (\). |
| 1074 |
INTEGER*4 KTERM |
| 1075 |
DATA KTERM /92/ |
| 1076 |
|
| 1077 |
C LOOP THROUGH EACH CHARACTER IN EACH WORD OF NSTR. |
| 1078 |
DO I=1,N |
| 1079 |
DO J=1,KCPW |
| 1080 |
CALL CDR1CH(J,NSTR(I),ITEMP) |
| 1081 |
|
| 1082 |
C CONVERT CHARACTER. |
| 1083 |
CALL CDRCVT(ITEMP,ITEMP1) |
| 1084 |
C |
| 1085 |
C CHECK FOR END-OF-STRING CHARACTER. |
| 1086 |
IF (ITEMP1.EQ.KTERM) GO TO 20 |
| 1087 |
C |
| 1088 |
C SEND PAIRS OF CHARACTERS TO THE OUTPUT FILE. |
| 1089 |
IF(MOD(J,2).EQ.1) THEN |
| 1090 |
ITEMP2=ITEMP1 |
| 1091 |
ELSE |
| 1092 |
ITEMP8=256*ITEMP2+ITEMP1 |
| 1093 |
CALL WMET13S(ITEMP8) |
| 1094 |
ENDIF |
| 1095 |
END DO |
| 1096 |
END DO |
| 1097 |
C |
| 1098 |
C PAD WITH A BLANK IF NECESSARY TO MAKE NUMBER OF CHARS EVEN. |
| 1099 |
20 CONTINUE |
| 1100 |
IF(MOD(J,2).EQ.0) THEN |
| 1101 |
ITEMP8=256*ITEMP2+32 |
| 1102 |
CALL WMET13S(ITEMP8) |
| 1103 |
ENDIF |
| 1104 |
|
| 1105 |
RETURN |
| 1106 |
END |
| 1107 |
SUBROUTINE WMET06(RGB,MAXVAL,HLS) |
| 1108 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1109 |
|
| 1110 |
C VB2HLS - Transform RGB to HLS |
| 1111 |
|
| 1112 |
C P. Watterberg - 2 APR 81 |
| 1113 |
|
| 1114 |
C ENVIRONMENT - COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1115 |
|
| 1116 |
C ENTRY CONDITIONS - RGB = integer array with 3 elements specifying |
| 1117 |
C Red, RGB(1), range 0 - MAXVAL |
| 1118 |
C Green, RGB(2), range 0 - MAXVAL |
| 1119 |
C Blue, RGB(3), range 0 - MAXVAL |
| 1120 |
|
| 1121 |
C MAXVAL = integer, largest value that each of R, G or B |
| 1122 |
C can assume |
| 1123 |
|
| 1124 |
C CALLS - none |
| 1125 |
|
| 1126 |
C EXIT CONDITIONS - HLS = Real array with 3 elements specifying |
| 1127 |
C Hue, HLS(1), range 0. - 360. |
| 1128 |
C Lightness, HLS(2), range 0. - 1. |
| 1129 |
C Saturation, HLS(3), range 0. - 1. |
| 1130 |
|
| 1131 |
C NARRATIVE - This routine converts RGB to HLS. The interpretation |
| 1132 |
C of HLS is the one adopted by GSPC 79. |
| 1133 |
|
| 1134 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1135 |
|
| 1136 |
integer maxval |
| 1137 |
REAL*4 HLS(3), temp |
| 1138 |
INTEGER*4 RGB(3) |
| 1139 |
integer*4 ired, igre, iblu, maxc, minc, isum, idif |
| 1140 |
integer*4 maxlit |
| 1141 |
|
| 1142 |
C copy the inputs to locals |
| 1143 |
|
| 1144 |
IRED = RGB(1) |
| 1145 |
IGRE = RGB(2) |
| 1146 |
IBLU = RGB(3) |
| 1147 |
|
| 1148 |
c compute some useful quantities |
| 1149 |
|
| 1150 |
MAXC = MAX(IRED,IGRE,IBLU) |
| 1151 |
MINC = MIN(IRED,IGRE,IBLU) |
| 1152 |
ISUM = MAXC + MINC |
| 1153 |
IDIF = MAXC - MINC |
| 1154 |
MAXLIT = 2*MAXVAL |
| 1155 |
|
| 1156 |
c getting lightness is easy |
| 1157 |
|
| 1158 |
HLS(2) = DBLE(ISUM)/DBLE(MAXLIT) |
| 1159 |
|
| 1160 |
c getting saturation is a little more difficult |
| 1161 |
|
| 1162 |
IF(IDIF.EQ.0) THEN |
| 1163 |
HLS(3) = 0. |
| 1164 |
ELSE |
| 1165 |
IF(ISUM.LE.MAXVAL) THEN |
| 1166 |
HLS(3) = DBLE(IDIF)/ISUM |
| 1167 |
ELSE |
| 1168 |
HLS(3) = DBLE(IDIF)/(MAXLIT-ISUM) |
| 1169 |
ENDIF |
| 1170 |
ENDIF |
| 1171 |
|
| 1172 |
c getting hue is a little harder yet |
| 1173 |
|
| 1174 |
IF(IDIF.EQ.0) THEN |
| 1175 |
TEMP = 0. |
| 1176 |
ELSE |
| 1177 |
TEMP = 60./IDIF |
| 1178 |
ENDIF |
| 1179 |
|
| 1180 |
c is the maximum color red? |
| 1181 |
|
| 1182 |
IF(MAXC.EQ.IRED) THEN |
| 1183 |
HLS(1) = 120. + ((IGRE-MINC) - (IBLU-MINC))*TEMP |
| 1184 |
|
| 1185 |
c is it green? |
| 1186 |
|
| 1187 |
ELSE IF(MAXC.EQ.IGRE) THEN |
| 1188 |
HLS(1) = 240. + ((IBLU-MINC) - (IRED-MINC))*TEMP |
| 1189 |
|
| 1190 |
c well then, it must be blue |
| 1191 |
|
| 1192 |
ELSE |
| 1193 |
IF(IRED.GE.IGRE) THEN |
| 1194 |
HLS(1) = (IRED-MINC)*TEMP |
| 1195 |
ELSE |
| 1196 |
HLS(1) = 360. - (IGRE-MINC)*TEMP |
| 1197 |
ENDIF |
| 1198 |
ENDIF |
| 1199 |
|
| 1200 |
RETURN |
| 1201 |
END |
| 1202 |
SUBROUTINE WMET07(HLS,RGB,MAXVAL) |
| 1203 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1204 |
|
| 1205 |
C VB2RGB - Transform HLS to RGB |
| 1206 |
|
| 1207 |
C P. Watterberg - 30 MAR 81 |
| 1208 |
|
| 1209 |
C ENVIRONMENT - COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1210 |
|
| 1211 |
C ENTRY CONDITIONS - HLS = Real array with 3 elements specifying |
| 1212 |
C Hue, HLS(1), range 0. - 360. |
| 1213 |
C Lightness, HLS(2), range 0. - 1. |
| 1214 |
C Saturation, HLS(3), range 0. - 1. |
| 1215 |
|
| 1216 |
C MAXVAL = integer, largest value that any of R, G or B |
| 1217 |
C can assume |
| 1218 |
|
| 1219 |
C CALLS - none |
| 1220 |
|
| 1221 |
C EXIT CONDITIONS - RGB = integer array with 3 elements specifying |
| 1222 |
C Red, RGB(1), range 0 - MAXVAL |
| 1223 |
C Green, RGB(2), range 0 - MAXVAL |
| 1224 |
C Blue , RGB(3), range 0 - MAXVAL |
| 1225 |
|
| 1226 |
C NARRATIVE - This routine converts HLS to RGB. The interpretation |
| 1227 |
C of HLS is the one adopted by GSPC 79. |
| 1228 |
|
| 1229 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1230 |
|
| 1231 |
INTEGER MAXVAL |
| 1232 |
REAL*4 HLS(3), LIT, HUE, SAT, f |
| 1233 |
INTEGER*4 RGB(3), inten, irange, irang2, isplus |
| 1234 |
integer*4 iv1, iv2, iv3, iv4, ib, ig, ir |
| 1235 |
integer*4 ijump, zero |
| 1236 |
integer*4 imaxval |
| 1237 |
|
| 1238 |
zero = 0 |
| 1239 |
imaxval = maxval |
| 1240 |
|
| 1241 |
C copy the inputs to locals |
| 1242 |
|
| 1243 |
HUE = HLS(1) |
| 1244 |
LIT = HLS(2) |
| 1245 |
SAT = HLS(3) |
| 1246 |
|
| 1247 |
C find out which major hue (0 - 5) we are interested in |
| 1248 |
|
| 1249 |
HUE = HUE/60. |
| 1250 |
|
| 1251 |
C avoid the maximum boundary conditions |
| 1252 |
|
| 1253 |
IF(HUE.GE.6.) HUE = 5.99 |
| 1254 |
IF(SAT.GE.1.) SAT = .99 |
| 1255 |
IF(LIT.GE.1.) LIT = .99 |
| 1256 |
|
| 1257 |
C the conversions and convolutions that happen here are not |
| 1258 |
C very easy to understand. It's best to talk to Peter but |
| 1259 |
C if you need to try to decipher it yourself, you might try |
| 1260 |
C by first assuming a saturation of 1. That way, irang2=irange, |
| 1261 |
C isplus goes away and you are left with the outer shell of |
| 1262 |
C rgb color cube to deal with. |
| 1263 |
|
| 1264 |
C ijump represents one of the six edges of the color cube |
| 1265 |
C connecting the six major hues. |
| 1266 |
|
| 1267 |
IJUMP = HUE |
| 1268 |
|
| 1269 |
c f is the distance (0.-.999) along an edge between two major hues |
| 1270 |
|
| 1271 |
F = HUE - IJUMP |
| 1272 |
INTEN = LIT*DBLE(2*IMAXVAL+1) |
| 1273 |
|
| 1274 |
c irange is the range a color may take on (i.e. maxval adjusted for |
| 1275 |
c intensity |
| 1276 |
c irang2 is irange adjusted for saturation |
| 1277 |
|
| 1278 |
IRANGE = IMAXVAL - ABS(INTEN-IMAXVAL) |
| 1279 |
C ... This is done for the 8-byte systems so we can pass native int to mod intrinsic |
| 1280 |
IRANGT = IRANGE |
| 1281 |
IRANG2 = 2*(INT((IRANGT/2+1)*SAT)) + MOD(IRANGT,2) |
| 1282 |
|
| 1283 |
c isplus is an additive to account for saturation |
| 1284 |
|
| 1285 |
ISPLUS = (IRANGE-IRANG2)/2 |
| 1286 |
IV1 = MIN(INTEN,IMAXVAL) - ISPLUS |
| 1287 |
IV2 = MAX(zero,INTEN-IMAXVAL) + ISPLUS |
| 1288 |
IV3 = F*IRANG2 + .5 + IV2 |
| 1289 |
IV4 = (1.-F)*IRANG2 + .5 + IV2 |
| 1290 |
GOTO (610,620,630,640,650,660),IJUMP+1 |
| 1291 |
|
| 1292 |
610 IB = IV1 |
| 1293 |
IG = IV2 |
| 1294 |
IR = IV3 |
| 1295 |
GOTO 670 |
| 1296 |
|
| 1297 |
620 IR = IV1 |
| 1298 |
IG = IV2 |
| 1299 |
IB = IV4 |
| 1300 |
GOTO 670 |
| 1301 |
|
| 1302 |
630 IR = IV1 |
| 1303 |
IB = IV2 |
| 1304 |
IG = IV3 |
| 1305 |
GOTO 670 |
| 1306 |
|
| 1307 |
640 IG = IV1 |
| 1308 |
IB = IV2 |
| 1309 |
IR = IV4 |
| 1310 |
GOTO 670 |
| 1311 |
|
| 1312 |
650 IG = IV1 |
| 1313 |
IR = IV2 |
| 1314 |
IB = IV3 |
| 1315 |
GOTO 670 |
| 1316 |
|
| 1317 |
660 IB = IV1 |
| 1318 |
IR = IV2 |
| 1319 |
IG = IV4 |
| 1320 |
|
| 1321 |
670 RGB(1) = IR |
| 1322 |
RGB(2) = IG |
| 1323 |
RGB(3) = IB |
| 1324 |
|
| 1325 |
RETURN |
| 1326 |
END |
| 1327 |
SUBROUTINE WMETFL |
| 1328 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1329 |
|
| 1330 |
C VDBUFL -Buffer Flush. |
| 1331 |
|
| 1332 |
C K.M.ERICKSON -04 MAY 81 |
| 1333 |
|
| 1334 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1335 |
|
| 1336 |
C ENTRY CONDITIONS - |
| 1337 |
|
| 1338 |
C CALLS -VBOUT |
| 1339 |
|
| 1340 |
C EXIT CONDITIONS - |
| 1341 |
|
| 1342 |
C NARRATIVE -Assure that the picture is up-to-date by flushing |
| 1343 |
C buffers if necessary. This is necessary to |
| 1344 |
C guarantee that the picture is in a certain state |
| 1345 |
C before interacting with it. |
| 1346 |
C -set terminal to alpha mode in order to facilitate |
| 1347 |
c fortran IO. |
| 1348 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1349 |
|
| 1350 |
c flush buffers |
| 1351 |
c modified 2-23-87 to be a dummy routine by JFM. |
| 1352 |
C** CALL VBOUT(0,1) |
| 1353 |
RETURN |
| 1354 |
END |
| 1355 |
SUBROUTINE WMETIC(NUM,INDEX,CLRARY,CLRMOD) |
| 1356 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1357 |
|
| 1358 |
C VDIQCO - Inquire Color Table. |
| 1359 |
|
| 1360 |
C K.M.Erickson - 04 May 81 |
| 1361 |
|
| 1362 |
C ENVIRONMENT - COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1363 |
|
| 1364 |
C ENTRY CONDITIONS - NUM = integer number of color indexes to inquire. |
| 1365 |
C Range 1-256. |
| 1366 |
C INDEX = integer array of indexes to inquire. Range |
| 1367 |
C 0-255. |
| 1368 |
C CLRMOD = integer color model to be used. Range 0,1. |
| 1369 |
|
| 1370 |
C CALLS - vb2hls |
| 1371 |
|
| 1372 |
C EXIT CONDITIONS - CLRARY = real array of 3 by NUM elements returning |
| 1373 |
C the values of the components of the indexes inquired. |
| 1374 |
C Range for rgb: 0. - 1. |
| 1375 |
C Range for hls: hue 0. - 360. |
| 1376 |
C l & s 0. - 1. |
| 1377 |
|
| 1378 |
C NARRATIVE - Inquire one or more color table entries. NUM and |
| 1379 |
C INDEX specify how many and which indexes are being |
| 1380 |
C inquired. CLRMOD specifies which color model |
| 1381 |
C (0=RGB, 1=HLS) should be used in constructing values |
| 1382 |
C to return in CLRARY. A device which does not |
| 1383 |
C support the color table indexes specified will |
| 1384 |
C return -1. in the first element of the CLRARY value |
| 1385 |
C for that index. |
| 1386 |
|
| 1387 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1388 |
|
| 1389 |
INTEGER*4 NUM,INDEX(NUM),CLRMOD, RGB(3) |
| 1390 |
REAL*4 CLRARY(3,NUM) |
| 1391 |
|
| 1392 |
INTEGER*4 CLRTAB(256,3) |
| 1393 |
COMMON /WMET08/ CLRTAB |
| 1394 |
|
| 1395 |
C check for valid num. |
| 1396 |
|
| 1397 |
integer*4 i, indexn |
| 1398 |
|
| 1399 |
IF(NUM.LT.1.OR.NUM.GT.256) THEN |
| 1400 |
CALL WMETER(723,5) |
| 1401 |
GOTO 999 |
| 1402 |
END IF |
| 1403 |
|
| 1404 |
C check for valid clrmod. |
| 1405 |
|
| 1406 |
IF(CLRMOD.NE.0.AND.CLRMOD.NE.1) THEN |
| 1407 |
CALL WMETER(725,5) |
| 1408 |
GOTO 999 |
| 1409 |
END IF |
| 1410 |
|
| 1411 |
C check for valid indexes. |
| 1412 |
|
| 1413 |
DO I=1,NUM |
| 1414 |
INDEXN=INDEX(I) |
| 1415 |
IF(INDEXN.LT.0.OR.INDEXN.GT.255) THEN |
| 1416 |
CALL WMETER(724,5) |
| 1417 |
GOTO 100 |
| 1418 |
END IF |
| 1419 |
RGB(1) =CLRTAB(INDEX(I)+1,1) |
| 1420 |
RGB(2) =CLRTAB(INDEX(I)+1,2) |
| 1421 |
RGB(3) =CLRTAB(INDEX(I)+1,3) |
| 1422 |
IF(CLRMOD.EQ.0) THEN |
| 1423 |
CLRARY(1,I) = RGB(1)/255. |
| 1424 |
CLRARY(2,I) = RGB(2)/255. |
| 1425 |
CLRARY(3,I) = RGB(3)/255. |
| 1426 |
ELSE |
| 1427 |
CALL WMET06(RGB,255,CLRARY(1,I)) |
| 1428 |
ENDIF |
| 1429 |
100 continue |
| 1430 |
end do |
| 1431 |
999 RETURN |
| 1432 |
END |
| 1433 |
SUBROUTINE WMETCP(X,Y) |
| 1434 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1435 |
|
| 1436 |
C VDIQCP -Inquire Where Current Position Is. |
| 1437 |
|
| 1438 |
C K.M. ERICKSON -14 NOV 80 |
| 1439 |
|
| 1440 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1441 |
|
| 1442 |
C ENTRY CONDITIONS - |
| 1443 |
|
| 1444 |
C CALLS - |
| 1445 |
|
| 1446 |
C EXIT CONDITIONS -X,Y = real NDC position. |
| 1447 |
|
| 1448 |
C NARRATIVE -Return the value of current position. |
| 1449 |
|
| 1450 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1451 |
COMMON /WMET09/XCP,YCP |
| 1452 |
REAL*4 XCP,YCP |
| 1453 |
REAL*4 X,Y |
| 1454 |
|
| 1455 |
C ASSIGN THE CP TO X,Y |
| 1456 |
|
| 1457 |
X=XCP |
| 1458 |
Y=YCP |
| 1459 |
RETURN |
| 1460 |
END |
| 1461 |
SUBROUTINE WMETCO(NUM,INDEX,CLRARY,CLRMOD) |
| 1462 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1463 |
|
| 1464 |
C VDSTCO - Set Color Table. |
| 1465 |
|
| 1466 |
C K.M.ERICKSON -04 MAY 81 |
| 1467 |
|
| 1468 |
C ENVIRONMENT - COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1469 |
|
| 1470 |
C ENTRY CONDITIONS - NUM = integer number of color indexes to be set. |
| 1471 |
C Range 1-256. |
| 1472 |
C INDEX = integer array of indexes to be set. Range |
| 1473 |
C 0-255. |
| 1474 |
C CLRARY = real array of 3 by NUM elements specifying |
| 1475 |
C the values of the components of the index to be |
| 1476 |
C set. |
| 1477 |
C Range for RGB: red 0.0 - 1.0 |
| 1478 |
C green 0.0 - 1.0 |
| 1479 |
C blue 0.0 - 1.0 |
| 1480 |
C Range for HLS: hue 0.0 - 360.0 |
| 1481 |
C lightness 0.0 - 1.0 |
| 1482 |
C saturation 0.0 - 1.0 |
| 1483 |
C Default: |
| 1484 |
C Index Color RGB Values |
| 1485 |
C 0 black 0.,0.,0. |
| 1486 |
C 1 red 1.,0.,0. |
| 1487 |
C 2 green 0.,1.,0. |
| 1488 |
C 3 yellow 1.,1.,0. |
| 1489 |
C 4 blue 0.,0.,1. |
| 1490 |
C 5 magenta 1.,0.,1. |
| 1491 |
C 6 cyan 0.,1.,1. |
| 1492 |
C 7 white 1.,1.,1. |
| 1493 |
C CLRMOD = integer color model being used. Range 0,1. |
| 1494 |
C Default: 0 (RGB). |
| 1495 |
|
| 1496 |
C CALLS - VBOUT |
| 1497 |
|
| 1498 |
C EXIT CONDITIONS - The Dicomed color table has been set |
| 1499 |
|
| 1500 |
C NARRATIVE - Set one or more color table entries. This is a |
| 1501 |
C dynamic setting, if the device will support it. |
| 1502 |
C "Dynamic" neans that primitives which have already |
| 1503 |
C been drawn will change their appearance when a |
| 1504 |
C dynamic setting is changed. INDEX is the |
| 1505 |
C position (or array of positions) in the table |
| 1506 |
C (0-255). CLRARY is a three-element vector (or 3 by |
| 1507 |
C NUM array) with the fractions (0.-1.) of RGB or |
| 1508 |
C values (0.0-360.0, 0.0-1.0, 0.0-1.0) of HLS. |
| 1509 |
C A translator for HLS to RGB will be used from |
| 1510 |
C GSPC79. CLRMOD specifies which color model is being |
| 1511 |
C used (0=RGB, 1=HLS). |
| 1512 |
C All devices must support at least a single device |
| 1513 |
C dependent value for each of red, green, and blue and |
| 1514 |
C the corresponding values for hue, lightness, and |
| 1515 |
C saturation. If unsupported values are specified, |
| 1516 |
C set to the closest supported values. |
| 1517 |
C All devices must support both RGB and HLS color |
| 1518 |
C models. |
| 1519 |
C All devices must support at least a single device |
| 1520 |
C dependent INDEX value in the range 0-7. If an |
| 1521 |
C unsupported value is |
| 1522 |
C specified, it should be ignored. |
| 1523 |
|
| 1524 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1525 |
|
| 1526 |
INTEGER*4 NUM, INDEX(NUM), CLRMOD, RGB(3), i |
| 1527 |
REAL*4 CLRARY(3,NUM) |
| 1528 |
|
| 1529 |
INTEGER*4 CLRTAB(256,3) |
| 1530 |
COMMON /WMET08/ CLRTAB |
| 1531 |
|
| 1532 |
c batch update mode--c700 |
| 1533 |
INTEGER IBATUP |
| 1534 |
|
| 1535 |
c send color table--c800 |
| 1536 |
INTEGER ISNDCO |
| 1537 |
|
| 1538 |
INTEGER*4 IBUF(6) |
| 1539 |
DATA IBUF/36869,5*0/ |
| 1540 |
c ibuf (1) (2) (3) (4) (5) (6) |
| 1541 |
c 9005 index z R g Y B M C W |
| 1542 |
|
| 1543 |
DATA IBATUP/50944/ |
| 1544 |
DATA ISNDCO/51200/ |
| 1545 |
|
| 1546 |
c check for valid NUM. |
| 1547 |
|
| 1548 |
IF(NUM.LT.1.OR.NUM.GT.256) THEN |
| 1549 |
CALL WMETER(723,5) |
| 1550 |
GOTO 999 |
| 1551 |
END IF |
| 1552 |
|
| 1553 |
c check for valid clrmod. |
| 1554 |
|
| 1555 |
IF(CLRMOD.NE.0.AND.CLRMOD.NE.1) THEN |
| 1556 |
CALL WMETER(725,5) |
| 1557 |
GOTO 999 |
| 1558 |
END IF |
| 1559 |
|
| 1560 |
c send batch update mode |
| 1561 |
CALL WMET13S(IBATUP) |
| 1562 |
c check for valid indexes. |
| 1563 |
|
| 1564 |
DO 100 I=1,NUM |
| 1565 |
IF(INDEX(I).LT.0.OR.INDEX(I).GT.255) THEN |
| 1566 |
CALL WMETER(724,5) |
| 1567 |
GOTO 100 |
| 1568 |
END IF |
| 1569 |
|
| 1570 |
IBUF(2) = INDEX(I) |
| 1571 |
c check for valid clrary. |
| 1572 |
c rgb |
| 1573 |
|
| 1574 |
IF(CLRMOD.EQ.0) THEN |
| 1575 |
IF( CLRARY(1,I).LT.0..OR.CLRARY(1,I).GT.1. |
| 1576 |
X .OR.CLRARY(2,I).LT.0..OR.CLRARY(2,I).GT.1. |
| 1577 |
X .OR.CLRARY(3,I).LT.0..OR.CLRARY(3,I).GT.1.) THEN |
| 1578 |
CALL WMETER(727,5) |
| 1579 |
GOTO 100 |
| 1580 |
END IF |
| 1581 |
IBUF(3)=INT(255.99*CLRARY(1,I)) |
| 1582 |
c zero/red |
| 1583 |
IBUF(4)=INT(255.99*CLRARY(2,I))*256 |
| 1584 |
c green/yellow |
| 1585 |
IBUF(5)=INT(255.99*CLRARY(3,I)) *256 |
| 1586 |
c blue/magenta |
| 1587 |
|
| 1588 |
ELSE |
| 1589 |
c hls |
| 1590 |
|
| 1591 |
IF( CLRARY(1,I).LT.0..OR.CLRARY(1,I).GT.360. |
| 1592 |
X .OR.CLRARY(2,I).LT.0..OR.CLRARY(2,I).GT.1. |
| 1593 |
X .OR.CLRARY(3,I).LT.0..OR.CLRARY(3,I).GT.1.) THEN |
| 1594 |
CALL WMETER(727,5) |
| 1595 |
GOTO 100 |
| 1596 |
END IF |
| 1597 |
CALL WMET07(CLRARY(1,I),RGB,15) |
| 1598 |
IBUF(3)=INT(255.99*RGB(1)) |
| 1599 |
c red |
| 1600 |
IBUF(4)=INT(255.99*RGB(2))*256 |
| 1601 |
c green |
| 1602 |
IBUF(5)=INT(255.99*RGB(3))*256 |
| 1603 |
c blue |
| 1604 |
|
| 1605 |
END IF |
| 1606 |
c store color table values |
| 1607 |
|
| 1608 |
CLRTAB(IBUF(2)+1,1)=IBUF(3) |
| 1609 |
CLRTAB(IBUF(2)+1,2)=IBUF(4)/256 |
| 1610 |
CLRTAB(IBUF(2)+1,3)=IBUF(5)/256 |
| 1611 |
|
| 1612 |
CALL WMET13(6,IBUF) |
| 1613 |
100 CONTINUE |
| 1614 |
|
| 1615 |
999 CALL WMET13S(ISNDCO) |
| 1616 |
c send color table |
| 1617 |
RETURN |
| 1618 |
END |
| 1619 |
SUBROUTINE WMETFC(COLOR) |
| 1620 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1621 |
|
| 1622 |
C VDSTFC -Set Foreground Color. |
| 1623 |
|
| 1624 |
C K.M. ERICKSON -12 NOV 80 |
| 1625 |
|
| 1626 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1627 |
|
| 1628 |
C ENTRY CONDITIONS -COLOR = integer color table index . Range 0-255. |
| 1629 |
C Default is device dependent, in range 0-7. |
| 1630 |
|
| 1631 |
C CALLS - |
| 1632 |
|
| 1633 |
C EXIT CONDITIONS -VECTOR(1) = real updated foreground color (COLOR). |
| 1634 |
|
| 1635 |
C NARRATIVE -Set the foreground color index, i.e., the color |
| 1636 |
C table index used for drawing future primitives. |
| 1637 |
C Color is an integer from 0-255 which is used as an |
| 1638 |
C index into the color table (see VDSTCO). |
| 1639 |
C All devices must support at least a single device |
| 1640 |
C dependent value in the range 0-7. |
| 1641 |
C If an unsupported value is specified, set to |
| 1642 |
C default. |
| 1643 |
|
| 1644 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1645 |
|
| 1646 |
INTEGER*4 COLOR |
| 1647 |
|
| 1648 |
INTEGER*4 COL(2) |
| 1649 |
|
| 1650 |
REAL*4 VECTOR(7) |
| 1651 |
COMMON /WMET04/ VECTOR |
| 1652 |
|
| 1653 |
DATA COL/37121,0/ |
| 1654 |
|
| 1655 |
C CHECK FOR VALID COLOR. |
| 1656 |
IF(COLOR.LT.0.OR.COLOR.GT.255) THEN |
| 1657 |
CALL WMETER(724,5) |
| 1658 |
GOTO 999 |
| 1659 |
END IF |
| 1660 |
|
| 1661 |
C VECTOR(1)=FOREGROUND COLOR |
| 1662 |
C (2)=BACKGROUND COLOR |
| 1663 |
C (3)=INTENSITY |
| 1664 |
C (4)=LINE STYLE |
| 1665 |
C (5)=LINE WIDTH |
| 1666 |
C (6)=CHARACTER BOX Y |
| 1667 |
C (7)=CHARACTER BOX X |
| 1668 |
VECTOR(1)=COLOR |
| 1669 |
COL(2)=COLOR |
| 1670 |
CALL WMET13(2,COL) |
| 1671 |
999 RETURN |
| 1672 |
END |
| 1673 |
SUBROUTINE WMETLW(LINWTH) |
| 1674 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1675 |
|
| 1676 |
C VDSTLW -Set Line Width. |
| 1677 |
|
| 1678 |
C K.M. ERICKSON -14 NOV 80 |
| 1679 |
|
| 1680 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1681 |
|
| 1682 |
C ENTRY CONDITIONS -LINWTH = real line width of line drawing output |
| 1683 |
C primitives. Range 0.-1. Default: device dependent. |
| 1684 |
|
| 1685 |
C CALLS - |
| 1686 |
|
| 1687 |
C EXIT CONDITIONS -VECTOR(5) = real updated line width (LINWTH). |
| 1688 |
|
| 1689 |
C NARRATIVE -Set the relative width of an output line. Values |
| 1690 |
C are 0.-1. with 1. being .01 in NDC space. |
| 1691 |
C All devices must support at least a single device |
| 1692 |
C dependent value that is the default. If an |
| 1693 |
C unsupported value is specified, set to the closest |
| 1694 |
C supported line width. |
| 1695 |
|
| 1696 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1697 |
|
| 1698 |
REAL*4 LINWTH |
| 1699 |
|
| 1700 |
INTEGER*4 LW(2) |
| 1701 |
|
| 1702 |
REAL*4 VECTOR(7) |
| 1703 |
COMMON /WMET04/ VECTOR |
| 1704 |
C CURRENT ATTRIBUTE VALUES. (DEVICE-INDEPENDENT) |
| 1705 |
C REAL*4 VECTOR(7) |
| 1706 |
C COMMON /VCATTR/ VECTOR |
| 1707 |
C VECTOR(1)=FOREGROUND COLOR |
| 1708 |
C (2)=BACKGROUND COLOR |
| 1709 |
C (3)=INTENSITY |
| 1710 |
C (4)=LINE STYLE |
| 1711 |
C (5)=LINE WIDTH |
| 1712 |
C (6)=CHARACTER BOX Y |
| 1713 |
C (7)=CHARACTER BOX X |
| 1714 |
|
| 1715 |
DATA LW/43265,0/ |
| 1716 |
|
| 1717 |
C CHECK FOR VALID LINWTH. |
| 1718 |
IF(LINWTH.LT.0.0.OR.LINWTH.GT.1.0) THEN |
| 1719 |
CALL WMETER(401,5) |
| 1720 |
GOTO 999 |
| 1721 |
END IF |
| 1722 |
|
| 1723 |
C ASSIGN VECTOR(5) |
| 1724 |
|
| 1725 |
VECTOR(5)=LINWTH |
| 1726 |
|
| 1727 |
C MAP 0.-1. INTO 0.-32767; FOR DICOMED |
| 1728 |
C 1. IS .01 IN NDC SPACE |
| 1729 |
|
| 1730 |
C LW(2)=LINWTH*32767*.01 |
| 1731 |
LW(2)=LINWTH*32767 |
| 1732 |
|
| 1733 |
C SEND BGP COMMAND |
| 1734 |
|
| 1735 |
CALL WMET13(2,LW) |
| 1736 |
|
| 1737 |
999 RETURN |
| 1738 |
END |
| 1739 |
SUBROUTINE WMETIG |
| 1740 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1741 |
|
| 1742 |
C VINWPG -New Page. |
| 1743 |
|
| 1744 |
C R.W.Simons -15MAY81 |
| 1745 |
|
| 1746 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1747 |
C Hard Copy Format 1. |
| 1748 |
|
| 1749 |
C ENTRY CONDITIONS - |
| 1750 |
|
| 1751 |
C CALLS -VBOUT. |
| 1752 |
|
| 1753 |
C EXIT CONDITIONS - |
| 1754 |
|
| 1755 |
C NARRATIVE -Physically advance the medium or clear the screen, |
| 1756 |
C whichever is appropriate. Also flood the screen |
| 1757 |
C with the background color on devices that support |
| 1758 |
C this. The current position is not changed. |
| 1759 |
|
| 1760 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1761 |
|
| 1762 |
C OUTARY = NEW PAGE COMMAND |
| 1763 |
C = 8505,FFFF,FFFF,FFFF,PAGE NUMBER,0 IN HEX |
| 1764 |
C = 34053,65535,65535,65535,PAGE NUMBER,0 |
| 1765 |
INTEGER*4 OUTARY(6) |
| 1766 |
DATA OUTARY /34053,65535,65535,65535,0,0/ |
| 1767 |
|
| 1768 |
C SEND A NEW PAGE COMMAND TO THE PLOT FILE. |
| 1769 |
C INCREMENT THE PAGE NUMBER. |
| 1770 |
OUTARY(5)=OUTARY(5)+1 |
| 1771 |
CALL WMET13(6,OUTARY) |
| 1772 |
CALL WMETMO(1) |
| 1773 |
|
| 1774 |
RETURN |
| 1775 |
END |
| 1776 |
SUBROUTINE WMETIM(X,Y) |
| 1777 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1778 |
|
| 1779 |
C VIMOVA -Move Absolute. |
| 1780 |
|
| 1781 |
C R.W.Simons -15MAY81 |
| 1782 |
|
| 1783 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1784 |
C Hard Copy Format 1. |
| 1785 |
|
| 1786 |
C ENTRY CONDITIONS -X,Y = real NDC position. |
| 1787 |
|
| 1788 |
C CALLS -VBOUT. |
| 1789 |
|
| 1790 |
C EXIT CONDITIONS -XCP,YCP = real updated current position. (XNDC,YNDC) |
| 1791 |
|
| 1792 |
C NARRATIVE -Set current position to absolute NDC position X,Y. |
| 1793 |
|
| 1794 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1795 |
|
| 1796 |
REAL*4 X,Y |
| 1797 |
|
| 1798 |
INTEGER*4 OUTARY(2) |
| 1799 |
|
| 1800 |
C CURRENT POSITION. (LXY,HC1) |
| 1801 |
REAL*4 XCP,YCP |
| 1802 |
COMMON /WMET09/ XCP,YCP |
| 1803 |
C Include '[VDIMAINT.COMMON]VCCRPS' |
| 1804 |
|
| 1805 |
C SCALE FACTORS FOR NDC TO DC MAPPING. (LXY) |
| 1806 |
REAL*4 XSCALE,YSCALE |
| 1807 |
COMMON /WMET10/ XSCALE,YSCALE |
| 1808 |
|
| 1809 |
C DC DIMENSIONS OF OFFSETS AND PICTURE. (LXY,HC1) |
| 1810 |
REAL*4 XPAD,YPAD,XDEVIC,YDEVIC |
| 1811 |
COMMON /WMET11/ XPAD,YPAD,XDEVIC,YDEVIC |
| 1812 |
|
| 1813 |
C CONVERT TO SCREEN UNITS. |
| 1814 |
C SET BIT 15 OF X = 0 TO INDICATE A COORDINATE POSITIONING COMMAND. |
| 1815 |
C SET BIT 15 OF Y = 0 TO INDICATE A DRAW COMMAND. |
| 1816 |
C ASSUME X AND Y ARE < 32768, WHICH WILL BE TRUE IF XNDC AND YNDC |
| 1817 |
C ARE IN THE PROPER RANGE. |
| 1818 |
OUTARY(1)=X*XSCALE+XPAD |
| 1819 |
OUTARY(2)=Y*YSCALE+YPAD |
| 1820 |
|
| 1821 |
C SEND THE COMMAND TO THE PLOT FILE. |
| 1822 |
CALL WMET13(2,OUTARY) |
| 1823 |
|
| 1824 |
C UPDATE CURRENT POSITION. |
| 1825 |
XCP=X |
| 1826 |
YCP=Y |
| 1827 |
|
| 1828 |
RETURN |
| 1829 |
END |
| 1830 |
SUBROUTINE WMETES(ESCPCD,N,ARGS) |
| 1831 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1832 |
|
| 1833 |
C VDESCP -Escape Code Routine. |
| 1834 |
|
| 1835 |
C K.M. ERICKSON -4 MAY 81 |
| 1836 |
|
| 1837 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1838 |
|
| 1839 |
C ENTRY CONDITIONS -ESCPCD = integer escape function code. |
| 1840 |
C N = integer number of arguments in ARG. RANGE 0-. |
| 1841 |
C ARGS = real array of arguments for the escape |
| 1842 |
C function specified. |
| 1843 |
|
| 1844 |
C CALLS -vbout |
| 1845 |
|
| 1846 |
C EXIT CONDITIONS - |
| 1847 |
|
| 1848 |
C NARRATIVE -Invoke the nonstandard, device-dependent function |
| 1849 |
C ESCPCD. N is the number of arguments used by this |
| 1850 |
C function and ARGS is a real array containing those |
| 1851 |
C arguments. |
| 1852 |
|
| 1853 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1854 |
|
| 1855 |
INTEGER*4 ESCPCD,N, i |
| 1856 |
C N COULD BE EQUAL TO 0 SO: |
| 1857 |
REAL*4 ARGS(N+1), ARG |
| 1858 |
REAL*4 ONE |
| 1859 |
|
| 1860 |
INTEGER*4 IBUF(4) |
| 1861 |
ONE = 1.0 |
| 1862 |
|
| 1863 |
C CHECK FOR VALID N. |
| 1864 |
IF(N.LT.0) THEN |
| 1865 |
CALL WMETER(802,5) |
| 1866 |
GOTO 999 |
| 1867 |
END IF |
| 1868 |
|
| 1869 |
C meta file escapes 800 - |
| 1870 |
|
| 1871 |
IF(ESCPCD.EQ.800) THEN |
| 1872 |
|
| 1873 |
C SEND ASPECT RATIO |
| 1874 |
IBUF(1) = 33539 |
| 1875 |
IBUF(2) = 32767.*MIN(ARGS(1),ONE) |
| 1876 |
IBUF(3) = 32767./MAX(ARGS(1),ONE) |
| 1877 |
IBUF(4) = 0 |
| 1878 |
CALL WMET13(4,IBUF) |
| 1879 |
ENDIF |
| 1880 |
|
| 1881 |
C ALL OTHER ESCAPE CODES |
| 1882 |
|
| 1883 |
C FIRST CHECK IF THIS IS AN ESCAPE WITH ALPHA ARGUMENTS |
| 1884 |
|
| 1885 |
IF(ESCPCD.EQ.250) THEN |
| 1886 |
ELSE |
| 1887 |
|
| 1888 |
C ALL OTHER ESCAPES HAVE REAL NUMBER ARGUMENTS |
| 1889 |
C SEND 82xx 01nn ESCPCD ARGS(1) ... ARGS(N) |
| 1890 |
C xx is 2*(N+1) and nn is 2*N+1 |
| 1891 |
C and each arg is sent as a fixed point real with sixteen bits |
| 1892 |
C integer and sixteen bits fraction. |
| 1893 |
|
| 1894 |
IBUF(1) = 33280 + 2*(N+1) |
| 1895 |
IBUF(2) = 256 + 2*N + 1 |
| 1896 |
IBUF(3) = ESCPCD |
| 1897 |
CALL WMET13(3,IBUF) |
| 1898 |
DO 10 I=1,N |
| 1899 |
ARG = ARGS(I) |
| 1900 |
IBUF(1) = ARG |
| 1901 |
IBUF(2) = (ARG-IBUF(1))*32768. |
| 1902 |
IF(ARGS(I).LT.0.) IBUF(1) = IBUF(1) + 32768 |
| 1903 |
CALL WMET13(2,IBUF) |
| 1904 |
10 CONTINUE |
| 1905 |
ENDIF |
| 1906 |
|
| 1907 |
999 RETURN |
| 1908 |
END |
| 1909 |
SUBROUTINE WMET12(XARRAY,YARRAY,NPTS) |
| 1910 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1911 |
|
| 1912 |
C VIPOLY -POLYGON FILL ROUTINE |
| 1913 |
|
| 1914 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 1915 |
|
| 1916 |
C ENTRY CONDITIONS -XARRAY-ARRAY OF X VALUES OF THE POLYGON |
| 1917 |
C YARRAY-CORRESPONDING ARRAY OF Y VALUES |
| 1918 |
C NPTS- NUMBER OF POINTS IN (XARRAY,YARRAY) |
| 1919 |
|
| 1920 |
C CALLS - |
| 1921 |
|
| 1922 |
C EXIT CONDITIONS - |
| 1923 |
|
| 1924 |
C NARRATIVE -The polygon defined by XARRAY,YARRAY will be drawn |
| 1925 |
C and filled (constrained by any limitations of the |
| 1926 |
C physical device -- see below). No checking will be |
| 1927 |
C done -- all points will be passed to the device. |
| 1928 |
C Current foreground color is used and the polygon |
| 1929 |
C boundary is drawn using the solid line style. |
| 1930 |
C VDI will close the polygon (i.e. the last point |
| 1931 |
C will be connected to the first). |
| 1932 |
|
| 1933 |
C The level of support for this primitive is device- |
| 1934 |
C dependent. The level of support is categorized |
| 1935 |
C as follows: |
| 1936 |
|
| 1937 |
C Level 0 -- no polygon fill. Only the polygon |
| 1938 |
C boundary is drawn. |
| 1939 |
C Level 1 -- the device fills convex polygons. |
| 1940 |
C Level 2 -- the device fills simple polygons (may |
| 1941 |
C be concave but not self-crossing) |
| 1942 |
C Level 3 -- full support for complex polygons (may |
| 1943 |
C be self-crossing). In general, the interior of |
| 1944 |
C a complex polygon is defined by the set of points |
| 1945 |
C such that, for each point, when an imaginary line |
| 1946 |
C is drawn to that point from a point far outside |
| 1947 |
C the polygon, that line intersects the polygon |
| 1948 |
C boundary an odd number of times. |
| 1949 |
|
| 1950 |
C Note that the level of support for a particular device |
| 1951 |
C can be inquired using the function VDIQDC. |
| 1952 |
|
| 1953 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 1954 |
|
| 1955 |
integer*4 i, nn, npts |
| 1956 |
REAL*4 XARRAY(NPTS),YARRAY(NPTS) |
| 1957 |
REAL*4 ATTARR(7) |
| 1958 |
|
| 1959 |
C MAX NPTS IS 508. Constraint imposed by postprocessor. |
| 1960 |
INTEGER*4 OUTARY(2) |
| 1961 |
INTEGER*4 zero, i4 |
| 1962 |
|
| 1963 |
C SCALE FACTORS FOR NDC TO DC MAPPING. (LXY) |
| 1964 |
REAL*4 XSCALE,YSCALE |
| 1965 |
COMMON /WMET10/ XSCALE,YSCALE |
| 1966 |
|
| 1967 |
C DC DIMENSIONS OF OFFSETS AND PICTURE. (LXY,HC1) |
| 1968 |
REAL*4 XPAD,YPAD,XDEVIC,YDEVIC |
| 1969 |
COMMON /WMET11/ XPAD,YPAD,XDEVIC,YDEVIC |
| 1970 |
|
| 1971 |
C CHECK FOR VALID N |
| 1972 |
IF (NPTS.LT.1) THEN |
| 1973 |
CALL WMETER(802,5) |
| 1974 |
GO TO 999 |
| 1975 |
END IF |
| 1976 |
|
| 1977 |
C SAVE CURRENT ATTRIBUTES |
| 1978 |
CALL WMETIO(ATTARR) |
| 1979 |
|
| 1980 |
C SET CURRENT LINESTYLE TO SOLID |
| 1981 |
zero = 0 |
| 1982 |
CALL WMETLS(zero) |
| 1983 |
|
| 1984 |
C BEGIN POLYGON COMMAND = AA00 |
| 1985 |
C = 43520 |
| 1986 |
C END POLYGON COMMAND = AB00 |
| 1987 |
C = 43776 |
| 1988 |
|
| 1989 |
CALL WMET13S(43520) |
| 1990 |
|
| 1991 |
NN=NPTS |
| 1992 |
C CHECK MAXIMUM POINTS LIMIT |
| 1993 |
IF (NN.GT.508) NN=508 |
| 1994 |
C CONVERT EACH X,Y TO SCREEN UNITS AND WRITE OUT |
| 1995 |
DO 100 I = 1,NN |
| 1996 |
OUTARY(1) = XARRAY(I) * XSCALE + XPAD |
| 1997 |
OUTARY(2) = YARRAY(I) * YSCALE + YPAD |
| 1998 |
CALL WMET13(2,OUTARY) |
| 1999 |
100 CONTINUE |
| 2000 |
|
| 2001 |
CALL WMET13S(43776) |
| 2002 |
|
| 2003 |
C MOVE SOMEWHERE TO UPDATE CURRENT POSITION |
| 2004 |
CALL WMETIM(XARRAY(1),YARRAY(1)) |
| 2005 |
|
| 2006 |
C RESTORE LINESTYLE |
| 2007 |
i4 = ATTARR(4) |
| 2008 |
CALL WMETLS(i4) |
| 2009 |
|
| 2010 |
999 RETURN |
| 2011 |
END |
| 2012 |
SUBROUTINE WMET13(NUMWDS,OUTARY) |
| 2013 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2014 |
|
| 2015 |
C VBOUT -Output 16 Bits of Data. |
| 2016 |
|
| 2017 |
CC ENVIRONMENT -Computer-independent, System-independent, FORTRAN 77 |
| 2018 |
|
| 2019 |
C ENTRY CONDITIONS -NUMWDS = integer number of words in OUTARY. |
| 2020 |
C = 0 means flush the buffer. |
| 2021 |
C OUTARY = integer array of output data, 16 bits/word, |
| 2022 |
C right-justified. |
| 2023 |
|
| 2024 |
C NARRATIVE - This routine used to do all the work but due to |
| 2025 |
C complex computer, device and software (COMDQ) |
| 2026 |
C dependencies, the work has moved to the computer |
| 2027 |
C dependent, device dependent, COMQ dependent routine |
| 2028 |
C BGPBUF. |
| 2029 |
|
| 2030 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2031 |
|
| 2032 |
C DIMENSION OUTARY TO NUMWDS+1 TO AVOID PROBLEMS WHEN NUMWDS = 0. |
| 2033 |
INTEGER NUMWDS |
| 2034 |
INTEGER*4 OUTARY(NUMWDS+1) |
| 2035 |
|
| 2036 |
CALL WMETBF(NUMWDS,OUTARY) |
| 2037 |
RETURN |
| 2038 |
END |
| 2039 |
SUBROUTINE WMET13S(OUT) |
| 2040 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2041 |
|
| 2042 |
C VBOUT -Output 16 Bits of Data. |
| 2043 |
|
| 2044 |
CC ENVIRONMENT -Computer-independent, System-independent, FORTRAN 77 |
| 2045 |
|
| 2046 |
C ENTRY CONDITIONS -NUMWDS = integer number of words in OUTARY. |
| 2047 |
C = 0 means flush the buffer. |
| 2048 |
C OUTARY = integer array of output data, 16 bits/word, |
| 2049 |
C right-justified. |
| 2050 |
|
| 2051 |
C NARRATIVE - This routine used to do all the work but due to |
| 2052 |
C complex computer, device and software (COMDQ) |
| 2053 |
C dependencies, the work has moved to the computer |
| 2054 |
C dependent, device dependent, COMQ dependent routine |
| 2055 |
C BGPBUF. |
| 2056 |
|
| 2057 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2058 |
|
| 2059 |
C DIMENSION OUTARY TO NUMWDS+1 TO AVOID PROBLEMS WHEN NUMWDS = 0. |
| 2060 |
INTEGER*4 OUTARY(1) |
| 2061 |
INTEGER OUT |
| 2062 |
|
| 2063 |
OUTARY(1) = OUT |
| 2064 |
CALL WMETBF(1,OUTARY) |
| 2065 |
RETURN |
| 2066 |
END |
| 2067 |
SUBROUTINE WMETDC(INDEX,VALUE) |
| 2068 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2069 |
|
| 2070 |
C VDIQDC -Inquire Device Capabilities. |
| 2071 |
|
| 2072 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2073 |
|
| 2074 |
C ENTRY CONDITIONS -INDEX = integer capability number. Range 1-33. |
| 2075 |
|
| 2076 |
C CALLS - |
| 2077 |
|
| 2078 |
C EXIT CONDITIONS -VALUE = real value of the capability indicated by |
| 2079 |
C INDEX. |
| 2080 |
|
| 2081 |
C NARRATIVE -Return values of various device capabilities. INDEX |
| 2082 |
C is the integer capability number (as given below), |
| 2083 |
C and the real value is returned in VALUE. |
| 2084 |
C 1. Erasability |
| 2085 |
C 0. None (hard copy) |
| 2086 |
C 1. Screen (Tektronix 4010) |
| 2087 |
C 2. Point or Line SLOW (Plasma) |
| 2088 |
C 3. Point or Line MEDIUM (Refresh -Serially connected) |
| 2089 |
C 4. Point or Line FAST (Refresh -Direct connected) |
| 2090 |
C 5. (1) and some (3) (Tektronix 4014 with write-thru mode) |
| 2091 |
C 2. Scan Type |
| 2092 |
C 0. Vector |
| 2093 |
C 1. Raster |
| 2094 |
C 2. Matrix (Plasma) |
| 2095 |
C 3. Intensities (1-N) |
| 2096 |
C 4. Colors (1-N) This is the number of colors that can be |
| 2097 |
C displayed at one time and may be less than the |
| 2098 |
C total number of colors the device can produce. |
| 2099 |
C 5. Line Widths (1-N) |
| 2100 |
C 6. Line Styles (0-N) A bit pattern indicating which of the 5 |
| 2101 |
C non-solid line styles are supported in the |
| 2102 |
C device. Bits 4,3,2,1, and 0 correspond to line |
| 2103 |
C styles medium dash, long dash, short dash, dot |
| 2104 |
C dash, and dot. (0 - device has no hardware line |
| 2105 |
C styles - simulate.) |
| 2106 |
C 7. Character Sizes (0-N) (0 - device has no hardware - simulate) |
| 2107 |
C 8. Number of Locator Devices |
| 2108 |
C 9. Number of Valuator Devices |
| 2109 |
C 10. Number of Button Devices |
| 2110 |
C 11. Number of Keyboard Devices |
| 2111 |
C 12. Number of Stroke Devices |
| 2112 |
C 13. Input |
| 2113 |
C 0. none |
| 2114 |
C 1. synchronous only - program requests input, then the user |
| 2115 |
C supplies it. |
| 2116 |
C 2. synchronous and asynchronous - synchronous is the same |
| 2117 |
C as in (1) above. Asynchronous means the user can provide |
| 2118 |
C input at any time; this input is then saved by the system |
| 2119 |
C in an event queue until the program calls for it. |
| 2120 |
C 14. Input Timing |
| 2121 |
C 0. no timeout supported |
| 2122 |
C 1. unreliable timing |
| 2123 |
C 2. timeout with reliable timing |
| 2124 |
C 15. X Dimension of View Surface in Device Coordinates |
| 2125 |
C 16. Y Dimension of View Surface in Device Coordinates |
| 2126 |
C 17. X Dimension of View Surface in Physical Units (mm) (0 if |
| 2127 |
C undefined). If this dimension is variable (as for drum |
| 2128 |
C plotters), it should be set equal to the Y dimension to |
| 2129 |
C guarantee a device aspect ratio of 1.0. |
| 2130 |
C 18. Y Dimension of View Surface in Physical Units (mm) (0 if |
| 2131 |
C undefined). |
| 2132 |
C 19. Smallest Line Width (DC) at default intensity |
| 2133 |
C 20. Smallest Point (DC) at default intensity |
| 2134 |
C 21. Smallest Character Size (DC) |
| 2135 |
C 22. Header and Trailer Frames Required (0=no,1=yes) |
| 2136 |
C 23. Device Identifier |
| 2137 |
C 1. TK4 - Tektronix 4014 |
| 2138 |
C 1.1 TK6 - Tektronix 4016 |
| 2139 |
C 1.2 TEK - Tektronix 4010, 4012 |
| 2140 |
C 1.3 TP2 - Tektronix 4662 |
| 2141 |
C 1.4 TP8 - Tektronix 4662 with 8 pen option |
| 2142 |
C 1.5 T14 - Tektronix 4114 |
| 2143 |
C 1.6 T13 - Tektronix 4113 |
| 2144 |
C 1.7 T05 - TEKTRONIX 4105 |
| 2145 |
C 1.8 T07 - TEKTRONIX 4107 |
| 2146 |
C 1.9 T15 - TEKTRONIX 4115 |
| 2147 |
C 2.1 16C - Dicomed 16mm color Movies |
| 2148 |
C 2.2 16B - Dicomed 16mm black and white movies |
| 2149 |
C 2.3 35C - Dicomed 35mm color slides |
| 2150 |
C 2.31 3MC - Dicomed 35mm movie color |
| 2151 |
C 2.4 35B - Dicomed 35mm black and white slides |
| 2152 |
C 2.41 3MB - Dicomed 35mm movie black and white |
| 2153 |
C 2.5 35A - Dicomed 35mm Aperture Card |
| 2154 |
C 2.6 24L - Dicomed 24X Fiche |
| 2155 |
C 2.7 48L - Dicomed 48X Fiche |
| 2156 |
C 2.8 CSQ - Dicomed Color Full Frame(square aspect ratio) |
| 2157 |
C 2.9 BSQ - Dicomed Black and White Full Frame(square aspect) |
| 2158 |
C 3 R94 - Ramtek 9400 |
| 2159 |
C 4. T27 - Tektronix 4027 |
| 2160 |
C 4.1 T25 - Tektronix 4025 |
| 2161 |
C 5. ALP - Alphanumeric Terminal |
| 2162 |
C 6. HC1 - Remote Hard Copy |
| 2163 |
C 7. LXY - Printronix |
| 2164 |
C 8. TST - Test Driver, Print VDI calls made. |
| 2165 |
C 9. V25 - Digital VT125 |
| 2166 |
C 10. AED - AED 512 |
| 2167 |
C 10.1 AE7 - AED 767 |
| 2168 |
C 10.2 AE1 - AED 1024 |
| 2169 |
C 11. MET - SVDI Metafile |
| 2170 |
c 12. HPP - Hewlett Packard Printer/Plotter 2671G |
| 2171 |
C 12.1 H75 - HP 7580 |
| 2172 |
C 12.2 H72 - HP 7221C OR T |
| 2173 |
C 12.3 H74 - HP 7475A |
| 2174 |
C 14. RET - Retrographics |
| 2175 |
C 15. AP5 - Aps 5 Phototypesetter |
| 2176 |
c 16. JP7 - JUPITER 7 |
| 2177 |
C 16.1 JP1 - Jupiter 1024 |
| 2178 |
C 17. GER - Gerber 4400 Photoplotter |
| 2179 |
C 18. XYN - XYNETICS |
| 2180 |
C 20. PS3 - E & S Picture System 300 |
| 2181 |
C 21. QMS - QMS LASER PRINTER |
| 2182 |
C 22. C51 - CALCOMP 1051 DRUM PLOTTER |
| 2183 |
C 23. R25 - RASTER TECHNOLOGIES MODEL ONE/25 |
| 2184 |
C 24. QLF - QCR large format (8 x 10) |
| 2185 |
C 24.1 Q35 - QCR 35mm format |
| 2186 |
C 25. T45 - Tektronix 4510 Rasterizer |
| 2187 |
C 24. Polygon support level |
| 2188 |
C 0. no support |
| 2189 |
C 1. fills convex polygons |
| 2190 |
C 2. fills simple polygons (may be concave but not |
| 2191 |
C self-crossing) |
| 2192 |
C 3. full complex polygon fill support |
| 2193 |
C 25. Maximum number of points in a polygon (99999. if infinite) |
| 2194 |
C 26. Setable color table |
| 2195 |
C 0. no |
| 2196 |
C 1. yes |
| 2197 |
C 27. Device color palette size (1-N) - the number of different |
| 2198 |
C colors a device can produce (may be more than the device |
| 2199 |
C can display simultaneously) |
| 2200 |
C 28. Direct color space size (0-N) - the number of colors |
| 2201 |
C available via direct RGB color specification |
| 2202 |
C (displayable simultaneously) |
| 2203 |
C 29. Vector verses Raster VDI |
| 2204 |
C 0. SVDI |
| 2205 |
C 1. SVDI+Raster |
| 2206 |
C 30. Maximum character height (DC) |
| 2207 |
C 31. Maximum line width (DC) |
| 2208 |
C 32. Color verses monochrome (greyscale) device |
| 2209 |
C 0. monochrome |
| 2210 |
C 1. color |
| 2211 |
C 33. Device pixel aspect - the ratio of the spacing of device |
| 2212 |
C pixels in x divided by the spacing in y (1 for square |
| 2213 |
C pixels) |
| 2214 |
|
| 2215 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2216 |
|
| 2217 |
INTEGER*4 INDEX |
| 2218 |
REAL*4 VALUE |
| 2219 |
REAL*4 DEV(33) |
| 2220 |
SAVE DEV |
| 2221 |
|
| 2222 |
C SET DEVICE CAPABILITIES |
| 2223 |
C THE VALUES CONTAINED IN DEV ARE: |
| 2224 |
|
| 2225 |
c ** Jan 16, 1991 -- Dino Pavlakos |
| 2226 |
c changed polygon support level (entry# 24) from 2 to 3 |
| 2227 |
|
| 2228 |
DATA DEV/ 0.,0.,256.,256.,4096.,31.,32767.,0.,0.,0., |
| 2229 |
* 0.,0.,0.,0.,32767.,32767.,0.0,0.0,8.,8., |
| 2230 |
* 0.,0.,11.,3.,508.,1.,16777216.,0.,0.,21298., |
| 2231 |
* 32767.,1.,0./ |
| 2232 |
|
| 2233 |
C CHECK FOR VALID INDEX. |
| 2234 |
IF(INDEX.LT.1.OR.INDEX.GT.33) THEN |
| 2235 |
CALL WMETER(726,5) |
| 2236 |
GOTO 999 |
| 2237 |
END IF |
| 2238 |
|
| 2239 |
C RETURN INDEXED VALUE. |
| 2240 |
VALUE=DEV(INDEX) |
| 2241 |
|
| 2242 |
999 RETURN |
| 2243 |
END |
| 2244 |
SUBROUTINE WMETIE(ESCPCD,SUPPRT) |
| 2245 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2246 |
|
| 2247 |
C VDIQES -Inquire Escape. |
| 2248 |
|
| 2249 |
C K.M.ERICKSON -04 may 81 |
| 2250 |
|
| 2251 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2252 |
|
| 2253 |
C ENTRY CONDITIONS -ESCPCD = integer escape function code. |
| 2254 |
|
| 2255 |
C CALLS - |
| 2256 |
|
| 2257 |
C EXIT CONDITIONS -SUPPRT = integer level of support for the escape |
| 2258 |
C function specified. Range 0,1,2. |
| 2259 |
|
| 2260 |
C NARRATIVE -An integer value indicating 2=hardware supported, |
| 2261 |
C 1=software supported, 0=unsupported is returned in |
| 2262 |
C SUPPRT for the escape function ESCPCD. |
| 2263 |
|
| 2264 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2265 |
|
| 2266 |
INTEGER*4 ESCPCD,SUPPRT |
| 2267 |
IF(ESCPCD .GE. 200 .AND. ESCPCD .LE. 205)THEN |
| 2268 |
SUPPRT=2 |
| 2269 |
C ELSE THERE IS NO SUPPORT OF ANY OTHER ESCAPE CODES |
| 2270 |
ELSE |
| 2271 |
SUPPRT=0 |
| 2272 |
END IF |
| 2273 |
RETURN |
| 2274 |
END |
| 2275 |
SUBROUTINE WMETBC(COLOR) |
| 2276 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2277 |
|
| 2278 |
C VDSTBC -Set Background Color. |
| 2279 |
|
| 2280 |
C K.M. ERICKSON -12 NOV 80 |
| 2281 |
|
| 2282 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2283 |
|
| 2284 |
C ENTRY CONDITIONS -COLOR = integer color table index. Range 0-255. |
| 2285 |
C Default: device dependent, in range 0-7. |
| 2286 |
|
| 2287 |
C CALLS - |
| 2288 |
|
| 2289 |
C EXIT CONDITIONS -VECTOR(2) = real updated background color (COLOR). |
| 2290 |
|
| 2291 |
C NARRATIVE -Set the background color for following VDNWPG or |
| 2292 |
C TEXT primitives for devices supporting these |
| 2293 |
C features. For example, many raster devices support |
| 2294 |
C both an overall background color and a background |
| 2295 |
C for character drawing(e.g.,red letters on a green |
| 2296 |
C box). |
| 2297 |
C All devices must support at least a single device |
| 2298 |
C dependent value in the range 0-7. |
| 2299 |
C If an unsupported value is specified, set to |
| 2300 |
C default. |
| 2301 |
|
| 2302 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2303 |
|
| 2304 |
INTEGER*4 COLOR |
| 2305 |
INTEGER*4 SETBC(2) |
| 2306 |
|
| 2307 |
REAL*4 VECTOR(7) |
| 2308 |
COMMON /WMET04/ VECTOR |
| 2309 |
|
| 2310 |
DATA SETBC(1) / 37633 / |
| 2311 |
|
| 2312 |
C CHECK FOR VALID COLOR. |
| 2313 |
IF(COLOR.LT.0.OR.COLOR.GT.255) THEN |
| 2314 |
CALL WMETER(724,5) |
| 2315 |
GOTO 999 |
| 2316 |
END IF |
| 2317 |
|
| 2318 |
C VECTOR(1)=FOREGROUND COLOR |
| 2319 |
C (2)=BACKGROUND COLOR |
| 2320 |
C (3)=INTENSITY |
| 2321 |
C (4)=LINE STYLE |
| 2322 |
C (5)=LINE WIDTH |
| 2323 |
C (6)=CHARACTER BOX Y |
| 2324 |
C (7)=CHARACTER BOX X |
| 2325 |
|
| 2326 |
VECTOR(2)=COLOR |
| 2327 |
SETBC(2) = COLOR |
| 2328 |
CALL WMET13(2,SETBC) |
| 2329 |
|
| 2330 |
999 RETURN |
| 2331 |
END |
| 2332 |
SUBROUTINE WMETCS(YSIZE) |
| 2333 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2334 |
|
| 2335 |
C VDSTCS -Set Character Size. |
| 2336 |
|
| 2337 |
C K.M.ERICKSON -04 May 81 |
| 2338 |
|
| 2339 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2340 |
|
| 2341 |
C ENTRY CONDITIONS -YSIZE = real Y dimension of the character box in NDC |
| 2342 |
C space. Range 0.-1. Default: device dependent, |
| 2343 |
C typically the smallest hardware size. |
| 2344 |
|
| 2345 |
C CALLS - |
| 2346 |
|
| 2347 |
C EXIT CONDITIONS -VECTOR(6) = real updated character box Y (YSIZE). |
| 2348 |
C VECTOR(7) = real updated character box X. |
| 2349 |
|
| 2350 |
C NARRATIVE -Set the character size for text primitives. Size |
| 2351 |
C is given by YSIZE as the Y dimension of the |
| 2352 |
C character box. The SVDI will assign the X dimension |
| 2353 |
C of the character box and X and Y character size |
| 2354 |
C within the box according to the font used. Applies |
| 2355 |
C only to text primitives. |
| 2356 |
C All devices must support at least a single device |
| 2357 |
C dependent value that is the default. If an |
| 2358 |
C unsupported value is specified, set to the largest |
| 2359 |
C supported character size that does not exceed the |
| 2360 |
C specified size. |
| 2361 |
|
| 2362 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2363 |
|
| 2364 |
REAL*4 YSIZE |
| 2365 |
|
| 2366 |
INTEGER*4 IBUF(4) |
| 2367 |
|
| 2368 |
REAL*4 VECTOR(7) |
| 2369 |
COMMON /WMET04/ VECTOR |
| 2370 |
|
| 2371 |
COMMON/WMET10/XSCALE,YSCALE |
| 2372 |
REAL*4 XSCALE,YSCALE |
| 2373 |
|
| 2374 |
C CHECK FOR VALID YSIZE. |
| 2375 |
IF(YSIZE.LT.0.0.OR.YSIZE.GT.1.0) THEN |
| 2376 |
CALL WMETER(401,5) |
| 2377 |
GOTO 999 |
| 2378 |
END IF |
| 2379 |
|
| 2380 |
C VECTOR(1)=FOREGROUND COLOR |
| 2381 |
C (2)=BACKGROUND COLOR |
| 2382 |
C (3)=INTENSITY |
| 2383 |
C (4)=LINE STYLE |
| 2384 |
C (5)=LINE WIDTH |
| 2385 |
C (6)=CHARACTER BOX Y |
| 2386 |
C (7)=CHARACTER BOX X |
| 2387 |
|
| 2388 |
C SET CHARACTER BOX = SPACING OF LETTERS TO A 5/7 BOX |
| 2389 |
VECTOR(6)=YSIZE |
| 2390 |
VECTOR(7)=VECTOR(6)*(5./7.) |
| 2391 |
|
| 2392 |
C SEND 15 BITS FOR THE HEIGHT AND WIDTH TO BGP. NOTE THAT CHARACTER SIZES |
| 2393 |
C ARE MAPPED FROM THE SMALLEST TO THE LARGEST CHARACTER DEFINED TO BE A |
| 2394 |
C CHARACTER FILLING THE SMALLEST DIMENSION OF THE SCREEN ASPECT RATIO. |
| 2395 |
|
| 2396 |
C SEND BGP COMMAND ,B202-HEIGHT-WIDTH |
| 2397 |
IBUF(1)=45570 |
| 2398 |
IBUF(2)=.65*VECTOR(6)*YSCALE |
| 2399 |
IBUF(3)=.65*VECTOR(7)*XSCALE |
| 2400 |
CALL WMET13(3,IBUF) |
| 2401 |
|
| 2402 |
999 RETURN |
| 2403 |
END |
| 2404 |
SUBROUTINE WMETIN(INTEN) |
| 2405 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2406 |
|
| 2407 |
C VDSTIN -Set Intensity. |
| 2408 |
|
| 2409 |
C K.M. ERICKSON -12 NOV 80 |
| 2410 |
|
| 2411 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2412 |
|
| 2413 |
C ENTRY CONDITIONS -INTEN = real intensity of the image of an output |
| 2414 |
C primitive. Range 0.-1. Default: device dependent. |
| 2415 |
|
| 2416 |
C CALLS - |
| 2417 |
|
| 2418 |
C EXIT CONDITIONS -VECTOR(3) = real updated intensity (INTEN). |
| 2419 |
|
| 2420 |
C NARRATIVE -Set the intensity value indicated for future |
| 2421 |
C primitives. Intensity is a real value between 0 |
| 2422 |
C (not visible) and 1 (maximum). Intensities are |
| 2423 |
C monotonically increasing within this range. |
| 2424 |
C All devices must support at least a single value: |
| 2425 |
C 1.0. If an unsupported value is specified, set to |
| 2426 |
C the closest supported intensity. |
| 2427 |
|
| 2428 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2429 |
|
| 2430 |
REAL*4 INTEN |
| 2431 |
|
| 2432 |
INTEGER*4 INTE(2) |
| 2433 |
|
| 2434 |
REAL*4 VECTOR(7) |
| 2435 |
COMMON /WMET04/ VECTOR |
| 2436 |
|
| 2437 |
DATA INTE/37377,0/ |
| 2438 |
C CHECK FOR VALID INTEN. |
| 2439 |
IF(INTEN.LT.0.0.OR.INTEN.GT.1.0) THEN |
| 2440 |
CALL WMETER(401,5) |
| 2441 |
GOTO 999 |
| 2442 |
END IF |
| 2443 |
|
| 2444 |
C VECTOR(1)=FOREGROUND COLOR |
| 2445 |
C (2)=BACKGROUND COLOR |
| 2446 |
C (3)=INTENSITY |
| 2447 |
C (4)=LINE STYLE |
| 2448 |
C (5)=LINE WIDTH |
| 2449 |
C (6)=CHARACTER BOX Y |
| 2450 |
C (7)=CHARACTER BOX X |
| 2451 |
|
| 2452 |
VECTOR(3)=INTEN |
| 2453 |
C MAP INTEN VALUE OF 0.-1. INTO 0.-32767. (15 BITS OF INFO) |
| 2454 |
INTE(2)=INTEN*32767. |
| 2455 |
|
| 2456 |
CALL WMET13(2,INTE) |
| 2457 |
|
| 2458 |
999 RETURN |
| 2459 |
END |
| 2460 |
SUBROUTINE WMETLS(LINSTY) |
| 2461 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2462 |
|
| 2463 |
C VDSTLS -Set Line Style. |
| 2464 |
|
| 2465 |
C K.M. ERICKSON -12 NOV 80 |
| 2466 |
|
| 2467 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2468 |
|
| 2469 |
C ENTRY CONDITIONS -LINSTY = integer linestyle of line drawing output |
| 2470 |
C primitives. Range 0-5. Default:0. |
| 2471 |
|
| 2472 |
C CALLS - |
| 2473 |
|
| 2474 |
C EXIT CONDITIONS -VECTOR(4) = real updated line style (LINSTY). |
| 2475 |
|
| 2476 |
C NARRATIVE -Set the style of line as below. This applies only |
| 2477 |
C to line drawing primitives. The line styles are: |
| 2478 |
C 0 - solid |
| 2479 |
C 1 - dotted |
| 2480 |
C 2 - dot dash |
| 2481 |
C 3 - short dash |
| 2482 |
C 4 - long dash |
| 2483 |
C 5 - medium dash |
| 2484 |
C All devices must support at least the values 0 and |
| 2485 |
C 5. If an unsupported value is specified, set to 5. |
| 2486 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2487 |
|
| 2488 |
INTEGER*4 LINSTY |
| 2489 |
|
| 2490 |
INTEGER*4 LS(2) |
| 2491 |
|
| 2492 |
INTEGER*4 LINS(6) |
| 2493 |
REAL*4 VECTOR(7) |
| 2494 |
COMMON /WMET04/ VECTOR |
| 2495 |
C CURRENT ATTRIBUTE VALUES. (DEVICE-INDEPENDENT) |
| 2496 |
C REAL*4 VECTOR(7) |
| 2497 |
C COMMON /VCATTR/ VECTOR |
| 2498 |
|
| 2499 |
C VECTOR(1)=FOREGROUND COLOR |
| 2500 |
C (2)=BACKGROUND COLOR |
| 2501 |
C (3)=INTENSITY |
| 2502 |
C (4)=LINE STYLE |
| 2503 |
C (5)=LINE WIDTH |
| 2504 |
C (6)=CHARACTER BOX Y |
| 2505 |
C (7)=CHARACTER BOX X |
| 2506 |
|
| 2507 |
DATA LS/43009,0/ |
| 2508 |
DATA LINS/32767,0,16382,5461,27305,16383/ |
| 2509 |
|
| 2510 |
C CHECK FOR VALID LINSTY. |
| 2511 |
IF(LINSTY.LT.0.OR.LINSTY.GT.5)THEN |
| 2512 |
CALL WMETER(401,5) |
| 2513 |
GOTO 99999 |
| 2514 |
END IF |
| 2515 |
VECTOR(4)=LINSTY |
| 2516 |
|
| 2517 |
C LINE STYLE (15 BITS) VARIES FROM 0. : DOTTED , 1-32755 :DASHED, 32767: SOLID |
| 2518 |
|
| 2519 |
LS(2)=LINS(LINSTY+1) |
| 2520 |
|
| 2521 |
C SEND BGP COMMAND |
| 2522 |
|
| 2523 |
CALL WMET13(2,LS) |
| 2524 |
99999 RETURN |
| 2525 |
END |
| 2526 |
SUBROUTINE WMETII(ASPECT,JUSTIF) |
| 2527 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2528 |
|
| 2529 |
C VIINIT -Initialize SVDI. Metafile |
| 2530 |
|
| 2531 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2532 |
C DICOMED |
| 2533 |
|
| 2534 |
C ENTRY CONDITIONS -ASPECT = real ratio of X dimension to Y dimension. |
| 2535 |
C Range >0.0. Default: 0. (device dependent). |
| 2536 |
C JUSTIF = integer justification of NDC space on the |
| 2537 |
C device. Range 0-9. Default: 0 (device dependent.) |
| 2538 |
|
| 2539 |
C CALLS -VBERRH,CDROFS,VBOUT,VIMOVA. |
| 2540 |
|
| 2541 |
C EXIT CONDITIONS -XNDCMX,YNDCMX = real NDC maximum valid values(as |
| 2542 |
C constrained by ASPECT). |
| 2543 |
C VECTOR = real array of attribute values(all device |
| 2544 |
C dependent except VECTOR(4)=0.0). |
| 2545 |
|
| 2546 |
C NARRATIVE -This must be the first SVDI call made. All |
| 2547 |
C attribute values, the color table, and current |
| 2548 |
C position are set to appropriate defaults for the |
| 2549 |
C device. All necessary input device initialization |
| 2550 |
C is done. The screen is cleared or paper advanced |
| 2551 |
C if necessary to guarantee a blank view surface for |
| 2552 |
C drawing on. |
| 2553 |
|
| 2554 |
C ASPECT specifies the ratio of the X dimension to the |
| 2555 |
C Y dimension . Maximum NDC values (at least one of |
| 2556 |
C which will be 1.0) are computed to give the ASPECT |
| 2557 |
C specified. The default ASPECT (0.0) is device |
| 2558 |
C dependent and equals the aspect ratio of the |
| 2559 |
C physical device, except for variable aspect devices |
| 2560 |
C (such as drum plotters) which are assigned a default |
| 2561 |
C aspect of 1.0. The NDC rectangle is scaled until |
| 2562 |
C one dimension fills the corresponding dimension of |
| 2563 |
C the device. |
| 2564 |
|
| 2565 |
C JUSTIF determines where the rectangle is located on |
| 2566 |
C the device as diagrammed below: |
| 2567 |
C --------- |
| 2568 |
C | 7 8 9 | |
| 2569 |
C | 4 5 6 | |
| 2570 |
C | 1 2 3 | |
| 2571 |
C --------- |
| 2572 |
C For example, JUSTIF = 7 indicates NDC space will be |
| 2573 |
C upper left justified on the device. |
| 2574 |
|
| 2575 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2576 |
|
| 2577 |
REAL*4 ASPECT |
| 2578 |
INTEGER*4 JUSTIF |
| 2579 |
integer iidsiz, iusrsz, iszrou |
| 2580 |
integer*4 i, just, aspe |
| 2581 |
integer istat |
| 2582 |
|
| 2583 |
INTEGER*4 CLRTAB(256,3) |
| 2584 |
COMMON /WMET08/ CLRTAB |
| 2585 |
|
| 2586 |
C MAXIMUM VALID NDC VALUES. (DEVICE-INDEPENDENT) |
| 2587 |
REAL*4 XNDCMX,YNDCMX |
| 2588 |
COMMON /WMET03/ XNDCMX,YNDCMX |
| 2589 |
|
| 2590 |
C CURRENT ATTRIBUTE VALUES. (DEVICE-INDEPENDENT) |
| 2591 |
C VECTOR(1)=FOREGROUND COLOR |
| 2592 |
C (2)=BACKGROUND COLOR |
| 2593 |
C (3)=INTENSITY |
| 2594 |
C (4)=LINE STYLE |
| 2595 |
C (5)=LINE WIDTH |
| 2596 |
C (6)=CHARACTER BOX Y |
| 2597 |
C (7)=CHARACTER BOX X |
| 2598 |
REAL*4 VECTOR(7) |
| 2599 |
COMMON /WMET04/ VECTOR |
| 2600 |
|
| 2601 |
C CURRENT POSITION. (LXY,HC1) |
| 2602 |
REAL*4 XCP,YCP |
| 2603 |
COMMON /WMET09/ XCP,YCP |
| 2604 |
C Include '[VDIMAINT.COMMON]VCCRPS' |
| 2605 |
|
| 2606 |
C SCALE FACTORS FOR NDC TO DC MAPPING. (LXY,HC1) |
| 2607 |
REAL*4 XSCALE,YSCALE |
| 2608 |
COMMON /WMET10/ XSCALE,YSCALE |
| 2609 |
C Include '[VDIMAINT.COMMON]VCSCAL' |
| 2610 |
|
| 2611 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 2612 |
1KCOMTP |
| 2613 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 2614 |
1 KBAUD,KCOMTP |
| 2615 |
|
| 2616 |
C DC DIMENSIONS OF OFFSETS AND PICTURE. (LXY,HC1) |
| 2617 |
REAL*4 XPAD,YPAD,XDEVIC,YDEVIC |
| 2618 |
COMMON /WMET11/ XPAD,YPAD,XDEVIC,YDEVIC |
| 2619 |
|
| 2620 |
INTEGER*4 MACHIN(3),MACLEN |
| 2621 |
INTEGER*4 KIDSIZ,KJOBID(4),KUSRSZ,KUSRID(4),KSZROU |
| 2622 |
INTEGER*4 KJROUT(4),KSECUR,KJTIME(4),KJDATE(4) |
| 2623 |
COMMON / VCJOB/ KIDSIZ,KJOBID,KUSRSZ,KUSRID,KSZROU, |
| 2624 |
1 KJROUT,KSECUR,KJTIME,KJDATE,MACHIN,MACLEN |
| 2625 |
|
| 2626 |
C DECLARE FILE INITIALIZATION COMMANDS. |
| 2627 |
integer*4 idfile(2),isecur(3), zero(1) |
| 2628 |
real*4 rzero |
| 2629 |
|
| 2630 |
DATA ISECUR/33282,1,0/ |
| 2631 |
|
| 2632 |
RZERO= 0 |
| 2633 |
ZERO(1) = 0 |
| 2634 |
XPAD = 0 |
| 2635 |
YPAD = 0 |
| 2636 |
|
| 2637 |
C SET DEFAULT ATTRIBUTE VALUES. ALL ARE DEVICE DEPENDENT EXCEPT |
| 2638 |
C VECTOR(4)=0.0. |
| 2639 |
VECTOR(1)=7. |
| 2640 |
C FOREGROUND COLOR - white |
| 2641 |
VECTOR(2)=0. |
| 2642 |
C BACKGROUND COLOR - black |
| 2643 |
VECTOR(3)=1.0 |
| 2644 |
C INTENSITY - |
| 2645 |
VECTOR(4)=0. |
| 2646 |
C LINE STYLE - SOLID |
| 2647 |
VECTOR(5)=.00024414 |
| 2648 |
C LINE WIDTH - 1/4096 |
| 2649 |
VECTOR(6)=.01 |
| 2650 |
C CHARACTER BOX Y - NORMAL PRINT SIZE (100 LINES/PAGE) |
| 2651 |
VECTOR(7)=.00714286 |
| 2652 |
C CHARACTER BOX X - NORMAL PRINT SIZE (VECTOR(6)*5/7) |
| 2653 |
|
| 2654 |
C ESTABLISH DEVICE UNITS (MAX ADDRESSABLE UNITS) |
| 2655 |
|
| 2656 |
XDEVIC=32767 |
| 2657 |
YDEVIC=32767 |
| 2658 |
|
| 2659 |
C ASSIGN INPUT PARAMETERS TO ASPE AND JUST |
| 2660 |
ASPE=ASPECT |
| 2661 |
JUST=JUSTIF |
| 2662 |
|
| 2663 |
C CHECK FOR VALID ASPECT. IF(ASPECT.LT.0.0) THEN CALL VBERRH(721,5), |
| 2664 |
C AND USE DEFAULT ASPECT. |
| 2665 |
|
| 2666 |
IF(ASPE.LT.0.) THEN |
| 2667 |
CALL WMETER(721,5) |
| 2668 |
ASPE=XDEVIC/YDEVIC |
| 2669 |
END IF |
| 2670 |
|
| 2671 |
C ESTABLISH ASPECT RATIO |
| 2672 |
|
| 2673 |
C IF=0 SET TO DEVICE DEPENDENT ASPECT RATIO(FOR dic ASPECT=32148/21698 |
| 2674 |
|
| 2675 |
IF(ASPE .EQ. 0.) ASPE = XDEVIC/YDEVIC |
| 2676 |
|
| 2677 |
IF (ASPE .GT. 1.) THEN |
| 2678 |
XNDCMX = 1. |
| 2679 |
YNDCMX = 1./ASPE |
| 2680 |
ELSE |
| 2681 |
XNDCMX=ASPE |
| 2682 |
YNDCMX=1. |
| 2683 |
END IF |
| 2684 |
|
| 2685 |
C DEFINE MAPPING FUNCTION FOR ANY DEVICE |
| 2686 |
|
| 2687 |
C ESTABLISH SCALE FACTOR FOR MAXIMUM SCREEN DIMENSIONS OF THE DEVICE |
| 2688 |
|
| 2689 |
XSCALE = XDEVIC /XNDCMX |
| 2690 |
YSCALE= YDEVIC / YNDCMX |
| 2691 |
XSCALE = MIN( XSCALE, YSCALE) |
| 2692 |
YSCALE = XSCALE |
| 2693 |
|
| 2694 |
C CHECK FOR VALID JUSTIF. IF(JUSTIF.LT.0 .OR. JUSTIF.GT.9) THEN |
| 2695 |
C CALL VBERRH(720,5), AND USE DEFAULT JUSTIF. |
| 2696 |
|
| 2697 |
IF(JUST .LT. 0 .OR. JUST .GT. 9) CALL WMETER(720,5) |
| 2698 |
|
| 2699 |
C MAKE OUTPUT FILE FOR THE METAFILE BE UNIT 55 |
| 2700 |
KOUTFL=55 |
| 2701 |
|
| 2702 |
C SET UP MONITORING INFORMATION |
| 2703 |
CALL WMETDV('C MET ') |
| 2704 |
CALL WMETMO(0) |
| 2705 |
|
| 2706 |
C INITIALIZE THE OUTPUT FILE. |
| 2707 |
CALL WMETFF(KOUTFL,1440,1,ISTAT) |
| 2708 |
|
| 2709 |
C COMPUTE LENGTH OF FILE ID INSTRUCTION. |
| 2710 |
IIDSIZ=(KIDSIZ+1)/2 |
| 2711 |
IUSRSZ=(KUSRSZ+1)/2 |
| 2712 |
ISZROU=(KSZROU+1)/2 |
| 2713 |
IDFILE(1)=33792+12+IIDSIZ+IUSRSZ+ISZROU |
| 2714 |
IDFILE(2)=KCOMTP |
| 2715 |
c SEND FILE ID. |
| 2716 |
|
| 2717 |
CALL WMET13(2,IDFILE) |
| 2718 |
|
| 2719 |
C SEND DATE AND TIME. |
| 2720 |
CALL WMET05(3,KJDATE) |
| 2721 |
CALL WMET05(3,KJTIME) |
| 2722 |
|
| 2723 |
C SEND LENGTH OF JOB ID AND JOB ID. |
| 2724 |
CALL WMET13S(IIDSIZ) |
| 2725 |
CALL WMET05(4,KJOBID) |
| 2726 |
|
| 2727 |
C SEND LENGTH OF USER ID AND USER ID. |
| 2728 |
CALL WMET13S(IUSRSZ) |
| 2729 |
CALL WMET05(4,KUSRID) |
| 2730 |
|
| 2731 |
C SEND LENGTH OF ROUTING INFO AND ROUTING INFO. |
| 2732 |
CALL WMET13S(ISZROU) |
| 2733 |
CALL WMET05(4,KJROUT) |
| 2734 |
|
| 2735 |
C SEND SECURITY AND FLUSH BUFFER. |
| 2736 |
ISECUR(3)=KSECUR |
| 2737 |
CALL WMET13(3,ISECUR) |
| 2738 |
zero(1) = 0 |
| 2739 |
CALL WMET13(0,zero) |
| 2740 |
|
| 2741 |
C SEND ASPECT RATIO |
| 2742 |
CALL WMET13S(33539) |
| 2743 |
CALL WMET13S(INT(XNDCMX*XDEVIC)) |
| 2744 |
CALL WMET13S(INT(YNDCMX*YDEVIC)) |
| 2745 |
CALL WMET13S(0) |
| 2746 |
|
| 2747 |
C SET UP COLOR TABLE |
| 2748 |
|
| 2749 |
DO 10 I=2,256 |
| 2750 |
CLRTAB(I,1) = 255 |
| 2751 |
CLRTAB(I,2) = 255 |
| 2752 |
CLRTAB(I,3) = 255 |
| 2753 |
10 CONTINUE |
| 2754 |
CLRTAB(1,1) = 0 |
| 2755 |
CLRTAB(1,2) = 0 |
| 2756 |
CLRTAB(1,3) = 0 |
| 2757 |
CLRTAB(2,2) = 0 |
| 2758 |
CLRTAB(2,3) = 0 |
| 2759 |
CLRTAB(3,1) = 0 |
| 2760 |
CLRTAB(3,3) = 0 |
| 2761 |
CLRTAB(4,3) = 0 |
| 2762 |
CLRTAB(5,1) = 0 |
| 2763 |
CLRTAB(5,2) = 0 |
| 2764 |
CLRTAB(6,2) = 0 |
| 2765 |
CLRTAB(7,1) = 0 |
| 2766 |
|
| 2767 |
C SET CURRENT POSITION TO (0.,0.) |
| 2768 |
CALL WMETIM(rzero, rzero) |
| 2769 |
|
| 2770 |
RETURN |
| 2771 |
END |
| 2772 |
SUBROUTINE WMETIL(XNDC,YNDC) |
| 2773 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2774 |
|
| 2775 |
C VILINA -Line Absolute. |
| 2776 |
|
| 2777 |
C R.W.Simons -08MAY81 |
| 2778 |
|
| 2779 |
C ENVIRONMENT -Computer-independent, system-independent, FORTRAN 77 |
| 2780 |
C Hard Copy Format 1. |
| 2781 |
|
| 2782 |
C ENTRY CONDITIONS -XNDC,YNDC = real NDC position. |
| 2783 |
|
| 2784 |
C CALLS - |
| 2785 |
|
| 2786 |
C EXIT CONDITIONS -XCP,YCP = real updated current position. (XNDC,YNDC) |
| 2787 |
|
| 2788 |
C NARRATIVE -Draw a line from current position to absolute NDC |
| 2789 |
C position XNDC,YNDC and update current position. |
| 2790 |
|
| 2791 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2792 |
|
| 2793 |
REAL*4 XNDC,YNDC |
| 2794 |
|
| 2795 |
INTEGER*4 OUTARY(2) |
| 2796 |
|
| 2797 |
C CURRENT POSITION. (LXY,HC1) |
| 2798 |
REAL*4 XCP,YCP |
| 2799 |
COMMON /WMET09/ XCP,YCP |
| 2800 |
C Include '[VDIMAINT.COMMON]VCCRPS' |
| 2801 |
|
| 2802 |
C SCALE FACTORS FOR NDC TO DC MAPPING. (LXY) |
| 2803 |
REAL*4 XSCALE,YSCALE |
| 2804 |
COMMON /WMET10/ XSCALE,YSCALE |
| 2805 |
|
| 2806 |
C DC DIMENSIONS OF OFFSETS AND PICTURE. (LXY,HC1) |
| 2807 |
REAL*4 XPAD,YPAD,XDEVIC,YDEVIC |
| 2808 |
COMMON /WMET11/ XPAD,YPAD,XDEVIC,YDEVIC |
| 2809 |
|
| 2810 |
C CONVERT TO SCREEN UNITS. |
| 2811 |
C SET BIT 15 OF X = 0 TO INDICATE A COORDINATE POSITIONING COMMAND. |
| 2812 |
C SET BIT 15 OF Y = 1 TO INDICATE A DRAW COMMAND. |
| 2813 |
C ASSUME X AND Y ARE < 32768, WHICH WILL BE TRUE IF XNDC AND YNDC |
| 2814 |
C ARE IN THE PROPER RANGE. |
| 2815 |
OUTARY(1)=XNDC*XSCALE+XPAD |
| 2816 |
OUTARY(2)=YNDC*YSCALE+YPAD+32768 |
| 2817 |
|
| 2818 |
C SEND THE COMMAND TO THE PLOT FILE. |
| 2819 |
CALL WMET13(2,OUTARY) |
| 2820 |
|
| 2821 |
C UPDATE CURRENT POSITION. |
| 2822 |
XCP=XNDC |
| 2823 |
YCP=YNDC |
| 2824 |
|
| 2825 |
RETURN |
| 2826 |
END |
| 2827 |
SUBROUTINE WMETIP(X,Y) |
| 2828 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2829 |
|
| 2830 |
C VIPNTA -Point Absolute. |
| 2831 |
|
| 2832 |
C R.W.Simons -15MAY81 |
| 2833 |
|
| 2834 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2835 |
C Hard Copy Format 1. |
| 2836 |
|
| 2837 |
C ENTRY CONDITIONS -X,Y = real NDC position. |
| 2838 |
|
| 2839 |
C CALLS -VIMOVA,VBOUT. |
| 2840 |
|
| 2841 |
C EXIT CONDITIONS - |
| 2842 |
|
| 2843 |
C NARRATIVE -Set current position to absolute NDC position X,Y |
| 2844 |
C and put a visible point there. Attributes |
| 2845 |
C foreground color and intensity apply. |
| 2846 |
|
| 2847 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2848 |
|
| 2849 |
REAL*4 X,Y |
| 2850 |
|
| 2851 |
C MOVE TO THE POSITION SPECIFIED. |
| 2852 |
CALL WMETIM(X,Y) |
| 2853 |
C plot marker at current position (A400 HEX = 41984) TO THE OUTPUT FILE. |
| 2854 |
CALL WMET13S(41984) |
| 2855 |
|
| 2856 |
RETURN |
| 2857 |
END |
| 2858 |
SUBROUTINE WMETIT |
| 2859 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2860 |
|
| 2861 |
C VITERM -Terminate SVDI. |
| 2862 |
|
| 2863 |
C R.W.Simons -13MAY81 |
| 2864 |
|
| 2865 |
C ENVIRONMENT -COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2866 |
C Hard Copy Format 1. |
| 2867 |
|
| 2868 |
C ENTRY CONDITIONS - |
| 2869 |
|
| 2870 |
C CALLS -VBOUT,VBERRH. |
| 2871 |
|
| 2872 |
C EXIT CONDITIONS - |
| 2873 |
|
| 2874 |
C NARRATIVE -Terminate the SVDI. Flush buffers, etc. |
| 2875 |
|
| 2876 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2877 |
|
| 2878 |
integer*4 i |
| 2879 |
|
| 2880 |
INTEGER*4 KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW,KBAUD, |
| 2881 |
1KCOMTP |
| 2882 |
COMMON /CDRCOM/ KWRTFL,KRDFL,KOUTFL,KINFL,KWRDSZ,KBYTEL,KCPW, |
| 2883 |
1 KBAUD,KCOMTP |
| 2884 |
INTEGER FILLER |
| 2885 |
|
| 2886 |
C FILLER IS 1440 BYTES WORTH OF DECIMAL 8100 PADD CHARACTERS |
| 2887 |
DATA FILLER /33024/ |
| 2888 |
integer*4 zero(1) |
| 2889 |
|
| 2890 |
C SEND AN END OF DATA COMMAND TO THE OUTPUT FILE. |
| 2891 |
C 8600 HEX = 34304 = END OF DATA COMMAND. |
| 2892 |
CALL WMET13S(34304) |
| 2893 |
|
| 2894 |
C UPON TERMINATION, WE WANT TO SEND AN EXTRA BUFFER FULL OF PADD |
| 2895 |
C CHARACTERS. BY DOING THIS, WE CAN EASILY BUILD A STANDARD |
| 2896 |
C METAFILE WHICH CAN BE PASSED AROUND SYSTEMS. IT MAY BE |
| 2897 |
C NECESSARY FOR SOME SYSTEMS TO THROW AWAY DATA AT THE END OF |
| 2898 |
C THE FILE, AND THIS WILL ENSURE THAT NOTHING WORTHWHILE GETS |
| 2899 |
C DISCARDED. |
| 2900 |
|
| 2901 |
zero(1) = 0 |
| 2902 |
DO 10 I=1,2048 |
| 2903 |
CALL WMET13S(FILLER) |
| 2904 |
10 CONTINUE |
| 2905 |
|
| 2906 |
C FLUSH OUTPUT BUFFERS. |
| 2907 |
CALL WMET13(0,zero) |
| 2908 |
|
| 2909 |
CALL WMETCF(KOUTFL,1) |
| 2910 |
CALL WMETMO(2) |
| 2911 |
|
| 2912 |
RETURN |
| 2913 |
END |
| 2914 |
SUBROUTINE WMETIX(LENGT1,CHARS) |
| 2915 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2916 |
|
| 2917 |
C VITEXT - Text from Array. |
| 2918 |
|
| 2919 |
C P. Watterberg - 24 MAR 81 |
| 2920 |
|
| 2921 |
C ENVIRONMENT - COMPUTER-INDEPENDENT, SYSTEM-INDEPENDENT, FORTRAN 77 |
| 2922 |
|
| 2923 |
C ENTRY CONDITIONS - LENGT1 = integer number of characters in CHARS. |
| 2924 |
C Range 1-136. |
| 2925 |
C CHARS = integer array of ASCII characters, one |
| 2926 |
C character per array element, right justified. |
| 2927 |
C Range 8,10,32-126. |
| 2928 |
|
| 2929 |
C CALLS - vbout |
| 2930 |
|
| 2931 |
C EXIT CONDITIONS - XCP,YCP = integer updated current position (at the end |
| 2932 |
C of the string). |
| 2933 |
|
| 2934 |
C NARRATIVE - Draw LENGT1 characters in CHARS, starting at |
| 2935 |
C current position and update current position to |
| 2936 |
C the point after the last character box where the |
| 2937 |
C next character would begin. Current position |
| 2938 |
C indicates the lower left corner of the first |
| 2939 |
C character box. Only printable characters (32-126 |
| 2940 |
C decimal) and backspace and linefeed are allowed. |
| 2941 |
C All values in this range must produce "reasonable" |
| 2942 |
C output; mapping lower case to upper case letters is |
| 2943 |
C considered reasonable. Attributes foreground color, |
| 2944 |
C background color, intensity, and character size |
| 2945 |
C apply. |
| 2946 |
|
| 2947 |
C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C |
| 2948 |
|
| 2949 |
INTEGER JSPOT |
| 2950 |
INTEGER*4 LENGT1, CHARS(136), LENGTH, i |
| 2951 |
REAL*4 VECTOR(7) |
| 2952 |
COMMON /WMET04/ VECTOR |
| 2953 |
|
| 2954 |
COMMON /WMET09/XCP,YCP |
| 2955 |
REAL*4 XCP,YCP |
| 2956 |
|
| 2957 |
LOGICAL ODD |
| 2958 |
INTEGER*4 TBUF(73) |
| 2959 |
|
| 2960 |
c check for valid length. |
| 2961 |
|
| 2962 |
LENGTH = LENGT1 |
| 2963 |
IF(LENGTH.LT.1) THEN |
| 2964 |
CALL WMETER(212,5) |
| 2965 |
GO TO 999 |
| 2966 |
END IF |
| 2967 |
|
| 2968 |
c if(length.gt.136) then call vberrh(213,5), and use the |
| 2969 |
c maximum length of 136. |
| 2970 |
|
| 2971 |
IF(LENGTH.GT.136) THEN |
| 2972 |
CALL WMETER(213,5) |
| 2973 |
LENGTH = 136 |
| 2974 |
ENDIF |
| 2975 |
|
| 2976 |
c initialized the number of chars in tbuf, |
| 2977 |
c the spot marker and the odd/even flag |
| 2978 |
|
| 2979 |
ODD = .TRUE. |
| 2980 |
JSPOT = 1 |
| 2981 |
|
| 2982 |
c loop through length characters. |
| 2983 |
|
| 2984 |
DO 100 I=1,LENGTH |
| 2985 |
|
| 2986 |
c check for valid chars. |
| 2987 |
c ignore control characters, except backspace and linefeed. |
| 2988 |
|
| 2989 |
IF(CHARS(I).LT.32 .OR. CHARS(I).GT.126) THEN |
| 2990 |
IF(CHARS(I).NE.8.AND.CHARS(I).NE.10) THEN |
| 2991 |
CALL WMETER(208,5) |
| 2992 |
GOTO 100 |
| 2993 |
ENDIF |
| 2994 |
END IF |
| 2995 |
|
| 2996 |
c now pack the chars into the buffer |
| 2997 |
|
| 2998 |
IF(ODD) THEN |
| 2999 |
JSPOT = JSPOT + 1 |
| 3000 |
TBUF(JSPOT) = CHARS(I)*256 |
| 3001 |
ELSE |
| 3002 |
TBUF(JSPOT) = TBUF(JSPOT) + CHARS(I) |
| 3003 |
ENDIF |
| 3004 |
ODD = .NOT. ODD |
| 3005 |
|
| 3006 |
C UPDATE THE CURRENT POSITION |
| 3007 |
|
| 3008 |
IF(CHARS(I).GE.32) THEN |
| 3009 |
XCP = XCP + VECTOR(7) |
| 3010 |
ELSE IF(CHARS(I).EQ.10) THEN |
| 3011 |
YCP = YCP - VECTOR(6) |
| 3012 |
ELSE |
| 3013 |
XCP = XCP - VECTOR(7) |
| 3014 |
ENDIF |
| 3015 |
|
| 3016 |
100 CONTINUE |
| 3017 |
|
| 3018 |
c send the chars to the bgp file |
| 3019 |
|
| 3020 |
c 45056 :: b000 tbuf(1)=45056 + jspot -1 |
| 3021 |
c jspot is the number of words filled or partially filled up in tbuf |
| 3022 |
c including the 1st word with the command |
| 3023 |
|
| 3024 |
TBUF(1)=JSPOT+45055 |
| 3025 |
CALL WMET13(JSPOT,TBUF) |
| 3026 |
|
| 3027 |
999 RETURN |
| 3028 |
END |