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

Comparing ray/src/hd/rholo4.c (file contents):
Revision 3.11 by gregl, Mon Dec 8 18:51:15 1997 UTC vs.
Revision 3.18 by gwlarson, Fri May 22 08:30:41 1998 UTC

# Line 13 | Line 13 | static char SCCSid[] = "$SunId$ SGI";
13   #include <sys/uio.h>
14  
15   #ifndef HDSUF
16 < #define HDSUF   ".hdisp"
16 > #define HDSUF   ".hdi"
17   #endif
18  
19   static int      inp_flags;
# Line 53 | Line 53 | char   *dname;
53          if (readinp)
54                  close(atoi(fd0));
55          close(atoi(fd1));
56 +                                /* check if outside */
57 +        if (vdef(OBSTRUCTIONS) && vbool(OBSTRUCTIONS))
58 +                disp_result(DS_OUTSECT, 0, NULL);
59 +                                /* send eye separation if specified */
60 +        if (vdef(EYESEP)) {
61 +                char    fbuf[32];
62 +                sprintf(fbuf, "%.9e", vflt(EYESEP));
63 +                disp_result(DS_EYESEP, strlen(fbuf)+1, fbuf);
64 +        }
65                                  /* write out hologram grids */
66          for (i = 0; hdlist[i] != NULL; i++)
67                  disp_result(DS_ADDHOLO, sizeof(HDGRID), (char *)hdlist[i]);
# Line 105 | Line 114 | int    block;
114                          goto readerr;
115          }
116          switch (msg.type) {             /* take appropriate action */
117 <        case DR_BUNDLE:
117 >        case DR_BUNDLE:         /* new bundle to calculate */
118                  if (msg.nbytes != sizeof(PACKHEAD))
119                          error(INTERNAL, "bad DR_BUNDLE from display process");
120                  bundle_set(BS_ADD, (PACKHEAD *)buf, 1);
121                  break;
122 <        case DR_NEWSET:
122 >        case DR_NEWSET:         /* new calculation set */
123                  if (msg.nbytes % sizeof(PACKHEAD))
124                          error(INTERNAL, "bad DR_NEWSET from display process");
125                  disp_result(DS_STARTIMM, 0, NULL);
# Line 118 | Line 127 | int    block;
127                  disp_result(DS_ENDIMM, 0, NULL);
128                  disp_flush();
129                  break;
130 <        case DR_ADDSET:
130 >        case DR_ADDSET:         /* add to calculation set */
131                  if (msg.nbytes % sizeof(PACKHEAD))
132                          error(INTERNAL, "bad DR_ADDSET from display process");
133                  disp_result(DS_STARTIMM, 0, NULL);
134                  bundle_set(BS_ADD, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD));
135                  disp_result(DS_ENDIMM, 0, NULL);
136 <                disp_check(0);          /* hack -- delete usu. follows add */
136 >                disp_flush();
137                  break;
138 <        case DR_ADJSET:
138 >        case DR_ADJSET:         /* adjust calculation set members */
139                  if (msg.nbytes % sizeof(PACKHEAD))
140                          error(INTERNAL, "bad DR_ADJSET from display process");
141                  disp_result(DS_STARTIMM, 0, NULL);
# Line 134 | Line 143 | int    block;
143                  disp_result(DS_ENDIMM, 0, NULL);
144                  disp_flush();
145                  break;
146 <        case DR_DELSET:
146 >        case DR_DELSET:         /* delete from calculation set */
147                  if (msg.nbytes % sizeof(PACKHEAD))
148                          error(INTERNAL, "bad DR_DELSET from display process");
149                  bundle_set(BS_DEL, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD));
150                  break;
151 <        case DR_ATTEN:
151 >        case DR_ATTEN:          /* block for priority request */
152                  if (msg.nbytes)
153                          error(INTERNAL, "bad DR_ATTEN from display process");
154                                          /* send acknowledgement */
155                  disp_result(DS_ACKNOW, 0, NULL);
156                  return(disp_check(1));  /* block on following request */
157 <        case DR_SHUTDOWN:
157 >        case DR_KILL:           /* kill computation process(es) */
158                  if (msg.nbytes)
159 +                        error(INTERNAL, "bad DR_KILL from display process");
160 +                if (nprocs > 0)
161 +                        done_rtrace();
162 +                else
163 +                        error(WARNING, "no rtrace process to kill");
164 +                break;
165 +        case DR_RESTART:        /* restart computation process(es) */
166 +                if (msg.nbytes)
167 +                        error(INTERNAL, "bad DR_RESTART from display process");
168 +                if (ncprocs > nprocs)
169 +                        new_rtrace();
170 +                else if (nprocs > 0)
171 +                        error(WARNING, "rtrace already runnning");
172 +                else
173 +                        error(WARNING, "holodeck not open for writing");
174 +                break;
175 +        case DR_CLOBBER:        /* clobber holodeck */
176 +                if (msg.nbytes)
177 +                        error(INTERNAL, "bad DR_CLOBBER from display process");
178 +                if (!force || !ncprocs)
179 +                        error(WARNING, "request to clobber holodeck denied");
180 +                else {
181 +                        error(WARNING, "clobbering holodeck contents");
182 +                        hdclobber(NULL);
183 +                }
184 +                break;
185 +        case DR_SHUTDOWN:       /* shut down program */
186 +                if (msg.nbytes)
187                          error(INTERNAL, "bad DR_SHUTDOWN from display process");
188                  return(0);              /* zero return signals shutdown */
189 <        case DR_NOOP:
189 >        case DR_NOOP:           /* do nothing */
190                  break;
191          default:
192                  error(INTERNAL, "unrecognized request from display process");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines