Sample G3D Applications
These functions were implemented to test the library. They are not very
efficient but can be used as starting point for other
applications. Some of them might actually be useful.
Function Index
void
G3d_retile (map, nameOut, tileX, tileY, tileZ)
void *map;
char *nameOut;
int tileX, tileY, 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_changePrecision (map, precision, nameOut)
void *map;
int precision;
char *nameOut;
Makes a copy of map with name nameOut which is
written with precision.
The source code can be found in changeprecision.c.
void
G3d_changeType (map, nameOut)
void *map;
char *nameOut;
Makes a copy of map with name nameOut in which the
cells are of type G3D_FLOAT if they are G3D_DOUBLE in map,
and in G3D_DOUBLE otherwise.
The source code can be found in changetype.c.
void
G3d_compareFiles (f1, mapset1, f2, mapset2)
char *f1, *f2;
char *mapset1, *mapset2;
Compares the cell-values of file f1 in mapset
mapset1 and file f2 in mapset mapset2.
The values are compared up to precision.
Terminates in error if the files don't match.
This function uses the more advanced features of the cache.
The source code can be found in filecompare.c.
void
G3d_getBlock (map, x0, y0, z0, nx, ny, nz, block, type)
void *map;
int x0, y0, z0, nx, ny, nz;
char *block;
int type;
Copies the cells contained in the block (cube) with vertices
(x0, y0, z0) and (x0 + nx - 1, y0 + ny - 1, z0 + nz - 1)
into block. The cell-values in block are of type.
The source code can be found in getblock.c.
void
G3d_writeAscii (map, fname)
void *map;
char *fname;
Writes the cell-values of map in ascii format to file
fname. The values are organized by horizontal slices.