[37] | 1 | /* |
---|
| 2 | |
---|
| 3 | Brian Curless |
---|
| 4 | |
---|
| 5 | Computer Graphics Laboratory |
---|
| 6 | Stanford University |
---|
| 7 | |
---|
| 8 | --------------------------------------------------------------------- |
---|
| 9 | |
---|
| 10 | Copyright (1997) The Board of Trustees of the Leland Stanford Junior |
---|
| 11 | University. Except for commercial resale, lease, license or other |
---|
| 12 | commercial transactions, permission is hereby given to use, copy, |
---|
| 13 | modify this software for academic purposes only. No part of this |
---|
| 14 | software or any derivatives thereof may be used in the production of |
---|
| 15 | computer models for resale or for use in a commercial |
---|
| 16 | product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND |
---|
| 17 | CONCERNING THIS SOFTWARE. No support is implied or provided. |
---|
| 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #include <unistd.h> |
---|
| 23 | #include <stdio.h> |
---|
| 24 | #ifdef LINUX |
---|
| 25 | #include <stdlib.h> |
---|
| 26 | #endif |
---|
| 27 | |
---|
| 28 | #include "OccGridRLE.h" |
---|
| 29 | |
---|
| 30 | int main(int argc, char **argv) |
---|
| 31 | { |
---|
| 32 | int xd, yd, zd, axis, flip; |
---|
| 33 | vec3f origin; |
---|
| 34 | float resolution; |
---|
| 35 | |
---|
| 36 | char *filename = argv[1]; |
---|
| 37 | |
---|
| 38 | FILE *fp = fopen(filename, "rb"); |
---|
| 39 | |
---|
| 40 | if (fp == NULL) { |
---|
| 41 | fprintf(stderr, "Could not open file.\n"); |
---|
| 42 | exit(1); |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | fread(&xd, sizeof(int), 1, fp); |
---|
| 46 | fread(&yd, sizeof(int), 1, fp); |
---|
| 47 | fread(&zd, sizeof(int), 1, fp); |
---|
| 48 | fread(&axis, sizeof(int), 1, fp); |
---|
| 49 | fread(&flip, sizeof(int), 1, fp); |
---|
| 50 | fread(&origin, sizeof(float), 3, fp); |
---|
| 51 | fread(&resolution, sizeof(float), 1, fp); |
---|
| 52 | fclose(fp); |
---|
| 53 | |
---|
| 54 | printf("Dimensions: %d x %d x %d\n", xd, yd, zd); |
---|
| 55 | printf("Axis: %d Flip: %d\n", axis, flip); |
---|
| 56 | printf("Origin: (%f, %f, %f)\n", origin[0], origin[1], origin[2]); |
---|
| 57 | printf("Resolution: %f\n", resolution); |
---|
| 58 | |
---|
| 59 | exit(0); |
---|
| 60 | } |
---|