ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/testBSDF.c
(Generate patch)

Comparing ray/src/common/testBSDF.c (file contents):
Revision 1.11 by greg, Tue Apr 11 16:14:05 2017 UTC vs.
Revision 1.15 by greg, Sat Dec 28 18:05:14 2019 UTC

# Line 8 | Line 8 | static const char RCSid[] = "$Id$";
8   */
9  
10   #define _USE_MATH_DEFINES
11 #include <stdio.h>
11   #include <stdlib.h>
12   #include <math.h>
13   #include <ctype.h>
# Line 108 | Line 107 | main(int argc, char *argv[])
107                          printf("Manufacturer: '%s'\n", bsdf->makr);
108                          printf("Width, Height, Thickness (m): %.4e, %.4e, %.4e\n",
109                                          bsdf->dim[0], bsdf->dim[1], bsdf->dim[2]);
110 <                        printf("Has geometry: %s\n", bsdf->mgf ? "yes" : "no");
111 <                        continue;
110 >                        if (bsdf->mgf)
111 >                                printf("Has geometry: %lu bytes\n",
112 >                                                (unsigned long)strlen(bsdf->mgf));
113 >                        else
114 >                                printf("Has geometry: no\n");
115 >                        break;
116                  case 'C':                       /* report constant values */
117                          if (!bsdf)
118                                  goto noBSDFerr;
# Line 130 | Line 133 | main(int argc, char *argv[])
133                          printXYZ("Diffuse Front Reflectance: ", &bsdf->rLambFront);
134                          printXYZ("Diffuse Back Reflectance: ", &bsdf->rLambBack);
135                          printXYZ("Diffuse Transmittance: ", &bsdf->tLamb);
136 <                        continue;
136 >                        break;
137                  case 'Q':                       /* query BSDF value */
138                          if (!bsdf)
139                                  goto noBSDFerr;
# Line 140 | Line 143 | main(int argc, char *argv[])
143                          vec_from_deg(vout, atof(sskip2(cp,3)), atof(sskip2(cp,4)));
144                          if (!SDreportError(SDevalBSDF(&val, vout, vin, bsdf), stderr))
145                                  printXYZ("", &val);
146 <                        continue;
146 >                        break;
147                  case 'S':                       /* sample BSDF */
148                          if (!bsdf)
149                                  goto noBSDFerr;
# Line 168 | Line 171 | main(int argc, char *argv[])
171                                  printf("%.8f %.8f %.8f ", vout[0], vout[1], vout[2]);
172                                  printXYZ("", &val);
173                          }
174 <                        continue;
174 >                        break;
175                  case 'H':                       /* hemispherical values */
176                  case 'R':
177                  case 'T':
# Line 186 | Line 189 | main(int argc, char *argv[])
189                                  sflags &= ~SDsampSp;
190                          vec_from_deg(vin, atof(sskip2(cp,1)), atof(sskip2(cp,2)));
191                          printf("%.4e\n", SDdirectHemi(vin, sflags, bsdf));
192 <                        continue;
192 >                        break;
193                  case 'A':                       /* resolution in proj. steradians */
194                          if (!bsdf)
195                                  goto noBSDFerr;
# Line 195 | Line 198 | main(int argc, char *argv[])
198                          vec_from_deg(vin, atof(sskip2(cp,1)), atof(sskip2(cp,2)));
199                          if (*sskip2(cp,4)) {
200                                  vec_from_deg(vout, atof(sskip2(cp,3)), atof(sskip2(cp,4)));
201 <                                if (SDreportError(SDsizeBSDF(proja, vin, vout,
201 >                                if (SDreportError(SDsizeBSDF(proja, vout, vin,
202                                                  SDqueryMin+SDqueryMax, bsdf), stderr))
203                                          continue;
204                          } else if (SDreportError(SDsizeBSDF(proja, vin, NULL,
205                                                  SDqueryMin+SDqueryMax, bsdf), stderr))
206                                          continue;
207                          printf("%.4e %.4e\n", proja[0], proja[1]);
208 <                        continue;
208 >                        break;
209 >                default:
210 >                        Usage(argv[0]);
211 >                        break;
212                  }
213 <                Usage(argv[0]);
213 >                fflush(stdout);                 /* in case we're on remote */
214                  continue;
215   noBSDFerr:
216                  fprintf(stderr, "%s: First, use 'L' command to load BSDF\n", argv[0]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines