Ejemplo n.º 1
0
void
doprim(		/* plot primitive */
	PRIMITIVE  *p
)
{

	switch (p->com) {

	case PMSTR:
		printstr(p);
		break;

	case PVSTR:
		plotvstr(p);
		break;

	case PLSEG:
		plotlseg(p);
		break;

	case PRFILL:
		fillrect(p);
		break;

	case PTFILL:
		filltri(p);
		break;

	case PPFILL:
		fillpoly(p);
		break;

	case PSEG:
		doseg(p);
		break;

	default:
		sprintf(errmsg, "unknown command '%c' in doprim", p->com);
		error(WARNING, errmsg);
		return;
	}
	newpage = FALSE;
}
Ejemplo n.º 2
0
void
plot4(			/* put a file into its place on page */
	FILE  *fp
)
{
	static int  nplts = 0;
	PRIMITIVE  curp;

	pglob(POPEN, 0, SEGNAME);

	while (readp(&curp, fp))
		if (curp.com == PEOP) {
			pglob(PCLOSE, 0200, NULL);
			doseg(nplts++ % 4);
			pglob(POPEN, 0, SEGNAME);
		} else
			writep(&curp, pout);
	
	pglob(PCLOSE, 0200, NULL);
}