10 retileNocache(
void *map,
const char *nameOut,
int tileX,
int tileY,
int tileZ)
13 int x,
y, z, saveType, nx, ny, nz;
16 int tileXsave, tileYsave, tileZsave;
40 for (z = 0; z < nz; z++)
41 for (y = 0; y < ny; y++)
42 for (x = 0; x < nx; x++) {
45 tileX, tileY, tileZ, data, typeIntern);
50 (
"G3d_retileNocache: error in G3d_writeTile");
76 G3d_retile(
void *map,
const char *nameOut,
int tileX,
int tileY,
int tileZ)
80 int x,
y, z, saveType;
81 int rows,
cols, depths, typeIntern;
82 int xTile, yTile, zTile;
83 int xOffs, yOffs, zOffs, prev;
84 int tileXsave, tileYsave, tileZsave;
88 retileNocache(map, nameOut, tileX, tileY, tileZ);
109 &xTile, &yTile, &zTile, &xOffs, &yOffs, &zOffs);
118 for (z = 0; z < depths; z++) {
120 &xOffs, &yOffs, &zOffs);
127 for (y = 0; y < rows; y++)
128 for (x = 0; x <
cols; x++) {
int G3d_writeTile(G3D_Map *map, int tileIndex, const void *tile, int type)
Writes tile with index tileIndex to the file corresponding to map. It is assumed that the cells in ti...
void G3d_getValueRegion(G3D_Map *map, int x, int y, int z, void *value, int type)
Returns in *value the cell-value of the cell with region-coordinate (x, y, z). The value returned is ...
int G3d_flushAllTiles(G3D_Map *map)
void * G3d_allocTiles(G3D_Map *map, int nofTiles)
Is equivalent to G3d_allocTilesType (map, nofTiles, G3d_fileTypeMap (map)).
void G3d_retile(void *map, const char *nameOut, int tileX, int tileY, int tileZ)
Makes a copy of map with name nameOut which has tile dimensions tileX, tileY, tileZ. The source code can be found in retile.c.
void G3d_setFileType(int type)
set G3d file type
void G3d_getTileDimension(int *tileX, int *tileY, int *tileZ)
get Tile Dimension
def region
Returns the output from running "g.region -gu", as a dictionary.
int G3d_closeCell(G3D_Map *map)
Closes g3d-file. If map is new and cache-mode is used for map then every tile which is not flushed be...
void G3d_freeTiles(void *tiles)
Is equivalent to G3d_free (tiles);
void G3d_setTileDimension(int tileX, int tileY, int tileZ)
set Tile Dimension
void G3d_coord2tileCoord(G3D_Map *map, int x, int y, int z, int *xTile, int *yTile, int *zTile, int *xOffs, int *yOffs, int *zOffs)
Converts cell-coordinates (x, y, z) into tile-coordinates (xTile, yTile, zTile) and the coordinate of...
void G3d_getBlock(G3D_Map *map, int x0, int y0, int z0, int nx, int ny, int nz, void *block, int type)
Copies the cells contained in the block (cube) with vertices (x0, y0, z0) and (x0 + nx - 1...
int G3d_tile2tileIndex(G3D_Map *map, int xTile, int yTile, int zTile)
Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile).
void G3d_fatalError(const char *,...)
This function prints the error message msg, and terminates the program with an error status...
int G3d_putValue(G3D_Map *map, int x, int y, int z, const void *value, int type)
After converting *value of type into the type specified at the initialization time (i...
void * G3d_openCellNew(const char *name, int typeIntern, int cache, G3D_Region *region)
Opens new g3d-file with name in the current mapset. Tiles are stored in memory with type which must b...
int G3d_getFileType()
get G3d file type