GRASS Programmer's Manual
6.4.2(2012)
|
00001 #include <rpc/types.h> 00002 #include <rpc/xdr.h> 00003 00004 /*---------------------------------------------------------------------------*/ 00005 00006 #include <grass/G3d.h> 00007 #include <grass/gis.h> 00008 00009 /*---------------------------------------------------------------------------*/ 00010 00011 #define G3D_LONG_LENGTH sizeof (long) 00012 00013 #define G3D_XDR_INT_LENGTH 4 00014 #define G3D_XDR_DOUBLE_LENGTH 8 00015 #define G3D_XDR_FLOAT_LENGTH 4 00016 00017 #define G3D_IS_CORRECT_TYPE(t) (((t) == FCELL_TYPE) || ((t) == DCELL_TYPE)) 00018 00019 #define G3D_WRITE_DATA 1 00020 #define G3D_READ_DATA 0 00021 00022 #define G3D_VALID_OPERATION(o) \ 00023 (((o) == G3D_WRITE_DATA) || ((o) == G3D_READ_DATA)) 00024 00025 #define G3D_MIN(a,b) ((a) <= (b) ? (a) : (b)) 00026 #define G3D_MAX(a,b) ((a) >= (b) ? (a) : (b)) 00027 00028 #define G3D_HAS_INDEX 1 00029 #define G3D_NO_INDEX 0 00030 00031 #define G3D_USE_XDR 1 00032 #define G3D_NO_XDR 0 00033 00034 #define G3D_VALID_XDR_OPTION(o) (((o) == G3D_USE_XDR) || ((o) == G3D_NO_XDR)) 00035 00036 /*---------------------------------------------------------------------------*/ 00037 00038 /* global arrays */ 00039 00040 extern void *tmpCompress; /* compression support array */ 00041 extern int tmpCompressLength; /* in bytes */ 00042 extern void *xdr; /* xdr support array */ 00043 extern int xdrLength; /* in bytes */ 00044 00045 /*---------------------------------------------------------------------------*/ 00046 00047 /* global variables */ 00048 00049 extern int g3d_do_compression; /* G3D_NO_COMPRESSION or G3D_COMPRESSION */ 00050 extern int g3d_do_lzw_compression; /* G3D_USE_LZW or G3D_NO_LZW */ 00051 extern int g3d_do_rle_compression; /* G3D_USE_RLE or G3D_NO_RLE */ 00052 extern int g3d_precision; /* G3D_ALLOW_PRECISION or G3D_NO_PRECISION */ 00053 extern int g3d_cache_default; /* in number of tiles; 0 ==> no cache */ 00054 extern int g3d_cache_max; /* in bytes */ 00055 extern int g3d_file_type; /* FCELL_TYPE or DCELL_TYPE */ 00056 extern int g3d_tile_dimension[3]; 00057 extern void (*g3d_error_fun) (const char *); 00058 extern char *g3d_unit_default; 00059 00060 extern G3D_Region g3d_window; 00061 00062 /*---------------------------------------------------------------------------*/ 00063 00064 extern void G3d_fatalError(const char * /* msg */ , ...); 00065 extern void G3d_fatalError_noargs(const char * /* msg */ ); 00066 00067 /*---------------------------------------------------------------------------*/ 00068 00069 /*---------------------------------------------------------------------------*/ 00070 00071 #define G3D_REGION_NORTH "North" 00072 #define G3D_REGION_SOUTH "South" 00073 #define G3D_REGION_EAST "East" 00074 #define G3D_REGION_WEST "West" 00075 #define G3D_REGION_TOP "Top" 00076 #define G3D_REGION_BOTTOM "Bottom" 00077 #define G3D_REGION_ROWS "nofRows" 00078 #define G3D_REGION_COLS "nofCols" 00079 #define G3D_REGION_DEPTHS "nofDepths" 00080 #define G3D_REGION_PROJ "Proj" 00081 #define G3D_REGION_ZONE "Zone" 00082 #define G3D_REGION_EWRES "e-w resol" 00083 #define G3D_REGION_NSRES "n-s resol" 00084 #define G3D_REGION_TBRES "t-b resol"