File: VPrintPoly.c

package info (click to toggle)
acm 5.0-23.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,364 kB
  • ctags: 4,793
  • sloc: ansic: 42,444; makefile: 706; cpp: 293; perl: 280; sh: 198
file content (27 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

#include "Vlib.h"

void
VPrintPolygon(FILE * file, VPolygon * p)
{

	int       i;
	char     *nullPoly = "*** Null Polygon ***\n";

	if (p == (VPolygon *) NULL)
		fprintf(file, nullPoly);
	else {
		if (p->numVtces == 0) {
			fprintf(file, nullPoly);
			return;
		}

		fprintf(file, "%d vertices:\n", p->numVtces);

		for (i = 0; i < p->numVtces; ++i)
			fprintf(file, "%9.6g %9.6g %9.6g\n", p->vertex[i].x,
					p->vertex[i].y, p->vertex[i].z);
	}

	return;
}