/** * @file testData.c * @author Robert S Laramee * @version 1.0 * @see ARrenderer.java *

* start date Thurs 9 Dec 1999 * finish date *

* Description This program generates test case cubes as input into the * ARrenderer program * compile using: * gcc -Wall testData.c -o testData -lm */ #include #include /* for pow(), sqrt(), link in using -lm option */ double pow(double x, double y); /* dimensions constants */ #define XROWS 2 #define YCOLUMNS 2 #define ZLAYERS 2 #define LEVEL 6 /* *#--- sample block data: -- *# 1 # block number *# 1 # level *# 0.012345 0.012345 0.012345 0.012345 0.012345 0.012345 0.012345 0.012345 *# 123 # index for 0th child *# 4 # block number in x direction *# 3 # block number in y direction *# 2 # block number in z direction *# 0.123456 # minimum value *# 1.123345 # maximum value */ /** * note: * 8 x 8 x 8 = 512 * 16 x 16 x 16 = 4096 */ int main(int argc, char *argv[]) { int i = 0; int x,y,z; fprintf(stdout, "\n" "#--- sample block data: -- \n" "# 1 # block number \n" "# 1 # level \n" "# 0.012345 0.012345 0.012345 0.012345 0.012345 0.012345 0.01234 0.0145\n" "# 123 # index for 0th child \n" "# 4 # block number in x direction \n" "# 3 # block number in y direction \n" "# 2 # block number in z direction \n" "# 0.123456 # minimum value \n" "# 1.123345 # maximum value \n"); /* print out the blocks */ for(z = 0; z < ZLAYERS; z++) { for(y = 0; y < YCOLUMNS; y++) { for(x = 0; x < XROWS; x++) { fprintf(stdout, "%d \n" "%d \n" "1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n" "0 \n" "%d \n" "%d \n" "%d \n" "0.0 \n" "1.0 \n", i, LEVEL, x, y, z); i++; } } } return 0; }