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 |
|
*/ |
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[]; |
57 |
|
nextloc = ftell(fp); /* get stdio position */ |
58 |
|
fclose(fp); /* done with stdio */ |
59 |
|
for (n = 0; nextloc > 0L; n++) { /* get the section(s) */ |
60 |
< |
lseek(fd, (long)nextloc, 0); |
60 |
> |
lseek(fd, (off_t)nextloc, 0); |
61 |
|
read(fd, (char *)&nextloc, sizeof(nextloc)); |
62 |
+ |
fprintf(fout, "Section %d:\n", n); |
63 |
|
hdsect = hdinit(fd, NULL); /* load section directory */ |
64 |
– |
fprintf(fout,"Section %d:\n",n); |
64 |
|
psectstats(hdsect, fout); /* print section statistics */ |
65 |
|
} |
66 |
|
nextloc = hdfilen(fd); /* print global statistics */ |
67 |
+ |
fputs("=====================================================\n", fout); |
68 |
+ |
fprintf(fout, "Total samples/beams: %ld/%ld (%.2f samples/beam)\n", |
69 |
+ |
samptot, beamtot, (double)samptot/beamtot); |
70 |
|
fprintf(fout, "%.1f Mbyte file, %.1f%% fragmentation\n", |
71 |
|
nextloc/(1024.*1024.), |
72 |
|
100.*(nextloc-hdfiluse(fd,1))/nextloc); |
84 |
|
{ |
85 |
|
int scount[NHBINS]; |
86 |
|
int minsamp = 10000, maxsamp = 0; |
87 |
+ |
FVECT vt; |
88 |
|
double sqrtmaxp; |
89 |
|
int bmin, bmax, cnt; |
90 |
|
register int i; |
91 |
|
|
92 |
+ |
fcross(vt, hp->xv[0], hp->xv[1]); |
93 |
+ |
fprintf(fp, "\tWorld volume: %g\n", fabs(DOT(vt,hp->xv[2]))); |
94 |
|
fprintf(fp, "\tGrid resolution: %d x %d x %d\n", |
95 |
|
hp->grid[0], hp->grid[1], hp->grid[2]); |
96 |
< |
fprintf(fp, "\tNumber of beams: %d\n", nbeams(hp)); |
97 |
< |
fprintf(fp, "\tNumber of ray samples: %d\n", biglob(hp)->nrd); |
96 |
> |
fprintf(fp, "\tNumber of beams: %ld\n", (long)nbeams(hp)); |
97 |
> |
beamtot += nbeams(hp); |
98 |
> |
fprintf(fp, "\tNumber of ray samples: %ld\n", (long)biglob(hp)->nrd); |
99 |
> |
samptot += biglob(hp)->nrd; |
100 |
|
if (biglob(hp)->nrd <= 0) |
101 |
|
return; /* no samples to stat! */ |
102 |
|
for (i = nbeams(hp); i > 0; i--) { |