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.13 by greg, Thu May 10 01:41:33 2018 UTC vs.
Revision 1.17 by greg, Tue Dec 7 23:49:50 2021 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 113 | Line 112 | main(int argc, char *argv[])
112                                                  (unsigned long)strlen(bsdf->mgf));
113                          else
114                                  printf("Has geometry: no\n");
115 <                        continue;
115 >                        break;
116                  case 'C':                       /* report constant values */
117                          if (!bsdf)
118                                  goto noBSDFerr;
# Line 127 | Line 126 | main(int argc, char *argv[])
126                                                  bsdf->rb->maxHemi);
127                          if (bsdf->tf)
128                                  printf("Peak front hemispherical transmittance: %.3e\n",
129 <                                                bsdf->tLamb.cieY + bsdf->tf->maxHemi);
129 >                                                bsdf->tLambFront.cieY + bsdf->tf->maxHemi);
130                          if (bsdf->tb)
131                                  printf("Peak back hemispherical transmittance: %.3e\n",
132 <                                                bsdf->tLamb.cieY + bsdf->tb->maxHemi);
132 >                                                bsdf->tLambBack.cieY + bsdf->tb->maxHemi);
133                          printXYZ("Diffuse Front Reflectance: ", &bsdf->rLambFront);
134                          printXYZ("Diffuse Back Reflectance: ", &bsdf->rLambBack);
135 <                        printXYZ("Diffuse Transmittance: ", &bsdf->tLamb);
136 <                        continue;
135 >                        printXYZ("Diffuse Front Transmittance: ", &bsdf->tLambFront);
136 >                        printXYZ("Diffuse Back Transmittance: ", &bsdf->tLambBack);
137 >                        break;
138                  case 'Q':                       /* query BSDF value */
139                          if (!bsdf)
140                                  goto noBSDFerr;
# Line 142 | Line 142 | main(int argc, char *argv[])
142                                  break;
143                          vec_from_deg(vin, atof(sskip2(cp,1)), atof(sskip2(cp,2)));
144                          vec_from_deg(vout, atof(sskip2(cp,3)), atof(sskip2(cp,4)));
145 <                        if (!SDreportError(SDevalBSDF(&val, vout, vin, bsdf), stderr))
145 >                        if (!SDreportError(SDevalBSDF(&val, vin, vout, bsdf), stderr))
146                                  printXYZ("", &val);
147 <                        continue;
147 >                        break;
148                  case 'S':                       /* sample BSDF */
149                          if (!bsdf)
150                                  goto noBSDFerr;
# Line 172 | Line 172 | main(int argc, char *argv[])
172                                  printf("%.8f %.8f %.8f ", vout[0], vout[1], vout[2]);
173                                  printXYZ("", &val);
174                          }
175 <                        continue;
175 >                        break;
176                  case 'H':                       /* hemispherical values */
177                  case 'R':
178                  case 'T':
# Line 190 | Line 190 | main(int argc, char *argv[])
190                                  sflags &= ~SDsampSp;
191                          vec_from_deg(vin, atof(sskip2(cp,1)), atof(sskip2(cp,2)));
192                          printf("%.4e\n", SDdirectHemi(vin, sflags, bsdf));
193 <                        continue;
193 >                        break;
194                  case 'A':                       /* resolution in proj. steradians */
195                          if (!bsdf)
196                                  goto noBSDFerr;
# Line 206 | Line 206 | main(int argc, char *argv[])
206                                                  SDqueryMin+SDqueryMax, bsdf), stderr))
207                                          continue;
208                          printf("%.4e %.4e\n", proja[0], proja[1]);
209 <                        continue;
209 >                        break;
210 >                default:
211 >                        Usage(argv[0]);
212 >                        break;
213                  }
214 <                Usage(argv[0]);
214 >                fflush(stdout);                 /* in case we're on remote */
215                  continue;
216   noBSDFerr:
217                  fprintf(stderr, "%s: First, use 'L' command to load BSDF\n", argv[0]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines