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);
207 bool Reset (
bool bManager =
true);
208 bool Reset_Manager (
void);
209 bool Reset_Grid_System (
void);
211 bool Update_Parameter_States (
void);
213 void Set_Callback (
bool bActive =
true);
218 bool Delete_Manager (
bool bDetachData =
false,
bool bReset =
true);
224 bool Settings_Pop (
void);
228 virtual bool needs_GUI (
void)
const {
return(
false ); }
229 bool has_GUI (
void)
const;
230 bool has_CMD (
void)
const;
232 virtual bool is_Grid (
void)
const {
return(
false ); }
237 void Set_Show_Progress (
bool bOn =
true);
242 bool Execute (
bool bAddHistory =
false);
261 CSG_String Get_Script (Script_Format Format,
bool bHeader =
true,
int Arguments = 0,
bool bWrapArgs =
true);
293 bool Dlg_Parameters (
const CSG_String &Identifier);
299 virtual bool Set_Progress (
int Position,
int Range )
const;
300 virtual bool Set_Progress (
sLong Position,
sLong Range )
const;
301 virtual bool Set_Progress (
double Position,
double Range = 1.)
const;
303 bool Stop_Execution (
bool bDialog =
true);
306 bool Message_Dlg_Confirm (
const CSG_String &Text,
const SG_Char *Caption = NULL);
308 void Message_Add (
const CSG_String &Text,
bool bNewLine =
true);
309 void Message_Fmt (
const char *Format, ...);
310 void Message_Fmt (
const wchar_t *Format, ...);
314 bool Error_Fmt (
const char *Format, ...);
315 bool Error_Fmt (
const wchar_t *Format, ...);
318 bool DataObject_Add (
CSG_Data_Object *pDataObject,
bool bUpdate =
false);
320 bool DataObject_Update_All (
void);
329 static int _On_Parameter_Changed (
CSG_Parameter *pParameter,
int Flags);
331 static bool Process_Get_Okay (
bool bBlink =
false);
332 static void Process_Set_Text (
const CSG_String &Text);
333 static void Process_Set_Text (
const char *Format, ...);
334 static void Process_Set_Text (
const wchar_t *Format, ...);
342 static bool DataObject_Set_Colors (
CSG_Data_Object *pDataObject,
const CSG_String &Colors,
int nColors = 0,
bool bRevert =
false);
357 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);
358 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);
359 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);
360 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);
362 static bool DataObject_Classify_Unique (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes_Max = 1024 ,
int Colors = -1);
363 static bool DataObject_Classify_Equal (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10 ,
int Colors = -1);
364 static bool DataObject_Classify_Defined (
CSG_Data_Object *pDataObject,
int Field ,
double Interval,
bool bOffset =
false,
double Offset = 0.,
int Colors = -1);
365 static bool DataObject_Classify_Quantile (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10,
bool bHistogram =
true ,
int Colors = -1);
366 static bool DataObject_Classify_Geometric (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10,
bool bIncreasing =
true ,
int Colors = -1);
367 static bool DataObject_Classify_Natural (
CSG_Data_Object *pDataObject,
int Field = -1,
int Classes = 10 ,
int Colors = -1);
368 static bool DataObject_Classify_StdDev (
CSG_Data_Object *pDataObject,
int Field = -1,
double StdDev = 0.5,
double StdDev_Max = 4.5 ,
int Colors = -1);
375 bool m_bExecutes, m_bError_Ignore, m_bShow_Progress, m_bGUI, m_bCMD;
379 CSG_String m_ID, m_Library, m_Library_Menu, m_File_Name, m_Author, m_Version, m_Execution_Info, m_Dynamic_Description;
384 bool _Synchronize_DataObjects (
void);
388 CSG_String _Get_Script_CMD (
bool bHeader ,
bool bAllArguments,
bool bWrapArgs,
bool bBatch);
389 void _Get_Script_CMD (
CSG_String &Script,
CSG_Parameters *pParameters,
bool bAllArguments,
bool bWrapArgs,
bool bBatch);
392 void _Get_Script_CMD_Usage (
CSG_Parameters *pParameters,
class wxCmdLineParser &Parser);
394 CSG_String _Get_Script_Python (
bool bHeader,
bool bAllArguments);
397 CSG_String _Get_Script_Python_Wrap (
bool bHeader,
bool bName,
bool bCall,
int AllArguments,
bool bWrapArgs);
400 CSG_String _Get_Script_Markdown (
bool bHeader,
int iArguments);
404 void _Set_Output_History (
void);
433 virtual bool is_Grid (
void)
const {
return(
true ); }
438 virtual bool Set_Progress_Cells (
sLong Cell)
const;
439 virtual bool Set_Progress_Rows (
int Row)
const;
463 void Lock_Create (
void);
464 void Lock_Destroy (
void);
467 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 ); }
471 if( m_pLock && x >= 0 && x <
Get_NX() && y >= 0 && y <
Get_NY() )
473 m_pLock->Set_Value(x, y, Value);
522#define TOOL_INTERACTIVE_KEY_LEFT 0x01
523#define TOOL_INTERACTIVE_KEY_MIDDLE 0x02
524#define TOOL_INTERACTIVE_KEY_RIGHT 0x04
525#define TOOL_INTERACTIVE_KEY_SHIFT 0x08
526#define TOOL_INTERACTIVE_KEY_ALT 0x10
527#define TOOL_INTERACTIVE_KEY_CTRL 0x20
557 virtual bool On_Execute_Keyboard (
int Character);
558 virtual bool On_Execute_Finish (
void);
572 void Set_Drag_Mode (
int Drag_Mode);
577 int m_Keys, m_Drag_Mode;
640 bool Get_Grid_Pos (
int &x,
int &y)
const;
642 int Get_xGrid (
void)
const;
643 int Get_yGrid (
void)
const;
672typedef CSG_Tool * (* TSG_PFNC_TLB_Create_Tool) (
int i);
706#define SYMBOL_TLB_Initialize "TLB_Initialize"
709#define SYMBOL_TLB_Finalize "TLB_Finalize"
712#define SYMBOL_TLB_Get_Interface "TLB_Get_Interface"
716#define TLB_INTERFACE_SKIP_TOOL ((CSG_Tool *)0x1)
719#define TLB_INTERFACE_ESTABLISH CSG_Tool_Library_Interface TLB_Interface;\
721extern "C" _SAGA_DLL_EXPORT CSG_Tool_Library_Interface * TLB_Get_Interface (void)\
723 return( &TLB_Interface );\
727#define TLB_INTERFACE_INITIALIZE extern "C" _SAGA_DLL_EXPORT bool TLB_Initialize(const SG_Char *TLB_Path)\
729 return( TLB_Interface.Create(SAGA_VERSION, TLB_Path, Get_Info, Create_Tool) );\
733#define TLB_INTERFACE_FINALIZE extern "C" _SAGA_DLL_EXPORT bool TLB_Finalize (void)\
739#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