GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tileread.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include "G3d_intern.h"
Include dependency graph for tileread.c:

Go to the source code of this file.

Functions

int G3d_readTile (G3D_Map *map, int tileIndex, void *tile, int type)
 Reads tile with index tileIndex into the tile buffer. The cells are stored with type type which must be one of FCELL_TYPE and DCELL_TYPE. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index tile is filled with NULL-values. More...
 
int G3d_readTileFloat (G3D_Map *map, int tileIndex, void *tile)
 Is equivalent to G3d_readTile (map, tileIndex, tile, FCELL_TYPE). More...
 
int G3d_readTileDouble (G3D_Map *map, int tileIndex, void *tile)
 Is equivalent to G3d_readTile (map, tileIndex, tile, DCELL_TYPE). More...
 
int G3d_lockTile (G3D_Map *map, int tileIndex)
 Locks tile with tileIndex in cache. If after locking fewer than the minimum number of unlocked tiles are unlocked, the lock request is ignored. More...
 
int G3d_unlockTile (G3D_Map *map, int tileIndex)
 Unlocks tile with tileIndex. More...
 
int G3d_unlockAll (G3D_Map *map)
 Unlocks every tile in cache of map. More...
 
void G3d_autolockOn (G3D_Map *map)
 Turns autolock mode on. More...
 
void G3d_autolockOff (G3D_Map *map)
 Turns autolock mode Off. More...
 
void G3d_minUnlocked (G3D_Map *map, int minUnlocked)
 Sets the minimum number of unlocked tiles to minUnlocked. This function should be used in combination with G3d_unlockAll () in order to avoid situations where the new minimum is larger than the actual number of unlocked tiles. minUnlocked must be one of G3D_USE_CACHE_X, G3D_USE_CACHE_Y, G3D_USE_CACHE_Z, G3D_USE_CACHE_XY, G3D_USE_CACHE_XZ, G3D_USE_CACHE_YZ, G3D_USE_CACHE_XYZ, the result of G3d_cacheSizeEncode() (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which explicitly specifies the number of tiles. More...
 
int G3d_beginCycle (G3D_Map *map)
 Starts a new cycle. More...
 
int G3d_endCycle (G3D_Map *map)
 Ends a cycle. More...
 

Function Documentation

void G3d_autolockOff ( G3D_Map *  map)

Turns autolock mode Off.

Parameters
map
Returns
void

Definition at line 357 of file tileread.c.

References G3d_cache_autolock_off(), and G3d_fatalError().

Referenced by G3d_endCycle().

void G3d_autolockOn ( G3D_Map *  map)

Turns autolock mode on.

Parameters
map
Returns
void

Definition at line 337 of file tileread.c.

References G3d_cache_autolock_on(), and G3d_fatalError().

Referenced by G3d_beginCycle(), and G3d_compareFiles().

int G3d_beginCycle ( G3D_Map *  map)

Starts a new cycle.

Parameters
map
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 408 of file tileread.c.

References G3d_autolockOn(), G3d_fatalError(), and G3d_unlockAll().

int G3d_endCycle ( G3D_Map *  map)

Ends a cycle.

Parameters
map
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 432 of file tileread.c.

References G3d_autolockOff().

int G3d_lockTile ( G3D_Map *  map,
int  tileIndex 
)

Locks tile with tileIndex in cache. If after locking fewer than the minimum number of unlocked tiles are unlocked, the lock request is ignored.

Parameters
map
tileIndex
Returns
1 ... if successful, -1 ... if request is ignored, 0 ... otherwise.

Definition at line 259 of file tileread.c.

References G3d_cache_lock(), G3d_error(), and G3d_fatalError().

void G3d_minUnlocked ( G3D_Map *  map,
int  minUnlocked 
)

Sets the minimum number of unlocked tiles to minUnlocked. This function should be used in combination with G3d_unlockAll () in order to avoid situations where the new minimum is larger than the actual number of unlocked tiles. minUnlocked must be one of G3D_USE_CACHE_X, G3D_USE_CACHE_Y, G3D_USE_CACHE_Z, G3D_USE_CACHE_XY, G3D_USE_CACHE_XZ, G3D_USE_CACHE_YZ, G3D_USE_CACHE_XYZ, the result of G3d_cacheSizeEncode() (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which explicitly specifies the number of tiles.

Parameters
map
minUnlocked
Returns
void

Definition at line 386 of file tileread.c.

References G3d__computeCacheSize(), G3d_cache_set_minUnlock(), and G3d_fatalError().

Referenced by G3d_compareFiles().

int G3d_readTile ( G3D_Map *  map,
int  tileIndex,
void *  tile,
int  type 
)

Reads tile with index tileIndex into the tile buffer. The cells are stored with type type which must be one of FCELL_TYPE and DCELL_TYPE. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index tile is filled with NULL-values.

Parameters
map
tileIndex
tile
type
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 145 of file tileread.c.

References dialogs::cols, G3d_computeClippedTileDimensions(), G3d_error(), G3d_fatalError(), G3d_maskIsOff(), G3d_maskTile(), and G3d_setNullTileType().

Referenced by G3d_changePrecision(), G3d_changeType(), G3d_getBlockNocache(), G3d_getTilePtr(), G3d_readTileDouble(), and G3d_readTileFloat().

int G3d_readTileDouble ( G3D_Map *  map,
int  tileIndex,
void *  tile 
)

Is equivalent to G3d_readTile (map, tileIndex, tile, DCELL_TYPE).

Parameters
map
tileIndex
tile
Returns
int

Definition at line 229 of file tileread.c.

References G3d_error(), and G3d_readTile().

int G3d_readTileFloat ( G3D_Map *  map,
int  tileIndex,
void *  tile 
)

Is equivalent to G3d_readTile (map, tileIndex, tile, FCELL_TYPE).

Parameters
map
tileIndex
tile
Returns
int

Definition at line 205 of file tileread.c.

References G3d_error(), and G3d_readTile().

int G3d_unlockAll ( G3D_Map *  map)

Unlocks every tile in cache of map.

Parameters
map
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 312 of file tileread.c.

References G3d_cache_unlock_all(), G3d_error(), and G3d_fatalError().

Referenced by G3d_beginCycle(), and G3d_compareFiles().

int G3d_unlockTile ( G3D_Map *  map,
int  tileIndex 
)

Unlocks tile with tileIndex.

Parameters
map
tileIndex
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 286 of file tileread.c.

References G3d_cache_unlock(), G3d_error(), and G3d_fatalError().