16 |
|
|
17 |
|
#include "object.h" |
18 |
|
|
19 |
– |
#ifndef DEFPATH |
20 |
– |
#define DEFPATH ":/usr/local/lib/ray" |
21 |
– |
#endif |
22 |
– |
|
19 |
|
char *progname; /* argv[0] */ |
20 |
|
|
25 |
– |
char *libpath; /* library search path */ |
26 |
– |
|
21 |
|
int nowarn = 0; /* supress warnings? */ |
22 |
|
|
23 |
|
int (*addobjnotify[])() = {NULL}; /* new object notifier functions */ |
35 |
|
int argc; |
36 |
|
char **argv; |
37 |
|
{ |
38 |
< |
char *getenv(); |
39 |
< |
double atof(); |
38 |
> |
extern char *getenv(); |
39 |
> |
int nohead = 0; |
40 |
|
int i; |
41 |
|
|
42 |
|
progname = argv[0]; |
43 |
|
|
44 |
< |
if ((libpath = getenv("RAYPATH")) == NULL) |
45 |
< |
libpath = DEFPATH; |
46 |
< |
|
47 |
< |
if (!strcmp(argv[1], "-w")) { |
48 |
< |
nowarn = 1; |
49 |
< |
i = 2; |
50 |
< |
} else |
51 |
< |
i = 1; |
52 |
< |
breakopt: |
44 |
> |
for (i = 1; i < argc && argv[i][0] == '-'; i++) { |
45 |
> |
switch (argv[i][1]) { |
46 |
> |
case 'w': |
47 |
> |
nowarn = 1; |
48 |
> |
continue; |
49 |
> |
case 'h': |
50 |
> |
nohead = 1; |
51 |
> |
continue; |
52 |
> |
} |
53 |
> |
break; |
54 |
> |
} |
55 |
|
/* find bounding box */ |
56 |
|
bbmin[0] = bbmin[1] = bbmin[2] = FHUGE; |
57 |
|
bbmax[0] = bbmax[1] = bbmax[2] = -FHUGE; |
65 |
|
else /* from file */ |
66 |
|
readobj(argv[i], addobject); |
67 |
|
/* print bounding box */ |
68 |
< |
printf(" xmin xmax ymin ymax zmin zmax\n"); |
68 |
> |
if (!nohead) |
69 |
> |
printf( |
70 |
> |
" xmin xmax ymin ymax zmin zmax\n"); |
71 |
> |
|
72 |
|
printf("%9g %9g %9g %9g %9g %9g\n", bbmin[0], bbmax[0], |
73 |
|
bbmin[1], bbmax[1], bbmin[2], bbmax[2]); |
74 |
|
quit(0); |