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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 2.13 by greg, Mon Mar 8 12:37:33 1993 UTC vs.
Revision 2.15 by greg, Fri Jun 18 10:14:42 1993 UTC

# Line 42 | Line 42 | int  inform = 'a';                     /* input format */
42   int  outform = 'a';                     /* output format */
43   char  *outvals = "v";                   /* output specification */
44  
45 + char  *tralist[128];                    /* list of modifers to trace (or no) */
46 + int  traincl = -1;                      /* include == 1, exclude == 0 */
47 + #define  MAXTSET        511             /* maximum number in trace set */
48 + OBJECT  traset[MAXTSET+1]={0};          /* trace include/exclude set */
49 +
50   int  hresolu = 0;                       /* horizontal (scan) size */
51   int  vresolu = 0;                       /* vertical resolution */
52  
# Line 76 | Line 81 | static int  oputo(), oputd(), oputv(), oputl(), oputL(
81                  oputp(), oputn(), oputN(), oputs(), oputw(), oputm();
82  
83   static int  ourtrace(), tabin();
84 < static int  (*ray_out[10])(), (*every_out[10])();
85 < static int  castonly;
84 > static int  (*ray_out[16])(), (*every_out[16])();
85 > static int  castonly = 0;
86  
87   static int  puta(), putf(), putd();
88  
# Line 128 | Line 133 | char  *fname;
133                  setmode(fileno(fp), O_BINARY);
134   #endif
135                                          /* set up output */
136 <        setoutput(outvals);
136 >        if (imm_irrad)
137 >                outvals = "v";
138 >        else
139 >                setoutput(outvals);
140          switch (outform) {
141          case 'a': putreal = puta; break;
142          case 'f': putreal = putf; break;
# Line 316 | Line 324 | FILE  *fp;
324   }
325  
326  
327 + tranotify(obj)                  /* record new modifier */
328 + OBJECT  obj;
329 + {
330 +        static int  hitlimit = 0;
331 +        register OBJREC  *o = objptr(obj);
332 +        register char  **tralp;
333 +
334 +        if (hitlimit || !ismodifier(o->otype))
335 +                return;
336 +        for (tralp = tralist; *tralp != NULL; tralp++)
337 +                if (!strcmp(o->oname, *tralp)) {
338 +                        if (traset[0] >= MAXTSET) {
339 +                                error(WARNING, "too many modifiers in trace list");
340 +                                hitlimit++;
341 +                                return;         /* should this be fatal? */
342 +                        }
343 +                        insertelem(traset, obj);
344 +                        return;
345 +                }
346 + }
347 +
348 +
349   static
350   ourtrace(r)                             /* print ray values */
351   RAY  *r;
# Line 323 | Line 353 | RAY  *r;
353          register int  (**tp)();
354  
355          if (every_out[0] == NULL)
356 +                return;
357 +        if (traincl == 1 && r->ro == NULL)
358 +                return;
359 +        if (traincl != -1 && traincl != inset(traset, r->ro->omod))
360                  return;
361          tabin(r);
362          for (tp = every_out; *tp != NULL; tp++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines