SAGA API  v9.6
tool.h
Go to the documentation of this file.
1 
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51 
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__tool_H
54 #define HEADER_INCLUDED__SAGA_API__tool_H
55 
56 
58 // //
59 // //
60 // //
62 
63 //---------------------------------------------------------
74 // //
76 // //
77 // //
79 
80 //---------------------------------------------------------
81 #include "parameters.h"
82 
83 
85 // //
86 // //
87 // //
89 
90 //---------------------------------------------------------
91 typedef enum
92 {
96 }
98 
99 //---------------------------------------------------------
100 typedef enum
101 {
107 }
109 
110 //---------------------------------------------------------
111 typedef enum
112 {
115 }
117 
118 //---------------------------------------------------------
119 typedef enum
120 {
131 }
133 
134 
136 // //
137 // CSG_Tool //
138 // //
140 
141 //---------------------------------------------------------
149 //---------------------------------------------------------
151 {
155  friend class CSG_Tool_Chain;
156 
157 public:
158 
159  CSG_Tool(void);
160  virtual ~CSG_Tool(void);
161 
162  virtual void Destroy (void);
163 
164  virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Base ); }
165 
166  const CSG_String & Get_ID (void) const { return( m_ID ); }
167 
168  const CSG_String & Get_Library (void) const;
169  const CSG_String & Get_File_Name (void) const; // Returns the file name of the tool's library or, if this is a tool chain, the associated XML file.
170  const CSG_String & Get_Name (void) const;
171  const CSG_String & Get_Author (void) const;
172  const CSG_String & Get_Version (void) const;
173  const CSG_String & Get_Description (void) const;
174  const CSG_Strings & Get_References (void) const;
175  const SG_Char * Get_Icon (void) { return( NULL ); }
176  CSG_String Get_Summary (bool bParameters = true, const CSG_String &Menu = "", const CSG_String &Description = "", int Format = SG_SUMMARY_FMT_HTML);
177 
178  virtual CSG_String Get_MenuPath (void) { return( SG_T("") ); }
179  virtual CSG_String Get_MenuPath (bool bSolved);
180 
181  CSG_Parameters * Get_Parameters (void) { return( &Parameters ); }
182 
183  int Get_Parameters_Count (void) const { return( (int)m_pParameters.Get_Size() ); }
184  CSG_Parameters * Get_Parameters (int i) const { return( i >= 0 && i < Get_Parameters_Count() ? (CSG_Parameters *)m_pParameters[i] : NULL ); }
185  CSG_Parameters * Get_Parameters (int i) { return( i >= 0 && i < Get_Parameters_Count() ? (CSG_Parameters *)m_pParameters[i] : NULL ); }
186  CSG_Parameters * Get_Parameters (const CSG_String &Identifier) const;
187 
188  CSG_Parameter * Get_Parameter (const CSG_String &ID) const { return( Parameters(ID) ); }
189  CSG_Parameter * Get_Parameter (const char *ID) const { return( Parameters(ID) ); }
190  CSG_Parameter * Get_Parameter (const wchar_t *ID) const { return( Parameters(ID) ); }
191  bool Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue);
192  bool Set_Parameter (const char *ID, CSG_Parameter *pValue);
193  bool Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue);
194  bool Set_Parameter (const CSG_String &ID, int Value, int Type = PARAMETER_TYPE_Undefined);
195  bool Set_Parameter (const char *ID, int Value, int Type = PARAMETER_TYPE_Undefined);
196  bool Set_Parameter (const wchar_t *ID, int Value, int Type = PARAMETER_TYPE_Undefined);
197  bool Set_Parameter (const CSG_String &ID, double Value, int Type = PARAMETER_TYPE_Undefined);
198  bool Set_Parameter (const char *ID, double Value, int Type = PARAMETER_TYPE_Undefined);
199  bool Set_Parameter (const wchar_t *ID, double Value, int Type = PARAMETER_TYPE_Undefined);
200  bool Set_Parameter (const CSG_String &ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
201  bool Set_Parameter (const char *ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
202  bool Set_Parameter (const wchar_t *ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
203  bool Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
204  bool Set_Parameter (const char *ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
205  bool Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
206  bool Set_Parameter (const CSG_String &ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
207  bool Set_Parameter (const char *ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
208  bool Set_Parameter (const wchar_t *ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
209  bool Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
210  bool Set_Parameter (const char *ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
211  bool Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
212 
213  bool Reset (bool bManager = true);
214  bool Reset_Manager (void);
215  bool Reset_Grid_System (void);
216 
217  bool Update_Parameter_States (void);
218 
219  void Set_Callback (bool bActive = true);
220 
221  bool Set_Manager (class CSG_Data_Manager *pManager);
222  class CSG_Data_Manager * Get_Manager (void) const;
223  class CSG_Data_Manager * Create_Manager (void);
224  bool Delete_Manager (bool bDetachData = false, bool bReset = true);
225 
226  bool Set_Grid_System (const CSG_Grid_System &System);
227  CSG_Grid_System * Get_Grid_System (void) const;
228 
229  bool Settings_Push (class CSG_Data_Manager *pManager = NULL);
230  bool Settings_Pop (void);
231 
232  virtual bool do_Sync_Projections (void) const { return( true ); }
233 
234  virtual bool needs_GUI (void) const { return( false ); }
235  bool has_GUI (void) const;
236  bool has_CMD (void) const;
237 
238  virtual bool is_Grid (void) const { return( false ); }
239  virtual bool is_Interactive (void) const { return( false ); }
240  bool is_Progress (void) const { return( SG_UI_Process_Get_Okay(false) ); }
241  bool is_Executing (void) const { return( m_bExecutes ); }
242 
243  void Set_Show_Progress (bool bOn = true);
244 
245  virtual bool On_Before_Execution (void) { return( true ); }
246  virtual bool On_After_Execution (void) { return( true ); }
247 
248  bool Execute (bool bAddHistory = false);
249 
250  const SG_Char * Get_Execution_Info (void) const { return( m_Execution_Info ); }
251 
252  CSG_String Get_Script (TSG_Tool_Script_Type Type, bool bHeader = true, bool bAllParameters = false);
253 
254 
255 protected:
256 
258 
260 
261 
262  //-----------------------------------------------------
263  void Set_Name (const CSG_String &String);
264  void Set_Author (const CSG_String &String);
265  void Set_Version (const CSG_String &String);
266  void Set_Description (const CSG_String &String);
267 
268  void Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link = NULL, const SG_Char *Link_Text = NULL);
269  void Add_Reference (const CSG_String &Link, const SG_Char *Link_Text = NULL);
270 
271  //-----------------------------------------------------
272  virtual bool On_Execute (void) = 0;
273 
274  virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter);
275  virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter);
276 
277  TSG_PFNC_Parameter_Changed Get_Parameter_Changed (void) { return( _On_Parameter_Changed ); }
278 
279  //-----------------------------------------------------
280  CSG_Parameters * Add_Parameters (const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
281  bool Dlg_Parameters (const CSG_String &Identifier); // deprecated
282 
283  bool Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption = "");
284  bool Dlg_Parameters (CSG_Parameters &Parameters, const CSG_String &Caption = "");
285 
286  //-----------------------------------------------------
287  virtual bool Set_Progress (int Position, int Range ) const;
288  virtual bool Set_Progress (sLong Position, sLong Range ) const;
289  virtual bool Set_Progress (double Position, double Range = 1.) const;
290 
291  bool Stop_Execution (bool bDialog = true);
292 
293  void Message_Dlg (const CSG_String &Text, const SG_Char *Caption = NULL);
294  bool Message_Dlg_Confirm (const CSG_String &Text, const SG_Char *Caption = NULL);
295 
296  void Message_Add (const CSG_String &Text, bool bNewLine = true);
297  void Message_Fmt (const char *Format, ...);
298  void Message_Fmt (const wchar_t *Format, ...);
299 
300  bool Error_Set (TSG_Tool_Error Error_ID = TOOL_ERROR_Unknown);
301  bool Error_Set (const CSG_String &Text);
302  bool Error_Fmt (const char *Format, ...);
303  bool Error_Fmt (const wchar_t *Format, ...);
304 
305  //-----------------------------------------------------
306  bool DataObject_Add (CSG_Data_Object *pDataObject, bool bUpdate = false);
307 
308  void DataObject_Update_All (void);
309 
310  bool DataObject_Set_History (CSG_Parameter *pParameter, CSG_MetaData *pHistory = NULL);
311 
312  bool Get_Projection (CSG_Projection &Projection) const;
313 
314 
315 public: // static functions...
316 
317  static bool Process_Get_Okay (bool bBlink = false);
318  static void Process_Set_Text (const CSG_String &Text);
319  static void Process_Set_Text (const char *Format, ...);
320  static void Process_Set_Text (const wchar_t *Format, ...);
321 
322  static bool DataObject_Update (CSG_Data_Object *pDataObject , int Show = SG_UI_DATAOBJECT_UPDATE);
323  static bool DataObject_Update (CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show = SG_UI_DATAOBJECT_UPDATE);
324 
325  static bool DataObject_Get_Colors (CSG_Data_Object *pDataObject, CSG_Colors &Colors);
326  static bool DataObject_Set_Colors (CSG_Data_Object *pDataObject, const CSG_Colors &Colors);
327  static bool DataObject_Set_Colors (CSG_Data_Object *pDataObject, int nColors, int Palette = SG_COLORS_DEFAULT, bool bRevert = false);
328 
329  static bool DataObject_Get_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters);
330  static bool DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters);
331  static bool DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy);
332 
333  static CSG_Parameter * DataObject_Get_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID);
334  static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Parameter *pParameter);
335  static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID);
336  static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value);
337  static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value);
338  static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value);
339  static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value);
340  static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal); // Range Parameter
341 
342  static int _On_Parameter_Changed (CSG_Parameter *pParameter, int Flags);
343 
344 
345 private:
346 
347  bool m_bExecutes, m_bError_Ignore, m_bShow_Progress, m_bGUI, m_bCMD;
348 
349  CSG_Array_Pointer m_pParameters;
350 
351  CSG_String m_ID, m_Library, m_Library_Menu, m_File_Name, m_Author, m_Version, m_Execution_Info;
352 
353 
354  bool _Synchronize_DataObjects (void);
355 
356  CSG_String _Get_Script_CMD (bool bHeader, bool bAllParameters, TSG_Tool_Script_Type Type);
357  void _Get_Script_CMD (CSG_String &Script, CSG_Parameters *pParameters, bool bAllParameters, TSG_Tool_Script_Type Type);
358 
359  CSG_String _Get_Script_CMD_Usage (void);
360  void _Get_Script_CMD_Usage (CSG_Parameters *pParameters, class wxCmdLineParser &Parser);
361 
362  CSG_String _Get_Script_Python (bool bHeader, bool bAllParameters);
363  void _Get_Script_Python (CSG_String &Script, CSG_Parameters *pParameters, bool bAllParameters, const CSG_String &Prefix = "");
364 
365  CSG_String _Get_Script_Python_Wrap (bool bHeader, bool bName, bool bCall, bool bOnlyNonDefaults);
366  bool _Get_Script_Python_Wrap (const CSG_Parameter &Parameter, int Constraint, CSG_String &Arguments, CSG_String &Description, CSG_String &Code, bool bCall, bool bOnlyNonDefaults, const CSG_String &Prefix = "");
367 
368  CSG_MetaData _Get_Output_History (void);
369  void _Set_Output_History (void);
370 
371  void _Update_Parameter_States (CSG_Parameters *pParameters);
372 
373 };
374 
375 
377 // //
378 // CSG_Tool_Grid //
379 // //
381 
382 //---------------------------------------------------------
386 //---------------------------------------------------------
388 {
389 public:
390  CSG_Tool_Grid(void);
391  virtual ~CSG_Tool_Grid(void);
392 
393  virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Grid ); }
394 
395  const CSG_Grid_System & Get_System (void) const { return( *Parameters.Get_Grid_System() ); }
396  bool Set_System (const CSG_Grid_System &System);
397 
398  virtual bool is_Grid (void) const { return( true ); }
399 
400 
401 protected:
402 
403  virtual bool Set_Progress_Cells (sLong Cell) const;
404  virtual bool Set_Progress_Rows (int Row) const;
405 
406  //-----------------------------------------------------
407  int Get_NX (void) const { return( Get_System().Get_NX () ); }
408  int Get_NY (void) const { return( Get_System().Get_NY () ); }
409  sLong Get_NCells (void) const { return( Get_System().Get_NCells () ); }
410  double Get_XMin (void) const { return( Get_System().Get_XMin () ); }
411  double Get_YMin (void) const { return( Get_System().Get_YMin () ); }
412  double Get_XMax (void) const { return( Get_System().Get_XMax () ); }
413  double Get_YMax (void) const { return( Get_System().Get_YMax () ); }
414  double Get_Cellsize (void) const { return( Get_System().Get_Cellsize() ); }
415  double Get_Cellarea (void) const { return( Get_System().Get_Cellarea() ); }
416 
417  double Get_Length (int i) const { return( Get_System().Get_Length (i) ); }
418  double Get_UnitLength (int i) const { return( Get_System().Get_UnitLength(i) ); }
419  bool is_InGrid (int x, int y) const { return( Get_System().is_InGrid(x, y) ); }
420  bool is_InGrid (int x, int y, int Rand) const { return( Get_System().is_InGrid(x, y, Rand) ); }
421 
422  static int Get_xTo (int i, int x = 0) { return( CSG_Grid_System::Get_xTo (i, x) ); }
423  static int Get_yTo (int i, int y = 0) { return( CSG_Grid_System::Get_yTo (i, y) ); }
424  static int Get_xFrom (int i, int x = 0) { return( CSG_Grid_System::Get_xFrom(i, x) ); }
425  static int Get_yFrom (int i, int y = 0) { return( CSG_Grid_System::Get_yFrom(i, y) ); }
426 
427  //-----------------------------------------------------
428  void Lock_Create (void);
429  void Lock_Destroy (void);
430 
431  bool is_Locked (int x, int y) { return( Lock_Get(x, y) != 0 ); }
432  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 ); }
433 
434  void Lock_Set (int x, int y, char Value = 1)
435  {
436  if( m_pLock && x >= 0 && x < Get_NX() && y >= 0 && y < Get_NY() )
437  {
438  m_pLock->Set_Value(x, y, Value);
439  }
440  }
441 
442 
443 private:
444 
445  CSG_Grid *m_pLock;
446 
447 };
448 
449 
451 // //
452 // CSG_Tool_Interactive_Base //
453 // //
455 
456 //---------------------------------------------------------
457 typedef enum
458 {
473 }
475 
476 //---------------------------------------------------------
477 typedef enum
478 {
483 }
485 
486 //---------------------------------------------------------
487 #define TOOL_INTERACTIVE_KEY_LEFT 0x01
488 #define TOOL_INTERACTIVE_KEY_MIDDLE 0x02
489 #define TOOL_INTERACTIVE_KEY_RIGHT 0x04
490 #define TOOL_INTERACTIVE_KEY_SHIFT 0x08
491 #define TOOL_INTERACTIVE_KEY_ALT 0x10
492 #define TOOL_INTERACTIVE_KEY_CTRL 0x20
493 
494 //---------------------------------------------------------
498 //---------------------------------------------------------
500 {
501  friend class CSG_Tool_Interactive;
503 
504 public:
506  virtual ~CSG_Tool_Interactive_Base(void);
507 
508  bool Set_Projection (const CSG_Projection &Projection);
509 
510  bool Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys);
511  bool Execute_Keyboard (int Character, int Keys);
512  bool Execute_Finish (void);
513 
514  int Get_Drag_Mode (void) const { return( m_Drag_Mode ); }
515 
516 
517 protected:
518 
519  const CSG_Projection & Get_Projection (void) const { return( m_Projection ); }
520 
521  virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode);
522  virtual bool On_Execute_Keyboard (int Character);
523  virtual bool On_Execute_Finish (void);
524 
525  const CSG_Point & Get_Position (void) const { return( m_Point ); }
526  double Get_xPosition (void) const { return( m_Point .x ); }
527  double Get_yPosition (void) const { return( m_Point .y ); }
528 
529  const CSG_Point & Get_Position_Last (void) const { return( m_Point_Last ); }
530  double Get_xPosition_Last (void) const { return( m_Point_Last.x ); }
531  double Get_yPosition_Last (void) const { return( m_Point_Last.y ); }
532 
533  bool is_Shift (void) const { return( (m_Keys & TOOL_INTERACTIVE_KEY_SHIFT) != 0 ); }
534  bool is_Alt (void) const { return( (m_Keys & TOOL_INTERACTIVE_KEY_ALT ) != 0 ); }
535  bool is_Ctrl (void) const { return( (m_Keys & TOOL_INTERACTIVE_KEY_CTRL ) != 0 ); }
536 
537  void Set_Drag_Mode (int Drag_Mode);
538 
539 
540 private:
541 
542  int m_Keys, m_Drag_Mode;
543 
544  CSG_Point m_Point, m_Point_Last;
545 
546  CSG_Projection m_Projection;
547 
548  CSG_Tool *m_pTool;
549 
550 };
551 
552 
554 // //
555 // CSG_Tool_Interactive //
556 // //
558 
559 //---------------------------------------------------------
563 //---------------------------------------------------------
565 {
566 public:
567  CSG_Tool_Interactive(void);
568  virtual ~CSG_Tool_Interactive(void);
569 
570  virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Interactive ); }
571 
572  virtual bool needs_GUI (void) const { return( true ); }
573 
574  virtual bool is_Interactive (void) const { return( true ); }
575 
576 };
577 
578 
580 // //
581 // CSG_Tool_Grid_Interactive //
582 // //
584 
585 //---------------------------------------------------------
589 //---------------------------------------------------------
591 {
592 public:
594  virtual ~CSG_Tool_Grid_Interactive(void);
595 
596  virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Grid_Interactive ); }
597 
598  virtual bool needs_GUI (void) const { return( true ); }
599 
600  virtual bool is_Interactive (void) const { return( true ); }
601 
602 
603 protected:
604 
605  bool Get_Grid_Pos (int &x, int &y) const;
606 
607  int Get_xGrid (void) const;
608  int Get_yGrid (void) const;
609 
610 };
611 
612 
614 // //
615 // Tool Library Interface Definitions //
616 // //
618 
619 //---------------------------------------------------------
620 typedef enum
621 {
633 }
635 
636 //---------------------------------------------------------
637 typedef CSG_Tool * (* TSG_PFNC_TLB_Create_Tool) (int i);
638 typedef CSG_String (* TSG_PFNC_TLB_Get_Info ) (int i);
639 
640 //---------------------------------------------------------
642 {
643 public:
645  virtual ~CSG_Tool_Library_Interface(void);
646 
647  bool Create (const CSG_String &Version, const CSG_String &TLB_Path, TSG_PFNC_TLB_Get_Info Fnc_Info, TSG_PFNC_TLB_Create_Tool Fnc_Create_Tool);
648  bool Destroy (void);
649 
650  const CSG_String & Get_Info (int ID);
651 
652  int Get_Count (void);
653  CSG_Tool * Get_Tool (int i);
654 
655  CSG_Tool * Create_Tool (int i, bool bWithGUI = false, bool bWithCMD =true);
656  bool Delete_Tool (CSG_Tool *pTool);
657  bool Delete_Tools (void);
658 
659 
660 private:
661 
662  CSG_Strings m_Info;
663 
664  CSG_Array_Pointer m_Tools, m_xTools;
665 
666  TSG_PFNC_TLB_Create_Tool m_Fnc_Create_Tool;
667 
668 };
669 
670 //---------------------------------------------------------
671 #define SYMBOL_TLB_Initialize "TLB_Initialize"
672 typedef bool (* TSG_PFNC_TLB_Initialize) (const SG_Char *);
673 
674 #define SYMBOL_TLB_Finalize "TLB_Finalize"
675 typedef bool (* TSG_PFNC_TLB_Finalize) (void);
676 
677 #define SYMBOL_TLB_Get_Interface "TLB_Get_Interface"
678 typedef CSG_Tool_Library_Interface * (* TSG_PFNC_TLB_Get_Interface) (void);
679 
680 //---------------------------------------------------------
681 #define TLB_INTERFACE_SKIP_TOOL ((CSG_Tool *)0x1)
682 
683 //---------------------------------------------------------
684 #define TLB_INTERFACE_ESTABLISH CSG_Tool_Library_Interface TLB_Interface;\
685 \
686 extern "C" _SAGA_DLL_EXPORT CSG_Tool_Library_Interface * TLB_Get_Interface (void)\
687 {\
688  return( &TLB_Interface );\
689 }\
690 
691 //---------------------------------------------------------
692 #define TLB_INTERFACE_INITIALIZE extern "C" _SAGA_DLL_EXPORT bool TLB_Initialize(const SG_Char *TLB_Path)\
693 {\
694  return( TLB_Interface.Create(SAGA_VERSION, TLB_Path, Get_Info, Create_Tool) );\
695 }\
696 
697 //---------------------------------------------------------
698 #define TLB_INTERFACE_FINALIZE extern "C" _SAGA_DLL_EXPORT bool TLB_Finalize (void)\
699 {\
700  return( true );\
701 }\
702 
703 //---------------------------------------------------------
704 #define TLB_INTERFACE TLB_INTERFACE_ESTABLISH TLB_INTERFACE_INITIALIZE TLB_INTERFACE_FINALIZE
705 
706 //---------------------------------------------------------
707 #ifndef SWIG
708 
710 
711 #endif // #ifdef SWIG
712 
713 
715 // //
716 // //
717 // //
719 
720 //---------------------------------------------------------
721 #endif // #ifndef HEADER_INCLUDED__SAGA_API__tool_H
TOOL_INTERACTIVE_LDCLICK
@ TOOL_INTERACTIVE_LDCLICK
Definition: tool.h:462
CSG_Tool_Grid::is_InGrid
bool is_InGrid(int x, int y) const
Definition: tool.h:419
CSG_Tool_Interactive
Definition: tool.h:565
CSG_Tool_Library_Interface
Definition: tool.h:642
CSG_Grid_System::Get_xTo
static int Get_xTo(int Direction, int x=0)
Definition: grid.h:312
CSG_Tool_Interactive_Base::CSG_Tool_Interactive_Base
CSG_Tool_Interactive_Base(void)
Definition: tool_interactive_base.cpp:81
CSG_Tool_Grid::Get_yFrom
static int Get_yFrom(int i, int y=0)
Definition: tool.h:425
CSG_Tool::Reset_Manager
bool Reset_Manager(void)
Definition: tool.cpp:1233
CSG_Tool::Parameters
CSG_Parameters Parameters
Definition: tool.h:257
SG_T
#define SG_T(s)
Definition: api_core.h:537
CSG_Tool_Grid::Lock_Get
char Lock_Get(int x, int y)
Definition: tool.h:432
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(int i) const
Definition: tool.h:184
CSG_Tool_Interactive_Base::Get_xPosition_Last
double Get_xPosition_Last(void) const
Definition: tool.h:530
CSG_Tool_Grid::Get_UnitLength
double Get_UnitLength(int i) const
Definition: tool.h:418
TOOL_INTERACTIVE_DRAG_LINE
@ TOOL_INTERACTIVE_DRAG_LINE
Definition: tool.h:480
TOOL_TYPE_Chain
@ TOOL_TYPE_Chain
Definition: tool.h:106
TOOL_SCRIPT_CHAIN
@ TOOL_SCRIPT_CHAIN
Definition: tool.h:124
CSG_Tool_Grid::Get_XMax
double Get_XMax(void) const
Definition: tool.h:412
TLB_INFO_Library
@ TLB_INFO_Library
Definition: tool.h:630
CSG_Tool::History_Supplement
CSG_MetaData History_Supplement
Definition: tool.h:259
CSG_Tool_Interactive_Base::On_Execute_Keyboard
virtual bool On_Execute_Keyboard(int Character)
Definition: tool_interactive_base.cpp:166
CSG_Tool_Interactive_Base::Get_Position_Last
const CSG_Point & Get_Position_Last(void) const
Definition: tool.h:529
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(int i)
Definition: tool.h:185
CSG_Tool_Interactive_Base::is_Shift
bool is_Shift(void) const
Definition: tool.h:533
CSG_Tool::Get_Summary
CSG_String Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
Definition: tool_summary.cpp:258
CSG_Tool::On_After_Execution
virtual bool On_After_Execution(void)
Definition: tool.h:246
CSG_Tool_Interactive_Base::On_Execute_Finish
virtual bool On_Execute_Finish(void)
Definition: tool_interactive_base.cpp:201
CSG_Tool::Get_Parameter_Changed
TSG_PFNC_Parameter_Changed Get_Parameter_Changed(void)
Definition: tool.h:277
TLB_INFO_Version
@ TLB_INFO_Version
Definition: tool.h:625
CSG_Tool_Grid::Get_NY
int Get_NY(void) const
Definition: tool.h:408
TLB_INFO_SAGA_Version
@ TLB_INFO_SAGA_Version
Definition: tool.h:631
CSG_Tool_Interactive_Base::Get_yPosition
double Get_yPosition(void) const
Definition: tool.h:527
CSG_Tool_Interactive_Base::~CSG_Tool_Interactive_Base
virtual ~CSG_Tool_Interactive_Base(void)
Definition: tool_interactive_base.cpp:93
CSG_Grid_System
Definition: grid.h:200
CSG_Tool_Interactive::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:572
CSG_Tool_Grid::Get_Length
double Get_Length(int i) const
Definition: tool.h:417
CSG_Tool_Interactive_Base::is_Ctrl
bool is_Ctrl(void) const
Definition: tool.h:535
CSG_Tool_Grid::Get_yTo
static int Get_yTo(int i, int y=0)
Definition: tool.h:423
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const char *ID) const
Definition: tool.h:189
TOOL_INTERACTIVE_DRAG_NONE
@ TOOL_INTERACTIVE_DRAG_NONE
Definition: tool.h:479
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:207
CSG_Tool::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:234
TLB_INFO_Category
@ TLB_INFO_Category
Definition: tool.h:627
CSG_Tool_Interactive_Base::Execute_Position
bool Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys)
Definition: tool_interactive_base.cpp:108
CSG_Tool::is_Executing
bool is_Executing(void) const
Definition: tool.h:241
TOOL_SCRIPT_CMD_SHELL
@ TOOL_SCRIPT_CMD_SHELL
Definition: tool.h:121
CSG_Tool_Grid::Get_YMin
double Get_YMin(void) const
Definition: tool.h:411
TOOL_INTERACTIVE_KEY_CTRL
#define TOOL_INTERACTIVE_KEY_CTRL
Definition: tool.h:492
CSG_Tool
Definition: tool.h:151
CSG_Grid_System::Get_yTo
static int Get_yTo(int Direction, int y=0)
Definition: grid.h:326
TOOL_ERROR_Unknown
@ TOOL_ERROR_Unknown
Definition: tool.h:113
CSG_Tool_Interactive_Base::Get_Projection
const CSG_Projection & Get_Projection(void) const
Definition: tool.h:519
CSG_Tool::~CSG_Tool
virtual ~CSG_Tool(void)
Definition: tool.cpp:86
TOOL_INTERACTIVE_RUP
@ TOOL_INTERACTIVE_RUP
Definition: tool.h:467
SG_SUMMARY_FMT_HTML
@ SG_SUMMARY_FMT_HTML
Definition: tool.h:94
CSG_Tool::Get_Name
const CSG_String & Get_Name(void) const
Definition: tool.cpp:132
TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL
@ TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL
Definition: tool.h:127
CSG_Tool_Grid
Definition: tool.h:388
TLB_INFO_User
@ TLB_INFO_User
Definition: tool.h:628
TSG_Tool_Type
TSG_Tool_Type
Definition: tool.h:101
CSG_Tool::do_Sync_Projections
virtual bool do_Sync_Projections(void) const
Definition: tool.h:232
SG_SUMMARY_FMT_XML
@ SG_SUMMARY_FMT_XML
Definition: tool.h:95
TLB_INFO_Name
@ TLB_INFO_Name
Definition: tool.h:622
TOOL_INTERACTIVE_MOVE
@ TOOL_INTERACTIVE_MOVE
Definition: tool.h:469
CSG_Tool::Get_References
const CSG_Strings & Get_References(void) const
Definition: tool.cpp:181
TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
@ TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
Definition: tool.h:130
CSG_Tool_Interactive_Base::Get_xPosition
double Get_xPosition(void) const
Definition: tool.h:526
CSG_Tool_Interactive_Base::Execute_Keyboard
bool Execute_Keyboard(int Character, int Keys)
Definition: tool_interactive_base.cpp:141
TSG_Tool_Interactive_Mode
TSG_Tool_Interactive_Mode
Definition: tool.h:458
TSG_Tool_Interactive_DragMode
TSG_Tool_Interactive_DragMode
Definition: tool.h:478
TOOL_INTERACTIVE_RDOWN
@ TOOL_INTERACTIVE_RDOWN
Definition: tool.h:466
CSG_Tool_Grid::Get_Cellarea
double Get_Cellarea(void) const
Definition: tool.h:415
CSG_Tool::Get_Parameters_Count
int Get_Parameters_Count(void) const
Definition: tool.h:183
CSG_Tool::Get_Version
const CSG_String & Get_Version(void) const
Definition: tool.cpp:154
CSG_Tool_Grid::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:393
TLB_INFO_Count
@ TLB_INFO_Count
Definition: tool.h:632
CSG_Tool_Interactive_Base::CSG_Tool_Interactive
friend class CSG_Tool_Interactive
Definition: tool.h:501
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1140
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1518
TLB_INFO_Description
@ TLB_INFO_Description
Definition: tool.h:623
TSG_PFNC_TLB_Get_Info
CSG_String(* TSG_PFNC_TLB_Get_Info)(int i)
Definition: tool.h:638
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const wchar_t *ID) const
Definition: tool.h:190
CSG_Tool_Interactive_Base::Execute_Finish
bool Execute_Finish(void)
Definition: tool_interactive_base.cpp:172
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Parameter
Definition: parameters.h:207
CSG_Tool_Interactive_Base::Set_Drag_Mode
void Set_Drag_Mode(int Drag_Mode)
Definition: tool_interactive_base.cpp:212
SG_SUMMARY_FMT_FLAT
@ SG_SUMMARY_FMT_FLAT
Definition: tool.h:93
CSG_Tool_Interactive_Base::Set_Projection
bool Set_Projection(const CSG_Projection &Projection)
Definition: tool_interactive_base.cpp:102
TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL_FULL
@ TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL_FULL
Definition: tool.h:128
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:165
TSG_Tool_Error
TSG_Tool_Error
Definition: tool.h:112
TOOL_INTERACTIVE_LDOWN
@ TOOL_INTERACTIVE_LDOWN
Definition: tool.h:460
TLB_INFO_File
@ TLB_INFO_File
Definition: tool.h:629
SG_COLORS_DEFAULT
@ SG_COLORS_DEFAULT
Definition: api_core.h:1294
CSG_Tool_Grid_Interactive::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:598
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(void)
Definition: tool.h:181
CSG_Tool_Grid::Lock_Set
void Lock_Set(int x, int y, char Value=1)
Definition: tool.h:434
CSG_Tool_Grid::Get_YMax
double Get_YMax(void) const
Definition: tool.h:413
TOOL_INTERACTIVE_MDCLICK
@ TOOL_INTERACTIVE_MDCLICK
Definition: tool.h:465
CSG_Tool::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool.h:178
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Tool::Get_Library
const CSG_String & Get_Library(void) const
Definition: tool.cpp:115
CSG_Tool_Interactive_Base::Get_yPosition_Last
double Get_yPosition_Last(void) const
Definition: tool.h:531
CSG_Tool::Destroy
virtual void Destroy(void)
Definition: tool.cpp:102
CSG_Tool::Set_Callback
void Set_Callback(bool bActive=true)
Definition: tool.cpp:559
TSG_PFNC_TLB_Finalize
bool(* TSG_PFNC_TLB_Finalize)(void)
Definition: tool.h:675
CSG_Tool::is_Grid
virtual bool is_Grid(void) const
Definition: tool.h:238
TOOL_SCRIPT_CMD_BATCH
@ TOOL_SCRIPT_CMD_BATCH
Definition: tool.h:122
CSG_Tool::Get_Execution_Info
const SG_Char * Get_Execution_Info(void) const
Definition: tool.h:250
TOOL_SCRIPT_PYTHON
@ TOOL_SCRIPT_PYTHON
Definition: tool.h:125
TOOL_TYPE_Grid_Interactive
@ TOOL_TYPE_Grid_Interactive
Definition: tool.h:105
CSG_Tool_Grid_Interactive::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:596
CSG_Tool::Get_ID
const CSG_String & Get_ID(void) const
Definition: tool.h:166
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Tool::is_Progress
bool is_Progress(void) const
Definition: tool.h:240
CSG_Tool_Grid_Interactive::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:600
CSG_Tool_Grid::is_Grid
virtual bool is_Grid(void) const
Definition: tool.h:398
CSG_Tool_Interactive_Base::Get_Drag_Mode
int Get_Drag_Mode(void) const
Definition: tool.h:514
CSG_Strings
Definition: api_core.h:699
CSG_Tool::Update_Parameter_States
bool Update_Parameter_States(void)
Definition: tool.cpp:1281
CSG_Tool::On_Execute
virtual bool On_Execute(void)=0
TOOL_ERROR_Calculation
@ TOOL_ERROR_Calculation
Definition: tool.h:114
CSG_Tool_Interactive_Base::Get_Position
const CSG_Point & Get_Position(void) const
Definition: tool.h:525
CSG_Tool_Grid::Get_xTo
static int Get_xTo(int i, int x=0)
Definition: tool.h:422
CSG_Tool::Get_File_Name
const CSG_String & Get_File_Name(void) const
Definition: tool.cpp:121
TOOL_INTERACTIVE_KEY_ALT
#define TOOL_INTERACTIVE_KEY_ALT
Definition: tool.h:491
parameters.h
CSG_Grid_System::Get_yFrom
static int Get_yFrom(int Direction, int y=0)
Definition: grid.h:341
TOOL_INTERACTIVE_UNDEFINED
@ TOOL_INTERACTIVE_UNDEFINED
Definition: tool.h:459
CSG_Tool_Chain
Definition: tool_chain.h:78
CSG_Projection
Definition: geo_tools.h:824
CSG_Tool_Grid::is_Locked
bool is_Locked(int x, int y)
Definition: tool.h:431
TLB_INFO_Author
@ TLB_INFO_Author
Definition: tool.h:624
CSG_Tool::Reset_Grid_System
bool Reset_Grid_System(void)
Definition: tool.cpp:1243
CSG_Tool_Grid::is_InGrid
bool is_InGrid(int x, int y, int Rand) const
Definition: tool.h:420
TOOL_INTERACTIVE_MOVE_LDOWN
@ TOOL_INTERACTIVE_MOVE_LDOWN
Definition: tool.h:470
TOOL_TYPE_Interactive
@ TOOL_TYPE_Interactive
Definition: tool.h:103
CSG_Tool_Interactive_Base::CSG_Tool_Grid_Interactive
friend class CSG_Tool_Grid_Interactive
Definition: tool.h:502
CSG_Tool_Chain::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool_chain.h:99
TOOL_SCRIPT_PYTHON_WRAP_NAME
@ TOOL_SCRIPT_PYTHON_WRAP_NAME
Definition: tool.h:126
SG_Char
#define SG_Char
Definition: api_core.h:536
TOOL_INTERACTIVE_MUP
@ TOOL_INTERACTIVE_MUP
Definition: tool.h:464
TSG_PFNC_TLB_Initialize
bool(* TSG_PFNC_TLB_Initialize)(const SG_Char *)
Definition: tool.h:672
CSG_String
Definition: api_core.h:563
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Tool::Get_Author
const CSG_String & Get_Author(void) const
Definition: tool.cpp:143
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:570
CSG_Data_Manager
Definition: data_manager.h:129
CSG_MetaData
Definition: metadata.h:88
TOOL_INTERACTIVE_LUP
@ TOOL_INTERACTIVE_LUP
Definition: tool.h:461
TOOL_INTERACTIVE_MOVE_MDOWN
@ TOOL_INTERACTIVE_MOVE_MDOWN
Definition: tool.h:471
TOOL_INTERACTIVE_RDCLICK
@ TOOL_INTERACTIVE_RDCLICK
Definition: tool.h:468
CSG_Tool::Get_Description
const CSG_String & Get_Description(void) const
Definition: tool.cpp:165
CSG_Tool_Grid::Get_NX
int Get_NX(void) const
Definition: tool.h:407
CSG_Tool_Interactive_Base
Definition: tool.h:500
TOOL_TYPE_Base
@ TOOL_TYPE_Base
Definition: tool.h:102
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const CSG_String &ID) const
Definition: tool.h:188
CSG_Tool_Grid::Get_XMin
double Get_XMin(void) const
Definition: tool.h:410
CSG_Tool::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:239
TOOL_SCRIPT_PYTHON_WRAP_ID
@ TOOL_SCRIPT_PYTHON_WRAP_ID
Definition: tool.h:129
CSG_Grid_System::Get_xFrom
static int Get_xFrom(int Direction, int x=0)
Definition: grid.h:340
CSG_Tool_Interactive::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:574
TOOL_INTERACTIVE_DRAG_CIRCLE
@ TOOL_INTERACTIVE_DRAG_CIRCLE
Definition: tool.h:482
CSG_Tool_Grid_Interactive
Definition: tool.h:591
CSG_Grid
Definition: grid.h:475
CSG_Tool_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: tool.h:395
CSG_Tool::CSG_Tool
CSG_Tool(void)
Definition: tool.cpp:67
TSG_PFNC_Parameter_Changed
int(* TSG_PFNC_Parameter_Changed)(CSG_Parameter *pParameter, int Flags)
Definition: parameters.h:1686
TSG_PFNC_TLB_Create_Tool
CSG_Tool *(* TSG_PFNC_TLB_Create_Tool)(int i)
Definition: tool.h:637
TOOL_SCRIPT_CMD_USAGE
@ TOOL_SCRIPT_CMD_USAGE
Definition: tool.h:123
TOOL_INTERACTIVE_DRAG_BOX
@ TOOL_INTERACTIVE_DRAG_BOX
Definition: tool.h:481
CSG_Tool_Grid::Get_NCells
sLong Get_NCells(void) const
Definition: tool.h:409
TSG_Tool_Script_Type
TSG_Tool_Script_Type
Definition: tool.h:120
CSG_Tool_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: tool.h:414
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:245
CSG_Tool_Interactive_Base::is_Alt
bool is_Alt(void) const
Definition: tool.h:534
CSG_Tool_Interactive::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:570
CSG_Parameters
Definition: parameters.h:1690
TSG_TLB_Info
TSG_TLB_Info
Definition: tool.h:621
TOOL_INTERACTIVE_MOVE_RDOWN
@ TOOL_INTERACTIVE_MOVE_RDOWN
Definition: tool.h:472
TSG_Summary_Format
TSG_Summary_Format
Definition: tool.h:92
CSG_Tool::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:164
CSG_Tool::Get_Icon
const SG_Char * Get_Icon(void)
Definition: tool.h:175
TLB_Interface
CSG_Tool_Library_Interface TLB_Interface
TOOL_INTERACTIVE_KEY_SHIFT
#define TOOL_INTERACTIVE_KEY_SHIFT
Definition: tool.h:490
CSG_Tool_Library_Manager
Definition: tool_library.h:184
CSG_Colors
Definition: api_core.h:1338
TLB_INFO_Menu_Path
@ TLB_INFO_Menu_Path
Definition: tool.h:626
TOOL_TYPE_Grid
@ TOOL_TYPE_Grid
Definition: tool.h:104
TOOL_INTERACTIVE_MDOWN
@ TOOL_INTERACTIVE_MDOWN
Definition: tool.h:463
CSG_Tool_Grid::Get_xFrom
static int Get_xFrom(int i, int x=0)
Definition: tool.h:424
CSG_Tool_Interactive_Base::On_Execute_Position
virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode)
Definition: tool_interactive_base.cpp:135