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

Comparing ray/src/gen/mkillum.c (file contents):
Revision 2.36 by greg, Sat Dec 12 19:00:59 2009 UTC vs.
Revision 2.40 by greg, Sun Aug 11 02:57:49 2013 UTC

# Line 8 | Line 8 | static const char RCSid[] = "$Id$";
8   #include  <signal.h>
9   #include  <ctype.h>
10  
11 + #include  "rtprocess.h" /* win_popen() */
12   #include  "mkillum.h"
13  
14                                  /* default parameters */
# Line 23 | Line 24 | static const char RCSid[] = "$Id$";
24  
25   struct illum_args  thisillum = {        /* our illum and default values */
26                  0,
26                UDzpos,
27                0.,
27                  DFLMAT,
28                  DFLDAT,
29                  0,
30                  VOIDID,
31                  SAMPDENS,
32                  NSAMPS,
34                NULL,
33                  0.,
34          };
35  
# Line 70 | Line 68 | main(          /* compute illum distributions using rtrace */
68                                  /* set up rendering defaults */
69          dstrsrc = 0.5;
70          directrelay = 3;
73        directvis = 0;
71          ambounce = 2;
72                                  /* get options from command line */
73          for (i = 1; i < argc; i++) {
# Line 307 | Line 304 | xoptions(                      /* process options in string s */
304                          }
305                          cp = sskip(cp);
306                          continue;
307 <                case 'd':                       /* sample density / BSDF data */
307 >                case 'd':                       /* sample density */
308                          if (*++cp != '=')
309                                  break;
313                        if (thisillum.sd != NULL) {
314                                free_BSDF(thisillum.sd);
315                                thisillum.sd = NULL;
316                        }
310                          if (!*++cp || isspace(*cp))
311                                  continue;
312                          if (isintd(cp, " \t\n\r")) {
313                                  thisillum.sampdens = atoi(cp);
314                          } else {
315 <                                atos(buf, sizeof(buf), cp);
316 <                                thisillum.sd = load_BSDF(buf);
324 <                                if (thisillum.sd == NULL)
325 <                                        break;
315 >                                error(WARNING, "direct BSDF input unsupported");
316 >                                goto opterr;
317                          }
318                          cp = sskip(cp);
319                          continue;
# Line 368 | Line 359 | xoptions(                      /* process options in string s */
359                          }
360                          doneheader = 0;
361                          continue;
371                case 'u':                       /* up direction */
372                        if (*++cp != '=')
373                                break;
374                        if (!*++cp || isspace(*cp)) {
375                                thisillum.udir = UDunknown;
376                                continue;
377                        }
378                        negax = 0;
379                        if (*cp == '+')
380                                cp++;
381                        else if (*cp == '-') {
382                                negax++;
383                                cp++;
384                        }
385                        switch (*cp++) {
386                        case 'x':
387                        case 'X':
388                                thisillum.udir = negax ? UDxneg : UDxpos;
389                                break;
390                        case 'y':
391                        case 'Y':
392                                thisillum.udir = negax ? UDyneg : UDypos;
393                                break;
394                        case 'z':
395                        case 'Z':
396                                thisillum.udir = negax ? UDzneg : UDzpos;
397                                break;
398                        default:
399                                thisillum.udir = UDunknown;
400                                break;
401                        }
402                        if (thisillum.udir == UDunknown || !isspace(*cp))
403                                break;
404                        continue;
405                case 't':                       /* object thickness */
406                        if (*++cp != '=')
407                                break;
408                        if (!isfltd(++cp, " \t\n\r"))
409                                break;
410                        thisillum.thick = atof(cp);
411                        if (thisillum.thick < .0)
412                                thisillum.thick = .0;
413                        cp = sskip(cp);
414                        continue;
362                  case '!':                       /* processed file! */
363                          sprintf(errmsg, "(%s): already processed!", nm);
364                          error(WARNING, errmsg);
# Line 457 | Line 404 | printopts(void)                        /* print out option default values *
404          printf("d=%d\t\t\t\t# density of directions\n", thisillum.sampdens);
405          printf("s=%d\t\t\t\t# samples per direction\n", thisillum.nsamps);
406          printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt);
460        switch (thisillum.udir) {
461        case UDzneg:
462                fputs("u=-Z\t\t\t\t# up is negative Z\n", stdout);
463                break;
464        case UDyneg:
465                fputs("u=-Y\t\t\t\t# up is negative Y\n", stdout);
466                break;
467        case UDxneg:
468                fputs("u=-X\t\t\t\t# up is negative X\n", stdout);
469                break;
470        case UDxpos:
471                fputs("u=+X\t\t\t\t# up is positive X\n", stdout);
472                break;
473        case UDypos:
474                fputs("u=+Y\t\t\t\t# up is positive Y\n", stdout);
475                break;
476        case UDzpos:
477                fputs("u=+Z\t\t\t\t# up is positive Z\n", stdout);
478                break;
479        case UDunknown:
480                break;
481        }
482        printf("t=%f\t\t\t# object thickness\n", thisillum.thick);
407   }
408  
409  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines