41 |
|
printdefaults(void) /* print default values to stdout */ |
42 |
|
{ |
43 |
|
printf("-c %-5d\t\t\t# accumulated rays per record\n", myRCmanager.accum); |
44 |
< |
printf("-V%c\t\t\t\t# output %s\n", contrib ? '+' : '-', |
45 |
< |
contrib ? "contributions" : "coefficients"); |
44 |
> |
printf(myRCmanager.HasFlag(RCcontrib) ? |
45 |
> |
"-V+\t\t\t\t# output contributions\n" : |
46 |
> |
"-V-\t\t\t\t# output coefficients\n"); |
47 |
|
if (myRCmanager.HasFlag(RTimmIrrad)) |
48 |
|
printf("-I+\t\t\t\t# immediate irradiance on\n"); |
49 |
|
printf("-n %-2d\t\t\t\t# number of rendering processes\n", nproc); |
50 |
< |
if (xres > 0) |
51 |
< |
printf("-x %-9d\t\t\t# x resolution\n", xres); |
52 |
< |
printf("-y %-9d\t\t\t# y resolution\n", yres); |
50 |
> |
if (myRCmanager.xres > 0) |
51 |
> |
printf("-x %-9d\t\t\t# x resolution\n", myRCmanager.xres); |
52 |
> |
printf("-y %-9d\t\t\t# y resolution\n", myRCmanager.yres); |
53 |
|
printf(myRCmanager.HasFlag(RTlimDist) ? |
54 |
|
"-ld+\t\t\t\t# limit distance on\n" : |
55 |
|
"-ld-\t\t\t\t# limit distance off\n"); |
96 |
|
sigerr[signo] = msg; |
97 |
|
} |
98 |
|
|
98 |
– |
const char * |
99 |
– |
formstr(int f) // return format identifier |
100 |
– |
{ |
101 |
– |
switch (f) { |
102 |
– |
case 'a': return("ascii"); |
103 |
– |
case 'f': return("float"); |
104 |
– |
case 'd': return("double"); |
105 |
– |
case 'c': return(NCSAMP==3 ? COLRFMT : SPECFMT); |
106 |
– |
} |
107 |
– |
return("unknown"); |
108 |
– |
} |
109 |
– |
|
99 |
|
/* set input/output format */ |
100 |
|
static void |
101 |
|
setformat(const char *fmt) |
207 |
|
nproc = 1; |
208 |
|
break; |
209 |
|
case 'V': /* output contributions? */ |
210 |
< |
check_bool(2,contrib); |
210 |
> |
rval = myRCmanager.HasFlag(RCcontrib); |
211 |
> |
check_bool(2,rval); |
212 |
> |
myRCmanager.SetFlag(RCcontrib, rval); |
213 |
|
break; |
214 |
|
case 'x': /* x resolution */ |
215 |
|
check(2,"i"); |
216 |
< |
xres = atoi(argv[++i]); |
216 |
> |
myRCmanager.xres = atoi(argv[++i]); |
217 |
|
break; |
218 |
|
case 'y': /* y resolution */ |
219 |
|
check(2,"i"); |
220 |
< |
yres = atoi(argv[++i]); |
220 |
> |
myRCmanager.yres = atoi(argv[++i]); |
221 |
|
break; |
222 |
|
case 'w': /* warnings on/off */ |
223 |
|
rval = (erract[WARNING].pf != NULL); |
337 |
|
// rval = # rows recovered |
338 |
|
rval = myRCmanager.PrepOutput(); |
339 |
|
// check if recovered everything |
340 |
< |
if (recover && rval >= myRCmanager.GetRowMax()) { |
340 |
> |
if (rval >= myRCmanager.GetRowMax()) { |
341 |
|
error(WARNING, "nothing left to compute"); |
342 |
|
quit(0); |
343 |
|
} // add processes as requested |
482 |
|
} |
483 |
|
last_report = tstart = time(0); |
484 |
|
} |
485 |
< |
while (r < totRows) { // getting to work... |
485 |
> |
while (r < totRows) { // loop until done |
486 |
|
time_t tnow; |
487 |
|
if (!getRayBundle(odarr)) |
488 |
|
goto readerr; |
491 |
|
r++; |
492 |
|
if (report_intvl <= 0) |
493 |
|
continue; |
494 |
< |
if ((r < totRows) & ((tnow = time(0)) < last_report+report_intvl)) |
494 |
> |
tnow = time(0); // time to report progress? |
495 |
> |
if (r == totRows) |
496 |
> |
myRCmanager.FlushQueue(); |
497 |
> |
else if (tnow < last_report+report_intvl) |
498 |
|
continue; |
499 |
|
sprintf(errmsg, "%.2f%% done after %.3f hours\n", |
500 |
< |
100.*r/totRows, (1./3600.)*(tnow - tstart)); |
500 |
> |
100.*myRCmanager.GetRowFinished()/totRows, |
501 |
> |
(1./3600.)*(tnow - tstart)); |
502 |
|
eputs(errmsg); |
503 |
|
last_report = tnow; |
504 |
|
} |