8 #define G3D_NO_DEFAULT -10
10 #define G3D_COMPRESSION_DEFAULT G3D_COMPRESSION
11 #define G3D_USE_LZW_DEFAULT G3D_NO_LZW
12 #define G3D_USE_RLE_DEFAULT G3D_USE_RLE
13 #define G3D_PRECISION_DEFAULT G3D_MAX_PRECISION
14 #define G3D_CACHE_SIZE_DEFAULT 1000
15 #define G3D_CACHE_SIZE_MAX_DEFAULT 2000000
16 #define G3D_FILE_TYPE_DEFAULT DCELL_TYPE
17 #define G3D_TILE_X_DEFAULT 8
18 #define G3D_TILE_Y_DEFAULT 8
19 #define G3D_TILE_Z_DEFAULT 8
20 #define G3D_ERROR_FUN_DEFAULT G3d_skipError
21 #define G3D_UNIT_DEFAULT "none"
25 #define G3D_COMPRESSION_ENV_VAR_YES "G3D_USE_COMPRESSION"
26 #define G3D_COMPRESSION_ENV_VAR_NO "G3D_NO_COMPRESSION"
28 #define G3D_LZW_ENV_VAR_YES "G3D_USE_LZW"
29 #define G3D_LZW_ENV_VAR_NO "G3D_NO_LZW"
31 #define G3D_RLE_ENV_VAR_YES "G3D_USE_RLE"
32 #define G3D_RLE_ENV_VAR_NO "G3D_NO_RLE"
34 #define G3D_PRECISION_ENV_VAR "G3D_PRECISION"
35 #define G3D_PRECISION_ENV_VAR_MAX "G3D_MAX_PRECISION"
37 #define G3D_CACHE_SIZE_ENV_VAR "G3D_DEFAULT_CACHE_SIZE"
38 #define G3D_CACHE_SIZE_MAX_ENV_VAR "G3D_MAX_CACHE_SIZE"
40 #define G3D_FILE_FLOAT_ENV_VAR "G3D_WRITE_FLOAT"
41 #define G3D_FILE_DOUBLE_ENV_VAR "G3D_WRITE_DOUBLE"
43 #define G3D_TILE_DIM_X_ENV_VAR "G3D_TILE_DIMENSION_X"
44 #define G3D_TILE_DIM_Y_ENV_VAR "G3D_TILE_DIMENSION_Y"
45 #define G3D_TILE_DIM_Z_ENV_VAR "G3D_TILE_DIMENSION_Z"
47 #define G3D_FATAL_ERROR_ENV_VAR "G3D_USE_FATAL_ERROR"
48 #define G3D_PRINT_ERROR_ENV_VAR "G3D_USE_PRINT_ERROR"
50 #define G3D_DEFAULT_WINDOW3D "G3D_DEFAULT_WINDOW3D"
87 if ((doCompress != G3D_NO_COMPRESSION) && (doCompress != G3D_COMPRESSION))
88 G3d_fatalError(
"G3d_setCompressionMode: wrong value for doCompress.");
92 if (doCompress == G3D_NO_COMPRESSION)
95 if ((doLzw != G3D_NO_LZW) && (doLzw != G3D_USE_LZW))
98 if ((doRle != G3D_NO_RLE) && (doRle != G3D_USE_RLE))
102 G3d_fatalError(
"G3d_setCompressionMode: wrong value for precision.");
128 if (doCompress !=
NULL)
134 if (precision !=
NULL)
225 if ((type != FCELL_TYPE) && (type != DCELL_TYPE))
266 (
"G3d_setTileDimension: value for tile x environment variable out of range");
270 (
"G3d_setTileDimension: value for tile y environment variable out of range");
274 (
"G3d_setTileDimension: value for tile z environment variable out of range");
349 static int firstTime = 1;
350 const char *value, *windowName;
411 (
"G3d_initDefaults: precision environment variable has invalid value");
416 (
"G3d_initDefaults: value for cache environment variable out of range");
446 (
"G3d_initDefaults: cache environment variable has invalid value");
450 (
"G3d_initDefaults: value for cache environment variable out of range");
464 (
"G3d_initDefaults: cache environment variable has invalid value");
468 (
"G3d_initDefaults: value for cache environment variable out of range");
482 (
"G3d_initDefaults: tile dimension x environment variable has invalid value");
486 (
"G3d_initDefaults: value for tile x environment variable out of range");
498 (
"G3d_initDefaults: tile dimension y environment variable has invalid value");
502 (
"G3d_initDefaults: value for tile y environment variable out of range");
514 (
"G3d_initDefaults: tile dimension z environment variable has invalid value");
518 (
"G3d_initDefaults: value for tile z environment variable out of range");
545 if (windowName ==
NULL) {