53#ifndef HEADER_INCLUDED__SAGA_API__tool_H
54#define HEADER_INCLUDED__SAGA_API__tool_H
153 const CSG_String & Get_File_Name (
void)
const;
157 const CSG_String & Get_Description (
void)
const;
158 const CSG_String & Get_Dynamic_Description (
void)
const;
162 static bool Set_Description_Source (
const CSG_String &Source =
"");
163 static const CSG_String & Get_Description_Source (
void);
164 CSG_String Get_Description_Editors (
bool bHTML =
true);
165 bool Load_Description (
void);
168 virtual CSG_String Get_MenuPath (
bool bSolved);
171 CSG_Strings Get_References (
bool bHTML =
true)
const;
172 bool Del_References (
void);
174 CSG_Table Get_Parameters_Table (
void)
const;
187 bool Set_Parameter (
const wchar_t *ID,
CSG_Parameter *pValue);
210 bool Reset (
bool bManager =
true);
211 bool Reset_Manager (
void);
212 bool Reset_Grid_System (
void);
214 bool Update_Parameter_States (
void);
216 void Set_Callback (
bool bActive =
true);
221 bool Delete_Manager (
bool bDetachData =
false,
bool bReset =
true);
227 bool Settings_Pop (
void);
231 virtual bool needs_GUI (
void)
const {
return(
false ); }
232 bool has_GUI (
void)
const;
233 bool has_CMD (
void)
const;
235 virtual bool is_Grid (
void)
const {
return(
false ); }
240 void Set_Show_Progress (
bool bOn =
true);
245 bool Execute (
bool bAddHistory =
false);
264 CSG_String Get_Script (Script_Format Format,
bool bHeader =
true,
int Arguments = 0,
bool bWrapArgs =
true);
296 bool Dlg_Parameters (
const CSG_String &Identifier);
302 virtual bool Set_Progress (
int Position,
int Range )
const;
303 virtual bool Set_Progress (
sLong Position,
sLong Range )
const;
304 virtual bool Set_Progress (
double Position,
double Range = 1.)
const;
306 bool Stop_Execution (
bool bDialog =
true);
309 bool Message_Dlg_Confirm (
const CSG_String &Text,
const SG_Char *Caption = NULL);
311 void Message_Add (
const CSG_String &Text,
bool bNewLine =
true);
312 void Message_Fmt (
const char *Format, ...);
313 void Message_Fmt (
const wchar_t *Format, ...);
317 bool Error_Fmt (
const char *Format, ...);
318 bool Error_Fmt (
const wchar_t *Format, ...);
321 bool DataObject_Add (
CSG_Data_Object *pDataObject,
bool bShow =
false);
323 bool DataObject_Update_All (
void);
332 static int _On_Parameter_Changed (
CSG_Parameter *pParameter,
int Flags);
334 static bool Process_Get_Okay (
bool bBlink =
false);
335 static void Process_Set_Text (
const CSG_String &Text);
336 static void Process_Set_Text (
const char *Format, ...);
337 static void Process_Set_Text (
const wchar_t *Format, ...);
345 static bool DataObject_Set_Colors (
CSG_Data_Object *pDataObject,
const CSG_String &Colors,
int nColors = 0,
bool bRevert =
false);
349 static bool DataObject_Set_Classification (
CSG_Data_Object *pDataObject,
const CSG_Table &LUT,
int Field = -1,
bool bSetClassify =
true);
350 static bool DataObject_Set_Classification (
CSG_Data_Object *pDataObject,
CSG_Table *pLUT,
int Field = -1,
bool bSetClassify =
true);
353 static ESymbology DataObject_Get_Symbology (
CSG_Data_Object *pDataObject);
354 static bool DataObject_Set_Symbology (
CSG_Data_Object *pDataObject, ESymbology Symbology);
369 static bool DataObject_Set_Stretch_Linear (
CSG_Data_Object *pDataObject,
int Field = -1,
double Minimum = 5.,
double Maximum = 95. ,
int Interval_Mode = 0,
double Interval_Log = 1.,
int Colors = -1,
bool bUpdateNow =
false);
370 static bool DataObject_Set_Stretch_StdDev (
CSG_Data_Object *pDataObject,
int Field = -1,
double StdDev = 2.,
bool bKeepInRange =
false,
int Interval_Mode = 0,
double Interval_Log = 1.,
int Colors = -1,
bool bUpdateNow =
false);
371 static bool DataObject_Set_Stretch_Percentile (
CSG_Data_Object *pDataObject,
int Field = -1,
double Minimum = 2.,
double Maximum = 98. ,
int Interval_Mode = 0,
double Interval_Log = 1.,
int Colors = -1,
bool bUpdateNow =
false);
372 static bool DataObject_Set_Stretch (
CSG_Data_Object *pDataObject,
int Field ,
double Minimum ,
double Maximum ,
int Interval_Mode = 0,
double Interval_Log = 1.,
int Colors = -1,
bool bUpdateNow =
false);
374 static bool DataObject_Classify_Unique (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes_Max = 1024 ,
int Colors = -1);
375 static bool DataObject_Classify_Equal (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10 ,
int Colors = -1);
376 static bool DataObject_Classify_Defined (
CSG_Data_Object *pDataObject,
int Field ,
double Interval,
bool bOffset =
false,
double Offset = 0.,
int Colors = -1);
377 static bool DataObject_Classify_Quantile (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10,
bool bHistogram =
true ,
int Colors = -1);
378 static bool DataObject_Classify_Geometric (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10,
bool bIncreasing =
true ,
int Colors = -1);
379 static bool DataObject_Classify_Natural (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10 ,
int Colors = -1);
380 static bool DataObject_Classify_StdDev (
CSG_Data_Object *pDataObject,
int Field = -1,
double StdDev = 0.5,
double StdDev_Max = 4.5 ,
int Colors = -1);
387 bool m_bExecutes, m_bError_Ignore, m_bShow_Progress, m_bGUI, m_bCMD;
391 CSG_String m_ID, m_Library, m_Library_Menu, m_File_Name, m_Author, m_Version, m_Execution_Info, m_Dynamic_Description;
396 bool _Synchronize_DataObjects (
void);
400 CSG_String _Get_Script_CMD (
bool bHeader ,
bool bAllArguments,
bool bWrapArgs,
bool bBatch);
401 void _Get_Script_CMD (
CSG_String &Script,
CSG_Parameters *pParameters,
bool bAllArguments,
bool bWrapArgs,
bool bBatch);
404 void _Get_Script_CMD_Usage (
CSG_Parameters *pParameters,
class wxCmdLineParser &Parser);
406 CSG_String _Get_Script_Python (
bool bHeader,
bool bAllArguments);
409 CSG_String _Get_Script_Python_Wrap (
bool bHeader,
bool bName,
bool bCall,
int AllArguments,
bool bWrapArgs);
412 CSG_String _Get_Script_Markdown (
bool bHeader,
int iArguments);
416 void _Set_Output_History (
void);
445 virtual bool is_Grid (
void)
const {
return(
true ); }
450 virtual bool Set_Progress_Cells (
sLong Cell)
const;
451 virtual bool Set_Progress_Rows (
int Row)
const;
475 void Lock_Create (
void);
476 void Lock_Destroy (
void);
479 char Lock_Get (
int x,
int y) {
return( m_pLock && x >= 0 && x <
Get_NX() && y >= 0 && y <
Get_NY() ? m_pLock->asChar(x, y) : 0 ); }
483 if( m_pLock && x >= 0 && x <
Get_NX() && y >= 0 && y <
Get_NY() )
485 m_pLock->Set_Value(x, y, Value);
534#define TOOL_INTERACTIVE_KEY_LEFT 0x01
535#define TOOL_INTERACTIVE_KEY_MIDDLE 0x02
536#define TOOL_INTERACTIVE_KEY_RIGHT 0x04
537#define TOOL_INTERACTIVE_KEY_SHIFT 0x08
538#define TOOL_INTERACTIVE_KEY_ALT 0x10
539#define TOOL_INTERACTIVE_KEY_CTRL 0x20
569 virtual bool On_Execute_Keyboard (
int Character);
570 virtual bool On_Execute_Finish (
void);
584 void Set_Drag_Mode (
int Drag_Mode);
589 int m_Keys, m_Drag_Mode;
652 bool Get_Grid_Pos (
int &x,
int &y)
const;
654 int Get_xGrid (
void)
const;
655 int Get_yGrid (
void)
const;
684typedef CSG_Tool * (* TSG_PFNC_TLB_Create_Tool) (
int i);
718#define SYMBOL_TLB_Initialize "TLB_Initialize"
721#define SYMBOL_TLB_Finalize "TLB_Finalize"
724#define SYMBOL_TLB_Get_Interface "TLB_Get_Interface"
728#define TLB_INTERFACE_SKIP_TOOL ((CSG_Tool *)0x1)
731#define TLB_INTERFACE_ESTABLISH CSG_Tool_Library_Interface TLB_Interface;\
733extern "C" _SAGA_DLL_EXPORT CSG_Tool_Library_Interface * TLB_Get_Interface (void)\
735 return( &TLB_Interface );\
739#define TLB_INTERFACE_INITIALIZE extern "C" _SAGA_DLL_EXPORT bool TLB_Initialize(const SG_Char *TLB_Path)\
741 return( TLB_Interface.Create(SAGA_VERSION, TLB_Path, Get_Info, Create_Tool) );\
745#define TLB_INTERFACE_FINALIZE extern "C" _SAGA_DLL_EXPORT bool TLB_Finalize (void)\
751#define TLB_INTERFACE TLB_INTERFACE_ESTABLISH TLB_INTERFACE_INITIALIZE TLB_INTERFACE_FINALIZE
bool SG_UI_Process_Get_Okay(bool bBlink)
@ SG_UI_DATAOBJECT_UPDATE
#define SAGA_API_DLL_EXPORT
static int Get_yTo(int Direction, int y=0)
static int Get_yFrom(int Direction, int y=0)
static int Get_xTo(int Direction, int x=0)
static int Get_xFrom(int Direction, int x=0)
int(* TSG_PFNC_Parameter_Changed)(CSG_Parameter *pParameter, int Flags)
@ PARAMETER_TYPE_Undefined