| 34 |
|
|
| 35 |
|
#define newnode() (struct node *)calloc(1, sizeof(struct node)) |
| 36 |
|
|
| 37 |
+ |
int slow = 0; /* slow trace? */ |
| 38 |
|
|
| 39 |
+ |
|
| 40 |
|
main(argc, argv) /* takes both the octree and the image */ |
| 41 |
|
int argc; |
| 42 |
|
char *argv[]; |
| 46 |
|
Cursor curs; |
| 47 |
|
|
| 48 |
|
progname = argv[0]; |
| 49 |
< |
if (argc < 3) { |
| 50 |
< |
fprintf(stderr, "Usage: %s [rtrace args] octree picture\n", |
| 49 |
> |
for (i = 1; i < argc-2; i++) |
| 50 |
> |
if (!strcmp(argv[i], "-s")) |
| 51 |
> |
slow++; |
| 52 |
> |
else |
| 53 |
> |
break; |
| 54 |
> |
if (i > argc-2) { |
| 55 |
> |
fprintf(stderr, "Usage: %s [-s] [rtrace args] octree picture\n", |
| 56 |
|
argv[0]); |
| 57 |
|
exit(1); |
| 58 |
|
} |
| 72 |
|
} |
| 73 |
|
/* build input command */ |
| 74 |
|
sprintf(combuf, "%s %s | %s", xicom, argv[argc-1], rtcom); |
| 75 |
< |
for (i = 1; i < argc-1; i++) { |
| 75 |
> |
for ( ; i < argc-1; i++) { |
| 76 |
|
strcat(combuf, " "); |
| 77 |
|
strcat(combuf, argv[i]); |
| 78 |
|
} |
| 116 |
|
if (i == 0) { |
| 117 |
|
setvec(sis[0]->ipt); |
| 118 |
|
tracerays(sis[0]); |
| 112 |
– |
XFlush(theDisplay); |
| 119 |
|
freetree(sis[0]); |
| 120 |
|
sis[0] = NULL; |
| 121 |
+ |
if (!slow) |
| 122 |
+ |
XFlush(theDisplay); |
| 123 |
|
} |
| 124 |
|
} |
| 125 |
|
} |
| 142 |
|
register struct node *kid; |
| 143 |
|
|
| 144 |
|
for (kid = tp->daughter; kid != NULL; kid = kid->sister) { |
| 137 |
– |
tracerays(kid); |
| 145 |
|
vector(tp->ipt, kid->ipt); |
| 146 |
+ |
tracerays(kid); |
| 147 |
|
} |
| 148 |
|
} |
| 149 |
|
|
| 207 |
|
XDrawLine(theDisplay, gwind, vecGC, |
| 208 |
|
(int)(ip1[0]*xres)+xoff, (int)((1.-ip1[1])*yres)+yoff, |
| 209 |
|
(int)(ip2[0]*xres)+xoff, (int)((1.-ip2[1])*yres)+yoff); |
| 210 |
+ |
if (slow) { |
| 211 |
+ |
XFlush(theDisplay); |
| 212 |
+ |
sleep(1); |
| 213 |
+ |
} |
| 214 |
|
} |