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

Comparing ray/src/hd/rhinfo.c (file contents):
Revision 3.1 by gwlarson, Thu Dec 31 16:25:26 1998 UTC vs.
Revision 3.7 by greg, Fri Jun 20 00:25:49 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Get general information on holodeck file
6   */
# Line 16 | Line 13 | static char SCCSid[] = "$SunId$ SGI";
13  
14   char    *progname;              /* global argv[0] */
15  
16 + long    beamtot, samptot;       /* total beams and samples */
17  
18 +
19   main(argc, argv)
20   int     argc;
21   char    *argv[];
# Line 38 | Line 37 | gethdinfo(fname, fout)         /* get information on holodeck
37   char    *fname;
38   FILE    *fout;
39   {
41        extern long     ftell();
40          FILE    *fp;
41          HOLO    *hdsect;
42          int     fd;
43 <        int4    nextloc;
43 >        int32   nextloc;
44          int     n;
45                                          /* open holodeck file */
46          if ((fp = fopen(fname, "r")) == NULL) {
# Line 58 | Line 56 | FILE   *fout;
56          nextloc = ftell(fp);                    /* get stdio position */
57          fclose(fp);                             /* done with stdio */
58          for (n = 0; nextloc > 0L; n++) {        /* get the section(s) */
59 <                lseek(fd, (long)nextloc, 0);
59 >                lseek(fd, (off_t)nextloc, 0);
60                  read(fd, (char *)&nextloc, sizeof(nextloc));
61 +                fprintf(fout, "Section %d:\n", n);
62                  hdsect = hdinit(fd, NULL);      /* load section directory */
64                fprintf(fout,"Section %d:\n",n);
63                  psectstats(hdsect, fout);       /* print section statistics */
64          }
65          nextloc = hdfilen(fd);                  /* print global statistics */
66 +        fputs("=====================================================\n", fout);
67 +        fprintf(fout, "Total samples/beams: %ld/%ld (%.2f samples/beam)\n",
68 +                        samptot, beamtot, (double)samptot/beamtot);
69          fprintf(fout, "%.1f Mbyte file, %.1f%% fragmentation\n",
70                          nextloc/(1024.*1024.),
71                          100.*(nextloc-hdfiluse(fd,1))/nextloc);
# Line 82 | Line 83 | FILE   *fp;
83   {
84          int     scount[NHBINS];
85          int     minsamp = 10000, maxsamp = 0;
86 +        FVECT   vt;
87          double  sqrtmaxp;
88          int     bmin, bmax, cnt;
89          register int    i;
90  
91 +        fcross(vt, hp->xv[0], hp->xv[1]);
92 +        fprintf(fp, "\tWorld volume:            %g\n", fabs(DOT(vt,hp->xv[2])));
93          fprintf(fp, "\tGrid resolution:         %d x %d x %d\n",
94                          hp->grid[0], hp->grid[1], hp->grid[2]);
95 <        fprintf(fp, "\tNumber of beams:         %d\n", nbeams(hp));
96 <        fprintf(fp, "\tNumber of ray samples:   %d\n", biglob(hp)->nrd);
95 >        fprintf(fp, "\tNumber of beams:         %ld\n", (long)nbeams(hp));
96 >        beamtot += nbeams(hp);
97 >        fprintf(fp, "\tNumber of ray samples:   %ld\n", (long)biglob(hp)->nrd);
98 >        samptot += biglob(hp)->nrd;
99          if (biglob(hp)->nrd <= 0)
100                  return;                         /* no samples to stat! */
101          for (i = nbeams(hp); i > 0; i--) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines