raster3d_intern.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #include <grass/raster3d.h>
  2. #include <grass/gis.h>
  3. /*---------------------------------------------------------------------------*/
  4. #define RASTER3D_LONG_LENGTH sizeof (long)
  5. #define RASTER3D_XDR_INT_LENGTH 4 /* Only kept for backward compatibility */
  6. #define RASTER3D_XDR_DOUBLE_LENGTH 8 /* Only kept for backward compatibility */
  7. #define RASTER3D_XDR_FLOAT_LENGTH 4 /* Only kept for backward compatibility */
  8. #define RASTER3D_IS_CORRECT_TYPE(t) (((t) == FCELL_TYPE) || ((t) == DCELL_TYPE))
  9. #define RASTER3D_WRITE_DATA 1
  10. #define RASTER3D_READ_DATA 0
  11. #define RASTER3D_VALID_OPERATION(o) \
  12. (((o) == RASTER3D_WRITE_DATA) || ((o) == RASTER3D_READ_DATA))
  13. #define RASTER3D_MIN(a,b) ((a) <= (b) ? (a) : (b))
  14. #define RASTER3D_MAX(a,b) ((a) >= (b) ? (a) : (b))
  15. #define RASTER3D_HAS_INDEX 1
  16. #define RASTER3D_NO_INDEX 0
  17. #define RASTER3D_USE_XDR 1 /* Only kept for backward compatibility */
  18. #define RASTER3D_NO_XDR 0 /* Only kept for backward compatibility */
  19. /* Only kept for backward compatibility */
  20. #define RASTER3D_VALID_XDR_OPTION(o) (((o) == RASTER3D_USE_XDR) || ((o) == RASTER3D_NO_XDR))
  21. /*---------------------------------------------------------------------------*/
  22. /* global arrays */
  23. extern void *tmpCompress; /* compression support array */
  24. extern int tmpCompressLength; /* in bytes */
  25. extern void *xdr; /* xdr support array */
  26. extern int xdrLength; /* in bytes */
  27. /*---------------------------------------------------------------------------*/
  28. /* global variables */
  29. extern int g3d_version; /* RASTER3D_MAP_VERSION */
  30. extern int g3d_do_compression; /* RASTER3D_NO_COMPRESSION or RASTER3D_COMPRESSION */
  31. extern int g3d_precision; /* RASTER3D_ALLOW_PRECISION or RASTER3D_NO_PRECISION */
  32. extern int g3d_cache_default; /* in number of tiles; 0 ==> no cache */
  33. extern int g3d_cache_max; /* in bytes */
  34. extern int g3d_file_type; /* FCELL_TYPE or DCELL_TYPE */
  35. extern int g3d_tile_dimension[3];
  36. extern void (*g3d_error_fun) (const char *);
  37. extern char *g3d_unit_default; /* The unit description of the map data */
  38. extern int g3d_vertical_unit_default; /* spatial or temporal units from gis.h, U_METERS; ..., U_YEARS, ... */
  39. extern RASTER3D_Region g3d_window;
  40. /*---------------------------------------------------------------------------*/
  41. extern void Rast3d_fatal_error(const char * /* msg */ , ...);
  42. extern void Rast3d_fatal_error_noargs(const char * /* msg */ );
  43. /*---------------------------------------------------------------------------*/
  44. /*---------------------------------------------------------------------------*/
  45. #define RASTER3D_REGION_NORTH "North"
  46. #define RASTER3D_REGION_SOUTH "South"
  47. #define RASTER3D_REGION_EAST "East"
  48. #define RASTER3D_REGION_WEST "West"
  49. #define RASTER3D_REGION_TOP "Top"
  50. #define RASTER3D_REGION_BOTTOM "Bottom"
  51. #define RASTER3D_REGION_ROWS "nofRows"
  52. #define RASTER3D_REGION_COLS "nofCols"
  53. #define RASTER3D_REGION_DEPTHS "nofDepths"
  54. #define RASTER3D_REGION_PROJ "Proj"
  55. #define RASTER3D_REGION_ZONE "Zone"
  56. #define RASTER3D_REGION_EWRES "e-w resol"
  57. #define RASTER3D_REGION_NSRES "n-s resol"
  58. #define RASTER3D_REGION_TBRES "t-b resol"