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.38 by greg, Wed Oct 5 17:20:55 2011 UTC vs.
Revision 2.39 by greg, Sat Oct 13 20:15:43 2012 UTC

# Line 24 | Line 24 | static const char RCSid[] = "$Id$";
24  
25   struct illum_args  thisillum = {        /* our illum and default values */
26                  0,
27                UDzpos,
27                  0.,
28                  DFLMAT,
29                  DFLDAT,
# Line 32 | Line 31 | struct illum_args  thisillum = {       /* our illum and defa
31                  VOIDID,
32                  SAMPDENS,
33                  NSAMPS,
35                NULL,
34                  0.,
35          };
36  
# Line 307 | 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;
313                        if (thisillum.sd != NULL) {
314                                free_BSDF(thisillum.sd);
315                                thisillum.sd = NULL;
316                        }
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);
324 <                                if (thisillum.sd == NULL)
325 <                                        break;
316 >                                error(WARNING, "direct BSDF input unsupported");
317 >                                goto opterr;
318                          }
319                          cp = sskip(cp);
320                          continue;
# Line 368 | Line 360 | xoptions(                      /* process options in string s */
360                          }
361                          doneheader = 0;
362                          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;
363                  case 't':                       /* object thickness */
364                          if (*++cp != '=')
365                                  break;
# Line 457 | 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);
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        }
418          printf("t=%f\t\t\t# object thickness\n", thisillum.thick);
419   }
420  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines