ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rxcmain.cpp
(Generate patch)

Comparing ray/src/rt/rxcmain.cpp (file contents):
Revision 2.1 by greg, Tue Oct 29 00:36:54 2024 UTC vs.
Revision 2.3 by greg, Wed Oct 30 02:22:23 2024 UTC

# Line 21 | Line 21 | int    nproc = 1;                      /* number of processes requested */
21   int     inpfmt = 'a';                   /* input format */
22   int     outfmt = 'f';                   /* output format */
23  
24 int     contrib = 0;                    /* computing contributions? */
25
26 int     xres = 0;                       /* horizontal (scan) size */
27 int     yres = 0;                       /* vertical resolution */
28
29 int     imm_irrad = 0;                  /* compute immediate irradiance? */
30 int     lim_dist = 0;                   /* limit distance? */
31
24   int     report_intvl = 0;               /* reporting interval (seconds) */
25  
26   extern char *   progname;               // global argv[0]
# Line 38 | Line 30 | RcontribSimulManager   myRCmanager;    // global rcontrib s
30   #define RCONTRIB_FEATURES       "Multiprocessing\n" \
31                                  "Accumulation\nRecovery\n" \
32                                  "ImmediateIrradiance\n" \
33 <                                "ProgressReporting?\nDistanceLimiting\n" \
33 >                                "ProgressReporting\nDistanceLimiting\n" \
34                                  "InputFormats=a,f,d\nOutputFormats=f,d,c\n" \
35                                  "Outputs=V,W\n" \
36                                  "OutputCS=RGB,spec\n"
# Line 51 | Line 43 | printdefaults(void)                    /* print default values to stdou
43          printf("-c %-5d\t\t\t# accumulated rays per record\n", myRCmanager.accum);
44          printf("-V%c\t\t\t\t# output %s\n", contrib ? '+' : '-',
45                          contrib ? "contributions" : "coefficients");
46 <        if (imm_irrad)
46 >        if (myRCmanager.HasFlag(RTimmIrrad))
47                  printf("-I+\t\t\t\t# immediate irradiance on\n");
48          printf("-n %-2d\t\t\t\t# number of rendering processes\n", nproc);
49          if (xres > 0)
50                  printf("-x %-9d\t\t\t# x resolution\n", xres);
51          printf("-y %-9d\t\t\t# y resolution\n", yres);
52 <        printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" :
52 >        printf(myRCmanager.HasFlag(RTlimDist) ?
53 >                        "-ld+\t\t\t\t# limit distance on\n" :
54                          "-ld-\t\t\t\t# limit distance off\n");
55          printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n",
56                          inpfmt, outfmt, formstr(inpfmt), formstr(outfmt));
# Line 191 | Line 184 | main(int argc, char *argv[])
184                                          /* initialize calcomp routines early */
185          initfunc();
186          calcontext(RCCONTEXT);
187 +        esupport &= ~E_REDEFW;          /* temporary */
188                                          /* option city */
189          for (i = 1; i < argc; i++) {
190                                                  /* expand arguments */
# Line 218 | Line 212 | main(int argc, char *argv[])
212                          continue;
213                  }
214                  switch (argv[i][1]) {
215 <                case 'n':                       /* number of cores */
215 >                case 'n':                       /* number of processes */
216                          check(2,"i");
217                          nproc = atoi(argv[++i]);
218                          if (nproc < 0 && (nproc += RadSimulManager::GetNCores()) <= 0)
219                                  nproc = 1;
220                          break;
221 <                case 'V':                       /* output contributions */
221 >                case 'V':                       /* output contributions? */
222                          check_bool(2,contrib);
223                          break;
224                  case 'x':                       /* x resolution */
# Line 235 | Line 229 | main(int argc, char *argv[])
229                          check(2,"i");
230                          yres = atoi(argv[++i]);
231                          break;
232 <                case 'w':                       /* warnings */
232 >                case 'w':                       /* warnings on/off */
233                          rval = (erract[WARNING].pf != NULL);
234                          check_bool(2,rval);
235                          if (rval) erract[WARNING].pf = wputs;
236                          else erract[WARNING].pf = NULL;
237                          break;
238 <                case 'e':                       /* expression */
238 >                case 'e':                       /* .cal expression */
239                          check(2,"s");
240                          scompile(argv[++i], NULL, 0);
241                          break;
242                  case 'l':                       /* limit distance */
243                          if (argv[i][2] != 'd')
244                                  goto badopt;
245 <                        check_bool(3,lim_dist);
245 >                        rval = myRCmanager.HasFlag(RTlimDist);
246 >                        check_bool(3,rval);
247 >                        myRCmanager.SetFlag(RTlimDist, rval);
248                          break;
249                  case 'I':                       /* immed. irradiance */
250 <                        check_bool(2,imm_irrad);
250 >                        rval = myRCmanager.HasFlag(RTimmIrrad);
251 >                        check_bool(2,rval);
252 >                        myRCmanager.SetFlag(RTimmIrrad, rval);
253                          break;
254 <                case 'f':                       /* file or force or format */
254 >                case 'f':                       /* .cal file or force or format */
255                          if (!argv[i][2]) {
256                                  check(2,"s");
257                                  loadfunc(argv[++i]);
# Line 266 | Line 264 | main(int argc, char *argv[])
264                          setformat(argv[i]+2);
265                          myRCmanager.SetDataFormat(outfmt);
266                          break;
267 <                case 'o':                       /* output */
267 >                case 'o':                       /* output file */
268                          check(2,"s");
269                          curout = argv[++i];
270                          break;
# Line 294 | Line 292 | main(int argc, char *argv[])
292                          check(2,"s");
293                          myRCmanager.AddModifier(argv[++i], curout, prms, binval, bincnt);
294                          break;
295 <                case 'M':                       /* modifier file */
295 >                case 'M':                       /* file of modifier names */
296                          check(2,"s");
297                          myRCmanager.AddModFile(argv[++i], curout, prms, binval, bincnt);
298                          break;
# Line 308 | Line 306 | main(int argc, char *argv[])
306          }
307          if (i != argc-1)
308                  error(USER, "expected single octree argument");
309 +
310 +        esupport |= E_REDEFW;
311 +        override_options();             /* override some option settings */
312 +
313 +        if (!myRCmanager.GetOutput())   // check that we have work to do
314 +                error(USER, "missing required modifier argument");
315                                          // get ready to rock...
316          if (setspectrsamp(CNDX, WLPART) < 0)
317                  error(USER, "unsupported spectral sampling");
314
315        if (!myRCmanager.GetOutputs(NULL))      // check that we're ready
316                error(USER, "missing required modifier argument");
317                                        /* override some option settings */
318        override_options();
318                                          /* set up signal handling */
319          sigdie(SIGINT, "Interrupt");
320   #ifdef SIGHUP
# Line 348 | Line 347 | main(int argc, char *argv[])
347                  myRCmanager.outOp = RCOnew;
348                                          // rval = # rows recovered
349          rval = myRCmanager.PrepOutput();
350 <                                        // check if all done
350 >                                        // check if recovered everything
351          if (recover && rval >= myRCmanager.GetRowMax()) {
352                  error(WARNING, "nothing left to compute");
353                  quit(0);
# Line 524 | Line 523 | wputs(                         /* warning output function */
523          const char      *s
524   )
525   {
526 +        if (!erract[WARNING].pf) return;
527          int  lasterrno = errno;
528          eputs(s);
529          errno = lasterrno;
# Line 551 | Line 551 | eputs(                         /* put string to stderr */
551   }
552  
553  
554 < /* Quit program */
554 > /* Exit program */
555   void
556   quit(
557          int  code

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines