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

Comparing ray/src/ot/oconv.c (file contents):
Revision 2.5 by greg, Fri Oct 9 10:26:28 1992 UTC vs.
Revision 2.12 by greg, Sat Feb 22 02:07:26 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  oconv.c - main program for object to octree conversion.
6   *
# Line 22 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19  
20   #define  OMARGIN        (10*FTINY)      /* margin around global cube */
21  
22 < #define  MAXOBJFIL      63              /* maximum number of scene files */
22 > #define  MAXOBJFIL      127             /* maximum number of scene files */
23  
24   char  *progname;                        /* argv[0] */
25  
29 char  *libpath;                         /* library search path */
30
26   int  nowarn = 0;                        /* supress warnings? */
27  
28   int  objlim = 5;                        /* # of objects before split */
29  
30 < int  resolu = 1024;                     /* octree resolution limit */
30 > int  resolu = 8192;                     /* octree resolution limit */
31  
32   CUBE  thescene = {EMPTY, {0.0, 0.0, 0.0}, 0.0};         /* our scene */
33  
# Line 41 | Line 36 | int  nfiles = 0;                       /* number of object files */
36  
37   double  mincusize;                      /* minimum cube size from resolu */
38  
39 < int  (*addobjnotify[])() = {NULL};      /* new object notifier functions */
39 > void  (*addobjnotify[])() = {NULL};     /* new object notifier functions */
40  
41  
42   main(argc, argv)                /* convert object files to an octree */
43   int  argc;
44 < char  **argv;
44 > char  *argv[];
45   {
51        extern char  *getenv();
46          FVECT  bbmin, bbmax;
47          char  *infile = NULL;
48 +        int  inpfrozen = 0;
49          int  outflags = IO_ALL;
50          OBJECT  startobj;
51          int  i;
52  
53          progname = argv[0] = fixargv0(argv[0]);
54  
60        if ((libpath = getenv(ULIBVAR)) == NULL)
61                libpath = DEFPATH;
62
55          initotypes();
56  
57          for (i = 1; i < argc && argv[i][0] == '-'; i++)
# Line 100 | Line 92 | breakopt:
92                  if (thescene.cusize > FTINY)
93                          error(USER, "only one of '-b' or '-i'");
94                  nfiles = readoct(infile, IO_ALL, &thescene, ofname);
95 <                if (nfiles == 0 && outflags & IO_FILES) {
96 <                        error(WARNING, "frozen octree");
97 <                        outflags &= ~IO_FILES;
98 <                }
99 <        }
108 <
109 <        printargs(argc, argv, stdout);  /* info. header */
95 >                if (nfiles == 0)
96 >                        inpfrozen++;
97 >        } else
98 >                newheader("RADIANCE", stdout);  /* new binary file header */
99 >        printargs(argc, argv, stdout);
100          fputformat(OCTFMT, stdout);
101          printf("\n");
102  
# Line 123 | Line 113 | breakopt:
113                  }
114  
115          ofname[nfiles] = NULL;
116 +
117 +        if (inpfrozen && outflags & IO_FILES) {
118 +                error(WARNING, "frozen octree");
119 +                outflags &= ~IO_FILES;
120 +        }
121                                                  /* find bounding box */
122          bbmin[0] = bbmin[1] = bbmin[2] = FHUGE;
123          bbmax[0] = bbmax[1] = bbmax[2] = -FHUGE;
# Line 162 | Line 157 | breakopt:
157   }
158  
159  
160 + void
161   quit(code)                              /* exit program */
162   int  code;
163   {
# Line 169 | Line 165 | int  code;
165   }
166  
167  
168 + void
169   cputs()                                 /* interactive error */
170   {
171          /* referenced, but not used */
172   }
173  
174  
175 + void
176   wputs(s)                                /* warning message */
177   char  *s;
178   {
# Line 183 | Line 181 | char  *s;
181   }
182  
183  
184 + void
185   eputs(s)                                /* put string to stderr */
186   register char  *s;
187   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines