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"); |
219 |
|
nproc = 1; |
220 |
|
break; |
221 |
|
case 'V': /* output contributions? */ |
222 |
< |
check_bool(2,contrib); |
222 |
> |
rval = myRCmanager.HasFlag(RCcontrib); |
223 |
> |
check_bool(2,rval); |
224 |
> |
myRCmanager.SetFlag(RCcontrib, rval); |
225 |
|
break; |
226 |
|
case 'x': /* x resolution */ |
227 |
|
check(2,"i"); |
228 |
< |
xres = atoi(argv[++i]); |
228 |
> |
myRCmanager.xres = atoi(argv[++i]); |
229 |
|
break; |
230 |
|
case 'y': /* y resolution */ |
231 |
|
check(2,"i"); |
232 |
< |
yres = atoi(argv[++i]); |
232 |
> |
myRCmanager.yres = atoi(argv[++i]); |
233 |
|
break; |
234 |
|
case 'w': /* warnings on/off */ |
235 |
|
rval = (erract[WARNING].pf != NULL); |
349 |
|
// rval = # rows recovered |
350 |
|
rval = myRCmanager.PrepOutput(); |
351 |
|
// check if recovered everything |
352 |
< |
if (recover && rval >= myRCmanager.GetRowMax()) { |
352 |
> |
if (rval >= myRCmanager.GetRowMax()) { |
353 |
|
error(WARNING, "nothing left to compute"); |
354 |
|
quit(0); |
355 |
|
} // add processes as requested |
494 |
|
} |
495 |
|
last_report = tstart = time(0); |
496 |
|
} |
497 |
< |
while (r < totRows) { // getting to work... |
497 |
> |
while (r < totRows) { // loop until done |
498 |
|
time_t tnow; |
499 |
|
if (!getRayBundle(odarr)) |
500 |
|
goto readerr; |
503 |
|
r++; |
504 |
|
if (report_intvl <= 0) |
505 |
|
continue; |
506 |
< |
if ((r < totRows) & ((tnow = time(0)) < last_report+report_intvl)) |
506 |
> |
tnow = time(0); // time to report progress? |
507 |
> |
if (r == totRows) |
508 |
> |
myRCmanager.FlushQueue(); |
509 |
> |
else if (tnow < last_report+report_intvl) |
510 |
|
continue; |
511 |
|
sprintf(errmsg, "%.2f%% done after %.3f hours\n", |
512 |
< |
100.*r/totRows, (1./3600.)*(tnow - tstart)); |
512 |
> |
100.*myRCmanager.GetRowFinished()/totRows, |
513 |
> |
(1./3600.)*(tnow - tstart)); |
514 |
|
eputs(errmsg); |
515 |
|
last_report = tnow; |
516 |
|
} |