|
SAGA API
v9.5
|
Go to the documentation of this file.
71 int g_SG_OMP_Max_Num_Threads = omp_get_num_procs();
80 else if( iCores > omp_get_num_procs() )
82 iCores = omp_get_num_procs();
85 omp_set_num_threads(g_SG_OMP_Max_Num_Threads = iCores);
91 return( g_SG_OMP_Max_Num_Threads );
97 return( omp_get_num_procs() );
103 return( omp_get_thread_num() );
141 default :
return( bShort ?
_TL(
"none" ) :
_TL(
"undefined" ) );
246 else if( Value > max )
272 class CSG_App_Initialize
275 CSG_App_Initialize(
void)
280 virtual ~CSG_App_Initialize(
void)
283 bool Initialize (
void)
295 bool Uninitialize (
void)
297 if( m_Initialized > 0 )
309 bool Uninitialize (
bool bAll)
313 while( m_Initialized > 0 )
344 wxDir Dir(Directory);
350 if( Dir.GetFirst(&Path,
"*.dll", wxDIR_HIDDEN|wxDIR_FILES) )
352 if( !Path.IsEmpty() )
360 if( Dir.GetFirst(&Path,
"gdal_netCDF.dll", wxDIR_HIDDEN|wxDIR_FILES) )
362 wxSetEnv(
"GDAL_DRIVER_PATH", Directory);
365 if( Dir.GetFirst(&Path,
"pdalcpp.dll", wxDIR_HIDDEN | wxDIR_FILES) )
367 wxSetEnv(
"PDAL_DRIVER_PATH", Directory);
370 if( Dir.GetFirst(&Path, wxEmptyString, wxDIR_HIDDEN|wxDIR_DIRS) )
374 wxString SubDir(Directory +
"\\" + Path);
376 if( !Path.CmpNoCase(
"gdal-plugins") ) { wxSetEnv(
"GDAL_DRIVER_PATH", SubDir); }
377 else if( !Path.CmpNoCase(
"gdal-data" ) ) { wxSetEnv(
"GDAL_DATA" , SubDir); }
378 else if( !Path.CmpNoCase(
"proj-data" ) ) { wxSetEnv(
"PROJ_LIB" , SubDir); }
384 while( Dir.GetNext(&Path) );
388 return( !Paths.IsEmpty() );
404 static bool bInitialized =
false;
406 if( bInitialized ==
false )
414 wxString App_Path, Dll_Paths, System_Paths;
418 App_Path = Directory;
425 wxGetEnv(
"PATH", &System_Paths);
429 Dll_Paths +=
';' + App_Path +
';' + System_Paths;
431 wxSetEnv(
"PATH", Dll_Paths);
444 #elif defined(__WXMAC__)
472 if(
SG_Dir_Exists(App_Path +
"/proj-data") ) { wxSetEnv(
"PROJ_LIB" , wxString::Format(
"%s/proj-data", App_Path.
c_str())); }
473 if(
SG_Dir_Exists(App_Path +
"/gdal-data") ) { wxSetEnv(
"GDAL_DATA", wxString::Format(
"%s/gdal-data", App_Path.
c_str())); }
475 #else // #ifdef _SAGA_LINUX
504 if( wxGetEnv(
"SAGA_TLB", &Path) )
510 #else // #ifdef _SAGA_LINUX
CSG_App_Initialize g_App_Initialize
#define SG_DATATYPES_ULong
#define SG_DATATYPES_Double
bool SG_Data_Type_Range_Check(TSG_Data_Type Type, double &Value)
int SG_Data_Type_Get_Flag(TSG_Data_Type Type)
#define SG_DATATYPES_Undefined
bool SG_Uninitialize_Environment(void)
#define SG_DATATYPES_Float
SAGA_API_DLL_EXPORT bool SG_Dir_Exists(const CSG_String &Directory)
#define SG_DATATYPES_DWord
bool SG_Add_Dll_Paths(const wxString &Directory, wxString &Paths)
void SG_UI_Console_Print_StdOut(const char *Text, SG_Char End, bool bFlush)
#define SG_DATATYPES_Long
#define SG_DATATYPES_String
CSG_String SG_UI_Get_Application_Path(bool bPathOnly)
#define SG_DATATYPES_Word
int Cmp(const CSG_String &String) const
CSG_String SG_Data_Type_Get_Identifier(TSG_Data_Type Type)
int SG_OMP_Get_Max_Num_Threads(void)
#define SG_DATATYPES_Char
bool SG_Initialize_Environment(bool bLibraries, bool bProjections, const SG_Char *Directory, bool bInitializeWX)
#define SG_DATATYPES_Byte
#define SG_DATATYPES_Date
bool Load(const CSG_String &File, bool bAppend=false)
bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
#define SG_DATATYPES_Short
int SG_OMP_Get_Max_Num_Procs(void)
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort)
#define SG_DATATYPES_Binary
const char gSG_Data_Type_Identifier[][32]
#define SG_DATATYPES_Color
void SG_OMP_Set_Max_Num_Threads(int iCores)
int SG_OMP_Get_Thread_Num(void)
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
void SG_UI_ProgressAndMsg_Lock(bool bOn)
const SG_Char * c_str(void) const
int Get_Count(void) const
TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)