NGSRAT(3NCARG)
π NAME π
okay so, NGSRAT β it saves, restores, and sets the NCAR GKS primitive attribute values in toto, like the whole entire vibe in one go. (This is the NCAR GRAPHICS manual, page 3NCARG, for the record. π«Ά)
πΈ SYNOPSIS πΈ
CALL NGSRAT(IOPT, IAT, RAT)
π C-BINDING SYNOPSIS π
#include <ncarg/ncargC.h>
void c_ngsrat(int iopt, int *iat, float *rat)
π§ DESCRIPTION π§
IOPTβ an input variable of type INTEGER, and bestie it is literally the whole personality of this call, it tells you what action you want:= 0β save the current settings of all attributes internal to the subroutine, i.e. not in theIATandRATarrays.= 1β restore the context from the most recently saved state.= 2β return the current context in the output arraysIAT(integer attributes) andRAT(floating-point attributes), as follows:IATcontains integer GKS attribute settings as per:IAT( 1)= Clip indicatorIAT( 2)= Line typeIAT( 3)= Polyline color indexIAT( 4)= Marker typeIAT( 5)= Polymarker color indexIAT( 6)= Text fontIAT( 7)= Text precisionIAT( 8)= Text color indexIAT( 9)= Text pathIAT(10)= Text horizontal alignmentIAT(11)= Text vertical alignmentIAT(12)= Fill area interior styleIAT(13)= Fill are style indexIAT(14)= Fill area color index
RATcontains REAL GKS attribute settings as per:RAT( 1)= Linewidth scale factorRAT( 2)= Marker scale factorRAT( 3)= Character expansion factorRAT( 4)= Character spacingRAT( 5)= Character height in world coordinatesRAT( 6)= Character up vector, X component in world coordinatesRAT( 7)= Character up vector, Y component in world coordinates
= 3β set the context to the values specified in theIATandRATarrays (as described above).
IATβ an integer array, of length 14, and it only means anything ifIOPTequals 2 or 3. Every element of theIATarray is described up there in theIOPTbit. πRATβ a real array, of length 7, and again it only means anything ifIOPTequals 2 or 3. The elements are described up in theIOPTdescription too.
π οΈ USAGE π οΈ
Wanna save the state of the NCAR GKS primitive attribute settings? Call NGSRAT with a first argument of 0. When the first argument is 0, the IAT and RAT arrays (second and third arguments) are ignored and the state values are stored internally to NGSRAT. π
To restore the NCAR GKS primitive attribute values to what they were as of the last time NGSRAT was called with argument IOPT = 0, then call NGSRAT with first argument of 1. IAT and RAT are ignored in this case too, they're just there vibing.
If you call NGSRAT with a first argument of 2, then the current settings of the NCAR GKS primitive attribute values are returned in arrays IAT and RAT as per the description of IAT and RAT above.
If you call NGSRAT with a first argument of 3, then arrays IAT and RAT must be supplied and the values therein will be used to set the NCAR GKS primitive attribute values as per the description of IAT and RAT above. No arrays, no slay. π
A common use of NGSRAT would be in conjunction with NGMFTC and NGREOP for saving the GKS state after writing to one metafile, writing to a new metafile, and then restoring the GKS state when reopening the initial metafile. It's giving teamwork, honestly. β¨
π EXAMPLES π
The following sequence:
CALL NGSRAT(0,IAT,RAT)
... do some setting and drawing
CALL NGSRAT(1,IAT,RAT)
would save the values of all NCAR GKS primitive attributes before the code that does setting and drawing and then restore the attribute values after the setting and drawing. Save, do the thing, put it back. Iconic behavior. π
Use the ncargex command to see the following relevant example: pgkex27.
π ACCESS π
To use NGSRAT or c_ngsrat, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. Order matters bestie, do not freestyle it. π«Ά
π’ MESSAGES π’
NGSRAT issues no messages apart from potential illegal setting of the attribute values when IOPT = 3. So like, mostly silent, but if you set something illegal it will absolutely let you know. π
π SEE ALSO π
- Online:
ngmftc(3NCARG),ngreop(3NCARG), - Hardcopy: NCAR Graphics Fundamentals, UNIX Version.
Β©οΈ COPYRIGHT Β©οΈ
Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.
okay that's the whole page, bestie π this one's from the UNIX manual, dated October 1996, and it lives under the name NGSRAT(3NCARG). go save some attributes, you got this π¦β¨
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms