Debian Codegraph @

packages/seacas/applications/blot/mshcol.f

raw
1 C Copyright(C) 1999-2020, 2024 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 MSHCOL (FNCT, IELB, MLNTYP, WIDLIN, BLKCOL,
9 & IDELB)
10 C=======================================================================
11
12 C --*** MSHCOL *** (MESH) Set line color, type, and width
13 C -- Modified by John Glick - 1/17/89
14 C -- Written by Amy Gilkey - revised 03/29/88
15 C --
16 C --MSHCOL sets the line color, type, and width. The lines have been
17 C --divided into parts as follows:
18 C -- -1) Mesh boundary
19 C -- 0) Element block boundary
20 C -- n) Interior within element block 'n'
21 C --
22 C --Be sure to call this routine to reset the line type and line width
23 C --to the default before exiting the mesh-drawing routine.
24 C --
25 C --Parameters:
26 C -- FNCT - IN - the type of lines being drawn:
27 C -- 'RESET' - reset line type, etc.
28 C -- 'INTERIOR' - the interior mesh lines (small)
29 C -- 'BOUNDARY' - mesh boundaries defined by hidden lines
30 C -- 'LINE' - normal mesh lines
31 C -- 'DEBUG' - lines for debugging (blue)
32 C -- IELB - IN - the line "part" (as above)
33 C -- MLNTYP - IN - the line type (and color) of lines (as in /MSHOPT/)
34 C -- WIDLIN - IN - true iff mesh lines should be wide versus narrow
35 C -- BLKCOL - IN/OUT - the user selected colors of the element blocks.
36 C -- BLKCOL(0) = 1 if the user defined material
37 C -- colors should be used in mesh plots.
38 C -- = -1 if program selected colors should
39 C -- be used.
40 C -- BLKCOL(i) = the user selected color of element
41 C -- block i:
42 C -- -2 - no color selected by user.
43 C -- -1 - black
44 C -- 0 - white
45 C -- 1 - red
46 C -- 2 - green
47 C -- 3 - yellow
48 C -- 4 - blue
49 C -- 5 - cyan
50 C -- 6 - magenta
51
52 PARAMETER (KWIDLN=2)
53
54 include 'dbnums.blk'
55 include 'linthc.blk'
56
57 CHARACTER*(*) FNCT
58 INTEGER MLNTYP(-1:1)
59 LOGICAL WIDLIN
60 INTEGER BLKCOL(0:NELBLK)
61 INTEGER IDELB(*)
62
63 LOGICAL PLTGTV, PLTSTV, LDUM
64
65 LOGICAL FIRST
66 SAVE FIRST
67
68 DATA FIRST / .TRUE. /
69
70 IF (FIRST) THEN
71 C --Get the default line width
72 LDUM = PLTGTV (KWIDLN, WIDLN)
73 FIRST = .FALSE.
74 END IF
75
76 IF ((FNCT .EQ. 'RESET') .OR. (IELB .LT. -1)) THEN
77 C --Reset to default color, line type, and line width
78 ICOLOR = 0
79 LTYP = 1
80 WID = 160.
81 C WID = 1.00
82 ELSE IF (IELB .EQ. -1) THEN
83 ICOLOR = 0
84 IF (MLNTYP(-1) .LT. 0) ICOLOR = -1
85 LTYP = IABS (MLNTYP(-1))
86 C WID = 1.75
87 WID = MSHBND
88 ELSE IF (IELB .EQ. 0) THEN
89 ICOLOR = 0
90 IF (MLNTYP(0) .LT. 0) ICOLOR = -1
91 LTYP = IABS (MLNTYP(0))
92 C WID = 1.25
93 WID = BLKBND
94 ELSE
95 ICOLOR = IELB
96 IF (MLNTYP(1) .LT. 0) ICOLOR = -1
97 LTYP = IABS (MLNTYP(1))
98 IF (WIDLIN) THEN
99 C WID = 1.00
100 WID = ELEBND
101 ELSE
102 C WID = 0.50
103 WID = ELEBND / 2
104 END IF
105 END IF
106
107 IF (FNCT .EQ. 'INTERIOR') THEN
108 C --Interior lines as thin lines
109 WID = 0.5 * WID
110 ELSE IF (FNCT .EQ. 'BOUNDARY') THEN
111 C --Element lines on hidden line boundaries - line type as
112 C --boundary lines, black => white as boundary
113 IF (IELB .GT. 0) THEN
114 IF ((ICOLOR .EQ. -1) .AND. (MLNTYP(0) .GT. 0)) ICOLOR = 0
115 LTYP = IABS (MLNTYP(0))
116 END IF
117 ELSE IF (FNCT .EQ. 'LINE') THEN
118 C --Normal mesh lines are ok
119 CONTINUE
120 ELSE IF (FNCT .EQ. 'DEBUG') THEN
121 C --Lines for debugging are blue
122 CALL GRCOLR (4)
123 END IF
124
125 C --Make line size of dotted lines smaller
126 IF (LTYP .NE. 1) THEN
127 IF ((IELB .LE. 0) .OR. WIDLIN) THEN
128 WID = 0.75 * WID
129 END IF
130 END IF
131
132 C IF (ICOLOR .GT. 0) ICOLOR = IDELB(IELB)
133 C ... Test by Sjaardema, should pass ielb?
134 IF (ICOLOR .GT. 0) ICOLOR = IELB
135 CALL UGRCOL (ICOLOR, BLKCOL)
136 LDUM = PLTSTV (1, 1.0 * LTYP)
137 LDUM = PLTSTV (KWIDLN, WID)
138
139 RETURN
140 END