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

Go to the source code of this file.

Macros

#define G3D_NO_DEFAULT   -10
 
#define G3D_COMPRESSION_DEFAULT   G3D_COMPRESSION
 
#define G3D_USE_LZW_DEFAULT   G3D_NO_LZW
 
#define G3D_USE_RLE_DEFAULT   G3D_USE_RLE
 
#define G3D_PRECISION_DEFAULT   G3D_MAX_PRECISION
 
#define G3D_CACHE_SIZE_DEFAULT   1000
 
#define G3D_CACHE_SIZE_MAX_DEFAULT   2000000
 
#define G3D_FILE_TYPE_DEFAULT   DCELL_TYPE
 
#define G3D_TILE_X_DEFAULT   8
 
#define G3D_TILE_Y_DEFAULT   8
 
#define G3D_TILE_Z_DEFAULT   8
 
#define G3D_ERROR_FUN_DEFAULT   G3d_skipError
 
#define G3D_UNIT_DEFAULT   "none"
 
#define G3D_COMPRESSION_ENV_VAR_YES   "G3D_USE_COMPRESSION"
 
#define G3D_COMPRESSION_ENV_VAR_NO   "G3D_NO_COMPRESSION"
 
#define G3D_LZW_ENV_VAR_YES   "G3D_USE_LZW"
 
#define G3D_LZW_ENV_VAR_NO   "G3D_NO_LZW"
 
#define G3D_RLE_ENV_VAR_YES   "G3D_USE_RLE"
 
#define G3D_RLE_ENV_VAR_NO   "G3D_NO_RLE"
 
#define G3D_PRECISION_ENV_VAR   "G3D_PRECISION"
 
#define G3D_PRECISION_ENV_VAR_MAX   "G3D_MAX_PRECISION"
 
#define G3D_CACHE_SIZE_ENV_VAR   "G3D_DEFAULT_CACHE_SIZE"
 
#define G3D_CACHE_SIZE_MAX_ENV_VAR   "G3D_MAX_CACHE_SIZE"
 
#define G3D_FILE_FLOAT_ENV_VAR   "G3D_WRITE_FLOAT"
 
#define G3D_FILE_DOUBLE_ENV_VAR   "G3D_WRITE_DOUBLE"
 
#define G3D_TILE_DIM_X_ENV_VAR   "G3D_TILE_DIMENSION_X"
 
#define G3D_TILE_DIM_Y_ENV_VAR   "G3D_TILE_DIMENSION_Y"
 
#define G3D_TILE_DIM_Z_ENV_VAR   "G3D_TILE_DIMENSION_Z"
 
#define G3D_FATAL_ERROR_ENV_VAR   "G3D_USE_FATAL_ERROR"
 
#define G3D_PRINT_ERROR_ENV_VAR   "G3D_USE_PRINT_ERROR"
 
#define G3D_DEFAULT_WINDOW3D   "G3D_DEFAULT_WINDOW3D"
 

Functions

void G3d_setCompressionMode (int doCompress, int doLzw, int doRle, int precision)
 doCompress should be one of G3D_NO_COMPRESSION and G3D_COMPRESSION, doRle should be either G3D_NO_RLE or G3D_USE_RLE, and precision should be either G3D_MAX_PRECISION or a positive integer. More...
 
void G3d_getCompressionMode (int *doCompress, int *doLzw, int *doRle, int *precision)
 
void G3d_setCacheSize (int nTiles)
 set cache size More...
 
int G3d_getCacheSize ()
 get cache size More...
 
void G3d_setCacheLimit (int nBytes)
 Set cache limit. More...
 
int G3d_getCacheLimit ()
 Get cache limit. More...
 
void G3d_setFileType (int type)
 set G3d file type More...
 
int G3d_getFileType ()
 get G3d file type More...
 
void G3d_setTileDimension (int tileX, int tileY, int tileZ)
 set Tile Dimension More...
 
void G3d_getTileDimension (int *tileX, int *tileY, int *tileZ)
 get Tile Dimension More...
 
void G3d_setErrorFun (void(*fun)(const char *))
 set error function More...
 
void G3d_setUnit (const char *unit)
 set G3d unit More...
 
void G3d_initDefaults (void)
 Initializes the default values described in G3D Defaults. Applications have to use this function only if they need to query the default values before the first file (either old or new) has been opened. More...
 

Variables

int g3d_do_compression = G3D_NO_DEFAULT
 
int g3d_do_lzw_compression = G3D_NO_DEFAULT
 
int g3d_do_rle_compression = G3D_NO_DEFAULT
 
int g3d_precision = G3D_NO_DEFAULT
 
int g3d_cache_default = G3D_NO_DEFAULT
 
int g3d_cache_max = G3D_NO_DEFAULT
 
int g3d_file_type = G3D_NO_DEFAULT
 
int g3d_tile_dimension [3]
 
void(* g3d_error_fun )(const char *) = NULL
 
char * g3d_unit_default = NULL
 

Macro Definition Documentation

#define G3D_CACHE_SIZE_DEFAULT   1000

Definition at line 14 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_CACHE_SIZE_ENV_VAR   "G3D_DEFAULT_CACHE_SIZE"

Definition at line 37 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_CACHE_SIZE_MAX_DEFAULT   2000000

Definition at line 15 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_CACHE_SIZE_MAX_ENV_VAR   "G3D_MAX_CACHE_SIZE"

Definition at line 38 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_COMPRESSION_DEFAULT   G3D_COMPRESSION

Definition at line 10 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_COMPRESSION_ENV_VAR_NO   "G3D_NO_COMPRESSION"

Definition at line 26 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_COMPRESSION_ENV_VAR_YES   "G3D_USE_COMPRESSION"

Definition at line 25 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_DEFAULT_WINDOW3D   "G3D_DEFAULT_WINDOW3D"

Definition at line 50 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_ERROR_FUN_DEFAULT   G3d_skipError

Definition at line 20 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_FATAL_ERROR_ENV_VAR   "G3D_USE_FATAL_ERROR"

Definition at line 47 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_FILE_DOUBLE_ENV_VAR   "G3D_WRITE_DOUBLE"

Definition at line 41 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_FILE_FLOAT_ENV_VAR   "G3D_WRITE_FLOAT"

Definition at line 40 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_FILE_TYPE_DEFAULT   DCELL_TYPE

Definition at line 16 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_LZW_ENV_VAR_NO   "G3D_NO_LZW"

Definition at line 29 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_LZW_ENV_VAR_YES   "G3D_USE_LZW"

Definition at line 28 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_NO_DEFAULT   -10

Definition at line 8 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_PRECISION_DEFAULT   G3D_MAX_PRECISION

Definition at line 13 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_PRECISION_ENV_VAR   "G3D_PRECISION"

Definition at line 34 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_PRECISION_ENV_VAR_MAX   "G3D_MAX_PRECISION"

Definition at line 35 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_PRINT_ERROR_ENV_VAR   "G3D_USE_PRINT_ERROR"

Definition at line 48 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_RLE_ENV_VAR_NO   "G3D_NO_RLE"

Definition at line 32 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_RLE_ENV_VAR_YES   "G3D_USE_RLE"

Definition at line 31 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_TILE_DIM_X_ENV_VAR   "G3D_TILE_DIMENSION_X"

Definition at line 43 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_TILE_DIM_Y_ENV_VAR   "G3D_TILE_DIMENSION_Y"

Definition at line 44 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_TILE_DIM_Z_ENV_VAR   "G3D_TILE_DIMENSION_Z"

Definition at line 45 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_TILE_X_DEFAULT   8

Definition at line 17 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_TILE_Y_DEFAULT   8

Definition at line 18 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_TILE_Z_DEFAULT   8

Definition at line 19 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_UNIT_DEFAULT   "none"

Definition at line 21 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_USE_LZW_DEFAULT   G3D_NO_LZW

Definition at line 11 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

#define G3D_USE_RLE_DEFAULT   G3D_USE_RLE

Definition at line 12 of file g3ddefaults.c.

Referenced by G3d_initDefaults().

Function Documentation

int G3d_getCacheLimit ( )

Get cache limit.

get cache limit

Parameters
nBytes
Returns
int

Definition at line 206 of file g3ddefaults.c.

References g3d_cache_max.

int G3d_getCacheSize ( )

get cache size

Returns
int

Definition at line 169 of file g3ddefaults.c.

References g3d_cache_default.

void G3d_getCompressionMode ( int doCompress,
int doLzw,
int doRle,
int precision 
)
Parameters
doCompress
doLzw
doRle
precision
Returns
void

Definition at line 125 of file g3ddefaults.c.

References g3d_do_compression, g3d_do_lzw_compression, g3d_do_rle_compression, g3d_precision, and NULL.

Referenced by G3d_changePrecision(), G3d_getStandard3dParams(), and G3d_openNewParam().

int G3d_getFileType ( )

get G3d file type

Parameters
type
Returns
int

Definition at line 243 of file g3ddefaults.c.

References g3d_file_type.

Referenced by G3d_changePrecision(), G3d_changeType(), G3d_getStandard3dParams(), G3d_makeAlignedVolumeFile(), G3d_openNewParam(), and G3d_retile().

void G3d_getTileDimension ( int tileX,
int tileY,
int tileZ 
)

get Tile Dimension

Parameters
tileX
tileY
tileZ
Returns
void

Definition at line 291 of file g3ddefaults.c.

References g3d_tile_dimension.

Referenced by G3d_changePrecision(), G3d_changeType(), G3d_getStandard3dParams(), G3d_openNewParam(), and G3d_retile().

void G3d_initDefaults ( void  )
void G3d_setCacheLimit ( int  nBytes)

Set cache limit.

set cache limit

Parameters
nBytes
Returns
void

Definition at line 186 of file g3ddefaults.c.

References g3d_cache_max, and G3d_fatalError().

void G3d_setCacheSize ( int  nTiles)

set cache size

Parameters
nTiles
Returns
void

Definition at line 150 of file g3ddefaults.c.

References g3d_cache_default, and G3d_fatalError().

void G3d_setCompressionMode ( int  doCompress,
int  doLzw,
int  doRle,
int  precision 
)

doCompress should be one of G3D_NO_COMPRESSION and G3D_COMPRESSION, doRle should be either G3D_NO_RLE or G3D_USE_RLE, and precision should be either G3D_MAX_PRECISION or a positive integer.

Parameters
doCompress
doLzw
doRle
precision
Returns
void

Definition at line 85 of file g3ddefaults.c.

References g3d_do_compression, g3d_do_lzw_compression, g3d_do_rle_compression, G3d_fatalError(), and g3d_precision.

Referenced by G3d_changePrecision(), and G3d_openNewParam().

void G3d_setErrorFun ( void(*)(const char *)  fun)

set error function

Parameters
\returnvoid

Definition at line 310 of file g3ddefaults.c.

References g3d_error_fun.

void G3d_setFileType ( int  type)

set G3d file type

Parameters
type
Returns
void

Definition at line 223 of file g3ddefaults.c.

References G3d_fatalError(), g3d_file_type, and dialogs::type.

Referenced by G3d_changePrecision(), G3d_changeType(), G3d_openNewParam(), and G3d_retile().

void G3d_setTileDimension ( int  tileX,
int  tileY,
int  tileZ 
)

set Tile Dimension

Parameters
tileX
tileY
tileZ
Returns
void

Definition at line 262 of file g3ddefaults.c.

References G3d_fatalError(), and g3d_tile_dimension.

Referenced by G3d_changePrecision(), G3d_changeType(), G3d_openNewParam(), and G3d_retile().

void G3d_setUnit ( const char *  unit)

set G3d unit

Parameters
unit
Returns
void

Definition at line 327 of file g3ddefaults.c.

References G3d_free(), g3d_unit_default, and G_store().

Variable Documentation

int g3d_cache_max = G3D_NO_DEFAULT
int g3d_do_compression = G3D_NO_DEFAULT
int g3d_do_lzw_compression = G3D_NO_DEFAULT
int g3d_do_rle_compression = G3D_NO_DEFAULT
void(* g3d_error_fun)(const char *) = NULL

Definition at line 63 of file g3ddefaults.c.

Referenced by G3d_initDefaults(), and G3d_setErrorFun().

int g3d_file_type = G3D_NO_DEFAULT

Definition at line 60 of file g3ddefaults.c.

Referenced by G3d_getFileType(), G3d_initDefaults(), G3d_openCellNew(), and G3d_setFileType().

int g3d_tile_dimension[3]
Initial value:
=
{ G3D_NO_DEFAULT, G3D_NO_DEFAULT, G3D_NO_DEFAULT }
#define G3D_NO_DEFAULT
Definition: g3ddefaults.c:8

Definition at line 61 of file g3ddefaults.c.

Referenced by G3d_getTileDimension(), G3d_initDefaults(), G3d_openCellNew(), and G3d_setTileDimension().

char* g3d_unit_default = NULL

Definition at line 64 of file g3ddefaults.c.

Referenced by G3d_initDefaults(), G3d_openCellNew(), and G3d_setUnit().