15 |
|
#include <ctype.h> |
16 |
|
|
17 |
|
/* default parameters */ |
18 |
< |
#define SAMPDENS 128 /* points per projected steradian */ |
18 |
> |
#define SAMPDENS 48 /* points per projected steradian */ |
19 |
|
#define NSAMPS 32 /* samples per point */ |
20 |
|
#define DFLMAT "illum_mat" /* material name */ |
21 |
|
/* selection options */ |
58 |
|
int warnings = 1; /* print warnings? */ |
59 |
|
|
60 |
|
extern char *fgetline(), *fgetword(), *sskip(), |
61 |
< |
*atos(), *iskip(), *fskip(); |
61 |
> |
*atos(), *iskip(), *fskip(), *strcpy(); |
62 |
|
extern FILE *popen(); |
63 |
|
|
64 |
|
|
158 |
|
if (rt.buf == NULL || rt.dest == NULL) |
159 |
|
error(SYSTEM, "out of memory in init"); |
160 |
|
rt.nrays = 0; |
161 |
+ |
/* set up urand */ |
162 |
+ |
initurand(2048); |
163 |
|
} |
164 |
|
|
165 |
|
|
255 |
|
if (*++cp != '=') |
256 |
|
break; |
257 |
|
if (!*++cp) { |
258 |
+ |
strcpy(thisillum.datafile,thisillum.matname); |
259 |
|
thisillum.flags &= ~IL_DATCLB; |
260 |
|
continue; |
261 |
|
} |
266 |
|
continue; |
267 |
|
case 'i': /* include material */ |
268 |
|
case 'e': /* exclude material */ |
269 |
< |
matselect = (*cp == 'i') ? S_ELEM : S_COMPL; |
267 |
< |
if (*++cp != '=') |
269 |
> |
if (cp[1] != '=') |
270 |
|
break; |
271 |
< |
atos(matcheck, MAXSTR, ++cp); |
271 |
> |
matselect = (*cp == 'i') ? S_ELEM : S_COMPL; |
272 |
> |
cp += 2; |
273 |
> |
atos(matcheck, MAXSTR, cp); |
274 |
|
cp = sskip(cp); |
275 |
|
continue; |
276 |
|
case 'a': /* use everything */ |
286 |
|
break; |
287 |
|
switch (*++cp) { |
288 |
|
case 'a': /* average */ |
289 |
< |
thisillum.flags |= IL_COLAVG; |
290 |
< |
thisillum.flags &= ~IL_COLDST; |
289 |
> |
thisillum.flags = (thisillum.flags|IL_COLAVG) |
290 |
> |
& ~IL_COLDST; |
291 |
|
break; |
292 |
|
case 'd': /* distribution */ |
293 |
|
thisillum.flags |= (IL_COLDST|IL_COLAVG); |
340 |
|
} |
341 |
|
doneheader = 0; |
342 |
|
continue; |
343 |
+ |
case '!': /* processed file! */ |
344 |
+ |
sprintf(errmsg, "(%s): already processed!", nm); |
345 |
+ |
error(WARNING, errmsg); |
346 |
+ |
matselect = S_NONE; |
347 |
+ |
return; |
348 |
|
} |
349 |
|
opterr: /* skip faulty option */ |
350 |
|
cp = sskip(cp); |
375 |
|
putchar(' '); |
376 |
|
fputs(*av++, stdout); |
377 |
|
} |
378 |
< |
putchar('\n'); |
378 |
> |
fputs("\n#@mkillum !\n", stdout); |
379 |
|
} |
380 |
|
|
381 |
|
|