18 |
|
#define SAMPDENS 48 /* points per projected steradian */ |
19 |
|
#define NSAMPS 32 /* samples per point */ |
20 |
|
#define DFLMAT "illum_mat" /* material name */ |
21 |
+ |
#define DFLDAT "illum" /* data file name */ |
22 |
|
/* selection options */ |
23 |
|
#define S_NONE 0 /* select none */ |
24 |
|
#define S_ELEM 1 /* select specified element */ |
37 |
|
struct illum_args thisillum = { /* our illum and default values */ |
38 |
|
0, |
39 |
|
DFLMAT, |
40 |
< |
DFLMAT, |
40 |
> |
DFLDAT, |
41 |
|
0, |
42 |
|
VOIDID, |
43 |
|
SAMPDENS, |
44 |
|
NSAMPS, |
45 |
+ |
0., |
46 |
|
}; |
47 |
|
|
48 |
|
char matcheck[MAXSTR]; /* current material to include or exclude */ |
91 |
|
rtargv[rtargc] = NULL; |
92 |
|
/* just asking for defaults? */ |
93 |
|
if (!strcmp(argv[gargc-1], "-defaults")) { |
94 |
+ |
printopts(); fflush(stdout); |
95 |
|
rtpath = getpath(rtargv[0], getenv("PATH"), X_OK); |
96 |
|
if (rtpath == NULL) { |
97 |
|
eputs(rtargv[0]); |
147 |
|
/* set up signal handling */ |
148 |
|
signal(SIGPIPE, quit); |
149 |
|
/* start rtrace process */ |
150 |
+ |
errno = 0; |
151 |
|
maxbytes = open_process(rt.pd, rtargv); |
152 |
|
if (maxbytes == 0) { |
153 |
|
eputs(rtargv[0]); |
260 |
|
break; |
261 |
|
if (!*++cp) { |
262 |
|
strcpy(thisillum.datafile,thisillum.matname); |
263 |
+ |
thisillum.dfnum = 0; |
264 |
|
thisillum.flags &= ~IL_DATCLB; |
265 |
|
continue; |
266 |
|
} |
331 |
|
break; |
332 |
|
cp++; |
333 |
|
continue; |
334 |
+ |
case 'b': /* brightness */ |
335 |
+ |
if (*++cp != '=') |
336 |
+ |
break; |
337 |
+ |
if (!isfltd(++cp, " \t\n")) |
338 |
+ |
break; |
339 |
+ |
thisillum.minbrt = atof(cp); |
340 |
+ |
if (thisillum.minbrt < 0.) |
341 |
+ |
thisillum.minbrt = 0.; |
342 |
+ |
cp = sskip(cp); |
343 |
+ |
continue; |
344 |
|
case 'o': /* output file */ |
345 |
|
if (*++cp != '=') |
346 |
|
break; |
378 |
|
} |
379 |
|
/* print pure comment */ |
380 |
|
printf("# %s", s+2); |
381 |
+ |
} |
382 |
+ |
|
383 |
+ |
|
384 |
+ |
printopts() /* print out option default values */ |
385 |
+ |
{ |
386 |
+ |
printf("m=%-15s\t\t# material name\n", thisillum.matname); |
387 |
+ |
printf("f=%-15s\t\t# data file name\n", thisillum.datafile); |
388 |
+ |
printf("c=n\t\t\t\t# color none\n"); |
389 |
+ |
printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens); |
390 |
+ |
printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps); |
391 |
+ |
printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt); |
392 |
|
} |
393 |
|
|
394 |
|
|