26 |
|
int input_orient = 0; |
27 |
|
int output_orient = 0; |
28 |
|
|
29 |
+ |
/* BSDF histogram */ |
30 |
+ |
int bsdf_hist[HISTLEN]; |
31 |
+ |
|
32 |
+ |
/* BSDF value for boundary regions */ |
33 |
+ |
double bsdf_min = 0; |
34 |
+ |
|
35 |
|
/* processed incident DSF measurements */ |
36 |
|
RBFNODE *dsf_list = NULL; |
37 |
|
|
252 |
|
FVECT odir; |
253 |
|
double sig2; |
254 |
|
int n; |
255 |
< |
|
256 |
< |
if (rp == NULL) |
257 |
< |
return(.0); |
255 |
> |
/* use minimum if no information avail. */ |
256 |
> |
if (rp == NULL) { |
257 |
> |
if (outvec[2] > 0 ^ output_orient > 0) |
258 |
> |
return(.0); |
259 |
> |
return(bsdf_min*output_orient*outvec[2]); |
260 |
> |
} |
261 |
|
rbfp = rp->rbfa; |
262 |
|
for (n = rp->nrbf; n--; rbfp++) { |
263 |
|
ovec_from_pos(odir, rbfp->gx, rbfp->gy); |
399 |
|
fprintf(ofp, "SYMMETRY=%d\n", !single_plane_incident * inp_coverage); |
400 |
|
fprintf(ofp, "IO_SIDES= %d %d\n", input_orient, output_orient); |
401 |
|
fprintf(ofp, "GRIDRES=%d\n", grid_res); |
402 |
+ |
fprintf(ofp, "BSDFMIN=%g\n", bsdf_min); |
403 |
|
fputformat(BSDFREP_FMT, ofp); |
404 |
|
fputc('\n', ofp); |
405 |
|
/* write each DSF */ |
463 |
|
} |
464 |
|
if (!strncmp(s, "GRIDRES=", 8)) { |
465 |
|
sscanf(s+8, "%d", &grid_res); |
466 |
+ |
return(0); |
467 |
+ |
} |
468 |
+ |
if (!strncmp(s, "BSDFMIN=", 8)) { |
469 |
+ |
sscanf(s+8, "%lf", &bsdf_min); |
470 |
|
return(0); |
471 |
|
} |
472 |
|
if (formatval(fmt, s) && strcmp(fmt, BSDFREP_FMT)) |