| 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 INPICK (TYPE) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** INPICK *** (MESH) Initialize cursor input for last display |
| 12 |
C -- Written by Amy Gilkey - revised 03/07/88 |
| 13 |
C -- |
| 14 |
C --INPICK saves the displayed mesh characteristics for cursor input |
| 15 |
C --in common /PICK/. This routine should be called after the last |
| 16 |
C --mesh display before any cursor input. |
| 17 |
C -- |
| 18 |
C --Parameters: |
| 19 |
C -- TYPE - IN - the type of mesh last displayed (determines which |
| 20 |
C -- coordinates arrays to use): |
| 21 |
C -- 'DEFORM' - deformed mesh (or any 3D mesh) |
| 22 |
C -- 'UNDEFORM' - undeformed mesh |
| 23 |
C -- 'NONE' - no mesh displayed |
| 24 |
C -- |
| 25 |
C --Common Variables: |
| 26 |
C -- Sets /PICK/ |
| 27 |
C -- Uses IS3DIM of /D3NUMS/ |
| 28 |
C -- Uses ZMMESH of /MSHLIM/ |
| 29 |
C -- Uses ROTMAT, ROTCEN of /ROTOPT/ |
| 30 |
|
| 31 |
PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6) |
| 32 |
|
| 33 |
include 'pick.blk' |
| 34 |
include 'd3nums.blk' |
| 35 |
include 'mshlim.blk' |
| 36 |
include 'rotopt.blk' |
| 37 |
|
| 38 |
CHARACTER*(*) TYPE |
| 39 |
|
| 40 |
INITP = .FALSE. |
| 41 |
|
| 42 |
IF ((TYPE .EQ. 'DEFORM') .OR. (TYPE .EQ. 'UNDEFORM')) THEN |
| 43 |
|
| 44 |
C --Set the pick initialization flag |
| 45 |
INITP = .TRUE. |
| 46 |
PKDEF = (TYPE .EQ. 'DEFORM') |
| 47 |
|
| 48 |
C --Save the limits of the displayed mesh |
| 49 |
CALL CPYREA (KTOP, ZMMESH, PKMESH) |
| 50 |
|
| 51 |
C --Save the rotation matrix and the rotation center of the displayed mesh |
| 52 |
IF (IS3DIM) THEN |
| 53 |
CALL CPYREA (3*3, ROTMAT, PKRMAT) |
| 54 |
CALL CPYREA (3, ROTCEN, PKRCEN) |
| 55 |
END IF |
| 56 |
|
| 57 |
C --Calculate the device coordinates of the limits of the displayed mesh |
| 58 |
CALL MP2PT (1, PKMESH(KLFT), PKMESH(KBOT), |
| 59 |
& DMESH(KLFT), DMESH(KBOT), M) |
| 60 |
CALL MP2PT (1, PKMESH(KRGT), PKMESH(KTOP), |
| 61 |
& DMESH(KRGT), DMESH(KTOP), M) |
| 62 |
|
| 63 |
C --Calculate the device to mesh conversion factor |
| 64 |
DVRAT = (PKMESH(KRGT) - PKMESH(KLFT)) |
| 65 |
& / (DMESH(KRGT) - DMESH(KLFT)) |
| 66 |
|
| 67 |
C --Find the device coordinates of the center of the displayed mesh, |
| 68 |
C --for use as the default starting point |
| 69 |
PKXMID = 0.5 * (PKMESH(KRGT) + PKMESH(KLFT)) |
| 70 |
PKYMID = 0.5 * (PKMESH(KTOP) + PKMESH(KBOT)) |
| 71 |
CALL MP2PT (1, PKXMID, PKYMID, DXMID, DYMID, M) |
| 72 |
|
| 73 |
DXLAST = DXMID |
| 74 |
DYLAST = DYMID |
| 75 |
|
| 76 |
ELSE |
| 77 |
|
| 78 |
C --Reset the pick initialization flag |
| 79 |
INITP = .FALSE. |
| 80 |
END IF |
| 81 |
|
| 82 |
RETURN |
| 83 |
END |