r3_data.c 814 B

1234567891011121314151617181920212223242526272829303132
  1. #include "vizual.h"
  2. #include <grass/raster3d.h>
  3. #define NO_RESAMPLE
  4. int r3read_level(void *g3map, RASTER3D_Region * g3reg, file_info * Headfax,
  5. float *data, int n_lev)
  6. {
  7. #ifdef NO_RESAMPLE
  8. Rast3d_get_block(g3map, 0, 0, n_lev,
  9. Headfax->xdim, Headfax->ydim, 1, (char *)data, FCELL_TYPE);
  10. #else
  11. /* Rast3d_getBlockRegion might be handy */
  12. /*
  13. Rast3d_getAllignedVolume (map, originNorth, originWest, originBottom,
  14. lengthNorth, lengthWest, lengthBottom,
  15. nx, ny, nz, volumeBuf, type);
  16. */
  17. Rast3d_getAllignedVolume(g3map, g3reg->north, g3reg->west,
  18. g3reg->top - n_lev * g3reg->tb_res,
  19. g3reg->north - g3reg->south,
  20. g3reg->east - g3reg->west,
  21. g3reg->tb_res,
  22. Headfax->xdim, Headfax->ydim, 1,
  23. (char *)data, FCELL_TYPE);
  24. #endif
  25. return 0;
  26. }