Exemple #1
0
void
plD_line_tek(short x1, short y1, short x2, short y2)
{
    fprintf(stdout, VECTOR_MODE);
    tek_vector(x1, y1);
    tek_vector(x2, y2);
}
Exemple #2
0
void
plD_line_tek(PLStream *pls, short xx1, short yy1, short xx2, short yy2)
{
    TekDev *dev = (TekDev *) pls->dev;

    tek_graph(pls);

/* If not continuation of previous line, begin a new one */

    if (xx1 != dev->xold || yy1 != dev->yold) {
	pls->bytecnt += fprintf(pls->OutFile, VECTOR_MODE);
	tek_vector(pls, xx1, yy1);
    }

/* Now send following point to complete line draw */

    tek_vector(pls, xx2, yy2);

    dev->xold = xx2;
    dev->yold = yy2;
}
Exemple #3
0
void
plD_polyline_tek(PLStream *pls, short *xa, short *ya, PLINT npts)
{
    PLINT i;
    TekDev *dev = (TekDev *) pls->dev;
    short x = xa[0], y = ya[0];

    tek_graph(pls);

/* If not continuation of previous line, begin a new one */

    if ( x != dev->xold || y != dev->yold ) {
	pls->bytecnt += fprintf(pls->OutFile, VECTOR_MODE);
	tek_vector(pls, x, y);
    }

/* Now send following points to complete polyline draw */

    for (i = 1; i < npts; i++) 
	tek_vector(pls, xa[i], ya[i]);

    dev->xold = xa[npts-1];
    dev->yold = ya[npts-1];
}
Exemple #4
0
static void
fill_polygon(PLStream *pls)
{
    TekDev *dev = (TekDev *) pls->dev;
    int i;
    char fillcol[4], firstpoint[5];

    if (pls->dev_npts < 1)
	return;

    tek_graph(pls);

    encode_int(fillcol, -dev->curcolor);
    encode_vector(firstpoint, pls->dev_x[0], pls->dev_y[0]);

/* Select the fill pattern */

    pls->bytecnt += fprintf(pls->OutFile, "\033MP%s", fillcol);

/* Begin panel boundary */
/* Set pls->debug to see the boundary of each fill box -- cool! */

    if (pls->debug)
	pls->bytecnt += fprintf(pls->OutFile, "\033LP%s1", firstpoint);
    else
	pls->bytecnt += fprintf(pls->OutFile, "\033LP%s0", firstpoint);

/* Specify boundary (in vector mode) */

    pls->bytecnt += fprintf(pls->OutFile, VECTOR_MODE);
    for (i = 1; i < pls->dev_npts; i++) 
	tek_vector(pls, pls->dev_x[i], pls->dev_y[i]);

/* End panel */

    pls->bytecnt += fprintf(pls->OutFile, "\033LE");
}