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

Comparing ray/src/cv/bsdf2ttree.c (file contents):
Revision 2.34 by greg, Tue Feb 2 22:34:00 2016 UTC vs.
Revision 2.35 by greg, Thu Feb 4 00:45:47 2016 UTC

# Line 185 | Line 185 | eval_isotropic(char *funame)
185                          fputs("{\n", uvfp[1]);
186                  }
187          }
188 <                                                /* need to assign Dx, Dy, Dz? */
189 <        if (funame != NULL)
188 >        if (funame != NULL)                     /* need to assign Dx, Dy, Dz? */
189                  assignD = (fundefined(funame) < 6);
190                                                  /* run through directions */
191          for (ix = 0; ix < sqres/2; ix++) {
# Line 271 | Line 270 | eval_isotropic(char *funame)
270                          free(rbf);
271                  prog_show((ix+1.)*(2./sqres));
272          }
273 +        prog_done();
274          if (pctcull >= 0) {                     /* finish output */
275                  if (pclose(ofp)) {
276                          fprintf(stderr, "%s: error running rttree_reduce on Y\n",
# Line 306 | Line 306 | eval_isotropic(char *funame)
306                          }
307                  }
308          }
309        prog_done();
309   }
310  
311   /* Interpolate and output anisotropic BSDF data */
# Line 322 | Line 321 | eval_anisotropic(char *funame)
321          float           bsdf, uv[2];
322  
323          if (pctcull >= 0) {
324 +                const char      *avgopt = (input_orient>0 ^ output_orient>0)
325 +                                                ? "" : " -a";
326                  sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d > %s",
327 <                                (input_orient>0 ^ output_orient>0) ? "" : " -a",
328 <                                pctcull, samp_order, create_component_file(0));
327 >                                avgopt, pctcull, samp_order,
328 >                                create_component_file(0));
329                  ofp = popen(cmd, "w");
330                  if (ofp == NULL) {
331                          fprintf(stderr, "%s: cannot create pipe to rttree_reduce\n",
# Line 338 | Line 339 | eval_anisotropic(char *funame)
339                  if (rbf_colorimetry == RBCtristimulus) {
340                          double  uvcull = 100. - (100.-pctcull)*.25;
341                          sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d > %s",
342 <                                        (input_orient>0 ^ output_orient>0) ? "" : " -a",
343 <                                        uvcull, samp_order, create_component_file(1));
342 >                                        avgopt, uvcull, samp_order,
343 >                                        create_component_file(1));
344                          uvfp[0] = popen(cmd, "w");
345                          sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d > %s",
346 <                                        (input_orient>0 ^ output_orient>0) ? "" : " -a",
347 <                                        uvcull, samp_order, create_component_file(2));
346 >                                        avgopt, uvcull, samp_order,
347 >                                        create_component_file(2));
348                          uvfp[1] = popen(cmd, "w");
349                          if ((uvfp[0] == NULL) | (uvfp[1] == NULL)) {
350                                  fprintf(stderr, "%s: cannot open pipes to uv output\n",
# Line 375 | Line 376 | eval_anisotropic(char *funame)
376                          fputs("{\n", uvfp[1]);
377                  }
378          }
379 <                                                /* need to assign Dx, Dy, Dz? */
379 <        if (funame != NULL)
379 >        if (funame != NULL)                     /* need to assign Dx, Dy, Dz? */
380                  assignD = (fundefined(funame) < 6);
381                                                  /* run through directions */
382          for (ix = 0; ix < sqres; ix++)
# Line 463 | Line 463 | eval_anisotropic(char *funame)
463                          free(rbf);
464                  prog_show((ix*sqres+iy+1.)/(sqres*sqres));
465              }
466 +        prog_done();
467          if (pctcull >= 0) {                     /* finish output */
468                  if (pclose(ofp)) {
469                          fprintf(stderr, "%s: error running rttree_reduce on Y\n",
# Line 492 | Line 493 | eval_anisotropic(char *funame)
493                          }
494                  }
495          }
495        prog_done();
496   }
497  
498   #ifdef _WIN32

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines