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.37 by greg, Mon Aug 15 19:48:06 2011 UTC vs.
Revision 2.39 by greg, Sat Oct 13 20:15:43 2012 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.,
28                  DFLMAT,
29                  DFLDAT,
# Line 31 | Line 31 | struct illum_args  thisillum = {       /* our illum and defa
31                  VOIDID,
32                  SAMPDENS,
33                  NSAMPS,
34                NULL,
34                  0.,
35          };
36  
# Line 306 | Line 305 | xoptions(                      /* process options in string s */
305                          }
306                          cp = sskip(cp);
307                          continue;
308 <                case 'd':                       /* sample density / BSDF data */
308 >                case 'd':                       /* sample density */
309                          if (*++cp != '=')
310                                  break;
312                        if (thisillum.sd != NULL) {
313                                free_BSDF(thisillum.sd);
314                                thisillum.sd = NULL;
315                        }
311                          if (!*++cp || isspace(*cp))
312                                  continue;
313                          if (isintd(cp, " \t\n\r")) {
314                                  thisillum.sampdens = atoi(cp);
315                          } else {
316 <                                atos(buf, sizeof(buf), cp);
317 <                                thisillum.sd = load_BSDF(buf);
323 <                                if (thisillum.sd == NULL)
324 <                                        break;
316 >                                error(WARNING, "direct BSDF input unsupported");
317 >                                goto opterr;
318                          }
319                          cp = sskip(cp);
320                          continue;
# Line 367 | Line 360 | xoptions(                      /* process options in string s */
360                          }
361                          doneheader = 0;
362                          continue;
370                case 'u':                       /* up direction */
371                        if (*++cp != '=')
372                                break;
373                        if (!*++cp || isspace(*cp)) {
374                                thisillum.udir = UDunknown;
375                                continue;
376                        }
377                        negax = 0;
378                        if (*cp == '+')
379                                cp++;
380                        else if (*cp == '-') {
381                                negax++;
382                                cp++;
383                        }
384                        switch (*cp++) {
385                        case 'x':
386                        case 'X':
387                                thisillum.udir = negax ? UDxneg : UDxpos;
388                                break;
389                        case 'y':
390                        case 'Y':
391                                thisillum.udir = negax ? UDyneg : UDypos;
392                                break;
393                        case 'z':
394                        case 'Z':
395                                thisillum.udir = negax ? UDzneg : UDzpos;
396                                break;
397                        default:
398                                thisillum.udir = UDunknown;
399                                break;
400                        }
401                        if (thisillum.udir == UDunknown || !isspace(*cp))
402                                break;
403                        continue;
363                  case 't':                       /* object thickness */
364                          if (*++cp != '=')
365                                  break;
# Line 456 | Line 415 | printopts(void)                        /* print out option default values *
415          printf("d=%d\t\t\t\t# density of directions\n", thisillum.sampdens);
416          printf("s=%d\t\t\t\t# samples per direction\n", thisillum.nsamps);
417          printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt);
459        switch (thisillum.udir) {
460        case UDzneg:
461                fputs("u=-Z\t\t\t\t# up is negative Z\n", stdout);
462                break;
463        case UDyneg:
464                fputs("u=-Y\t\t\t\t# up is negative Y\n", stdout);
465                break;
466        case UDxneg:
467                fputs("u=-X\t\t\t\t# up is negative X\n", stdout);
468                break;
469        case UDxpos:
470                fputs("u=+X\t\t\t\t# up is positive X\n", stdout);
471                break;
472        case UDypos:
473                fputs("u=+Y\t\t\t\t# up is positive Y\n", stdout);
474                break;
475        case UDzpos:
476                fputs("u=+Z\t\t\t\t# up is positive Z\n", stdout);
477                break;
478        case UDunknown:
479                break;
480        }
418          printf("t=%f\t\t\t# object thickness\n", thisillum.thick);
419   }
420  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines