Debian Codegraph @

packages/seacas/applications/blot/grview.f

raw
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 GRVIEW (ASPECT, DVIEW0, DVIEW)
9 C=======================================================================
10
11 C --*** GRVIEW *** (GRPLIB) Set graphics window
12 C -- Written by Amy Gilkey - revised 02/20/86
13 C --
14 C --GRVIEW sets the device coordinates for the window given the X:Y
15 C --axis length ratio.
16 C --
17 C --Parameters:
18 C -- ASPECT - IN - the ratio of the X axis length to the Y axis length
19 C -- = (X axis length / Y axis length) {in window units}
20 C -- / (X axis length / Y axis length) {in device units}
21 C -- DVIEW0 - IN - the maximum window (left, right, bottom, top)
22 C -- (in device coordinates)
23 C -- DVIEW - OUT - the actual window (left, right, bottom, top)
24 C -- (in device coordinates)
25
26 PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4)
27
28 REAL ASPECT
29 REAL DVIEW0(KTOP), DVIEW(KTOP)
30
31 IF (ASPECT .GE. 1.0) THEN
32 DVIEW(KLFT) = DVIEW0(KLFT)
33 DVIEW(KRGT) = DVIEW0(KRGT)
34 ELSE
35 OS = .5 * (1.0 - ASPECT) * (DVIEW0(KRGT) - DVIEW0(KLFT))
36 DVIEW(KLFT) = DVIEW0(KLFT) + OS
37 DVIEW(KRGT) = DVIEW0(KRGT) - OS
38 END IF
39 IF (ASPECT .LE. 1.0) THEN
40 DVIEW(KBOT) = DVIEW0(KBOT)
41 DVIEW(KTOP) = DVIEW0(KTOP)
42 ELSE
43 OS = .5 * (1.0 - 1.0/ASPECT) * (DVIEW0(KTOP) - DVIEW0(KBOT))
44 DVIEW(KBOT) = DVIEW0(KBOT) + OS
45 DVIEW(KTOP) = DVIEW0(KTOP) - OS
46 END IF
47
48 RETURN
49 END