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

Comparing ray/src/px/xshowtrace.c (file contents):
Revision 1.1 by greg, Sat Sep 22 10:53:57 1990 UTC vs.
Revision 1.4 by greg, Fri Dec 21 17:24:45 1990 UTC

# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15   #define MAXDEPTH        32              /* ridiculous ray tree depth */
16  
17   char    rtcom[] = "rtrace -h -otp -fa -x 1";
18 < char    xicom[] = "x11image";
18 > char    xicom[] = "x11image -f";
19  
20   VIEW    ourview = STDVIEW;              /* view for picture */
21   int     xres, yres;
# Line 34 | Line 34 | struct node {                          /* ray tree node */
34  
35   #define newnode()       (struct node *)calloc(1, sizeof(struct node))
36  
37 + int     slow = 0;               /* slow trace? */
38  
39 +
40   main(argc, argv)                /* takes both the octree and the image */
41   int     argc;
42   char    *argv[];
43   {
44          int     i;
45          char    combuf[256];
44        Cursor  curs;
46  
47          progname = argv[0];
48 <        if (argc < 3) {
49 <                fprintf(stderr, "Usage: %s [rtrace args] octree picture\n",
48 >        for (i = 1; i < argc-2; i++)
49 >                if (!strcmp(argv[i], "-s"))
50 >                        slow++;
51 >                else
52 >                        break;
53 >        if (i > argc-2) {
54 >                fprintf(stderr, "Usage: %s [-s] [rtrace args] octree picture\n",
55                                  argv[0]);
56                  exit(1);
57          }
# Line 65 | Line 71 | char   *argv[];
71          }
72                                          /* build input command */
73          sprintf(combuf, "%s %s | %s", xicom, argv[argc-1], rtcom);
74 <        for (i = 1; i < argc-1; i++) {
74 >        for ( ; i < argc-1; i++) {
75                  strcat(combuf, " ");
76                  strcat(combuf, argv[i]);
77          }
# Line 109 | Line 115 | mainloop()                             /* get and process input */
115                  if (i == 0) {
116                          setvec(sis[0]->ipt);
117                          tracerays(sis[0]);
112                        XFlush(theDisplay);
118                          freetree(sis[0]);
119                          sis[0] = NULL;
120 +                        if (!slow)
121 +                                XFlush(theDisplay);
122                  }
123          }
124   }
# Line 134 | Line 141 | struct node    *tp;
141          register struct node    *kid;
142  
143          for (kid = tp->daughter; kid != NULL; kid = kid->sister) {
137                tracerays(kid);
144                  vector(tp->ipt, kid->ipt);
145 +                tracerays(kid);
146          }
147   }
148  
# Line 167 | Line 174 | double ipt[2];
174          XWindowAttributes       wa;
175          XColor  xc;
176          XGCValues       gcv;
177 <        int     pm, rx, ry, wx, wy, rw, cw;
177 >        int     rx, ry, wx, wy;
178 >        Window  rw, cw;
179 >        unsigned int    pm;
180                                          /* compute pointer location */
181          if (gwind == 0) {
182                  XQueryPointer(theDisplay, rwind, &rw, &gwind,
# Line 199 | Line 208 | double ip1[2], ip2[2];
208          XDrawLine(theDisplay, gwind, vecGC,
209                          (int)(ip1[0]*xres)+xoff, (int)((1.-ip1[1])*yres)+yoff,
210                          (int)(ip2[0]*xres)+xoff, (int)((1.-ip2[1])*yres)+yoff);
211 +        if (slow) {
212 +                XFlush(theDisplay);
213 +                sleep(1);
214 +        }
215   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines