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 type INTEGER) β€” an array containing an area map that's been initialized by a call to ARINAM, and to which edges have been added by calls to AREDAM. Heads up: if you did not preprocess the area map by calling ARPRAM, ARSCAM calls it for you before doing literally anything else. πŸ’…
Note: as part of initializing the area map, ARINAM stores the dimension of MAP in MAP(1); therefore, the dimension does not have to be given as an argument in calls to ARSCAM.
  • XCS,YCS β€” (workspace arrays, dimensioned MCS, of type REAL) β€” hold the X and Y coordinates defining the edge of a given area, for use by ARSCAM in calls to the area-processing routine APR.
  • MCS β€” (an input expression of type INTEGER) β€” dimension of each of the arrays XCS and YCS.
  • IAI,IAG β€” (workspace arrays, dimensioned MAI, of type INTEGER) β€” hold MAI pairs of area identifiers and group identifiers, respectively. Used by ARSCAM in calls to the area-processing routine APR.
  • MAI β€” (an input expression of type INTEGER) β€” dimension of each of the arrays IAI and IAG. MAI must be greater than or equal to n, where n is the number of groups in the area map.
  • APR β€” (a subroutine) β€” an area-processing routine that is called by ARSCAM, and must be declared EXTERNAL in the routine that calls ARSCAM. You have to supply the routine APR yourself, 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, dimensioned NCS, of type REAL) β€” the X and Y coordinates, in NDCs, of NCS points 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 type INTEGER) β€” number of X and Y coordinates in the arrays XCS and YCS.
  • IAI,IAG β€” (input arrays, dimensioned NAI, of type INTEGER) β€” hold NAI pairs of identifiers for the area defined by XCS and YCS. For each value of I from 1 to NAI, IAI(I) is the area identifier for the area with respect to the group of edges specified by the group identifier IAG(I).
  • NAI β€” (an input expression of type INTEGER) β€” number of values returned in IAI and IAG. NAI equals 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 (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 πŸ’–βœ¨πŸ¦‹