1NGREOP(3NCARG) NCAR GRAPHICS NGREOP(3NCARG)
2
3
4
6 NGREOP - reopen an existing NCAR Graphics metafile for appending.
7
9 CALL NGREOP(WKID, CONID, ITYPE, FNAME, IOPT, IAT, RAT,
10 NCOLRS, NSTART, CTAB)
11
13 #include <ncarg/ncargC.h>
14 #include <ncarg/gks.h>
15
16 void c_ngsrat(int wkid, int conid, int itype, char *fname,
17 int iopt, int *iat, float *rat, int ncolrs,
18 int nstart, Gcolr_rep *ctab)
19
21 WKID (an input variable of type INTEGER) specifying the
22 workstation identifier that the reopened metafile will
23 subsequently be known by. This does not have to be the
24 same as the worksttion identifier used to create the
25 original metafile.
26
27 CONID (an input variable of type INTEGER) specifying the
28 connection identifier.
29
30 ITYPE (an input variable of type INTEGER) specifying the
31 workstation type. Currently the only valid value is "1".
32 This subroutine may be augmented to accommodate PostScript
33 files in the future.
34
35 FNAME (an input variable of type CHARACTER) specifying the
36 filename of the metafile being opened for appending.
37
38 IOPT (an input variable of type INTEGER) specifying the desired
39 action:
40
41 = 0 reestablish the color table only (using the color
42 table in argument CTAB described below). The
43 attributes of the reopened workstation will be set
44 to default values and may well be out of sync with
45 the current GKS attributes.
46
47 = 1 reestablish the color table and GKS state (the GKS
48 state as supplied in arguments IAT and RAT
49 described below). The state values will not be
50 flushed to the metafile.
51
52 = 2 reestablish the color table and GKS state and flush
53 the GKS state values to the metafile.
54
55 = 3 reestablish the color table and flush the current
56 GKS state values to the metafile (not the values in
57 IAT and RAT). values to the metafile.
58
59
60
61 If IOPT equals 1 or 2, then IAT and RAT must be supplied,
62 otherwise not.
63
64 IAT (an input array of type INTEGER dimensioned for 14) that
65 contains GKS integer state variables as follows:
66
67 IAT( 1) = Clip indicator
68
69 IAT( 2) = Line type
70
71 IAT( 3) = Polyline color index
72
73 IAT( 4) = Marker type
74
75 IAT( 5) = Polymarker color index
76
77 IAT( 6) = Text font
78
79 IAT( 7) = Text precision
80
81 IAT( 8) = Text color index
82
83 IAT( 9) = Text path
84
85 IAT(10) = Text horizontal alignment
86
87 IAT(11) = Text vertical alignment
88
89 IAT(12) = Fill area interior style
90
91 IAT(13) = Fill are style index
92
93 IAT(14) = Fill area color index
94
95 RAT (an input array of type REAL dimensioned for 7) that
96 contains REAL GKS attribute settings as follows:
97
98 RAT( 1) = Linewidth scale factor
99
100 RAT( 2) = Marker scale factor
101
102 RAT( 3) = Character expansion factor
103
104 RAT( 4) = Character spacing
105
106 RAT( 5) = Character height in world coordinates
107
108 RAT( 6) = Character up vector, X component in world
109 coordinates
110
111 RAT( 7) = Character up vector, Y component in world
112 coordinates
113
114 NCOLRS (an input variable of type INTEGER) that specifies the
115 number of colors in the color table supplied in argument
116 CTAB, described below. NCOLRS can be 0 .
117
118 NSTART (an input variable of type INTEGER) that specifies the
119 color index associated with the first color in the color
120 table CTAB (all other color indices are filled in in
121 sequence). For example, if NCOLRS = 3 and NSTART = 4, then
122 the color values defined in CTAB would be used to define
123 color indices 4, 5, and 6.
124
125 CTAB (in the FORTRAN version of this routine, a two-dimensional
126 input array of type REAL dimensioned CTAB(3,NCOLRS); in the
127 C version of this routine, a one-dimensional input array of
128 type Gcolr_rep dimensioned ctab[ncolrs]) that specifies a
129 color table used to initialize the reopened metafile. This
130 color table does not necessarily have to agree with the
131 color table in effect when the original metafile was
132 created.
133
135 The most common usage of NGREOP would be in conjunction with usage of
136 NGSRAT and NGMFTC. NGMFTC would be used to temporarily close a
137 metafile and NGSRAT used to save the state of the GKS primitive
138 attributes at the time of the close. To reopen the temporarily closed
139 metafile you would call NGREOP with the attribute settings previously
140 saved and a setting of IOPT of 2. NGMFTC can be used to temporarily
141 close a metafile any time after it has been opened, even in the middle
142 of a picture.
143
144 NGREOP only reopens the metafile and does not activate it. It will be
145 necessary to call GACWK before sending graphics primitives to the
146 reopened metafile.
147
148 NGREOP can also be used to reopen a previously created metafile -
149 either created in an independent job step, or in the same job step.
150
152 The following sequence:
153
154 CALL NGMFTC(1)
155 CALL NGSRAT(2, IAT, RAT)
156
157 ... do stuff
158
159 CALL NGREOP(CALL NGREOP(1, 2, 1, 'gmeta1', 2, IAT, RAT,
160 NCOLS, 0, CTAB)
161
162
163 would temporarily close the metafile with workstation ID of 1 (in this
164 case a metafile with name "gmeta1") and save the GKS state variables at
165 the time of the close. Then the call to NGREOP would reopen the
166 metafile for appending.
167
168 Use the ncargex command to see the following relevant example: pgkex27.
169
171 To use NGREOP or c_ngreop, load the NCAR Graphics libraries ncarg,
172 ncarg_gks, and ncarg_c, preferably in that order.
173
175 NGREOP issues the same messages as those issued by GOPWK.
176
178 Online: ngmftc(3NCARG), ngsrat(3NCARG),
179
180 Online URL: http://ngwww.ucar.edu/ngdoc/ng/gks/gkshome.html
181
183 Copyright (C) 1987-2009
184 University Corporation for Atmospheric Research
185 The use of this Software is governed by a License Agreement.
186
187
188
189UNIX October 1996 NGREOP(3NCARG)