ftp.nice.ch/pub/next/unix/developer/plplot.3.0.s.tar.gz#/plplot/src/plvpor.c

This is plvpor.c in view mode; [Download] [Up]

/* Sets the edges of the viewport to the specified normalized subpage */
/* coordinates */

#include "plplot.h"

void plvpor(xmin, xmax, ymin, ymax)
double xmin, xmax, ymin, ymax;
{
    double spdxmi, spdxma, spdymi, spdyma;
    double vpdxmi, vpdxma, vpdymi, vpdyma;
    int vppxmi, vppxma, vppymi, vppyma;
    int nx, ny, cs;
    int level;

    glev(&level);
    if (level < 1) plexit("Please call plstar before calling plvpor.");
    if((xmin>=xmax)||(ymin>=ymax)||(xmin<0.)||
       (ymin<0.)||(xmax>1.)||(ymax>1.))
        plexit("Invalid limits in plsvpa.");

    gsub(&nx,&ny,&cs);
    if ((cs<=0) || (cs>(nx*ny)))
        plexit("Please call pladv or plenv to go to a subpage.");
    gspd(&spdxmi,&spdxma,&spdymi,&spdyma);
    vpdxmi = spdxmi + (spdxma - spdxmi) * xmin;
    vpdxma = spdxmi + (spdxma - spdxmi) * xmax;
    vpdymi = spdymi + (spdyma - spdymi) * ymin;
    vpdyma = spdymi + (spdyma - spdymi) * ymax;
    svpd(vpdxmi,vpdxma,vpdymi,vpdyma);

    vppxmi = dcpcx(vpdxmi);
    vppxma = dcpcx(vpdxma);
    vppymi = dcpcy(vpdymi);
    vppyma = dcpcy(vpdyma);
    svpp(vppxmi,vppxma,vppymi,vppyma);
    sclp(vppxmi,vppxma,vppymi,vppyma);
    slev(2);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.