1 #ifndef RASTER3D_INTERN_H
2 #define RASTER3D_INTERN_H
9 #define RASTER3D_LONG_LENGTH sizeof(long)
11 #define RASTER3D_XDR_INT_LENGTH 4
12 #define RASTER3D_XDR_DOUBLE_LENGTH \
15 #define RASTER3D_XDR_FLOAT_LENGTH 4
17 #define RASTER3D_IS_CORRECT_TYPE(t) (((t) == FCELL_TYPE) || ((t) == DCELL_TYPE))
19 #define RASTER3D_WRITE_DATA 1
20 #define RASTER3D_READ_DATA 0
22 #define RASTER3D_VALID_OPERATION(o) \
23 (((o) == RASTER3D_WRITE_DATA) || ((o) == RASTER3D_READ_DATA))
25 #define RASTER3D_MIN(a, b) ((a) <= (b) ? (a) : (b))
26 #define RASTER3D_MAX(a, b) ((a) >= (b) ? (a) : (b))
28 #define RASTER3D_HAS_INDEX 1
29 #define RASTER3D_NO_INDEX 0
31 #define RASTER3D_USE_XDR 1
32 #define RASTER3D_NO_XDR 0
34 #define RASTER3D_VALID_XDR_OPTION(o) \
35 (((o) == RASTER3D_USE_XDR) || ((o) == RASTER3D_NO_XDR))
75 #define RASTER3D_REGION_NORTH "North"
76 #define RASTER3D_REGION_SOUTH "South"
77 #define RASTER3D_REGION_EAST "East"
78 #define RASTER3D_REGION_WEST "West"
79 #define RASTER3D_REGION_TOP "Top"
80 #define RASTER3D_REGION_BOTTOM "Bottom"
81 #define RASTER3D_REGION_ROWS "nofRows"
82 #define RASTER3D_REGION_COLS "nofCols"
83 #define RASTER3D_REGION_DEPTHS "nofDepths"
84 #define RASTER3D_REGION_PROJ "Proj"
85 #define RASTER3D_REGION_ZONE "Zone"
86 #define RASTER3D_REGION_EWRES "e-w resol"
87 #define RASTER3D_REGION_NSRES "n-s resol"
88 #define RASTER3D_REGION_TBRES "t-b resol"
97 #define EASTERN_TO_COL(east, region) (east - region->west) / (region->ew_res);
98 #define NORTHERN_TO_ROW(north, region) \
99 (region->north - north) / (region->ns_res);
100 #define TOP_TO_DEPTH(top, region) (top - region->bottom) / (region->tb_res);
106 #define LOCATION_TO_COORD(region, north, east, top, x, y, z) \
107 { *x = EASTERN_TO_COL(east, region) *y = \
108 NORTHERN_TO_ROW(north, region) *z = TOP_TO_DEPTH(top, region)}
115 #define COL_TO_EASTERN(region, x) region->west + x * region->ew_res;
116 #define ROW_TO_NORTHERN(region, y) region->north - y * region->ns_res;
117 #define DEPTH_TO_TOP(region, z) region->bottom + z * region->tb_res;
118 #define COORD_TO_LOCATION(region, x, y, z, north, east, top) \
119 { *east = COL_TO_EASTERN(region, x) *north = \
120 ROW_TO_NORTHERN(region, y) *top = DEPTH_TO_TOP(region, z)}
int g3d_tile_dimension[3]
void(* g3d_error_fun)(const char *)
void Rast3d_fatal_error_noargs(const char *)
RASTER3D_Region g3d_window
void Rast3d_fatal_error(const char *,...)
Prints fatal error message.
int g3d_vertical_unit_default