| 1 |
C Copyright(C) 1999-2020 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======================================================================= |
| 8 |
SUBROUTINE PICK2D (PROMPT, CURSOR, MIDDEF, IFLD, INTYP, RFIELD, |
| 9 |
& XRES, YRES, *) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** PICK2D *** (MESH) Pick a window point |
| 13 |
C -- Written by Amy Gilkey - revised 02/05/88 |
| 14 |
C -- |
| 15 |
C --PICK2D picks a user-selected window point. For cursor input, PICK2D |
| 16 |
C --puts a cursor on the screen, waits until the user positions the cursor, |
| 17 |
C --then translates the position into a 2D point. For character input, |
| 18 |
C --PICK2D gets an X,Y pair from the free-format fields (defaults are |
| 19 |
C --not allowed). |
| 20 |
C -- |
| 21 |
C --Parameters: |
| 22 |
C -- PROMPT - IN - the point requested |
| 23 |
C -- CURSOR - IN - true iff cursor input |
| 24 |
C -- MIDDEF - IN - true if the middle of the displayed mesh is to be the |
| 25 |
C -- starting position, else use the last selected position |
| 26 |
C -- (cursor input only) |
| 27 |
C -- IFLD - IN/OUT - the free-format field index (character input only) |
| 28 |
C -- INTYP - IN - the free-format field types (character input only) |
| 29 |
C -- RFIELD - IN - the free-format real fields (character input only) |
| 30 |
C -- XRES, YRES - OUT - the returned point |
| 31 |
C -- * - return statement if error picking point |
| 32 |
C -- |
| 33 |
C --Common Variables: |
| 34 |
C -- Sets DXLAST, DYLAST of /PICK/ |
| 35 |
C -- Uses /PICK/ |
| 36 |
|
| 37 |
PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6) |
| 38 |
|
| 39 |
include 'pick.blk' |
| 40 |
|
| 41 |
CHARACTER*(*) PROMPT |
| 42 |
LOGICAL CURSOR |
| 43 |
LOGICAL MIDDEF |
| 44 |
INTEGER INTYP(*) |
| 45 |
REAL RFIELD(*) |
| 46 |
|
| 47 |
CHARACTER*80 XPRMPT |
| 48 |
CHARACTER CH |
| 49 |
|
| 50 |
IF (CURSOR) THEN |
| 51 |
IF (.NOT. INITP) THEN |
| 52 |
CALL PRTERR ('CMDERR', 'No mesh is displayed') |
| 53 |
GOTO 100 |
| 54 |
END IF |
| 55 |
|
| 56 |
C --Put up the cursor at the default location and wait for the user |
| 57 |
C --to select a point |
| 58 |
|
| 59 |
IF (PROMPT .NE. ' ') THEN |
| 60 |
XPRMPT = 'Pick ' // PROMPT // '...' |
| 61 |
ELSE |
| 62 |
XPRMPT = ' ' |
| 63 |
END IF |
| 64 |
|
| 65 |
IF (MIDDEF) THEN |
| 66 |
DXRES = DXMID |
| 67 |
DYRES = DYMID |
| 68 |
ELSE |
| 69 |
DXRES = DXLAST |
| 70 |
DYRES = DYLAST |
| 71 |
END IF |
| 72 |
CALL GRIKEY (XPRMPT, DXRES, DYRES, CH, *100) |
| 73 |
|
| 74 |
C --Save the selected position |
| 75 |
|
| 76 |
DXLAST = DXRES |
| 77 |
DYLAST = DYRES |
| 78 |
|
| 79 |
C --Translate the point from device coordinates into mesh coordinates |
| 80 |
|
| 81 |
XRES = PKMESH(KLFT) + (DXRES - DMESH(KLFT)) * DVRAT |
| 82 |
YRES = PKMESH(KBOT) + (DYRES - DMESH(KBOT)) * DVRAT |
| 83 |
|
| 84 |
ELSE |
| 85 |
|
| 86 |
C --Get the X,Y pair from the free-format fields, no defaults |
| 87 |
|
| 88 |
XPRMPT = PROMPT // ' X, Y' |
| 89 |
CALL FFNEED (IFLD, INTYP, 'R', 2, |
| 90 |
& XPRMPT(:LENSTR(XPRMPT)), *100) |
| 91 |
CALL FFREAL (IFLD, INTYP, RFIELD, |
| 92 |
& 'X', 0.0, XRES, *100) |
| 93 |
CALL FFREAL (IFLD, INTYP, RFIELD, |
| 94 |
& 'Y', 0.0, YRES, *100) |
| 95 |
END IF |
| 96 |
|
| 97 |
RETURN |
| 98 |
|
| 99 |
100 CONTINUE |
| 100 |
RETURN 1 |
| 101 |
END |