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 */ |
30 |
|
"-ab", "2", "-ad", "256", "-as", "128", "-aa", ".15", }; |
31 |
|
int rtargc = 14; |
32 |
|
/* overriding rtrace options */ |
33 |
< |
char *myrtopts[] = { "-I-", "-i-", "-ov", "-h-", "-fff", NULL }; |
33 |
> |
char *myrtopts[] = { "-I-", "-i-", "-ov", "-h-", "-fff", "-y", "0", NULL }; |
34 |
|
|
35 |
|
struct rtproc rt; /* our rtrace process */ |
36 |
|
|
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 */ |
82 |
|
if (argv[i][0] == '-' && argv[i][1] == 'w') |
83 |
|
warnings = !warnings; |
84 |
|
} |
85 |
< |
if ((gargc = i) < 2) |
84 |
< |
error(USER, "too few arguments"); |
85 |
> |
gargc = i; |
86 |
|
rtargc--; |
87 |
|
for (i = 0; myrtopts[i] != NULL; i++) |
88 |
|
rtargv[rtargc++] = myrtopts[i]; |
101 |
|
perror(rtpath); |
102 |
|
exit(1); |
103 |
|
} |
104 |
+ |
if (gargc < 2 || argv[gargc-1][0] == '-') |
105 |
+ |
error(USER, "missing octree argument"); |
106 |
|
/* else initialize and run our calculation */ |
107 |
|
init(); |
108 |
|
if (gargc+1 < argc) |
148 |
|
/* set up signal handling */ |
149 |
|
signal(SIGPIPE, quit); |
150 |
|
/* start rtrace process */ |
151 |
+ |
errno = 0; |
152 |
|
maxbytes = open_process(rt.pd, rtargv); |
153 |
|
if (maxbytes == 0) { |
154 |
|
eputs(rtargv[0]); |
261 |
|
break; |
262 |
|
if (!*++cp) { |
263 |
|
strcpy(thisillum.datafile,thisillum.matname); |
264 |
+ |
thisillum.dfnum = 0; |
265 |
|
thisillum.flags &= ~IL_DATCLB; |
266 |
|
continue; |
267 |
|
} |
332 |
|
break; |
333 |
|
cp++; |
334 |
|
continue; |
335 |
+ |
case 'b': /* brightness */ |
336 |
+ |
if (*++cp != '=') |
337 |
+ |
break; |
338 |
+ |
if (!isfltd(++cp, " \t\n")) |
339 |
+ |
break; |
340 |
+ |
thisillum.minbrt = atof(cp); |
341 |
+ |
if (thisillum.minbrt < 0.) |
342 |
+ |
thisillum.minbrt = 0.; |
343 |
+ |
cp = sskip(cp); |
344 |
+ |
continue; |
345 |
|
case 'o': /* output file */ |
346 |
|
if (*++cp != '=') |
347 |
|
break; |
384 |
|
|
385 |
|
printopts() /* print out option default values */ |
386 |
|
{ |
387 |
< |
printf("m=%s\t\t\t# material name\n", thisillum.matname); |
388 |
< |
printf("f=%s\t\t\t# data file name\n", thisillum.datafile); |
389 |
< |
printf("c=n\t\t\t\t# color none\n"); |
387 |
> |
printf("m=%-15s\t\t# material name\n", thisillum.matname); |
388 |
> |
printf("f=%-15s\t\t# data file name\n", thisillum.datafile); |
389 |
> |
if (thisillum.flags & IL_COLAVG) |
390 |
> |
if (thisillum.flags & IL_COLDST) |
391 |
> |
printf("c=d\t\t\t\t# color distribution\n"); |
392 |
> |
else |
393 |
> |
printf("c=a\t\t\t\t# color average\n"); |
394 |
> |
else |
395 |
> |
printf("c=n\t\t\t\t# color none\n"); |
396 |
> |
if (thisillum.flags & IL_LIGHT) |
397 |
> |
printf("l+\t\t\t\t# light type on\n"); |
398 |
> |
else |
399 |
> |
printf("l-\t\t\t\t# light type off\n"); |
400 |
|
printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens); |
401 |
|
printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps); |
402 |
+ |
printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt); |
403 |
|
} |
404 |
|
|
405 |
|
|