Back to index

radiance  4R0+20100331
Functions | Variables
getbbox.c File Reference
#include "standard.h"
#include "octree.h"
#include "object.h"
#include "oconv.h"

Go to the source code of this file.

Functions

static void addobject (OBJREC *o)
int main (int argc, char **argv)
void quit (int code)
void cputs (void)
void wputs (char *s)
void eputs (register char *s)

Variables

static const char RCSid [] = "$Id: getbbox.c,v 2.6 2004/03/27 12:41:45 schorsch Exp $"
char * progname
int nowarn = 0
void(* addobjnotify [])() = {NULL}
FVECT bbmin
FVECT bbmax

Function Documentation

static void addobject ( OBJREC o) [static]

Definition at line 28 of file getbbox.c.

{
       add2bbox(o, bbmin, bbmax);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cputs ( void  )

Definition at line 93 of file getbbox.c.

{
       /* referenced, but not used */
}
void eputs ( register char *  s)

Definition at line 110 of file getbbox.c.

{
       static int  inln = 0;

       if (!inln++) {
              fputs(progname, stderr);
              fputs(": ", stderr);
       }
       fputs(s, stderr);
       if (*s && s[strlen(s)-1] == '\n')
              inln = 0;
}
int main ( int  argc,
char **  argv 
)

Definition at line 37 of file getbbox.c.

{
       extern char  *getenv();
       int  nohead = 0;
       int  i;

       progname = argv[0];

       for (i = 1; i < argc && argv[i][0] == '-'; i++) {
              switch (argv[i][1]) {
              case 'w':
                     nowarn = 1;
                     continue;
              case 'h':
                     nohead = 1;
                     continue;
              }
              break;
       }
                                          /* find bounding box */
       bbmin[0] = bbmin[1] = bbmin[2] = FHUGE;
       bbmax[0] = bbmax[1] = bbmax[2] = -FHUGE;
                                          /* read input */
       if (i >= argc)
              readobj2(NULL, addobject);
       else
              for ( ; i < argc; i++)
                     if (!strcmp(argv[i], "-"))  /* from stdin */
                            readobj2(NULL, addobject);
                     else                        /* from file */
                            readobj2(argv[i], addobject);
                                          /* print bounding box */
       if (!nohead)
              printf(
"     xmin      xmax      ymin      ymax      zmin      zmax\n");

       printf("%9g %9g %9g %9g %9g %9g\n", bbmin[0], bbmax[0],
                     bbmin[1], bbmax[1], bbmin[2], bbmax[2]);
       quit(0);
       return 0; /* pro forma return */
}

Here is the call graph for this function:

void quit ( int  code)

Definition at line 84 of file getbbox.c.

{
       exit(code);
}
void wputs ( char *  s)

Definition at line 100 of file getbbox.c.

{
       if (!nowarn)
              eputs(s);
}

Here is the call graph for this function:


Variable Documentation

void(* addobjnotify[])() = {NULL}

Definition at line 19 of file getbbox.c.

Definition at line 21 of file getbbox.c.

Definition at line 21 of file getbbox.c.

int nowarn = 0

Definition at line 17 of file getbbox.c.

char* progname

Definition at line 15 of file getbbox.c.

const char RCSid[] = "$Id: getbbox.c,v 2.6 2004/03/27 12:41:45 schorsch Exp $" [static]

Definition at line 2 of file getbbox.c.