| 77 |
|
inpfile[i].isDSF = 1; |
| 78 |
|
continue; |
| 79 |
|
} |
| 80 |
< |
if (!strcasecmp(typ, "BSDF")) { |
| 80 |
> |
if (!strcasecmp(typ, "BSDF") || |
| 81 |
> |
!strcasecmp(typ, "BRDF") || |
| 82 |
> |
!strcasecmp(typ, "BTDF")) { |
| 83 |
|
inpfile[i].isDSF = 0; |
| 84 |
|
continue; |
| 85 |
|
} |
| 131 |
|
if (i) /* process previous incidence */ |
| 132 |
|
make_rbfrep(); |
| 133 |
|
#ifdef DEBUG |
| 134 |
< |
fprintf(stderr, "New incident (theta,phi)=(%f,%f)\n", |
| 134 |
> |
fprintf(stderr, "New incident (theta,phi)=(%.1f,%.1f)\n", |
| 135 |
|
inpfile[i].theta, inpfile[i].phi); |
| 136 |
|
#endif |
| 137 |
|
new_bsdf_data(inpfile[i].theta, inpfile[i].phi); |
| 212 |
|
FVECT dir; |
| 213 |
|
int i, j, n; |
| 214 |
|
|
| 215 |
+ |
progname = argv[0]; |
| 216 |
|
if (argc != 2) { |
| 217 |
< |
fprintf(stderr, "Usage: %s input.dat > output.rad\n", argv[0]); |
| 217 |
> |
fprintf(stderr, "Usage: %s input.dat > output.rad\n", progname); |
| 218 |
|
return(1); |
| 219 |
|
} |
| 220 |
|
ninpfiles = 1; |
| 222 |
|
if (!init_pabopto_inp(0, argv[1]) || !add_pabopto_inp(0)) |
| 223 |
|
return(1); |
| 224 |
|
/* reduce data set */ |
| 225 |
< |
make_rbfrep(); |
| 225 |
> |
if (make_rbfrep() == NULL) { |
| 226 |
> |
fprintf(stderr, "%s: nothing to plot!\n", progname); |
| 227 |
> |
exit(1); |
| 228 |
> |
} |
| 229 |
|
#ifdef DEBUG |
| 230 |
|
fprintf(stderr, "Minimum BSDF = %.4f\n", bsdf_min); |
| 231 |
|
#endif |
| 268 |
|
sprintf(buf, "gensurf tgreen bsdf - - - %d %d", GRIDRES-1, GRIDRES-1); |
| 269 |
|
pfp = popen(buf, "w"); |
| 270 |
|
if (pfp == NULL) { |
| 271 |
< |
fprintf(stderr, "%s: cannot open '| %s'\n", argv[0], buf); |
| 271 |
> |
fprintf(stderr, "%s: cannot open '| %s'\n", progname, buf); |
| 272 |
|
return(1); |
| 273 |
|
} |
| 274 |
|
for (i = 0; i < GRIDRES; i++) |