1NGSRAT(3NCARG) NCAR GRAPHICS NGSRAT(3NCARG)
2
3
4
6 NGSRAT - save/restore/set NCAR GKS primitive attribute values in toto.
7
9 CALL NGSRAT(IOPT, IAT, RAT)
10
12 #include <ncarg/ncargC.h>
13
14 void c_ngsrat(int iopt, int *iat, float *rat)
15
17 IOPT (an input variable of type INTEGER) indicating the desired
18 action:
19
20 = 0 save the current settings of all attributes
21 internal to the subroutine, i.e. not in the IAT and
22 RAT arrays.
23
24 = 1 restore the context from the most recently saved
25 state.
26
27 = 2 return the current context in the output arrays IAT
28 (integer attributes) and RAT (floating-point
29 attributes) as follows:
30
31 IAT contains integer GKS attribute settings as per:
32
33 IAT( 1) = Clip indicator
34
35 IAT( 2) = Line type
36
37 IAT( 3) = Polyline color index
38
39 IAT( 4) = Marker type
40
41 IAT( 5) = Polymarker color index
42
43 IAT( 6) = Text font
44
45 IAT( 7) = Text precision
46
47 IAT( 8) = Text color index
48
49 IAT( 9) = Text path
50
51 IAT(10) = Text horizontal alignment
52
53 IAT(11) = Text vertical alignment
54
55 IAT(12) = Fill area interior style
56
57 IAT(13) = Fill are style index
58
59 IAT(14) = Fill area color index
60
61 RAT contains REAL GKS attribute settings as per:
62
63 RAT( 1) = Linewidth scale factor
64
65 RAT( 2) = Marker scale factor
66
67 RAT( 3) = Character expansion factor
68
69 RAT( 4) = Character spacing
70
71 RAT( 5) = Character height in world coordinates
72
73 RAT( 6) = Character up vector, X component in
74 world coordinates
75
76 RAT( 7) = Character up vector, Y component in
77 world coordinates
78
79 = 3 set the context to the values specified in the IAT
80 and RAT arrays (as described above).
81
82 IAT An integer array, of length 14, that has meaning only if
83 IOPT equals 2 or 3. The elements of the IAT array are
84 described in the above description of IOPT.
85
86 RAT A real array, of length 7, that has meaning only if IOPT
87 equals 2 or 3. The elements of the IAT array are described
88 in the above description of IOPT.
89
91 If you want to save the state of the NCAR GKS primitive attribute
92 settings, call NGSRAT with a first argument of 0. When the first
93 argument is 0, the IAT and RAT arrays (second and third arguments) are
94 ignored and the state values are stored internally to NGSRAT.
95
96 To restore the NCAR GKS primitive attribute values to what they were as
97 of the last time NGSRAT was called with argument IOPT = 0, then call
98 NGSRAT with first argument of 1. IAT and RAT are ignored in this case.
99
100 If you call NGSRAT with a fist argument of 2, then the current settings
101 of the NCAR GKS primitive attribute values are returned in arrays IAT
102 and RAT as per the description of IAT and RAT above.
103
104 If you call NGSRAT with a fist argument of 3, then arrays IAT and RAT
105 must be supplied and the values therein will be used to set the NCAR
106 GKS primitive attribute values as per the description of IAT and RAT
107 above.
108
109 A common use of NGSRAT would be in conjunction with NGMFTC and NGREOP
110 for saving the GKS state after writing to one metafile, writing to a
111 new metafile, and then restoring the GKS state when reopening the
112 initial metafile.
113
115 The following sequence:
116
117 CALL NGSRAT(0,IAT,RAT)
118
119 ... do some setting and drawing
120
121 CALL NGSRAT(1,IAT,RAT)
122
123 would save the values of all NCAR GKS primitive attributes before the
124 code that does setting and drawing and then restore the attribute
125 values after the setting and drawing.
126
127 Use the ncargex command to see the following relevant example: pgkex27.
128
130 To use NGSRAT or c_ngsrat, load the NCAR Graphics libraries ncarg,
131 ncarg_gks, and ncarg_c, preferably in that order.
132
134 NGSRAT issues no messages apart from potential illegal setting of the
135 attribute values when IOPT = 3.
136
138 Online: ngmftc(3NCARG), ngreop(3NCARG),
139
140 Hardcopy: NCAR Graphics Fundamentals, UNIX Version.
141
143 Copyright (C) 1987-2009
144 University Corporation for Atmospheric Research
145 The use of this Software is governed by a License Agreement.
146
147
148
149UNIX October 1996 NGSRAT(3NCARG)