Debian Codegraph @

packages/seacas/libraries/svdi/test/cgitest.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 external cgit07
8 c external cgimet
9 character*10 met1,met2
10 integer mf1id, tk1id
11 real x(20), y(20)
12 integer clr(3)
13 integer colors(24)
14 character*10 text
15 integer lnclr(3)
16 integer chhit(10)
17
18 include 'cgidef.f'
19
20 c set colors up like vdi:
21 C Index Color RGB Values
22 C 0 black 0.,0.,0.
23 C 1 red 1.,0.,0.
24 C 2 green 0.,1.,0.
25 C 3 yellow 1.,1.,0.
26 C 4 blue 0.,0.,1.
27 C 5 magenta 1.,0.,1.
28 C 6 cyan 0.,1.,1.
29 C 7 white 1.,1.,1.
30
31 data colors / 0, 0, 0, 255, 0, 0, 0, 255, 0,
32 * 255, 255, 0, 0, 0, 255, 255, 0, 255,
33 * 0, 255, 255, 255, 255, 255 /
34
35 met1 = 'file55'
36 met2 = 'meta2'
37
38 c call xcact(cgimet,mf1id)
39 c call xcact(cgimet,mf2id)
40 c call xcact(cgit07,tk1id)
41
42 c call xcooff(tk1id)
43 c call xcooff(mf2id)
44 c call cesc(-28372,1,met1)
45 c call xcooff(mf1id)
46 c call xcoon(mf2id)
47 c call cesc(-28372,1,met2)
48 c call xcoon(tk1id)
49 c call xcoon(mf1id)
50
51 c initialize cgi
52 c call cesc(-28372,1,met1)
53 call ci(1)
54 call cvdcx(0., 0., 32767.,32767.)
55 c call cv(.5,0.,2.5,1.)
56 C VDC clip COFF, CON
57 call ccl(CON)
58 C viewsurface clip CDCOFF, CDCREC, CVPORT
59 call cdscl(CDCREC)
60
61 do 10 i=1,2
62 c draw some primitives in default color
63 c ..polylines
64 x(1) = 100.
65 x(2) = 16000.
66 y(1) = 16500.
67 y(2) = 16500.
68 call clnt(1)
69 call cpl(2,x,y)
70 y(1) = 20500.
71 y(2) = 20500.
72 call clnt(2)
73 call cpl(2,x,y)
74 y(1) = 24500.
75 y(2) = 24500.
76 call clnt(3)
77 call cpl(2,x,y)
78 y(1) = 28500.
79 y(2) = 28500.
80 call clnt(4)
81 call cpl(2,x,y)
82
83 c ..polygons
84 call cis(CHOLLO)
85 x(1) = 20000.
86 y(1) = 25000.
87 x(2) = 29000.
88 y(2) = 25000.
89 x(3) = 24500.
90 y(3) = 32000
91 x(4) = 20000.
92 y(4) = 25000.
93 call cpg(4,x,y)
94 x(1) = 20000.
95 y(1) = 23500.
96 x(2) = 29000.
97 y(2) = 23500.
98 x(3) = 24500.
99 y(3) = 16500.
100 x(4) = 20000.
101 y(4) = 23500.
102 call cis(CSOLID)
103 call cpg(4,x,y)
104
105 c ...markers
106 x(1) = 100.
107 y(1) = 100.
108 x(2) = 2100.
109 y(2) = 2100.
110 x(3) = 4100.
111 y(3) = 4100.
112 x(4) = 6100.
113 y(4) = 6100
114 x(5) = 8100.
115 y(5) = 8100.
116 x(6) = 10100.
117 y(6) = 10100.
118 x(7) = 12100.
119 y(7) = 12100.
120 x(8) = 14100.
121 y(8) = 14100.
122 x(9) = 16100.
123 y(9) = 16100.
124 call cpm(9,x,y)
125
126 c ...text
127 c ...do tektronix first, then metafile
128 c ...do this because cgtxx is an inquiry
129 c do 20 j=1,2
130 c if(j.eq.1)then
131 c call xcooff( mf1id )
132 c call xcooff( mf2id )
133 c call xcoon( tk1id )
134 c call xcsol( tk1id )
135 c call cili( CLOCAT, 1)
136 c else
137 c call xcooff( tk1id )
138 c call xcoon( mf1id )
139 c call xcoon( mf2id )
140 c call xcsol( mf1id )
141 call cili( CLOCAT, 1)
142 c endif
143 call cqchh(" ",0,1,1,istat,ntot,nlist,chhit)
144 text = "TEXT"
145 call cchh(327.)
146 call ctx( 17000.,100.,1,text(1:4))
147 call cgtxx(17000.,100.,text(1:4),ivstat,ivconc,xconc,yconc,
148 * p1,q1,p2,q2,p3,q3,p4,q4)
149 call ctx( xconc,yconc,1,text(1:4))
150 call cgtxx(xconc,yconc,text(1:4),ivstat,ivconc, xconc,yconc,
151 * p1,q1,p2,q2,p3,q3,p4,q4)
152 call cchh(3270.)
153 call ctx( xconc,yconc,1,text(1:4))
154
155 call cchh(3270.)
156 text = "A"
157 call ctx( 16500.,10000.,1,text(1:1))
158 call cgtxx(16500.,10000.,text(1:1),ivstat,ivconc, xconc,yconc,
159 * p1,q1,p2,q2,p3,q3,p4,q4)
160 text = "B"
161 call ctx( xconc,yconc,1,text(1:1))
162 call cgtxx(xconc,yconc,text(1:1),ivstat,ivconc, xconc,yconc,
163 * p1,q1,p2,q2,p3,q3,p4,q4)
164 text = "C"
165 call ctx( xconc,yconc,1,text(1:1))
166 call cgtxx(xconc,yconc,text(1:1),ivstat,ivconc, xconc,yconc,
167 * p1,q1,p2,q2,p3,q3,p4,q4)
168 text = "ABC"
169 call ctx( xconc, yconc,1,text(1:3))
170 call cgtxx(xconc,yconc,text(1:3),ivstat,ivconc, xconc,yconc,
171 * p1,q1,p2,q2,p3,q3,p4,q4)
172 x(1) = p1
173 y(1) = q1
174 x(2) = p2
175 y(2) = q2
176 x(3) = p3
177 y(3) = q3
178 x(4) = p4
179 y(4) = q4
180 x(5) = p1
181 y(5) = q1
182 call clnt(1)
183 call cpl(5,x,y)
184
185 c use request locator as a pause
186 call crqlc(1,1,istat,irstat,mvalid,itrig,xx,yy)
187 call cpds(0)
188 20 continue
189
190 c turn everything on
191 c call xcoon( tk1id )
192 c call xcoon( mf1id )
193 c call xcoon( mf2id )
194
195 c change colors
196 if(i.eq.1) then
197
198 c does the device support direct color
199 c ...do it this weird way cause i'm lazy - if one is only indexed
200 c color, then treat them both as indexed color
201 c call xcsol( tk1id )
202 call cqc( idum, idum, idum, idum, icmode, idum, idum, idum )
203 if( icmode .eq. CCLRID ) then
204 c call xcsol( mf1id )
205 call cqc( idum, idum, idum, idum, icmode, idum, idum, idum )
206 endif
207
208 c set direct color mode if supported, otherwise use indexed
209 c only set the color table for indexed color
210 if( icmode .eq. CCLRID ) then
211 call ccsm( CDRECT )
212 else
213 call ccsm( CINDEX )
214 call cct(0,8,colors)
215 endif
216
217 c ...make polylines red
218 if( icmode .eq. CCLRID ) then
219 clr(1) = 255
220 clr(2) = 0
221 clr(3) = 0
222 else
223 clr(1) = 1
224 endif
225 call clnc(clr)
226 call cqlna(istat,lnbi,lntyp,lwmod,lnwid,csmod,lnclr,lcmod)
227
228 c ...make polygons green
229 if( icmode .eq. CCLRID ) then
230 clr(1) = 0
231 clr(2) = 255
232 clr(3) = 0
233 else
234 clr(1) = 2
235 endif
236 call cflc(clr)
237
238 c ...make polymarkers yellow
239 if( icmode .eq. CCLRID ) then
240 clr(1) = 255
241 clr(2) = 255
242 clr(3) = 0
243 else
244 clr(1) = 3
245 endif
246 call cmkc(clr)
247
248 c ...make text blue
249 if( icmode .eq. CCLRID ) then
250 clr(1) = 0
251 clr(2) = 0
252 clr(3) = 255
253 else
254 clr(1) = 4
255 endif
256 call ctxc(clr)
257 endif
258
259 10 continue
260 call ct
261 c call xcdact( mf1id )
262 c call xcdact( mf2id )
263 c call xcdact( tk1id )
264 stop
265 end