| 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 SHADE (LENF, NLNKF, LINKF, NXFAC, IXFAC, |
| 9 |
& XN, YN, ZN, IELBST, BLKCOL, IDELB, SHDCOL, ISHDCL, IHIDOP, *) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** SOLID *** (DETOUR) Paint solid mesh (by index) |
| 13 |
C -- Modified by John Glick - 11/29/88 |
| 14 |
C -- Written by Amy Gilkey - revised 10/27/87 |
| 15 |
C -- |
| 16 |
C --SOLID paints the mesh in the color of each elements element block. |
| 17 |
C -- |
| 18 |
C --Parameters: |
| 19 |
C -- LENF - IN - the cumulative face counts by element block |
| 20 |
C -- NLNKF - IN - the number of nodes per face |
| 21 |
C -- LINKF - IN - the connectivity for all faces |
| 22 |
C -- NXFAC - IN - the number of ordered faces (if DOIXF) |
| 23 |
C -- IXFAC - IN - the indices of the ordered faces (if DOIXF) |
| 24 |
C -- XN, YN, ZN - IN - the nodal coordinates |
| 25 |
C -- IELBST - IN - the element block status (>0 if selected) |
| 26 |
C -- BLKCOL - IN/OUT - the user selected colors of the element blocks. |
| 27 |
C -- BLKCOL(0) = 1 if the user defined material |
| 28 |
C -- colors should be used in mesh plots. |
| 29 |
C -- = -1 if program selected colors should |
| 30 |
C -- be used. |
| 31 |
C -- BLKCOL(i) = the user selected color of element |
| 32 |
C -- block i: |
| 33 |
C -- -2 - no color selected by user. |
| 34 |
C -- -1 - black |
| 35 |
C -- 0 - white |
| 36 |
C -- 1 - red |
| 37 |
C -- 2 - green |
| 38 |
C -- 3 - yellow |
| 39 |
C -- 4 - blue |
| 40 |
C -- 5 - cyan |
| 41 |
C -- 6 - magenta |
| 42 |
C -- * - return statement if the cancel function is active |
| 43 |
C -- |
| 44 |
C --Common Variables: |
| 45 |
C -- Uses NUMEL, NELBLK of /DBNUMS/ |
| 46 |
C -- Uses IS3DIM of /D3NUMS/ |
| 47 |
|
| 48 |
PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6) |
| 49 |
include 'mshlim.blk' |
| 50 |
include 'icrnbw.blk' |
| 51 |
include 'light.blk' |
| 52 |
include 'dbnums.blk' |
| 53 |
include 'd3nums.blk' |
| 54 |
|
| 55 |
INTEGER LENF(0:NELBLK) |
| 56 |
INTEGER NLNKF(NELBLK) |
| 57 |
INTEGER LINKF(*) |
| 58 |
INTEGER IXFAC(*) |
| 59 |
REAL XN(*), YN(*), ZN(*) |
| 60 |
INTEGER IELBST(NELBLK) |
| 61 |
INTEGER BLKCOL(0:NELBLK) |
| 62 |
INTEGER IDELB(*) |
| 63 |
C ... SHDCOL(1, *) = Red Component |
| 64 |
C SHDCOL(2, *) = Green Component |
| 65 |
C SHDCOL(3, *) = Blue Component |
| 66 |
C SHDCOL(4-7,*) - Future Use |
| 67 |
REAL SHDCOL(7,NELBLK) |
| 68 |
C ... ISHDCL(1, *) = -1 if color not set, >0 if color set |
| 69 |
C ISHDCL(2, *) = Number of colors to use for this block (SET if 0) |
| 70 |
C ISHDCL(3, *) = Starting location in color map (SET) |
| 71 |
INTEGER ISHDCL(3,NELBLK) |
| 72 |
|
| 73 |
C ... AMBIENT controls the range of hue values. The hue is scaled by: |
| 74 |
C HUE = (1 - AMBIENT) * HUE + AMBIENT |
| 75 |
C ... It is somewhat similar to the ambient intensity. |
| 76 |
|
| 77 |
if (.not. is3dim) return |
| 78 |
|
| 79 |
C ... Determine range of plot window |
| 80 |
XMIN = ZMMESH(KLFT) |
| 81 |
XMAX = ZMMESH(KRGT) |
| 82 |
YMIN = ZMMESH(KBOT) |
| 83 |
YMAX = ZMMESH(KTOP) |
| 84 |
|
| 85 |
C ... Set colors for all blocks |
| 86 |
call setcol (nelblk, shdcol, ishdcl, ielbst, blkcol, idelb) |
| 87 |
|
| 88 |
C ... Heres where we actually start plotting something. |
| 89 |
|
| 90 |
call excpus(time1) |
| 91 |
DO 100 IX = 1, NXFAC |
| 92 |
IFAC = IXFAC(IX) |
| 93 |
IELB = 0 |
| 94 |
IXL = IDBLNK (IELB, IFAC, LENF, NLNKF) |
| 95 |
|
| 96 |
NNPF = NLNKF(IELB) |
| 97 |
CALL SHADEN (NNPF, LINKF(IXL), XN, YN, ZN, |
| 98 |
* ishdcl(2,ielb), LITE, NLIT, ishdcl(3,ielb), |
| 99 |
* shdcol(4,ielb), shdcol(5,ielb), shdcol(6,ielb), |
| 100 |
* xmin, ymin, xmax, ymax) |
| 101 |
100 CONTINUE |
| 102 |
call excpus(time2) |
| 103 |
tottim = time2 - time1 |
| 104 |
if (tottim .gt. 0.0) then |
| 105 |
write (*,900) nxfac, time2-time1, nxfac/(time2-time1) |
| 106 |
end if |
| 107 |
900 FORMAT (' Processed ', i6, ' faces in ', 1pe10.3, ' seconds. ', |
| 108 |
* '(',1pe10.3,' faces/second)',/) |
| 109 |
|
| 110 |
CALL PLTFLU |
| 111 |
|
| 112 |
RETURN |
| 113 |
END |