PPPLCL(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– PPPLCL πŸ’– β€” the NCAR GRAPHICS polyline-clipping girlie

okay so bestie, welcome to PPPLCL, a member of the NCAR Graphics family (that's the 3NCARG section of the manual, if you're keeping track πŸ“šβœ¨).

So what does she do? She clips a polyline against a clipping rectangle. That's it. That's the job. πŸ’…

And real talk, the devs straight-up say it in the notes: it was intended that eventually there should be a better routine that will clip a polyline against an arbitrary polygon, but that routine has not yet been written. So we work with what we have, and what we have is a rectangle. πŸŽ€


✨ SYNOPSIS ✨

CALL PPPLCL (XMIN,XMAX,YMIN,YMAX,XCPL,YCPL,NCPL,RWRK,LRWK,URPF,IERR)

πŸ¦‹ C-BINDING SYNOPSIS πŸ¦‹

#include <ncarg/ncargC.h>

void c_ppplcl(float xmin,
              float xmax,
              float ymin,
              float ymax,
              float *xcpl,
              float *ycpl,
              int ncpl,
              float *rwrk,
              int lwrk,
              int (*urpf_)(float *xcra,
                           float *ycra,
                           int *ncra),
              int *ierr)

🌸 DESCRIPTION 🌸

okay let's meet the cast, one by one, no skips 🫢

  • XMIN β€” an input expression of type REAL, and she's the X coordinate value that defines the position of the left edge of the clipping rectangle.
  • XMAX β€” an input expression of type REAL, the X coordinate value defining the position of the right edge of the clipping rectangle.
  • YMIN β€” an input expression of type REAL, the Y coordinate value defining the position of the bottom of the clipping rectangle.
  • YMAX β€” an input expression of type REAL, the Y coordinate value defining the position of the top of the clipping rectangle.
  • XCPL β€” an input array of type REAL, and she's the X coordinate array for the polyline that is to be clipped.
  • YCPL β€” an input array of type REAL, the Y coordinate array for the polyline that is to be clipped. (XCPL and YCPL are a matched set, they ride together πŸ’ž)
  • NCPL β€” an input expression of type INTEGER, the number of points defining the input polyline. In other words: the number of meaningful elements in each of the arrays XCPL and YCPL.
  • RWRK β€” a scratch array of type REAL, a workspace array for PPPLCL to use. It is divided into halves; one half is used for X coordinates and the other half for Y coordinates. This array doesn't have to be too big unless it is important not to break the polyline except at the edges of the clipping rectangle.
  • LRWK β€” an input expression of type INTEGER, the length of the array RWRK.
  • URPF β€” the name of a user-provided routine to process the fragments of the polyline resulting from the clipping process. This name must appear in an EXTERNAL statement in the routine that calls PPPLCL, and the routine itself must have the following form:
     SUBROUTINE URPF (XCRA,YCRA,NCRA)
       DIMENSION XCRA(NCRA),YCRA(NCRA)
       ...(code to process a polyline)...
       RETURN
     END

Each of the arguments XCRA and YCRA is a real array, dimensioned NCRA; the former holds the X coordinates, and the latter the Y coordinates, of a polyline fragment.

  • IERR β€” an output variable of type INTEGER, returned with the value zero if no errors occurred in the execution of PPPLCL, or with a small positive value if an error did occur. The value 1 indicates that NCPL is less than or equal to zero, and the value 2 indicates that LRWK is less than 4.
⚠️ girl, watch your LRWK. If it's less than 4, that's an error and IERR will tell on you (value 2). And if NCPL is <= 0? That's error 1. Not dramatic, just facts. πŸ’€

🧚 C-BINDING DESCRIPTION 🧚

The C-binding argument descriptions are the same as the FORTRAN argument descriptions. Same energy, different language, we love a bilingual icon. 🌈


πŸ‘‘ USAGE πŸ‘‘

The FORTRAN statement

CALL PPPLCL (XMIN,XMAX,YMIN,YMAX,XCPL,YCPL,NCPL,RWRK,LRWK,URPF,IERR)

clips a polyline against a rectangle and delivers the portions of the polyline that fall within the rectangle, one by one, to the user-specified polyline-fragment-processing routine URPF. It's giving personal delivery service, fr fr. πŸ“¦βœ¨


⭐ EXAMPLES ⭐

Use the ncargex command to see the following relevant examples: ppex01, tppack, c_ppex01.


πŸ”₯ ACCESS πŸ”₯

To use PPPLCL or c_ppplcl, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. (Yes, order matters bestie, don't be chaotic about it. 😭)


πŸ’œ SEE ALSO πŸ’œ

Online: polypack, ppdipo, ppditr, ppinpo, ppintr, ppppap, ppunpo, ppuntr, ncarg_cbind.

Hardcopy: None.


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, no crumbs left πŸ“βœ¨ β€” this was PPPLCL from the NCAR Graphics manual, as shipped on UNIX, dated March 1995, page PPPLCL(3NCARG). periodt. πŸ’…πŸ«Ά

πŸ“¦ where this page comes from