| 1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 3 |
– |
#ifndef lint |
| 4 |
– |
static char SCCSid[] = "$SunId$ SGI"; |
| 5 |
– |
#endif |
| 6 |
– |
|
| 1 |
|
/* |
| 2 |
|
* Routines for tracking beam compuatations |
| 3 |
|
*/ |
| 56 |
|
int nents; |
| 57 |
|
{ |
| 58 |
|
int oldnr; |
| 59 |
+ |
register HDBEAMI *hb; |
| 60 |
|
register int i, n; |
| 61 |
|
/* look for common members */ |
| 62 |
|
for (n = 0; n < nents; n++) { |
| 92 |
|
/* complete list operations */ |
| 93 |
|
switch (op) { |
| 94 |
|
case BS_NEW: /* new computation set */ |
| 95 |
< |
listpos = 0; |
| 101 |
< |
lastin = -1; |
| 95 |
> |
listpos = 0; lastin = -1; |
| 96 |
|
if (complen) /* free old list */ |
| 97 |
|
free((char *)complist); |
| 98 |
|
complist = NULL; |
| 112 |
|
/* what can't we satisfy? */ |
| 113 |
|
for (n = 0; n < nents && clist[n].nr > clist[n].nc; n++) |
| 114 |
|
; |
| 115 |
< |
if (op == BS_ADJ) |
| 116 |
< |
nents = n; |
| 115 |
> |
if (op == BS_ADJ) { /* don't regenerate adjusted beams */ |
| 116 |
> |
for (i = n; i < nents && clist[i].nr > 0; i++) |
| 117 |
> |
; |
| 118 |
> |
nents = i; |
| 119 |
> |
} |
| 120 |
|
if (n) { /* allocate space for merged list */ |
| 121 |
|
PACKHEAD *newlist; |
| 122 |
|
newlist = (PACKHEAD *)malloc( |
| 138 |
|
default: |
| 139 |
|
error(CONSISTENCY, "bundle_set called with unknown operation"); |
| 140 |
|
} |
| 141 |
< |
if (outdev != NULL) { /* load and display beams we have */ |
| 142 |
< |
register HDBEAMI *hb; |
| 143 |
< |
|
| 144 |
< |
hb = (HDBEAMI *)malloc(nents*sizeof(HDBEAMI)); |
| 145 |
< |
for (i = 0; i < nents; i++) { |
| 146 |
< |
hb[i].h = hdlist[clist[i].hd]; |
| 147 |
< |
hb[i].b = clist[i].bi; |
| 151 |
< |
} |
| 152 |
< |
hdloadbeams(hb, nents, dispbeam); |
| 153 |
< |
free((char *)hb); |
| 141 |
> |
if (outdev == NULL) /* nothing to display? */ |
| 142 |
> |
return; |
| 143 |
> |
/* load and display beams we have */ |
| 144 |
> |
hb = (HDBEAMI *)malloc(nents*sizeof(HDBEAMI)); |
| 145 |
> |
for (i = 0; i < nents; i++) { |
| 146 |
> |
hb[i].h = hdlist[clist[i].hd]; |
| 147 |
> |
hb[i].b = clist[i].bi; |
| 148 |
|
} |
| 149 |
+ |
hdloadbeams(hb, nents, dispbeam); |
| 150 |
+ |
free((char *)hb); |
| 151 |
|
return; |
| 152 |
|
memerr: |
| 153 |
|
error(SYSTEM, "out of memory in bundle_set"); |
| 226 |
|
frac = 1024.*1024.*16384. / (wtotal*sizeof(RAYVAL)); |
| 227 |
|
while (k--) |
| 228 |
|
complist[k].nr = frac * complist[k].nr; |
| 229 |
< |
listpos = 0; lastin = -1; /* flag initial sort */ |
| 229 |
> |
listpos = 0; lastin = -1; /* perform initial sort */ |
| 230 |
> |
sortcomplist(); |
| 231 |
|
} |
| 232 |
|
|
| 233 |
|
|