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.30 by greg, Tue Sep 18 19:51:07 2007 UTC vs.
Revision 2.36 by greg, Sat Dec 12 19:00:59 2009 UTC

# Line 8 | Line 8 | static const char RCSid[] = "$Id$";
8   #include  <signal.h>
9   #include  <ctype.h>
10  
11 #include  "platform.h"
11   #include  "mkillum.h"
13 #include  "random.h"
12  
13                                  /* default parameters */
14   #define  SAMPDENS       48              /* points per projected steradian */
# Line 26 | Line 24 | static const char RCSid[] = "$Id$";
24   struct illum_args  thisillum = {        /* our illum and default values */
25                  0,
26                  UDzpos,
27 +                0.,
28                  DFLMAT,
29                  DFLDAT,
30                  0,
# Line 69 | Line 68 | main(          /* compute illum distributions using rtrace */
68          gargv = argv;
69          progname = gargv[0];
70                                  /* set up rendering defaults */
71 <        dstrsrc = 0.25;
71 >        dstrsrc = 0.5;
72          directrelay = 3;
73          directvis = 0;
74          ambounce = 2;
# Line 177 | Line 176 | char  *s;
176  
177  
178   void
179 + quit(ec)                        /* make sure exit is called */
180 + int     ec;
181 + {
182 +        if (ray_pnprocs > 0)    /* close children if any */
183 +                ray_pclose(0);          
184 +        exit(ec);
185 + }
186 +
187 +
188 + void
189   filter(         /* process stream */
190          register FILE   *infp,
191          char    *name
# Line 307 | Line 316 | xoptions(                      /* process options in string s */
316                          }
317                          if (!*++cp || isspace(*cp))
318                                  continue;
319 <                        if (isintd(++cp, " \t\n\r")) {
319 >                        if (isintd(cp, " \t\n\r")) {
320                                  thisillum.sampdens = atoi(cp);
321                          } else {
322                                  atos(buf, sizeof(buf), cp);
# Line 384 | Line 393 | xoptions(                      /* process options in string s */
393                                  break;
394                          case 'z':
395                          case 'Z':
396 <                                thisillum.udir = negax ? UDxneg : UDxpos;
396 >                                thisillum.udir = negax ? UDzneg : UDzpos;
397                                  break;
398                          default:
399                                  thisillum.udir = UDunknown;
# Line 393 | Line 402 | xoptions(                      /* process options in string s */
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;
415                  case '!':                       /* processed file! */
416                          sprintf(errmsg, "(%s): already processed!", nm);
417                          error(WARNING, errmsg);
# Line 435 | Line 454 | printopts(void)                        /* print out option default values *
454                  printf("l+\t\t\t\t# light type on\n");
455          else
456                  printf("l-\t\t\t\t# light type off\n");
457 <        printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens);
458 <        printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps);
457 >        printf("d=%d\t\t\t\t# density of directions\n", thisillum.sampdens);
458 >        printf("s=%d\t\t\t\t# samples per direction\n", thisillum.nsamps);
459          printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt);
460          switch (thisillum.udir) {
461          case UDzneg:
# Line 460 | Line 479 | printopts(void)                        /* print out option default values *
479          case UDunknown:
480                  break;
481          }
482 +        printf("t=%f\t\t\t# object thickness\n", thisillum.thick);
483   }
484  
485  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines