|
SAGA API
v9.6
|
Go to the documentation of this file.
54 #include <wx/stdpaths.h>
72 int g_SG_OMP_Max_Num_Threads = omp_get_num_procs();
81 else if( iCores > omp_get_num_procs() )
83 iCores = omp_get_num_procs();
86 omp_set_num_threads(g_SG_OMP_Max_Num_Threads = iCores);
92 return( g_SG_OMP_Max_Num_Threads );
98 return( omp_get_num_procs() );
104 return( omp_get_thread_num() );
142 default :
return( bShort ?
_TL(
"none" ) :
_TL(
"undefined" ) );
247 else if( Value > max )
273 class CSG_App_Initialize
276 CSG_App_Initialize(
void)
281 virtual ~CSG_App_Initialize(
void)
284 bool Initialize (
void)
296 bool Uninitialize (
void)
298 if( m_Initialized > 0 )
310 bool Uninitialize (
bool bAll)
314 while( m_Initialized > 0 )
362 App_Path = wxStandardPaths::Get().GetExecutablePath().wc_str();
382 g_App_Name = wxApp::GetInstance()->GetAppName().wc_str();
405 wxDir Dir(Directory);
411 if( Dir.GetFirst(&Path,
"*.dll", wxDIR_HIDDEN|wxDIR_FILES) )
413 if( !Path.IsEmpty() )
421 if( Dir.GetFirst(&Path,
"gdal_netCDF.dll", wxDIR_HIDDEN|wxDIR_FILES) )
423 wxSetEnv(
"GDAL_DRIVER_PATH", Directory);
426 if( Dir.GetFirst(&Path,
"pdalcpp.dll", wxDIR_HIDDEN | wxDIR_FILES) )
428 wxSetEnv(
"PDAL_DRIVER_PATH", Directory);
431 if( Dir.GetFirst(&Path, wxEmptyString, wxDIR_HIDDEN|wxDIR_DIRS) )
435 wxString SubDir(Directory +
"\\" + Path);
437 if( !Path.CmpNoCase(
"gdal-plugins") ) { wxSetEnv(
"GDAL_DRIVER_PATH", SubDir); }
else
438 if( !Path.CmpNoCase(
"gdal-data" ) ) { wxSetEnv(
"GDAL_DATA" , SubDir); }
else
439 if( !Path.CmpNoCase(
"proj-data" ) ) { wxSetEnv(
"PROJ_LIB" , SubDir); }
else
444 while( Dir.GetNext(&Path) );
448 return( !Paths.IsEmpty() );
464 static bool bInitialized =
false;
466 if( bInitialized ==
false )
472 #if defined(_SAGA_MSW)
474 wxString App_Path, Dll_Paths, System_Paths;
478 App_Path = SAGA_Path;
487 wxGetEnv(
"PATH", &System_Paths);
491 Dll_Paths +=
';' + App_Path +
';' + System_Paths;
493 wxSetEnv(
"PATH", Dll_Paths);
496 #elif defined(__WXMAC__)
500 if(
SG_Dir_Exists(App_Path +
"/proj-data") ) { wxSetEnv(
"PROJ_LIB" , wxString::Format(
"%s/proj-data", App_Path.
c_str())); }
501 if(
SG_Dir_Exists(App_Path +
"/gdal-data") ) { wxSetEnv(
"GDAL_DATA", wxString::Format(
"%s/gdal-data", App_Path.
c_str())); }
503 #else // #if defined(_SAGA_LINUX)
CSG_App_Initialize g_App_Initialize
bool Create(bool LoadCodeList=true)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
#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
CSG_String SG_UI_Get_Application_Name(void)
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
#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
#define SG_DATATYPES_Byte
#define SG_DATATYPES_Date
bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
#define SG_DATATYPES_Short
int SG_OMP_Get_Max_Num_Procs(void)
CSG_String SG_UI_Set_Application_Name(const CSG_String &Name)
CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort)
#define SG_DATATYPES_Binary
bool SG_Initialize_Environment(bool bLibraries, bool bProjections, const SG_Char *SAGA_Path, bool bInitializeWX)
CSG_String g_SAGA_API_Path
const char gSG_Data_Type_Identifier[][32]
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
#define SG_DATATYPES_Color
CSG_String SG_UI_Get_Application_Path(bool bPathOnly)
void SG_OMP_Set_Max_Num_Threads(int iCores)
bool is_Empty(void) const
int SG_OMP_Get_Thread_Num(void)
CSG_String SG_UI_Get_API_Path(void)
void SG_UI_ProgressAndMsg_Lock(bool bOn)
const SG_Char * c_str(void) const
TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)