ARSCAM(3NCARG)
β¨ ARSCAM β¨ (the NCAR Graphics manual, bestie edition)
okay so first things first: this is a page from the NCAR Graphics manual, and today's main character is a routine called ARSCAM. Pull up a chair, grab a boba, and let's get into it π
πΈ NAME πΈ
ARSCAM β scans an area map from left to right, extracting the definitions of all the areas defined by the area map and delivering them to a user-defined subroutine for processing.
like. it literally walks the map left to right, picks up every area it finds, and hands each one off to a routine you wrote. iconic behavior honestly π«Ά
π SYNOPSIS π
CALL ARSCAM (MAP,XCS,YCS,MCS,IAI,IAG,MAI,APR)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
void c_arscam (int *map, float *xcs, float *ycs, int mcs, int *iai, int
*iag, int mai, int (*apr)(float *xcs, float *ycs, int *ncs, int *iai,
int *iag, int *nai))
π DESCRIPTION π
okay bestie, here's the cast of characters. every single one of them, no skips:
MAPβ (an input/output array of typeINTEGER) β an array containing an area map that's been initialized by a call toARINAM, and to which edges have been added by calls toAREDAM. Heads up: if you did not preprocess the area map by callingARPRAM,ARSCAMcalls it for you before doing literally anything else. π
Note: as part of initializing the area map,ARINAMstores the dimension ofMAPinMAP(1); therefore, the dimension does not have to be given as an argument in calls toARSCAM.
XCS,YCSβ (workspace arrays, dimensionedMCS, of typeREAL) β hold the X and Y coordinates defining the edge of a given area, for use byARSCAMin calls to the area-processing routineAPR.MCSβ (an input expression of typeINTEGER) β dimension of each of the arraysXCSandYCS.IAI,IAGβ (workspace arrays, dimensionedMAI, of typeINTEGER) β holdMAIpairs of area identifiers and group identifiers, respectively. Used byARSCAMin calls to the area-processing routineAPR.MAIβ (an input expression of typeINTEGER) β dimension of each of the arraysIAIandIAG.MAImust be greater than or equal ton, wherenis the number of groups in the area map.APRβ (a subroutine) β an area-processing routine that is called byARSCAM, and must be declaredEXTERNALin the routine that callsARSCAM. You have to supply the routineAPRyourself, and it must have the following form:
SUBROUTINE APR (XCS,YCS,NCS,IAI,IAG,NAI)
DIMENSION XCS(*),YCS(*),IAI(*),IAG(*)
(code to process the area defined by XCS, YCS, IAI, and IAG)
RETURN
END
and inside that routine, here's what all those args mean:
XCS,YCSβ (input arrays, dimensionedNCS, of typeREAL) β the X and Y coordinates, in NDCs, ofNCSpoints defining a polygonal area. The last of these points is a duplicate of the first. Holes in an area are traced in a way that maximizes the probability of hardware fill working properly. π³οΈβ¨NCSβ (an input expression of typeINTEGER) β number of X and Y coordinates in the arraysXCSandYCS.IAI,IAGβ (input arrays, dimensionedNAI, of typeINTEGER) β holdNAIpairs of identifiers for the area defined byXCSandYCS. For each value ofIfrom1toNAI,IAI(I)is the area identifier for the area with respect to the group of edges specified by the group identifierIAG(I).NAIβ (an input expression of typeINTEGER) β number of values returned inIAIandIAG.NAIequals the number of groups of edges that you put in the area map.
now for the little behind-the-scenes moment, because this part is so important π
Before executing the first call to APR, ARSCAM calls GETSET to retrieve the current user coordinates and then executes the statement:
CALL SET (VPL,VPR,VPB,VPT,VPL,VPR,VPB,VPT,1)
where VPL, VPR, VPB, and VPT are the viewport left, right, bottom, and top coordinates in NDCs.
This ensures correct results if the NDCs in XCS and YCS are used in calls to such routines as GFA and GPL, and it allows clipping at the edges of the viewport. APR may make its own SET call to achieve some other effect. Before returning control to the calling routine, ARSCAM calls SET again to restore the original mapping parameters. π«‘
π C-BINDING DESCRIPTION π
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. (yes bestie, same energy, just a different language π₯°)
β EXAMPLES β
Use the ncargex command to see the following relevant examples: cardb1, carfill, ccpcldm, ccpfil, ccplbam, ccpllb, ccplll, ccpllw, ccpscam, ccpvs, colcon, cmpfil, cmpgrp, cmpita, cmptit, cpex01, cpex02, cpex03, cpex04, cpex05, cpex07, cpex08, eezmpa, arex01, vvex01, tareas, tconpa, tezmpa, fcover, ffex00, fcirc, fsfsgfa, fsppoint.
that's a whole lotta examples, and every single one of them is listed here because we do not skip π
π ACCESS π
To use ARSCAM or c_arscam, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. order matters, bestie, don't play games with the linker π
π₯ MESSAGES π₯
See the areas man page for a description of all Areas error messages and/or informational messages. go read it if something's acting up π
π¦ SEE ALSO π¦
- Online:
areas,areas_params,ardbpa,ardrln,aredam,argeti,argetr,argtai,arinam,armvam,arpram,arseti,arsetr,ncarg_cbind - Hardcopy: NCAR Graphics Contouring and Mapping Tutorial
π COPYRIGHT π
Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.
and that's the whole page, bestie!! π this one's from the UNIX side of things, dated March 1993, ARSCAM(3NCARG) β mwah, go scan some areas, you've 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