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

Comparing ray/src/common/objset.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:34:37 1989 UTC vs.
Revision 1.2 by greg, Thu Sep 6 23:32:41 1990 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include  "object.h"
18  
19 + #include  "otypes.h"
20 +
21   #define  OSTSIZ         3037            /* object table size (a prime!) */
22  
23   static OBJECT  *ostable[OSTSIZ];        /* the object set table */
# Line 173 | Line 175 | OCTREE  ot;
175          return;
176   noderr:
177          error(CONSISTENCY, "bad node in objset");
178 + }
179 +
180 +
181 + nonsurfinset(orig, nobjs)               /* check sets for non-surfaces */
182 + int  orig, nobjs;
183 + {
184 +        int  n;
185 +        OBJECT  *nonset;
186 +        register OBJECT  *os;
187 +        register OBJECT  i;
188 +                                                /* count non-surfaces */
189 +        n = 0;
190 +        for (i = orig; i < orig+nobjs; i++)
191 +                if (!issurface(objptr(i)->otype))
192 +                        n++;
193 +        if (n <= 0)
194 +                return(0);
195 +                                                /* allocate set */
196 +        if ((nonset = (OBJECT *)malloc((n+1)*sizeof(OBJECT))) == NULL)
197 +                return(0);              /* give up if we haven't enough mem */
198 +                                                /* fill set */
199 +        os = nonset;
200 +        *os = n;
201 +        for (i = orig; i < orig+nobjs; i++)
202 +                if (!issurface(objptr(i)->otype))
203 +                        *++os = i;
204 +                                                /* now check all sets */
205 +        for (n = 0; n < OSTSIZ; n++) {
206 +                if ((os = ostable[n]) == NULL)
207 +                        continue;
208 +                while ((i = *os++) > 0)
209 +                        while (i--) {
210 +                                if (*os >= nonset[1]
211 +                                                && *os <= nonset[nonset[0]]
212 +                                                && inset(nonset, *os))
213 +                                        goto done;
214 +                                os++;
215 +                        }
216 +        }
217 + done:
218 +        free((char *)nonset);
219 +        return(n < OSTSIZ);
220   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines