|
SAGA API
v9.5
|
Go to the documentation of this file.
53 #ifndef HEADER_INCLUDED__SAGA_API__tool_library_H
54 #define HEADER_INCLUDED__SAGA_API__tool_library_H
130 virtual int Get_Count (
void)
const {
return( m_pInterface ? m_pInterface->Get_Count() : 0 ); }
143 virtual bool Delete_Tools (
void);
150 void Del_References (
void);
166 bool _Destroy (
void);
173 class wxDynamicLibrary *m_pLibrary;
194 int Get_Tool_Count (
void)
const;
200 int Add_Directory (
const CSG_String &Directory,
bool bOnlySubDirectories =
false);
201 int Add_Directory (
const char *Directory,
bool bOnlySubDirectories =
false);
202 int Add_Directory (
const wchar_t *Directory,
bool bOnlySubDirectories =
false);
204 bool Del_Library (
int i);
215 CSG_Tool * Get_Tool (
const char *Library,
int Index)
const;
216 CSG_Tool * Get_Tool (
const wchar_t *Library,
int Index)
const;
218 CSG_Tool * Get_Tool (
const char *Library,
const char *Name)
const;
219 CSG_Tool * Get_Tool (
const wchar_t *Library,
const wchar_t *Name)
const;
221 CSG_Tool * Create_Tool (
const CSG_String &Library,
int Index,
bool bWithGUI =
false)
const;
222 CSG_Tool * Create_Tool (
const char *Library,
int Index,
bool bWithGUI =
false)
const;
223 CSG_Tool * Create_Tool (
const wchar_t *Library,
int Index,
bool bWithGUI =
false)
const;
225 CSG_Tool * Create_Tool (
const char *Library,
const char *Name,
bool bWithGUI =
false)
const;
226 CSG_Tool * Create_Tool (
const wchar_t *Library,
const wchar_t *Name,
bool bWithGUI =
false)
const;
227 bool Delete_Tool (
CSG_Tool *pTool)
const;
230 bool Get_Summary (
const CSG_String &Path)
const;
232 bool Create_Python_ToolBox (
const CSG_String &Destination,
bool bClean =
true,
bool bName =
true,
bool bSingleFile =
false)
const;
257 #define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION) {\
261 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool(SG_T(LIBRARY), TOOL);\
265 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("could not find tool"), SG_T(LIBRARY)));\
269 SG_UI_Process_Set_Text(pTool->Get_Name());\
271 pTool->Settings_Push();\
273 if( !pTool->On_Before_Execution() || !(CONDITION) )\
275 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not initialize tool"), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
277 else if( !pTool->Execute(false) )\
279 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not execute tool" ), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
286 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);\
290 #define SG_RUN_TOOL_ExitOnError(LIBRARY, TOOL, CONDITION) {\
294 SG_RUN_TOOL(bResult, LIBRARY, TOOL, CONDITION)\
303 #define SG_RUN_TOOL_KEEP_PARMS(bRetVal, LIBRARY, TOOL, PARMS, CONDITION) {\
307 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool(SG_T(LIBRARY), TOOL);\
311 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("could not find tool"), SG_T(LIBRARY)));\
315 SG_UI_Process_Set_Text(pTool->Get_Name());\
317 pTool->Settings_Push();\
319 if( !pTool->On_Before_Execution() || !(CONDITION) )\
321 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not initialize tool"), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
323 else if( !pTool->Execute(false) )\
325 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not execute tool" ), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
331 PARMS.Set_Manager(NULL); PARMS.Assign_Parameters(pTool->Get_Parameters());\
334 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);\
338 #define SG_RUN_TOOL_KEEP_PARMS_ExitOnError(LIBRARY, TOOL, PARMS, CONDITION) {\
342 SG_RUN_TOOL_KEEP_PARMS(bResult, LIBRARY, TOOL, PARMS, CONDITION)\
351 #define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE) (pTool->Get_Parameters()->Get_Parameter(IDENTIFIER, true) && pTool->Set_Parameter(IDENTIFIER, VALUE))
353 #define SG_TOOL_PARAMLIST_ADD(IDENTIFIER, VALUE) (\
354 pTool->Get_Parameters()->Get_Parameter(IDENTIFIER, true)\
355 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()\
356 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()->Add_Item(VALUE)\
359 #define SG_TOOL_SET_DATAOBJECT_LIST(IDENTIFIER, VALUE) (\
360 pTool->Get_Parameters()->Get_Parameter(IDENTIFIER, true)\
361 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()\
362 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()->Assign(VALUE)\
373 #endif // #ifndef HEADER_INCLUDED__SAGA_API__tool_library_H
#define SAGA_API_DLL_EXPORT