--- ray/src/ot/oconv.c 1989/06/21 08:56:35 1.5 +++ ray/src/ot/oconv.c 1990/06/26 09:02:03 1.9 @@ -39,7 +39,9 @@ int nfiles = 0; /* number of object files */ double mincusize; /* minimum cube size from resolu */ +int (*addobjnotify[])() = {NULL}; /* new object notifier functions */ + main(argc, argv) /* convert object files to an octree */ int argc; char **argv; @@ -177,15 +179,15 @@ char *s; eputs(s) /* put string to stderr */ register char *s; { - static int inline = 0; + static int inln = 0; - if (!inline++) { + if (!inln++) { fputs(progname, stderr); fputs(": ", stderr); } fputs(s, stderr); if (*s && s[strlen(s)-1] == '\n') - inline = 0; + inln = 0; } @@ -201,7 +203,7 @@ OBJECT obj; in = (*ofun[objptr(obj)->otype].funp)(objptr(obj), cu); - if (!in) + if (in == O_MISS) return; /* no intersection */ if (istree(cu->cutree)) { @@ -228,7 +230,7 @@ OBJECT obj; objset(oset, cu->cutree); cukid.cusize = cu->cusize * 0.5; - if (in == 2 || oset[0] < objlim || cukid.cusize < mincusize) { + if (in==O_IN || oset[0] < objlim || cukid.cusize < mincusize) { /* add to set */ if (oset[0] >= MAXSET) { sprintf(errmsg, @@ -250,9 +252,16 @@ OBJECT obj; if ((1<otype)) + addobject(&cukid, oset[j]); + /* then this object */ addobject(&cukid, obj); + /* volumes last */ + for (j = 1; j <= oset[0]; j++) + if (isvolume(objptr(oset[j])->otype)) + addobject(&cukid, oset[j]); octkid(ot, i) = cukid.cutree; } cu->cutree = ot;