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

Comparing ray/src/hd/rhdisp2.c (file contents):
Revision 3.20 by gwlarson, Thu May 14 10:13:50 1998 UTC vs.
Revision 3.26 by gwlarson, Tue Nov 24 17:05:36 1998 UTC

# Line 11 | Line 11 | static char SCCSid[] = "$SunId$ SGI";
11   #include "rholo.h"
12   #include "rhdisp.h"
13   #include "rhdriver.h"
14 + #include "random.h"
15  
16   #ifndef MAXDIST
17   #define MAXDIST         42      /* maximum distance outside section */
18   #endif
19 + #ifndef NVSAMPS
20 + #define NVSAMPS         4096    /* number of ray samples per view */
21 + #endif
22 + #ifndef MEYERNG
23 + #define MEYERNG         0.2     /* target mean eye range (rel. to grid) */
24 + #endif
25 + #ifndef MAXTODO
26 + #define MAXTODO         3       /* maximum sections to look at */
27 + #endif
28 + #ifndef MAXDRAT
29 + #define MAXDRAT         3.0     /* maximum distance ratio btwn. cand. sect. */
30 + #endif
31  
19 #define MAXVOXEL        16      /* maximum number of active voxels */
20
21 extern GCOORD   *getviewcells();
22
23 static VIEW     dvw;            /* current view corresponding to beam list */
24
25 typedef struct {
26        int     hd;             /* holodeck section number (-1 if inactive) */
27        int     i[3];           /* voxel index (may be outside section) */
28 } VOXL;                 /* a voxel */
29
30 static VOXL voxel[MAXVOXEL] = {{-1}};   /* current voxel list */
31
32   #define CBEAMBLK        1024    /* cbeam allocation block size */
33  
34   static struct beamcomp {
35 <        unsigned short  wants;  /* flags telling which voxels want us */
36 <        unsigned short  hd;     /* holodeck section number */
35 >        int     hd;             /* holodeck section number */
36          int     bi;             /* beam index */
37 +        int4    nr;             /* number of samples desired */
38   } *cbeam = NULL;        /* current beam list */
39  
40 + VIEWPOINT       cureye;         /* current eye position */
41 +
42   static int      ncbeams = 0;    /* number of sorted beams in cbeam */
43   static int      xcbeams = 0;    /* extra (unregistered) beams past ncbeams */
44   static int      maxcbeam = 0;   /* size of cbeam array */
45  
44 struct cellact {
45        short   vi;             /* voxel index */
46        short   add;            /* zero means delete */
47        short   rev;            /* reverse ray direction? */
48 };              /* action for cell */
46  
50 struct beamact {
51        struct cellact  ca;     /* cell action */
52        GCOORD  gc;             /* grid coordinate */
53 };              /* beam origin and action */
54
55
47   int
48   newcbeam()              /* allocate new entry at end of cbeam array */
49   {
# Line 91 | Line 82 | register struct beamcomp       *cb1, *cb2;
82   {
83          register int    c;
84  
85 <        if (!cb1->wants)                /* put orphans at the end, unsorted */
86 <                return(cb2->wants);
87 <        if (!cb2->wants)
85 >        if (!cb1->nr)                   /* put orphans at the end, unsorted */
86 >                return(cb2->nr);
87 >        if (!cb2->nr)
88                  return(-1);
89          if ((c = cb1->bi - cb2->bi))    /* sort on beam index first */
90                  return(c);
# Line 110 | Line 101 | int    hd, bi;
101  
102          if (ncbeams <= 0)
103                  return(-1);
104 <        cb.wants = 0; cb.hd = hd; cb.bi = bi;
104 >        cb.hd = hd; cb.bi = bi; cb.nr = 0;
105          p = (struct beamcomp *)bsearch((char *)&cb, (char *)cbeam, ncbeams,
106                          sizeof(struct beamcomp), cbeamcmp);
107          if (p == NULL)
# Line 138 | Line 129 | int    bi;
129          if (bi < 1 | bi > nbeams(hdlist[hd]))
130                  error(INTERNAL, "illegal beam index in getcbeam");
131          n = newcbeam();         /* allocate and assign */
132 <        cbeam[n].wants = 0; cbeam[n].hd = hd; cbeam[n].bi = bi;
132 >        cbeam[n].nr = 0; cbeam[n].hd = hd; cbeam[n].bi = bi;
133          return(n);
134   }
135  
# Line 156 | Line 147 | int    adopt;
147          if (adopt)
148                  return;
149          for (i = ncbeams; i--; )        /* identify orphans */
150 <                if (cbeam[i].wants)
150 >                if (cbeam[i].nr)
151                          break;
152          xcbeams = ncbeams - ++i;        /* put orphans after ncbeams */
153          ncbeams = i;
154   }
155  
156  
157 < cbeamop(op, bl, n, v, hr, vr)   /* update beams on server list */
157 > cbeamop(op, bl, n)              /* update beams on server list */
158   int     op;
159   register struct beamcomp        *bl;
160   int     n;
170 VIEW    *v;
171 int     hr, vr;
161   {
162          register PACKHEAD       *pa;
163          register int    i;
# Line 177 | Line 166 | int    hr, vr;
166                  return;
167          pa = (PACKHEAD *)malloc(n*sizeof(PACKHEAD));
168          if (pa == NULL)
169 <                error(SYSTEM, "out of memory in cbeamadd");
169 >                error(SYSTEM, "out of memory in cbeamop");
170          for (i = 0; i < n; i++) {
171                  pa[i].hd = bl[i].hd;
172                  pa[i].bi = bl[i].bi;
173 <                pa[i].nr = v==NULL ? 0 :
185 <                                npixels(v, hr, vr, hdlist[bl[i].hd], bl[i].bi);
173 >                pa[i].nr = bl[i].nr;
174                  pa[i].nc = 0;
175          }
176          serv_request(op, n*sizeof(PACKHEAD), (char *)pa);
# Line 191 | Line 179 | int    hr, vr;
179  
180  
181   int
182 < set_voxels(vl, n)       /* set new voxel array */
183 < VOXL    vl[MAXVOXEL];
184 < int     n;
182 > comptodo(tdl, vw)               /* compute holodeck sections in view */
183 > int     tdl[MAXTODO+1];
184 > VIEW    *vw;
185   {
186 <        short   wmap[256];
187 <        int     vmap[MAXVOXEL];
188 <        int     comn = 0;
201 <        int     no;
186 >        int     n = 0;
187 >        FVECT   gp, dv;
188 >        double  dist2[MAXTODO+1], thisdist2;
189          register int    i, j;
190 <                                        /* find common voxels */
191 <        for (j = 0; j < MAXVOXEL && voxel[j].hd >= 0; j++) {
192 <                vmap[j] = -1;
193 <                for (i = n; i--; )
194 <                        if (!bcmp((char *)(vl+i), (char *)(voxel+j),
195 <                                        sizeof(VOXL))) {
196 <                                vmap[j] = i;
197 <                                comn |= 1<<i;
198 <                                break;
199 <                        }
200 <        }
201 <        no = comn ? j : 0;              /* compute flag mapping */
202 <        for (i = 256; i--; ) {
203 <                wmap[i] = 0;
217 <                for (j = no; j--; )
218 <                        if (vmap[j] >= 0 && i & 1<<j)
219 <                                wmap[i] |= 1<<vmap[j];
220 <        }
221 <                                        /* fix cbeam flags */
222 <        for (i = ncbeams; i--; )
223 <                cbeam[i].wants = wmap[cbeam[i].wants];
224 <                                        /* update our voxel list */
225 <        bcopy((char *)vl, (char *)voxel, n*sizeof(VOXL));
226 <        if (n < MAXVOXEL)
227 <                voxel[n].hd = -1;
228 <        return(comn);                   /* return bit array of common voxels */
229 < }
230 <
231 <
232 < int
233 < get_voxels(vl, vp)      /* find voxels corresponding to view point */
234 < VOXL    vl[MAXVOXEL];
235 < FVECT   vp;
236 < {
237 <        int     first, n;
238 <        FVECT   gp;
239 <        double  d;
240 <        int     dist, bestd = 0x7fff;
241 <        VOXL    vox;
242 <        register int    i, j, k;
243 <                                        /* count voxels in list already */
244 <        for (first = 0; first < MAXVOXEL && vl[first].hd >= 0; first++)
245 <                ;
246 <                                        /* find closest voxels */
247 <        for (n = first, i = 0; n < MAXVOXEL && hdlist[i]; i++) {
248 <                hdgrid(gp, hdlist[i], vp);
249 <                for (j = 0; n < MAXVOXEL && j < 8; j++) {
250 <                        dist = 0;
251 <                        for (k = 0; k < 3; k++) {
252 <                                d = gp[k] - .5 + (j>>k & 1);
253 <                                if (d < 0.)
254 <                                        dist += -(vox.i[k] = (int)d - 1);
255 <                                else if ((vox.i[k] = d) >= hdlist[i]->grid[k])
256 <                                        dist += vox.i[k] -
257 <                                                        hdlist[i]->grid[k] + 1;
258 <                        }
259 <                        if (dist > bestd)       /* others were closer */
260 <                                continue;
261 <                        if (dist < bestd) {     /* start closer list */
262 <                                n = first;
263 <                                bestd = dist;
264 <                        }
265 <                                                /* check if already in list */
266 <                        for (k = first; k--; )
267 <                                if (vl[k].hd == i &&
268 <                                                vl[k].i[0] == vox.i[0] &&
269 <                                                vl[k].i[1] == vox.i[1] &&
270 <                                                vl[k].i[2] == vox.i[2])
271 <                                        break;
272 <                        if (k >= 0)
273 <                                continue;
274 <                        vox.hd = i;             /* add this voxel */
275 <                        copystruct(&vl[n], &vox);
276 <                        n++;
190 >                                        /* find closest MAXTODO sections */
191 >        for (i = 0; hdlist[i]; i++) {
192 >                hdgrid(gp, hdlist[i], vw->vp);
193 >                for (j = 0; j < 3; j++)
194 >                        if (gp[j] < 0.)
195 >                                dv[j] = -gp[j];
196 >                        else if (gp[j] > hdlist[i]->grid[j])
197 >                                dv[j] = gp[j] - hdlist[i]->grid[j];
198 >                        else
199 >                                dv[j] = 0.;
200 >                thisdist2 = DOT(dv,dv);
201 >                for (j = n; j > 0 && thisdist2 < dist2[j-1]; j--) {
202 >                        tdl[j] = tdl[j-1];
203 >                        dist2[j] = dist2[j-1];
204                  }
205 +                tdl[j] = i;
206 +                dist2[j] = thisdist2;
207 +                if (n < MAXTODO)
208 +                        n++;
209          }
210 <                                        /* check for really stupid move */
211 <        if (bestd > MAXDIST) {
210 >                                        /* watch for bad move */
211 >        if (n && dist2[0] > MAXDIST*MAXDIST) {
212                  error(COMMAND, "move past outer limits");
213                  return(0);
214          }
215 <        if (n < MAXVOXEL)
216 <                vl[n].hd = -1;
215 >                                        /* avoid big differences */
216 >        for (j = 1; j < n; j++)
217 >                if (dist2[j] > MAXDRAT*MAXDRAT*dist2[j-1])
218 >                        n = j;
219 >        tdl[n] = -1;
220          return(n);
221   }
222  
223  
224 < int
225 < dobeam(gcp, bp)         /* express interest or disintrest in a beam */
226 < GCOORD  *gcp;
227 < register struct beamact *bp;
224 > addview(hd, vw, hres, vres)     /* add view for section */
225 > int     hd;
226 > VIEW    *vw;
227 > int     hres, vres;
228   {
229 +        int     sampquant;
230 +        int     h, v, shr, svr;
231          GCOORD  gc[2];
232 <        int     bi, i;
233 <                                        /* compute beam index */
234 <        if (bp->ca.rev) {
235 <                copystruct(gc, &bp->gc);
236 <                copystruct(gc+1, gcp);
232 >        FVECT   rorg, rdir;
233 >                                /* compute sampling grid */
234 >        if (hres|vres && hres*vres <= NVSAMPS) {
235 >                shr = hres; svr = vres;
236 >                sampquant = 1;
237          } else {
238 <                copystruct(gc, gcp);
239 <                copystruct(gc+1, &bp->gc);
238 >                shr = sqrt(NVSAMPS/viewaspect(vw)) + .5;
239 >                svr = (NVSAMPS + shr/2)/shr;
240 >                sampquant = (hres*vres + shr*svr/2)/(shr*svr);
241          }
242 <        if ((bi = hdbindex(hdlist[voxel[bp->ca.vi].hd], gc)) <= 0)
243 <                error(CONSISTENCY, "bad grid coordinate in dobeam");
244 <        if (bp->ca.add) {               /* add it in */
245 <                i = getcbeam(voxel[bp->ca.vi].hd, bi);
246 <                cbeam[i].wants |= 1<<bp->ca.vi; /* say we want it */
247 <                return(i == ncbeams+xcbeams-1); /* return 1 if totally new */
248 <        }
249 <                                        /* else delete it */
250 <        i = findcbeam(voxel[bp->ca.vi].hd, bi);
251 <        if (i >= 0 && cbeam[i].wants & 1<<bp->ca.vi) {
252 <                cbeam[i].wants &= ~(1<<bp->ca.vi);      /* we don't want it */
253 <                return(1);                      /* indicate change */
317 <        }
318 <        return(0);
242 >                                /* intersect sample rays with section */
243 >        for (v = svr; v--; )
244 >                for (h = shr; h--; ) {
245 >                        if (viewray(rorg, rdir, vw, (v+frandom())/svr,
246 >                                                (h+frandom())/shr) < -FTINY)
247 >                                continue;
248 >                        if (hdinter(gc, NULL, NULL, hdlist[hd], rorg, rdir)
249 >                                                >= FHUGE)
250 >                                continue;
251 >                        cbeam[getcbeam(hd,hdbindex(hdlist[hd],gc))].nr +=
252 >                                        sampquant;
253 >                }
254   }
255  
256  
257 <
258 < int
324 < docell(gcp, cap)        /* find beams corresponding to cell and voxel */
325 < GCOORD  *gcp;
326 < register struct cellact *cap;
257 > beam_init(fresh)                /* clear beam list for new view(s) */
258 > int     fresh;
259   {
328        register HOLO   *hp = hdlist[voxel[cap->vi].hd];
329        FVECT   org, dir[4];
330        FVECT   vgp, cgp, vc;
331        FVECT   v1, v2;
332        struct beamact  bo;
333        int     axmax, j;
334        double  d, avmax;
260          register int    i;
336                                /* compute cell center */
337        cgp[gcp->w>>1] = gcp->w&1 ? hp->grid[gcp->w>>1] : 0 ;
338        cgp[hdwg0[gcp->w]] = gcp->i[0] + .5;
339        cgp[hdwg1[gcp->w]] = gcp->i[1] + .5;
340        hdworld(org, hp, cgp);
341                                /* compute direction to voxel center */
342        for (i = 3; i--; )
343                vgp[i] = voxel[cap->vi].i[i] + .5;
344        hdworld(vc, hp, vgp);
345        for (i = 3; i--; )
346                vc[i] -= org[i];
347                                /* compute maximum area axis */
348        axmax = -1; avmax = 0;
349        for (i = 3; i--; ) {
350                d = vgp[i] - cgp[i];
351                if (d < 0.) d = -d;
352                if (d > avmax) {
353                        avmax = d;
354                        axmax = i;
355                }
356        }
357 #ifdef DEBUG
358        if (axmax < 0.)
359                error(CONSISTENCY, "botched axis computation in docell");
360 #endif
361                                /* compute offset vectors */
362        d = 0.5/hp->grid[j=(axmax+1)%3];
363        for (i = 3; i--; )
364                v1[i] = hp->xv[j][i] * d;
365        d = 0.5/hp->grid[j=(axmax+2)%3];
366        if (DOT(hp->wg[axmax], vc) < 0.)
367                d = -d; /* reverse vertex order */
368        for (i = 3; i--; )
369                v2[i] = hp->xv[j][i] * d;
370                                /* compute voxel pyramid */
371        for (i = 3; i--; ) {
372                dir[0][i] = vc[i] - v1[i] - v2[i];
373                dir[1][i] = vc[i] + v1[i] - v2[i];
374                dir[2][i] = vc[i] + v1[i] + v2[i];
375                dir[3][i] = vc[i] - v1[i] + v2[i];
376        }
377                                /* visit beams for opposite cells */
378        copystruct(&bo.ca, cap);
379        copystruct(&bo.gc, gcp);
380        return(visit_cells(org, dir, hp, dobeam, &bo));
381 }
261  
262 <
263 < int
264 < doview(cap, vp)                 /* visit cells for a given view */
265 < struct cellact  *cap;
266 < VIEW    *vp;
267 < {
389 <        int     orient;
390 <        FVECT   org, dir[4];
391 <                                        /* compute view pyramid */
392 <        orient = viewpyramid(org, dir, hdlist[voxel[cap->vi].hd], vp);
393 <        if (!orient)
394 <                error(INTERNAL, "unusable view in doview");
395 <        cap->rev = orient < 0;
396 <                                        /* visit cells within pyramid */
397 <        return(visit_cells(org, dir, hdlist[voxel[cap->vi].hd], docell, cap));
262 >        if (fresh)                      /* discard old beams? */
263 >                ncbeams = xcbeams = 0;
264 >        else                            /* else clear sample requests */
265 >                for (i = ncbeams+xcbeams; i--; )
266 >                        cbeam[i].nr = 0;
267 >        cureye.rng = 0.;
268   }
269  
270  
271 < mvview(voxi, vold, vnew)        /* move view for a voxel */
272 < int     voxi;
273 < VIEW    *vold, *vnew;
271 > beam_view(vn, hr, vr)           /* add beam view (if advisable) */
272 > VIEW    *vn;
273 > int     hr, vr;
274   {
275 <        int     netchange = 0;
276 <        struct cellact  oca, nca;
277 <        int     ocnt, ncnt;
278 <        int     nmatch = 0;
279 <        GCOORD  *ogcl, *ngcl;
280 <        register int    c;
281 <        register GCOORD *ogcp, *ngcp;
282 <                                /* get old and new cell lists */
283 <        ogcp = ogcl = getviewcells(&ocnt, hdlist[voxel[voxi].hd], vold);
284 <        ngcp = ngcl = getviewcells(&ncnt, hdlist[voxel[voxi].hd], vnew);
285 <                                /* set up actions */
286 <        oca.vi = nca.vi = voxi;
287 <        oca.add = 0; nca.add = 1;
288 <        if ((oca.rev = ocnt < 0))
289 <                ocnt = -ocnt;
290 <        if ((nca.rev = ncnt < 0))
291 <                ncnt = -ncnt;
292 <        if (oca.rev == nca.rev) {       /* count matches */
293 <                int     oc = ocnt, nc = ncnt;
424 <                while (oc > 0 & nc > 0) {
425 <                        c = cellcmp(ogcp, ngcp);
426 <                        if (c >= 0) { ngcp++; nc--; }
427 <                        if (c <= 0) { ogcp++; oc--; }
428 <                        nmatch += c==0;
429 <                }
430 <                ogcp = ogcl; ngcp = ngcl;
275 >        int     todo[MAXTODO+1], n;
276 >        double  hdgsiz, d;
277 >        register HOLO   *hp;
278 >        register int    i;
279 >                                        /* sort our list */
280 >        cbeamsort(1);
281 >                                        /* add view to nearby sections */
282 >        if (!(n = comptodo(todo, vn)))
283 >                return(0);
284 >        for (i = 0; i < n; i++)
285 >                addview(todo[i], vn, hr, vr);
286 >        if (MEYERNG <= FTINY || vn->type == VT_PAR)
287 >                return(1);
288 >        hdgsiz = 0.; d = 1./3. / n;     /* compute mean grid size */
289 >        for (i = 0; i < n; i++) {
290 >                hp = hdlist[todo[i]];
291 >                hdgsiz += d * ( VLEN(hp->xv[0])/hp->grid[0] +
292 >                                VLEN(hp->xv[1])/hp->grid[1] +
293 >                                VLEN(hp->xv[2])/hp->grid[2] ) ;
294          }
295 <        if (nmatch < ocnt>>1) {         /* faster to just delete old cells? */
296 <                for (c = ncbeams; c--; )
297 <                        if (cbeam[c].wants & 1<<voxi) {
298 <                                cbeam[c].wants &= ~(1<<voxi);
299 <                                netchange--;
300 <                        }
301 <                free((char *)ogcl);
302 <                ogcl = NULL; ocnt = 0;
295 >                                        /* add to current eye position */
296 >        if (cureye.rng <= FTINY) {
297 >                VCOPY(cureye.vpt, vn->vp);
298 >                cureye.rng = MEYERNG * hdgsiz;
299 >        } else if ((d = sqrt(dist2(vn->vp,cureye.vpt))) + MEYERNG*hdgsiz >
300 >                        cureye.rng) {
301 >                for (i = 3; i--; )
302 >                        cureye.vpt[i] = 0.5*(cureye.vpt[i] + vn->vp[i]);
303 >                cureye.rng = 0.5*(cureye.rng + MEYERNG*hdgsiz + d);
304          }
305 <                                /* add and delete cells in order */
442 <        while (ocnt > 0 & ncnt > 0)
443 <                if ((c = cellcmp(ogcp, ngcp)) > 0) {    /* new cell */
444 <                        netchange += docell(ngcp++, &nca);
445 <                        ncnt--;
446 <                } else if (c < 0) {                     /* old cell */
447 <                        netchange -= docell(ogcp++, &oca);
448 <                        ocnt--;
449 <                } else {                                /* same cell */
450 <                        ogcp++; ocnt--;
451 <                        ngcp++; ncnt--;
452 <                }
453 <                                /* take care of list tails */
454 <        for ( ; ncnt > 0; ncnt--)
455 <                netchange += docell(ngcp++, &nca);
456 <        for ( ; ocnt > 0; ocnt--)
457 <                netchange -= docell(ogcp++, &oca);
458 <                                /* clean up */
459 <        if (ogcl != NULL) free((char *)ogcl);
460 <        if (ngcl != NULL) free((char *)ngcl);
461 <        return(netchange);
305 >        return(1);
306   }
307  
308  
309   int
310 < beam_sync()             /* synchronize beams on server */
310 > beam_sync(all)                  /* update beam list on server */
311 > int     all;
312   {
313 <        cbeamop(DR_NEWSET, cbeam, ncbeams, &odev.v, odev.hres, odev.vres);
314 <        return(ncbeams);
315 < }
316 <
317 <
318 < beam_view(vn)                   /* change beam view (if advisable) */
319 < VIEW    *vn;
320 < {
321 <        struct cellact  ca;
477 <        VOXL    vlnew[MAXVOXEL];
478 <        int     n, comn;
479 <
480 <        if (vn == NULL || !vn->type) {  /* clear our beam list */
481 <                set_voxels(vlnew, 0);
482 <                cbeamop(DR_DELSET, cbeam, ncbeams, NULL, 0, 0);
483 <                ncbeams = 0;
484 <                dvw.type = 0;
485 <                return(1);
486 <        }
487 <                                        /* find our new voxels */
488 <        n = get_voxels(vlnew, vn->vp);
489 <        if (dvw.type && !n) {
490 <                copystruct(vn, &dvw);           /* cancel move */
491 <                return(0);
492 <        }
493 <                                        /* set the new voxels */
494 <        comn = set_voxels(vlnew, n);
495 <        if (!dvw.type)
496 <                comn = 0;
497 <        ca.add = 1;                     /* update our beam list */
498 <        for (ca.vi = n; ca.vi--; )
499 <                if (comn & 1<<ca.vi)    /* change which cells we see */
500 <                        mvview(ca.vi, &dvw, vn);
501 <                else                    /* else add all new cells */
502 <                        doview(&ca, vn);
503 <                                        /* inform server of new beams */
504 <        cbeamop(DR_ADDSET, cbeam+ncbeams, xcbeams, vn, odev.hres, odev.vres);
505 <                                        /* sort list to put orphans at end */
506 <        cbeamsort(0);
507 <                                        /* tell server to delete orphans */
508 <        cbeamop(DR_DELSET, cbeam+ncbeams, xcbeams, NULL, 0, 0);
313 >                                        /* set new eye position */
314 >        serv_request(DR_VIEWPOINT, sizeof(VIEWPOINT), (char *)&cureye);
315 >                                        /* sort list (put orphans at end) */
316 >        cbeamsort(all < 0);
317 >                                        /* send beam request */
318 >        if (all)
319 >                cbeamop(DR_NEWSET, cbeam, ncbeams);
320 >        else
321 >                cbeamop(DR_ADJSET, cbeam, ncbeams+xcbeams);
322          xcbeams = 0;                    /* truncate our list */
323 <        copystruct(&dvw, vn);           /* record new view */
511 <        return(1);
323 >        return(ncbeams);
324   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines