G3d.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. #include <grass/gis.h>
  2. #ifndef GRASS_G3D_H
  3. #define GRASS_G3D_H
  4. #define G3D_TILE_SAME_AS_FILE 2
  5. #define G3D_NO_COMPRESSION 0
  6. #define G3D_COMPRESSION 1
  7. #define G3D_USE_LZW 1
  8. #define G3D_NO_LZW 0
  9. #define G3D_USE_RLE 1
  10. #define G3D_NO_RLE 0
  11. #define G3D_MAX_PRECISION -1
  12. #define G3D_NO_CACHE 0
  13. #define G3D_USE_CACHE_DEFAULT -1
  14. #define G3D_USE_CACHE_X -2
  15. #define G3D_USE_CACHE_Y -3
  16. #define G3D_USE_CACHE_Z -4
  17. #define G3D_USE_CACHE_XY -5
  18. #define G3D_USE_CACHE_XZ -6
  19. #define G3D_USE_CACHE_YZ -7
  20. #define G3D_USE_CACHE_XYZ -8
  21. #define G3D_DEFAULT_WINDOW NULL
  22. #define G3D_DIRECTORY "grid3"
  23. #define G3D_CELL_ELEMENT "cell"
  24. #define G3D_CATS_ELEMENT "cats"
  25. #define G3D_RANGE_ELEMENT "range"
  26. #define G3D_HEADER_ELEMENT "cellhd"
  27. #define G3D_HISTORY_ELEMENT "hist"
  28. #define G3D_COLOR_ELEMENT "color"
  29. #define G3D_COLOR2_DIRECTORY "colr2"
  30. #define G3D_MASK_MAP "G3D_MASK"
  31. #define G3D_WINDOW_ELEMENT "WIND3"
  32. #define G3D_DEFAULT_WINDOW_ELEMENT "DEFAULT_WIND3"
  33. #define G3D_WINDOW_DATABASE "windows3d"
  34. #define G3D_PERMANENT_MAPSET "PERMANENT"
  35. /*---------------------------------------------------------------------------*/
  36. typedef struct {
  37. double north, south;
  38. double east, west;
  39. double top, bottom;
  40. /* dimension of data in "cells"; rows == #x; cols == #y; depths == #z */
  41. int rows, cols, depths;
  42. double ns_res, ew_res, tb_res;
  43. int proj; /* Projection (see gis.h) */
  44. int zone; /* Projection zone (see gis.h) */
  45. } G3D_Region;
  46. /*---------------------------------------------------------------------------*/
  47. typedef struct {
  48. char *fileName;
  49. char *tempName;
  50. char *mapset;
  51. /* operation performed on map */
  52. int operation; /* G3D_WRITE_DATA or G3D_READ_DATA */
  53. /* region */
  54. G3D_Region region;
  55. /* window for map */
  56. G3D_Region window;
  57. /* resmapling function used for map. default is nearest neighbor */
  58. void (*resampleFun) ();
  59. /* units */
  60. char *unit;
  61. /* dimension of a single tile in "cells" */
  62. int tileX, tileY, tileZ;
  63. /* # of tiles in x, y, and z direction */
  64. int nx, ny, nz;
  65. /* data file specific information */
  66. /* file descriptor */
  67. int data_fd; /* file descriptor */
  68. /* type in which data is stored on file */
  69. int type; /* DCELL_TYPE or FCELL_TYPE */
  70. /* data concering the compression */
  71. int precision; /* G3D_MAX_PRECISION or, 0 .. 23 for float,
  72. 0 .. 52 for double */
  73. int compression; /* G3D_NO_COMPRESSION or G3D_USE_COMPRESSION */
  74. int useLzw; /* G3D_USE_LZW or G3D_NO_LZW */
  75. int useRle; /* G3D_USE_RLE or G3D_NO_RLE */
  76. int useXdr; /* G3D_USE_XDR or G3D_NO_XDR */
  77. /* pointer to first tile in file */
  78. int offset;
  79. /* pointer to the first index entry in file */
  80. long indexOffset;
  81. /* sizeof (long) of the system on which the file is/was written */
  82. int indexLongNbytes;
  83. /* max # bytes used in the representation of indices; this is equal to */
  84. /* # bytes used in the representation of "indexOffset" */
  85. int indexNbytesUsed;
  86. /* pointer to the last entry in the file */
  87. int fileEndPtr;
  88. /* indicates if index is stored in file; used for G3D_READ_DATA only */
  89. int hasIndex; /* G3D_HAS_INDEX or G3D_NO_INDEX */
  90. /* information concerning internal storage of data */
  91. /* index specific information */
  92. /* index[i] == the offset of tile "i" in the data file */
  93. long *index;
  94. /* tileLength[i] == # bytes used to store tile "i" */
  95. int *tileLength;
  96. /* tile specific information */
  97. /* type in which data is stored in memory */
  98. int typeIntern; /* DCELL_TYPE or FCELL_TYPE */
  99. /* in non-cache mode the "data" array is used to store one tile */
  100. char *data;
  101. /* index of tile currently stored in "data"; -1 if none */
  102. int currentIndex;
  103. /* cache related variables */
  104. int useCache; /* 1 if cache is used */
  105. void *cache; /* pointer to cache structure */
  106. int cacheFD; /* file discriptor of cache file -- write mode only */
  107. char *cacheFileName; /* filename of cache file -- write mode only */
  108. long cachePosLast; /* position of last entry in cache file -- write */
  109. /* mode only*/
  110. /* range info */
  111. struct FPRange range;
  112. /* some constants stored for efficiency */
  113. /* number of bytes required to store a single value of "type" */
  114. int numLengthExtern;
  115. /* number of bytes required to store a single value of "typeIntern" */
  116. int numLengthIntern;
  117. /* see header.c for details */
  118. int clipX, clipY, clipZ;
  119. int tileXY, tileSize;
  120. int nxy, nTiles;
  121. /* mask related information */
  122. int useMask; /* 1 if mask is used; 0 otherwise */
  123. } G3D_Map;
  124. /*---------------------------------------------------------------------------*/
  125. typedef struct {
  126. char *elts; /* ptr to array of elts */
  127. int nofElts; /* size of "elts" */
  128. int eltSize; /* size of elt in "elts" */
  129. int *names; /* name[i] is the name of elts[i] */
  130. char *locks; /* lock[i] == 1 iff elts[i] is locked
  131. lock[i] == 0 iff elts[i] is unlocked but active
  132. lock[i] == 2 iff elts[i] doesn't contain valid data */
  133. int autoLock; /* 1 if auto locking is turned on */
  134. int nofUnlocked; /* nof tiles which are unlocked */
  135. int minUnlocked; /* min nof elts which have to remain unlocked. min = 1 */
  136. int *next, *prev; /* prev/next pointers for fifo */
  137. int first, last; /* index (into next) of first and last elt in fifo */
  138. /* first == -1 iff fifo is empty */
  139. int (* eltRemoveFun) (); /* callback activated if the contents of an
  140. elt needs to be removed */
  141. void *eltRemoveFunData; /* pointer to user data passed along with
  142. eltRemoveFun */
  143. int (* eltLoadFun) (); /* callback activated to load contents of an elt */
  144. void *eltLoadFunData; /* pointer to user data passed along with
  145. eltLoadFun */
  146. void *hash; /* ptr to hashTable used to relate external names to
  147. internal indices (elts) */
  148. } G3D_cache;
  149. /*---------------------------------------------------------------------------*/
  150. typedef struct {
  151. int nofNames;
  152. int *index;
  153. char *active;
  154. int lastName;
  155. int lastIndex;
  156. int lastIndexActive;
  157. } G3d_cache_hash;
  158. /*---------------------------------------------------------------------------*/
  159. /* grass/src/libes/g3d/cache.c */
  160. void G3d_cache_reset(G3D_cache *);
  161. void G3d_cache_dispose(G3D_cache *);
  162. void *G3d_cache_new(int, int, int, int (*)(), void *, int (*)(), void *);
  163. void G3d_cache_set_removeFun(G3D_cache *, int (*)(), void *);
  164. void G3d_cache_set_loadFun(G3D_cache *, int (*)(), void *);
  165. void *G3d_cache_new_read(int, int, int, int (*)(), void *);
  166. int G3d_cache_lock(G3D_cache *, int);
  167. void G3d_cache_lock_intern(G3D_cache *, int);
  168. int G3d_cache_unlock(G3D_cache *, int);
  169. int G3d_cache_unlock_all(G3D_cache *);
  170. int G3d_cache_lock_all(G3D_cache *);
  171. void G3d_cache_autolock_on(G3D_cache *);
  172. void G3d_cache_autolock_off(G3D_cache *);
  173. void G3d_cache_set_minUnlock(G3D_cache *, int);
  174. int G3d_cache_remove_elt(G3D_cache *, int);
  175. int G3d_cache_flush(G3D_cache *, int);
  176. int G3d_cache_remove_all(G3D_cache *);
  177. int G3d_cache_flush_all(G3D_cache *);
  178. char *G3d_cache_elt_ptr(G3D_cache *, int);
  179. int G3d_cache_load(G3D_cache *, int);
  180. int G3d_cache_get_elt(G3D_cache *, int, char *);
  181. int G3d_cache_put_elt(G3D_cache *, int, char *);
  182. /* grass/src/libes/g3d/cachehash.c */
  183. void G3d_cache_hash_reset(G3d_cache_hash *);
  184. void G3d_cache_hash_dispose(G3d_cache_hash *);
  185. void *G3d_cache_hash_new(int);
  186. void G3d_cache_hash_remove_name(G3d_cache_hash *, int);
  187. void G3d_cache_hash_load_name(G3d_cache_hash *, int, int);
  188. int G3d_cache_hash_name2index(G3d_cache_hash *, int);
  189. /* grass/src/libes/g3d/changeprecision.c */
  190. void G3d_changePrecision(void *, int, char *);
  191. /* grass/src/libes/g3d/changetype.c */
  192. void G3d_changeType(void *, char *);
  193. /* grass/src/libes/g3d/filecompare.c */
  194. void G3d_compareFiles(char *, char *, char *, char *);
  195. /* grass/src/libes/g3d/filename.c */
  196. void G3d_filename(char *, char *, char *, char *);
  197. /* grass/src/libes/g3d/find_grid3.c */
  198. char *G_find_grid3(char *, char *);
  199. /* grass/src/libes/g3d/fpcompress.c */
  200. void G_fpcompress_printBinary(char *, int);
  201. void G_fpcompress_dissectXdrDouble(unsigned char *);
  202. int G_fpcompress_writeXdrNums(int, char *, int, int, char *, int, int, int);
  203. int G_fpcompress_writeXdrFloats(int, char *, int, int, char *, int, int);
  204. int G_fpcompress_writeXdrDouble(int, char *, int, int, char *, int, int);
  205. int G_fpcompress_readXdrNums(int, char *, int, int, int, char *, int);
  206. int G_fpcompress_readXdrFloats(int, char *, int, int, int, char *);
  207. int G_fpcompress_readXdrDoubles(int, char *, int, int, int, char *);
  208. /* grass/src/libes/g3d/g3dalloc.c */
  209. void *G3d_malloc(int);
  210. void *G3d_realloc(void *, int);
  211. void G3d_free(void *);
  212. /* grass/src/libes/g3d/g3dcache.c */
  213. int G3d_initCache(G3D_Map *, int);
  214. int G3d_disposeCache(G3D_Map *);
  215. int G3d_flushAllTiles(G3D_Map *);
  216. /* grass/src/libes/g3d/g3dcats.c */
  217. int G3d_writeCats(char *, struct Categories *);
  218. int G3d_readCats(char *, char *, struct Categories *);
  219. /* grass/src/libes/g3d/g3dclose.c */
  220. int G3d_closeCell(G3D_Map *);
  221. /* grass/src/libes/g3d/g3dcolor.c */
  222. int G3d_removeColor(char *);
  223. int G3d_readColors(char *, char *, struct Colors *);
  224. int G3d_writeColors(char *, char *, struct Colors *);
  225. /* grass/src/libes/g3d/g3ddefaults.c */
  226. void G3d_setCompressionMode(int, int, int, int);
  227. void G3d_getCompressionMode(int *, int *, int *, int *);
  228. void G3d_setCacheSize(int);
  229. int G3d_getCacheSize(void);
  230. void G3d_setCacheLimit(int);
  231. int G3d_getCacheLimit(void);
  232. void G3d_setFileType(int);
  233. int G3d_getFileType(void);
  234. void G3d_setTileDimension(int, int, int);
  235. void G3d_getTileDimension(int *, int *, int *);
  236. void G3d_setErrorFun(void (*)(const char *));
  237. void G3d_setUnit(char *);
  238. void G3d_initDefaults(void);
  239. /* grass/src/libes/g3d/g3ddoubleio.c */
  240. int G3d_writeDoubles(int, int, double *, int);
  241. int G3d_readDoubles(int, int, double *, int);
  242. /* grass/src/libes/g3d/g3derror.c */
  243. void G3d_skipError(const char *);
  244. void G3d_printError(const char *);
  245. void G3d_fatalError(const char *, ...);
  246. void G3d_fatalError_noargs(const char *);
  247. void G3d_error(const char *);
  248. /* grass/src/libes/g3d/g3dfpxdr.c */
  249. int G3d_isXdrNullNum(unsigned char *, int);
  250. int G3d_isXdrNullFloat(float *);
  251. int G3d_isXdrNullDouble(double *);
  252. void G3d_setXdrNullNum(unsigned char *, int);
  253. void G3d_setXdrNullDouble(double *);
  254. void G3d_setXdrNullFloat(float *);
  255. int G3d_initFpXdr(G3D_Map *, int);
  256. int G3d_initCopyToXdr(G3D_Map *, int);
  257. int G3d_copyToXdr(char *, int);
  258. int G3d_initCopyFromXdr(G3D_Map *, int);
  259. int G3d_copyFromXdr(int, char *);
  260. /* grass/src/libes/g3d/g3dhistory.c */
  261. int G3d_writeHistory(char *, struct History *);
  262. int G3d_readHistory(char *, char *, struct History *);
  263. /* grass/src/libes/g3d/g3dintio.c */
  264. int G3d_writeInts(int, int, int *, int);
  265. int G3d_readInts(int, int, int *, int);
  266. /* grass/src/libes/g3d/g3dkeys.c */
  267. int G3d_keyGetInt(struct Key_Value *, char *, int *);
  268. int G3d_keyGetDouble(struct Key_Value *, char *, double *);
  269. int G3d_keyGetString(struct Key_Value *, char *, char **);
  270. int G3d_keyGetValue(struct Key_Value *, char *, char *, char *, int, int, int *);
  271. int G3d_keySetInt(struct Key_Value *, char *, int *);
  272. int G3d_keySetDouble(struct Key_Value *, char *, double *);
  273. int G3d_keySetString(struct Key_Value *, char *, char **);
  274. int G3d_keySetValue(struct Key_Value *, char *, char *, char *, int, int, int *);
  275. /* grass/src/libes/g3d/g3dlong.c */
  276. int G3d_longEncode(long *, unsigned char *, int);
  277. void G3d_longDecode(unsigned char *, long *, int, int);
  278. /* grass/src/libes/g3d/g3dmapset.c */
  279. void G3d_makeMapsetMapDirectory(char *);
  280. /* grass/src/libes/g3d/g3dmask.c */
  281. int G3d_maskClose(void);
  282. int G3d_maskFileExists(void);
  283. int G3d_maskOpenOld(void);
  284. int G3d_maskReopen(int);
  285. int G3d_isMasked(G3D_Map *, int, int, int);
  286. void G3d_maskNum(G3D_Map *, int, int, int, void *, int);
  287. void G3d_maskFloat(G3D_Map *, int, int, int, float *);
  288. void G3d_maskDouble(G3D_Map *, int, int, int, double *);
  289. void G3d_maskTile(G3D_Map *, int, char *, int);
  290. void G3d_maskOn(G3D_Map *);
  291. void G3d_maskOff(G3D_Map *);
  292. int G3d_maskIsOn(G3D_Map *);
  293. int G3d_maskIsOff(G3D_Map *);
  294. char *G3d_maskFile(void);
  295. int G3d_maskMapExists(void);
  296. /* grass/src/libes/g3d/g3dmisc.c */
  297. int G3d_g3dType2cellType(int);
  298. void G3d_copyFloat2Double(float *, int, double *, int, int);
  299. void G3d_copyDouble2Float(double *, int, float *, int, int);
  300. void G3d_copyValues(char *, int, int, char *, int, int, int);
  301. int G3d_length(int);
  302. int G3d_externLength(int);
  303. /* grass/src/libes/g3d/g3dnull.c */
  304. int G3d_isNullValueNum(void *, int);
  305. void G3d_setNullValue(void *, int, int);
  306. /* grass/src/libes/g3d/g3dopen2.c */
  307. /* grass/src/libes/g3d/g3dopen.c */
  308. void *G3d_openCellOldNoHeader(char *, char *);
  309. void * G3d_openCellOld (char *, char * , G3D_Region *, int, int);
  310. void * G3d_openCellNew (char *, int, int, G3D_Region * );
  311. /* grass/src/libes/g3d/g3dparam.c */
  312. void G3d_setStandard3dInputParams(void);
  313. int G3d_getStandard3dParams(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *);
  314. void G3d_setWindowParams(void);
  315. char *G3d_getWindowParams(void);
  316. /* grass/src/libes/g3d/g3drange.c */
  317. void G3d_range_updateFromTile(G3D_Map *, char *, int, int, int, int, int, int, int, int);
  318. int G3d_readRange(char *, char *, struct FPRange *);
  319. int G3d_range_load(G3D_Map *);
  320. void G3d_range_min_max(G3D_Map *, double *, double *);
  321. int G3d_range_write(G3D_Map *);
  322. int G3d_range_init(G3D_Map *);
  323. /* grass/src/libes/g3d/g3dregion.c */
  324. void G3d_getRegionValue(G3D_Map *, double, double, double, char *, int);
  325. void G3d_adjustRegion (G3D_Region *);
  326. void G3d_regionCopy (G3D_Region *,G3D_Region *);
  327. void G3d_incorporate2dRegion (struct Cell_head *, G3D_Region *);
  328. void G3d_regionFromToCellHead (struct Cell_head *, G3D_Region *);
  329. void G3d_adjustRegionRes (G3D_Region *);
  330. void G3d_extract2dRegion (G3D_Region *, struct Cell_head *);
  331. void G3d_regionToCellHead (G3D_Region *, struct Cell_head *);
  332. int G3d_readRegionMap (char *, char *,G3D_Region *);
  333. /* grass/src/libes/g3d/g3dresample.c */
  334. void G3d_nearestNeighbor(G3D_Map *, int, int, int, char *, int);
  335. void G3d_setResamplingFun(G3D_Map *, void (*)());
  336. void G3d_getResamplingFun(G3D_Map *, void (**)());
  337. void G3d_getNearestNeighborFunPtr(void (**)());
  338. /* grass/src/libes/g3d/g3dvolume.c */
  339. void G3d_getVolumeA(void *, double [2][2][2][3], int, int, int, char *, int);
  340. void G3d_getVolume(void *, double, double, double, double, double, double, double, double, double, double, double, double, int, int, int, char *, int);
  341. void G3d_getAllignedVolume(void *, double, double, double, double, double, double, int, int, int, char *, int);
  342. void G3d_makeAllignedVolumeFile(void *, char *, double, double, double, double, double, double, int, int, int);
  343. /* grass/src/libes/g3d/g3dwindow.c */
  344. void G3d_getValue(G3D_Map *, int, int, int, void *, int);
  345. float G3d_getFloat(G3D_Map *, int, int, int);
  346. double G3d_getDouble(G3D_Map *, int, int, int);
  347. G3D_Region * G3d_windowPtr (void);
  348. void G3d_setWindow (G3D_Region *);
  349. void G3d_setWindowMap (G3D_Map *, G3D_Region *);
  350. void G3d_getWindow (G3D_Region *);
  351. /* grass/src/libes/g3d/g3dwindowio.c */
  352. void G3d_useWindowParams(void);
  353. int G3d_readWindow (G3D_Region *, char *);
  354. /* int G3d_writeWindow (G3D_Region *, char *); */
  355. /* grass/src/libes/g3d/getblock.c */
  356. void G3d_getBlockNocache(G3D_Map *, int, int, int, int, int, int, void *, int);
  357. void G3d_getBlock(G3D_Map *, int, int, int, int, int, int, char *, int);
  358. /* grass/src/libes/g3d/header.c */
  359. int G3d_readHeader(G3D_Map *, int *, int *, double *, double *, double *, double *, double *, double *, int *, int *, int *, double *, double *, double *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, char **);
  360. int G3d_writeHeader(G3D_Map *, int, int, double, double, double, double, double, double, int, int, int, double, double, double, int, int, int, int, int, int, int, int, int, int, int, char *);
  361. int G3d_cacheSizeEncode(int, int);
  362. int G3d__computeCacheSize(G3D_Map *, int);
  363. int G3d_fillHeader(G3D_Map *, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, double, double, double, double, double, double, int, int, int, double, double, double, char *);
  364. /* grass/src/libes/g3d/headerinfo.c */
  365. void G3d_getCoordsMap(G3D_Map *, int *, int *, int *);
  366. void G3d_getCoordsMapWindow(G3D_Map *, int *, int *, int *);
  367. void G3d_getNofTilesMap(G3D_Map *, int *, int *, int *);
  368. void G3d_getRegionMap(G3D_Map *, double *, double *, double *, double *, double *, double *);
  369. void G3d_getWindowMap(G3D_Map *, double *, double *, double *, double *, double *, double *);
  370. void G3d_getTileDimensionsMap(G3D_Map *, int *, int *, int *);
  371. int G3d_tileTypeMap(G3D_Map *);
  372. int G3d_fileTypeMap(G3D_Map *);
  373. int G3d_tilePrecisionMap(G3D_Map *);
  374. int G3d_tileUseCacheMap(G3D_Map *);
  375. void G3d_printHeader(G3D_Map *);
  376. void G3d_getRegionStructMap (G3D_Map *, G3D_Region *);
  377. /* grass/src/libes/g3d/index.c */
  378. int G3d_flushIndex(G3D_Map *);
  379. int G3d_initIndex(G3D_Map *, int);
  380. /* grass/src/libes/g3d/retile.c */
  381. void G3d_retile(void *, char *, int, int, int);
  382. /* grass/src/libes/g3d/rle.c */
  383. int G_rle_count_only(char *, int, int);
  384. void G_rle_encode(char *, char *, int, int);
  385. void G_rle_decode(char *, char *, int, int, int *, int *);
  386. /* grass/src/libes/g3d/tilealloc.c */
  387. char *G3d_allocTilesType(G3D_Map *, int, int);
  388. char *G3d_allocTiles(G3D_Map *, int);
  389. void G3d_freeTiles(char *);
  390. /* grass/src/libes/g3d/tileio.c */
  391. char *G3d_getTilePtr(G3D_Map *, int);
  392. int G3d_tileLoad(G3D_Map *, int);
  393. int G3d__removeTile(G3D_Map *, int);
  394. float G3d_getFloatRegion(G3D_Map *, int, int, int);
  395. double G3d_getDoubleRegion(G3D_Map *, int, int, int);
  396. void G3d_getValueRegion(G3D_Map *, int, int, int, void *, int);
  397. /* grass/src/libes/g3d/tilemath.c */
  398. void G3d_tileIndex2tile(G3D_Map *, int, int *, int *, int *);
  399. int G3d_tile2tileIndex(G3D_Map *, int, int, int);
  400. void G3d_tileCoordOrigin(G3D_Map *, int, int, int, int *, int *, int *);
  401. void G3d_tileIndexOrigin(G3D_Map *, int, int *, int *, int *);
  402. void G3d_coord2tileCoord(G3D_Map *, int, int, int, int *, int *, int *, int *, int *, int *);
  403. void G3d_coord2tileIndex(G3D_Map *, int, int, int, int *, int *);
  404. int G3d_coordInRange(G3D_Map *, int, int, int);
  405. int G3d_tileIndexInRange(G3D_Map *, int);
  406. int G3d_tileInRange(G3D_Map *, int, int, int);
  407. int G3d_computeClippedTileDimensions(G3D_Map *, int, int *, int *, int *, int *, int *, int *);
  408. int G3d_isValidLocation(G3D_Map *, double, double, double);
  409. void G3d_location2coord(G3D_Map *, double, double, double, int *, int *, int *);
  410. /* grass/src/libes/g3d/tilenull.c */
  411. void G3d_setNullTileType(G3D_Map *, char *, int);
  412. void G3d_setNullTile(G3D_Map *, char *);
  413. /* grass/src/libes/g3d/tileread.c */
  414. int G3d_readTile(G3D_Map *, int, char *, int);
  415. int G3d_readTileFloat(G3D_Map *, int, char *);
  416. int G3d_readTileDouble(G3D_Map *, int, char *);
  417. int G3d_lockTile(G3D_Map *, int);
  418. int G3d_unlockTile(G3D_Map *, int);
  419. int G3d_unlockAll(G3D_Map *);
  420. void G3d_autolockOn(G3D_Map *);
  421. void G3d_autolockOff(G3D_Map *);
  422. void G3d_minUnlocked(G3D_Map *, int);
  423. int G3d_beginCycle(G3D_Map *);
  424. int G3d_endCycle(G3D_Map *);
  425. /* grass/src/libes/g3d/tilewrite.c */
  426. int G3d_writeTile(G3D_Map *, int, char *, int);
  427. int G3d_writeTileFloat(G3D_Map *, int, char *);
  428. int G3d_writeTileDouble(G3D_Map *, int, char *);
  429. int G3d_flushTile(G3D_Map *, int);
  430. int G3d_flushTileCube(G3D_Map *, int, int, int, int, int, int);
  431. int G3d_flushTilesInCube(G3D_Map *, int, int, int, int, int, int);
  432. int G3d_putFloat(G3D_Map *, int, int, int, float);
  433. int G3d_putDouble(G3D_Map *, int, int, int, double);
  434. int G3d_putValue(G3D_Map *, int, int, int, char *, int);
  435. /* grass/src/libes/g3d/writeascii.c */
  436. void G3d_writeAscii(void *, char *);
  437. #endif /* #ifndef GRASS_G3D_H */