SAGA API  v9.9
parameters.cpp
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 // parameters.cpp //
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 #include "parameters.h"
54 #include "data_manager.h"
55 #include "tool.h"
56 
57 
59 // //
60 // //
61 // //
63 
64 //---------------------------------------------------------
66 {
67  _On_Construction();
68 }
69 
70 //---------------------------------------------------------
72 {
73  _On_Construction();
74 
75  Create(Parameters);
76 }
77 
78 //---------------------------------------------------------
79 CSG_Parameters::CSG_Parameters(const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
80 {
81  _On_Construction();
82 
83  Create(Name, Description, Identifier, bGrid_System);
84 }
85 
86 //---------------------------------------------------------
87 CSG_Parameters::CSG_Parameters(void *pOwner, const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
88 {
89  _On_Construction();
90 
91  Create(pOwner, Name, Description, Identifier, bGrid_System);
92 }
93 
94 //---------------------------------------------------------
96 {
97  Destroy();
98 }
99 
100 
102 // //
104 
105 //---------------------------------------------------------
106 void CSG_Parameters::_On_Construction(void)
107 {
108  m_pOwner = NULL;
109  m_pTool = NULL;
110  m_pManager = &SG_Get_Data_Manager();
111 
112  m_Callback = NULL;
113  m_bCallback = true;
114 
115  m_Parameters = NULL;
116  m_nParameters = 0;
117 
118  m_pGrid_System = NULL;
119 
120  m_pStack = NULL;
121 }
122 
123 //---------------------------------------------------------
124 bool CSG_Parameters::Create(const CSG_Parameters &Parameters)
125 {
126  Destroy();
127 
128  Set_Identifier (Parameters.Get_Identifier ());
129  Set_Name (Parameters.Get_Name ());
130  Set_Description(Parameters.Get_Description());
131 
132  m_pOwner = Parameters.m_pOwner;
133  m_pTool = Parameters.m_pTool;
134  m_pManager = Parameters.m_pManager;
135 
136  m_Callback = Parameters.m_Callback;
137  m_bCallback = Parameters.m_bCallback;
138 
139  for(int i=0; i<Parameters.m_nParameters; i++)
140  {
141  _Add(Parameters.m_Parameters[i]);
142  }
143 
144  if( Parameters.m_pGrid_System )
145  {
146  m_pGrid_System = Get_Parameter(Parameters.m_pGrid_System->Get_Identifier());
147  }
148 
149  return( m_nParameters == Parameters.m_nParameters );
150 }
151 
152 //---------------------------------------------------------
153 bool CSG_Parameters::Create(const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
154 {
155  Destroy();
156 
157  Set_Identifier (Identifier);
158  Set_Name (Name);
159  Set_Description(Description ? Description : SG_T(""));
160 
161  if( bGrid_System )
162  {
163  Use_Grid_System();
164  }
165 
166  return( true );
167 }
168 
169 //---------------------------------------------------------
170 bool CSG_Parameters::Create(void *pOwner, const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
171 {
172  if( Create(Name, Description, Identifier, bGrid_System) )
173  {
174  m_pOwner = pOwner;
175 
176  return( true );
177  }
178 
179  return( false );
180 }
181 
182 //---------------------------------------------------------
184 {
185  Pop();
186 
187  m_pOwner = NULL;
188  m_pTool = NULL;
189  m_pGrid_System = NULL;
190 
191  Del_Parameters();
192 
193  m_References.Clear();
194 }
195 
196 
198 // //
200 
201 //---------------------------------------------------------
203 {
204  m_pTool = pTool;
205 
206  for(int i=0; i<Get_Count(); i++)
207  {
208  if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters )
209  {
210  m_Parameters[i]->asParameters()->Set_Tool(pTool);
211  }
212  }
213 }
214 
215 //---------------------------------------------------------
222 //---------------------------------------------------------
224 {
225  m_pManager = pManager;
226 
227  for(int i=0; i<Get_Count(); i++)
228  {
229  if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters )
230  {
231  m_Parameters[i]->asParameters()->Set_Manager(pManager);
232  }
233  }
234 }
235 
236 //---------------------------------------------------------
240 //---------------------------------------------------------
242 {
243  if( !m_pGrid_System )
244  {
245  m_pGrid_System = Add_Grid_System("", "PARAMETERS_GRID_SYSTEM", _TL("Grid System"), _TL(""));
246 
247  return( true );
248  }
249 
250  return( false );
251 }
252 
253 
254 //---------------------------------------------------------
261 //---------------------------------------------------------
262 bool CSG_Parameters::Push(CSG_Data_Manager *pManager, bool bRestoreDefaults)
263 {
264  CSG_Parameters *pStack = m_pStack;
265 
266  m_pStack = new CSG_Parameters(*this);
267 
268  m_pStack->m_pStack = pStack;
269 
270  m_pManager = pManager;
271 
272  if( bRestoreDefaults )
273  {
274  Restore_Defaults(true);
275  }
276 
277  return( true );
278 }
279 
280 //---------------------------------------------------------
284 //---------------------------------------------------------
286 {
287  if( m_pStack )
288  {
289  m_pManager = m_pStack->m_pManager;
290 
291  Assign_Values(m_pStack);
292 
293  CSG_Parameters *pStack = m_pStack->m_pStack;
294 
295  delete( m_pStack );
296 
297  m_pStack = pStack;
298 
299  return( true );
300  }
301 
302  return( false );
303 }
304 
305 //---------------------------------------------------------
310 //---------------------------------------------------------
311 bool CSG_Parameters::has_GUI(void) const
312 {
313  return( Get_Tool() ? Get_Tool()->has_GUI() : (Get_Owner() && SG_UI_Get_Window_Main()) );
314 }
315 
316 //---------------------------------------------------------
320 //---------------------------------------------------------
322 {
323  m_Identifier = Identifier;
324 }
325 
326 //---------------------------------------------------------
330 //---------------------------------------------------------
331 bool CSG_Parameters::Cmp_Identifier(const CSG_String &Identifier) const
332 {
333  return( m_Identifier.Cmp(Identifier) == 0 );
334 }
335 
336 //---------------------------------------------------------
340 //---------------------------------------------------------
342 {
343  m_Name = Name;
344 }
345 
346 //---------------------------------------------------------
350 //---------------------------------------------------------
352 {
353  m_Description = Description;
354 }
355 
356 //---------------------------------------------------------
360 //---------------------------------------------------------
361 void CSG_Parameters::Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link, const SG_Char *Link_Text)
362 {
363  CSG_String Reference("<b>" + Authors + " (" + Year + "):</b> " + Title + ". " + Where);
364 
365  if( Link && *Link )
366  {
367  Reference += CSG_String::Format(" <a href=\"%s\">%s</a>.", Link, Link_Text && *Link_Text ? Link_Text : Link);
368  }
369 
370  if( !Reference.is_Empty() )
371  {
372  m_References += Reference;
373  }
374 
375  m_References.Sort();
376 }
377 
378 //---------------------------------------------------------
382 //---------------------------------------------------------
383 void CSG_Parameters::Add_Reference(const CSG_String &Link, const SG_Char *Link_Text)
384 {
385  m_References += CSG_String::Format("<a href=\"%s\">%s</a>", Link.c_str(), Link_Text && *Link_Text ? Link_Text : Link.c_str());
386 
387  m_References.Sort();
388 }
389 
390 //---------------------------------------------------------
394 //---------------------------------------------------------
396 {
397  m_References.Clear();
398 }
399 
400 //---------------------------------------------------------
404 //---------------------------------------------------------
405 void CSG_Parameters::Set_Enabled(bool bEnabled)
406 {
407  for(int i=0; i<m_nParameters; i++)
408  {
409  m_Parameters[i]->Set_Enabled(bEnabled);
410  }
411 }
412 
413 //---------------------------------------------------------
417 //---------------------------------------------------------
418 void CSG_Parameters::Set_Enabled(const CSG_String &Identifier, bool bEnabled)
419 {
420  CSG_Parameter *pParameter = Get_Parameter(Identifier);
421 
422  if( pParameter )
423  {
424  pParameter->Set_Enabled(bEnabled);
425  }
426 }
427 
428 
430 // //
432 
433 //---------------------------------------------------------
435 {
436  return( _Add(pParameter) );
437 }
438 
439 //---------------------------------------------------------
440 CSG_Parameter * CSG_Parameters::Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bCollapsed)
441 {
442  return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Node, bCollapsed ? PARAMETER_GUI_COLLAPSED|PARAMETER_INFORMATION : PARAMETER_INFORMATION) );
443 }
444 
445 //---------------------------------------------------------
454 CSG_Parameter * CSG_Parameters::Add_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
455 {
456  return( _Add_Value(ParentID, ID, Name, Description, false, Type, Value, Minimum, bMinimum, Maximum, bMaximum) );
457 }
458 
459 CSG_Parameter * CSG_Parameters::Add_Info_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value)
460 {
461  return( _Add_Value(ParentID, ID, Name, Description, true, Type, Value, 0.0, false, 0.0, false) );
462 }
463 
464 //---------------------------------------------------------
465 CSG_Parameter * CSG_Parameters::Add_Bool (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value)
466 {
467  return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Bool , Value ? 1.0 : 0.0) );
468 }
469 
470 CSG_Parameter * CSG_Parameters::Add_Int (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value, int Minimum, bool bMinimum, int Maximum, bool bMaximum)
471 {
472  return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Int , Value, Minimum, bMinimum, Maximum, bMaximum) );
473 }
474 
475 CSG_Parameter * CSG_Parameters::Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
476 {
477  return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Double, Value, Minimum, bMinimum, Maximum, bMaximum) );
478 }
479 
480 CSG_Parameter * CSG_Parameters::Add_Degree(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
481 {
482  return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Degree, Value, Minimum, bMinimum, Maximum, bMaximum) );
483 }
484 
485 CSG_Parameter * CSG_Parameters::Add_Date (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value) // Julian Day Number
486 {
487  if( !Value )
488  {
489  Value = CSG_DateTime::Now().Get_JDN();
490  }
491 
492  return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Date , Value) );
493 }
494 
495 CSG_Parameter * CSG_Parameters::Add_Color (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value)
496 {
497  return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Color , Value) );
498 }
499 
500 //---------------------------------------------------------
501 CSG_Parameter * CSG_Parameters::Add_Range (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min, double Range_Max, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
502 {
503  return( _Add_Range(ParentID, ID, Name, Description, false, Range_Min, Range_Max, Minimum, bMinimum, Maximum, bMaximum) );
504 }
505 
506 CSG_Parameter * CSG_Parameters::Add_Info_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min, double Range_Max)
507 {
508  return( _Add_Range(ParentID, ID, Name, Description, true, Range_Min, Range_Max, 0.0, false, 0.0, false) );
509 }
510 
511 //---------------------------------------------------------
520 //---------------------------------------------------------
521 CSG_Parameter * CSG_Parameters::Add_Data_Type(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Data_Types, TSG_Data_Type Default, const CSG_String &User)
522 {
523  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Data_Type, 0);
524 
525  bool bCallback = Set_Callback(false);
526  pParameter->asDataType()->Set_Data_Types(Data_Types, Default, User);
527  Set_Callback(bCallback);
528 
529  return( pParameter );
530 }
531 
532 //---------------------------------------------------------
533 CSG_Parameter * CSG_Parameters::Add_Choice(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default)
534 {
535  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Choice, 0);
536 
537  pParameter->asChoice()->Set_Items(Items);
538 
539  bool bCallback = Set_Callback(false);
540  pParameter->Set_Value (Default);
541  pParameter->Set_Default(Default);
542  Set_Callback(bCallback);
543 
544  return( pParameter );
545 }
546 
547 //---------------------------------------------------------
548 CSG_Parameter * CSG_Parameters::Add_Choices(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items)
549 {
550  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Choices, 0);
551 
552  pParameter->asChoices()->Set_Items(Items);
553 
554  return( pParameter );
555 }
556 
557 //---------------------------------------------------------
558 CSG_Parameter * CSG_Parameters::Add_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText, bool bPassword)
559 {
560  return( _Add_String(ParentID, ID, Name, Description, false, String, bLongText, bPassword) );
561 }
562 
563 CSG_Parameter * CSG_Parameters::Add_Info_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText)
564 {
565  return( _Add_String(ParentID, ID, Name, Description, true, String, bLongText, false) );
566 }
567 
568 //---------------------------------------------------------
569 CSG_Parameter * CSG_Parameters::Add_FilePath(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter, const SG_Char *Default, bool bSave, bool bDirectory, bool bMultiple)
570 {
571  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_FilePath, 0);
572 
573  pParameter->asFilePath()->Set_Filter (Filter );
574  pParameter->asFilePath()->Set_Flag_Save (bSave );
575  pParameter->asFilePath()->Set_Flag_Multiple (bMultiple );
576  pParameter->asFilePath()->Set_Flag_Directory(bDirectory);
577 
578  bool bCallback = Set_Callback(false);
579  pParameter->Set_Value (Default);
580  pParameter->Set_Default(Default);
581  Set_Callback(bCallback);
582 
583  return( pParameter );
584 }
585 
586 //---------------------------------------------------------
587 CSG_Parameter * CSG_Parameters::Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Palette, int nColors, bool bRevert)
588 {
589  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Colors, 0);
590 
591  pParameter->asColors()->Create(nColors, Palette, bRevert);
592 
593  return( pParameter );
594 }
595 
596 CSG_Parameter * CSG_Parameters::Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit)
597 {
598  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Colors, 0);
599 
600  if( pInit )
601  {
602  pParameter->asColors()->Create(*pInit);
603  }
604 
605  return( pParameter );
606 }
607 
608 //---------------------------------------------------------
609 CSG_Parameter * CSG_Parameters::Add_Font(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit)
610 {
611  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Font, 0);
612 
613  if( pInit && *pInit )
614  {
615  bool bCallback = Set_Callback(false);
616  pParameter->Set_Value (pInit);
617  pParameter->Set_Default(pInit);
618  Set_Callback(bCallback);
619  }
620 
621  return( pParameter );
622 }
623 
624 //---------------------------------------------------------
625 CSG_Parameter * CSG_Parameters::Add_FixedTable(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pTemplate)
626 {
627  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_FixedTable, 0);
628 
629  pParameter->asTable()->Create(pTemplate);
630  pParameter->asTable()->Set_Name(Name);
631  pParameter->asTable()->Assign_Values(pTemplate);
632 
633  return( pParameter );
634 }
635 
636 
638 // //
640 
641 //---------------------------------------------------------
642 CSG_Parameter * CSG_Parameters::Add_Grid_Resampling(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_Resampling Methods, CSG_Grid_Resampling Default)
643 {
644  CSG_String Choices; int Choice = 0, nChoices = 0;
645 
646  #define ADD_METHOD(method, name) if( ((int)Methods & (int)method) != 0 ) { if( !Choices.is_Empty() ){ Choices += "|"; } Choices += CSG_String::Format("{%d}", (int)method); Choices += name; if( method == Default ) { Choice = nChoices; } nChoices++; }
647 
648  ADD_METHOD(CSG_Grid_Resampling::NearestNeighbour, _TL("Nearest Neighbour"));
649  ADD_METHOD(CSG_Grid_Resampling::Bilinear , _TL("Bilinear"));
650  ADD_METHOD(CSG_Grid_Resampling::Bicubic_1 , CSG_String::Format("%s 1", _TL("Cubic")));
651  ADD_METHOD(CSG_Grid_Resampling::Bicubic_2 , CSG_String::Format("%s 2", _TL("Cubic")));
652  ADD_METHOD(CSG_Grid_Resampling::Mean_Nodes , _TL("Mean Value"));
653  ADD_METHOD(CSG_Grid_Resampling::Mean_Cells , _TL("Mean Value (cell area weighted)"));
654  ADD_METHOD(CSG_Grid_Resampling::Minimum , _TL("Minimum Value"));
655  ADD_METHOD(CSG_Grid_Resampling::Maximum , _TL("Maximum Value"));
656  ADD_METHOD(CSG_Grid_Resampling::Majority , _TL("Majority"));
657 
658  //-----------------------------------------------------
659  if( nChoices > 0 )
660  {
661  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Choice, 0);
662 
663  pParameter->asChoice()->Set_Items(Choices);
664 
665  bool bCallback = Set_Callback(false);
666  pParameter->Set_Value (Choice);
667  pParameter->Set_Default(Choice);
668  Set_Callback(bCallback);
669 
670  return( pParameter );
671  }
672 
673  return( NULL );
674 }
675 
676 //---------------------------------------------------------
677 CSG_Parameter * CSG_Parameters::Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit)
678 {
679  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Grid_System, 0);
680 
681  if( pInit )
682  {
683  pParameter->asGrid_System()->Assign(*pInit);
684  }
685 
686  return( pParameter );
687 }
688 
689 //---------------------------------------------------------
690 CSG_Parameter * CSG_Parameters::Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent, TSG_Data_Type Preferred_Type)
691 {
692  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
693 
694  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
695  {
696  SystemID = pParent->Get_Identifier();
697  }
698  else if( bSystem_Dependent && m_pGrid_System )
699  {
700  SystemID = m_pGrid_System->Get_Identifier();
701  }
702  else
703  {
704  pParent = Add_Grid_System(pParent ? pParent->Get_Identifier() : SG_T(""), ID + "_GRIDSYSTEM", _TL("Grid system"), "");
705  SystemID = pParent->Get_Identifier();
706  }
707 
708  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grid, Constraint);
709 
710  ((CSG_Parameter_Grid *)pParameter)->Set_Preferred_Type(Preferred_Type);
711 
712  return( pParameter );
713 }
714 
715 //---------------------------------------------------------
716 CSG_Parameter * CSG_Parameters::Add_Grid_or_Const(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum, bool bSystem_Dependent)
717 {
718  CSG_Parameter *pParameter = Add_Grid(ParentID, ID, Name, Description, PARAMETER_INPUT_OPTIONAL, bSystem_Dependent);
719 
720  ((CSG_Parameter_Grid *)pParameter)->Add_Default(Value, Minimum, bMinimum, Maximum, bMaximum);
721 
722  return( pParameter );
723 }
724 
725 //---------------------------------------------------------
726 CSG_Parameter * CSG_Parameters::Add_Grid_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
727 {
728  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
729 
730  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Grid);
731 
732  return( pParameter );
733 }
734 
735 //---------------------------------------------------------
736 CSG_Parameter * CSG_Parameters::Add_Grid_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent)
737 {
738  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
739 
740  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
741  {
742  SystemID = pParent->Get_Identifier();
743  }
744  else if( bSystem_Dependent && m_pGrid_System && !((Constraint & PARAMETER_OUTPUT) && (Constraint & PARAMETER_OPTIONAL)) )
745  {
746  SystemID = m_pGrid_System->Get_Identifier();
747  }
748 
749  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grid_List, Constraint);
750 
751  return( pParameter );
752 }
753 
754 
756 // //
758 
759 //---------------------------------------------------------
760 CSG_Parameter * CSG_Parameters::Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent, TSG_Data_Type Preferred_Type)
761 {
762  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
763 
764  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
765  {
766  SystemID = pParent->Get_Identifier();
767  }
768  else if( bSystem_Dependent && m_pGrid_System )
769  {
770  SystemID = m_pGrid_System->Get_Identifier();
771  }
772  else
773  {
774  pParent = Add_Grid_System(pParent ? pParent->Get_Identifier() : SG_T(""), ID + "_GRIDSYSTEM", _TL("Grid system"), "");
775  SystemID = pParent->Get_Identifier();
776  }
777 
778  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grids, Constraint);
779 
780  ((CSG_Parameter_Grids *)pParameter)->Set_Preferred_Type(Preferred_Type);
781 
782  return( pParameter );
783 }
784 
785 //---------------------------------------------------------
786 CSG_Parameter * CSG_Parameters::Add_Grids_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
787 {
788  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
789 
790  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Grids);
791 
792  return( pParameter );
793 }
794 
795 //---------------------------------------------------------
796 CSG_Parameter * CSG_Parameters::Add_Grids_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent)
797 {
798  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
799 
800  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
801  {
802  SystemID = pParent->Get_Identifier();
803  }
804  else if( bSystem_Dependent && m_pGrid_System && !((Constraint & PARAMETER_OUTPUT) && (Constraint & PARAMETER_OPTIONAL)) )
805  {
806  SystemID = m_pGrid_System->Get_Identifier();
807  }
808 
809  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grids_List, Constraint);
810 
811  return( pParameter );
812 }
813 
814 
816 // //
818 
819 //---------------------------------------------------------
820 CSG_Parameter * CSG_Parameters::Add_Table_Field(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone)
821 {
822  CSG_Parameter *pParent = Get_Parameter(ParentID);
823 
824  if( pParent && (
825  pParent->Get_Type() == PARAMETER_TYPE_Table
826  || pParent->Get_Type() == PARAMETER_TYPE_Shapes
827  || pParent->Get_Type() == PARAMETER_TYPE_TIN
828  || pParent->Get_Type() == PARAMETER_TYPE_PointCloud) )
829  {
830  return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_Field, bAllowNone ? PARAMETER_OPTIONAL : 0) );
831  }
832 
833  return( NULL );
834 }
835 
836 //---------------------------------------------------------
837 CSG_Parameter * CSG_Parameters::Add_Table_Field_or_Const(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
838 {
839  CSG_Parameter *pParameter = Add_Table_Field(ParentID, ID, Name, Description, true);
840 
841  if( pParameter )
842  {
843  ((CSG_Parameter_Table_Field *)pParameter)->Add_Default(Value, Minimum, bMinimum, Maximum, bMaximum);
844  }
845 
846  return( pParameter );
847 }
848 
849 //---------------------------------------------------------
850 CSG_Parameter * CSG_Parameters::Add_Table_Fields(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
851 {
852  CSG_Parameter *pParent = Get_Parameter(ParentID);
853 
854  if( pParent && (
855  pParent->Get_Type() == PARAMETER_TYPE_Table
856  || pParent->Get_Type() == PARAMETER_TYPE_Shapes
857  || pParent->Get_Type() == PARAMETER_TYPE_TIN
858  || pParent->Get_Type() == PARAMETER_TYPE_PointCloud) )
859  {
860  return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_Fields, 0) );
861  }
862 
863  return( NULL );
864 }
865 
866 //---------------------------------------------------------
867 CSG_Parameter * CSG_Parameters::Add_Table(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
868 {
869  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table, Constraint);
870 
871  return( pParameter );
872 }
873 
874 //---------------------------------------------------------
875 CSG_Parameter * CSG_Parameters::Add_Table_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
876 {
877  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
878 
879  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Table);
880 
881  return( pParameter );
882 }
883 
884 //---------------------------------------------------------
885 CSG_Parameter * CSG_Parameters::Add_Table_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
886 {
887  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_List, Constraint);
888 
889  return( pParameter );
890 }
891 
892 
894 // //
896 
897 //---------------------------------------------------------
898 CSG_Parameter * CSG_Parameters::Add_Shapes(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type)
899 {
900  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Shapes, Constraint);
901 
902  ((CSG_Parameter_Shapes *)pParameter)->Set_Shape_Type(Shape_Type);
903 
904  return( pParameter );
905 }
906 
907 //---------------------------------------------------------
908 CSG_Parameter * CSG_Parameters::Add_Shapes_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
909 {
910  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
911 
912  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Shapes);
913 
914  return( pParameter );
915 }
916 
917 //---------------------------------------------------------
918 CSG_Parameter * CSG_Parameters::Add_Shapes_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Type)
919 {
920  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Shapes_List, Constraint);
921 
922  ((CSG_Parameter_Shapes_List *)pParameter)->Set_Shape_Type(Type);
923 
924  return( pParameter );
925 }
926 
927 
929 // //
931 
932 //---------------------------------------------------------
933 CSG_Parameter * CSG_Parameters::Add_TIN(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
934 {
935  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_TIN, Constraint);
936 
937  return( pParameter );
938 }
939 
940 //---------------------------------------------------------
941 CSG_Parameter * CSG_Parameters::Add_TIN_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
942 {
943  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
944 
945  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_TIN);
946 
947  return( pParameter );
948 }
949 
950 //---------------------------------------------------------
951 CSG_Parameter * CSG_Parameters::Add_TIN_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
952 {
953  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_TIN_List, Constraint);
954 
955  return( pParameter );
956 }
957 
958 
960 // //
962 
963 //---------------------------------------------------------
964 CSG_Parameter * CSG_Parameters::Add_PointCloud(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
965 {
966  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_PointCloud, Constraint);
967 
968  return( pParameter );
969 }
970 
971 //---------------------------------------------------------
972 CSG_Parameter * CSG_Parameters::Add_PointCloud_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
973 {
974  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
975 
976  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_PointCloud);
977 
978  return( pParameter );
979 }
980 
981 //---------------------------------------------------------
982 CSG_Parameter * CSG_Parameters::Add_PointCloud_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
983 {
984  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_PointCloud_List, Constraint);
985 
986  return( pParameter );
987 }
988 
989 
991 // //
993 
994 //---------------------------------------------------------
995 CSG_Parameter * CSG_Parameters::Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
996 {
997  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Parameters, 0);
998 
999  pParameter->asParameters()->m_Callback = m_Callback;
1000  pParameter->asParameters()->m_pTool = m_pTool;
1001 
1002  return( pParameter );
1003 }
1004 
1005 
1007 // //
1009 
1010 //---------------------------------------------------------
1011 CSG_Parameter * CSG_Parameters::_Add_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, TSG_Parameter_Type Type, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
1012 {
1013  switch( Type ) // Check if Type is valid...
1014  {
1015  case PARAMETER_TYPE_Bool :
1016  case PARAMETER_TYPE_Int :
1017  case PARAMETER_TYPE_Double:
1018  case PARAMETER_TYPE_Degree:
1019  case PARAMETER_TYPE_Date :
1020  case PARAMETER_TYPE_Color :
1021  break;
1022 
1023  default: // if not valid set Type to [double]...
1024  Type = PARAMETER_TYPE_Double;
1025  }
1026 
1027  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, Type, bInformation ? PARAMETER_INFORMATION : 0);
1028 
1029  bool bCallback = Set_Callback(false);
1030 
1031  if( !bInformation )
1032  {
1033  if( Type == PARAMETER_TYPE_Int
1034  || Type == PARAMETER_TYPE_Double
1035  || Type == PARAMETER_TYPE_Degree )
1036  {
1037  pParameter->asValue()->Set_Minimum(Minimum, bMinimum);
1038  pParameter->asValue()->Set_Maximum(Maximum, bMaximum);
1039  }
1040  }
1041 
1042  pParameter->Set_Value(Value);
1043 
1044  Set_Callback(bCallback);
1045 
1046  if( !bInformation )
1047  {
1048  switch( Type )
1049  {
1050  case PARAMETER_TYPE_Bool :
1051  case PARAMETER_TYPE_Int :
1052  case PARAMETER_TYPE_Color :
1053  pParameter->Set_Default((int)Value);
1054  break;
1055 
1056  case PARAMETER_TYPE_Date :
1057  pParameter->Set_Default(pParameter->asString());
1058  break;
1059 
1060  default:
1061  pParameter->Set_Default( Value);
1062  }
1063  }
1064 
1065  return( pParameter );
1066 }
1067 
1068 //---------------------------------------------------------
1069 CSG_Parameter * CSG_Parameters::_Add_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, double Default_Min, double Default_Max, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
1070 {
1071  //-----------------------------------------------------
1072  if( Default_Min > Default_Max )
1073  {
1074  double d = Default_Min;
1075  Default_Min = Default_Max;
1076  Default_Max = d;
1077  }
1078 
1079  //-----------------------------------------------------
1080  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Range, bInformation ? PARAMETER_INFORMATION : 0);
1081 
1082  pParameter->asRange()->Get_Min_Parameter()->Set_Minimum(Minimum, bMinimum);
1083  pParameter->asRange()->Get_Min_Parameter()->Set_Maximum(Maximum, bMaximum);
1084  pParameter->asRange()->Get_Min_Parameter()->Set_Default(Default_Min);
1085  pParameter->asRange()->Set_Min(Default_Min);
1086 
1087  pParameter->asRange()->Get_Max_Parameter()->Set_Minimum(Minimum, bMinimum);
1088  pParameter->asRange()->Get_Max_Parameter()->Set_Maximum(Maximum, bMaximum);
1089  pParameter->asRange()->Get_Max_Parameter()->Set_Default(Default_Max);
1090  pParameter->asRange()->Set_Max(Default_Max);
1091 
1092  return( pParameter );
1093 }
1094 
1095 //---------------------------------------------------------
1096 CSG_Parameter * CSG_Parameters::_Add_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, const SG_Char *String, bool bLongText, bool bPassword)
1097 {
1098  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, bLongText ? PARAMETER_TYPE_Text : PARAMETER_TYPE_String, bInformation ? PARAMETER_INFORMATION : 0);
1099 
1100  bool bCallback = Set_Callback(false);
1101  pParameter->Set_Value (String);
1102  pParameter->Set_Default(String);
1103  Set_Callback(bCallback);
1104 
1105  ((CSG_Parameter_String *)pParameter)->Set_Password(bPassword);
1106 
1107  return( pParameter );
1108 }
1109 
1110 
1112 // //
1114 
1115 //---------------------------------------------------------
1116 #ifdef _DEBUG
1117 #include <wx/debug.h>
1118 #include <wx/string.h>
1119 #endif
1120 
1121 //---------------------------------------------------------
1122 CSG_Parameter * CSG_Parameters::_Add(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, int Constraint)
1123 {
1124 #ifdef _DEBUG
1125  wxASSERT_MSG(!ID.is_Empty() , wxString::Format("CSG_Parameter::_Add(): Parameter ID is empty!"));
1126  wxASSERT_MSG(!Get_Parameter(ID), wxString::Format("CSG_Parameter::_Add(): Parameter ID \"%s\" is already in use!", ID.c_str()));
1127 #endif
1128 
1129  CSG_Parameter *pParameter;
1130 
1131  switch( Type )
1132  {
1133  default:
1134  return( NULL );
1135 
1136  case PARAMETER_TYPE_Node : pParameter = new CSG_Parameter_Node (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1137 
1138  case PARAMETER_TYPE_Bool : pParameter = new CSG_Parameter_Bool (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1139  case PARAMETER_TYPE_Int : pParameter = new CSG_Parameter_Int (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1140  case PARAMETER_TYPE_Double : pParameter = new CSG_Parameter_Double (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1141  case PARAMETER_TYPE_Degree : pParameter = new CSG_Parameter_Degree (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1142  case PARAMETER_TYPE_Date : pParameter = new CSG_Parameter_Date (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1143  case PARAMETER_TYPE_Range : pParameter = new CSG_Parameter_Range (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1144  case PARAMETER_TYPE_Data_Type : pParameter = new CSG_Parameter_Data_Type (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1145  case PARAMETER_TYPE_Choice : pParameter = new CSG_Parameter_Choice (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1146  case PARAMETER_TYPE_Choices : pParameter = new CSG_Parameter_Choices (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1147 
1148  case PARAMETER_TYPE_String : pParameter = new CSG_Parameter_String (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1149  case PARAMETER_TYPE_Text : pParameter = new CSG_Parameter_Text (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1150  case PARAMETER_TYPE_FilePath : pParameter = new CSG_Parameter_File_Name (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1151 
1152  case PARAMETER_TYPE_Font : pParameter = new CSG_Parameter_Font (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1153  case PARAMETER_TYPE_Color : pParameter = new CSG_Parameter_Color (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1154  case PARAMETER_TYPE_Colors : pParameter = new CSG_Parameter_Colors (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1155  case PARAMETER_TYPE_FixedTable : pParameter = new CSG_Parameter_Fixed_Table (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1156  case PARAMETER_TYPE_Grid_System : pParameter = new CSG_Parameter_Grid_System (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1157  case PARAMETER_TYPE_Table_Field : pParameter = new CSG_Parameter_Table_Field (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1158  case PARAMETER_TYPE_Table_Fields : pParameter = new CSG_Parameter_Table_Fields (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1159 
1160  case PARAMETER_TYPE_DataObject_Output: pParameter = new CSG_Parameter_Data_Object_Output(this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1161  case PARAMETER_TYPE_Grid : pParameter = new CSG_Parameter_Grid (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1162  case PARAMETER_TYPE_Grids : pParameter = new CSG_Parameter_Grids (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1163  case PARAMETER_TYPE_Table : pParameter = new CSG_Parameter_Table (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1164  case PARAMETER_TYPE_Shapes : pParameter = new CSG_Parameter_Shapes (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1165  case PARAMETER_TYPE_TIN : pParameter = new CSG_Parameter_TIN (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1166  case PARAMETER_TYPE_PointCloud : pParameter = new CSG_Parameter_PointCloud (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1167 
1168  case PARAMETER_TYPE_Grid_List : pParameter = new CSG_Parameter_Grid_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1169  case PARAMETER_TYPE_Grids_List : pParameter = new CSG_Parameter_Grids_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1170  case PARAMETER_TYPE_Table_List : pParameter = new CSG_Parameter_Table_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1171  case PARAMETER_TYPE_Shapes_List : pParameter = new CSG_Parameter_Shapes_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1172  case PARAMETER_TYPE_TIN_List : pParameter = new CSG_Parameter_TIN_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1173  case PARAMETER_TYPE_PointCloud_List : pParameter = new CSG_Parameter_PointCloud_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1174 
1175  case PARAMETER_TYPE_Parameters : pParameter = new CSG_Parameter_Parameters (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1176  }
1177 
1178  m_Parameters = (CSG_Parameter **)SG_Realloc(m_Parameters, (m_nParameters + 1) * sizeof(CSG_Parameter *));
1179  m_Parameters[m_nParameters++] = pParameter;
1180 
1181  pParameter->_Set_String();
1182 
1183  return( pParameter );
1184 }
1185 
1186 //---------------------------------------------------------
1187 CSG_Parameter * CSG_Parameters::_Add(CSG_Parameter *pSource)
1188 {
1189  CSG_Parameter *pParameter = !pSource ? NULL : _Add(
1190  pSource->Get_Parent() ? pSource->Get_Parent()->Get_Identifier() : SG_T(""),
1191  pSource->Get_Identifier (),
1192  pSource->Get_Name (),
1193  pSource->Get_Description(),
1194  pSource->Get_Type (),
1195  pSource->m_Constraint
1196  );
1197 
1198  if( pParameter )
1199  {
1200  pParameter->Assign(pSource);
1201  }
1202 
1203  return( pParameter );
1204 }
1205 
1206 
1208 // //
1210 
1211 //---------------------------------------------------------
1212 CSG_Parameter * CSG_Parameters::Get_Parameter(int i, bool MsgOnError) const
1213 {
1214  if( i >= 0 && i < m_nParameters )
1215  {
1216  return( m_Parameters[i] );
1217  }
1218 
1219  if( MsgOnError )
1220  {
1221  SG_UI_Msg_Add_Error(CSG_String::Format("%s index=[%d]", _TL("Could not find requested parameter!"), i));
1222  }
1223 
1224  return( NULL );
1225 }
1226 
1227 //---------------------------------------------------------
1228 CSG_Parameter * CSG_Parameters::Get_Parameter(const char *ID, bool MsgOnError) const { return( Get_Parameter(CSG_String(ID), MsgOnError) ); }
1229 CSG_Parameter * CSG_Parameters::Get_Parameter(const wchar_t *ID, bool MsgOnError) const { return( Get_Parameter(CSG_String(ID), MsgOnError) ); }
1230 CSG_Parameter * CSG_Parameters::Get_Parameter(const CSG_String &ID, bool MsgOnError) const
1231 {
1232  if( m_Parameters && !ID.is_Empty() )
1233  {
1234  for(int i=0; i<m_nParameters; i++)
1235  {
1236  if( m_Parameters[i]->Cmp_Identifier(ID) )
1237  {
1238  return( m_Parameters[i] );
1239  }
1240  }
1241 
1242  //-------------------------------------------------
1243  if( ID.Find('.') > 0 ) // id not found? check for sub-parameter ('id.id')!
1244  {
1245  CSG_Parameter *pParameter = Get_Parameter(ID.BeforeFirst('.'));
1246 
1247  if( pParameter )
1248  {
1249  switch( pParameter->Get_Type() )
1250  {
1252  return( pParameter->asParameters()->Get_Parameter(ID.AfterFirst('.')) );
1253 
1254  case PARAMETER_TYPE_Range :
1255  if( !ID.AfterFirst('.').CmpNoCase("min") || !ID.AfterFirst('.').CmpNoCase("minimum") )
1256  {
1257  return( pParameter->asRange()->Get_Min_Parameter() );
1258  }
1259 
1260  if( !ID.AfterFirst('.').CmpNoCase("max") || !ID.AfterFirst('.').CmpNoCase("maximum") )
1261  {
1262  return( pParameter->asRange()->Get_Max_Parameter() );
1263  }
1264  break;
1265 
1266  default:
1267  break;
1268  }
1269  }
1270  }
1271 
1272  //-------------------------------------------------
1273  if( MsgOnError )
1274  {
1275  SG_UI_Msg_Add_Error(CSG_String::Format("%s id=[%s]", _TL("Could not find requested parameter!"), ID.c_str()));
1276  }
1277  }
1278 
1279  return( NULL );
1280 }
1281 
1282 //---------------------------------------------------------
1283 bool CSG_Parameters::Del_Parameter(int iParameter)
1284 {
1285  if( m_Parameters && iParameter >= 0 && iParameter < m_nParameters )
1286  {
1287  CSG_Parameter *pParameter = m_Parameters[iParameter];
1288 
1289  for(m_nParameters--; iParameter<m_nParameters; iParameter++)
1290  {
1291  m_Parameters[iParameter] = m_Parameters[iParameter + 1];
1292  }
1293 
1294  m_Parameters = (CSG_Parameter **)SG_Realloc(m_Parameters, m_nParameters * sizeof(CSG_Parameter *));
1295 
1296  for(iParameter=pParameter->Get_Children_Count()-1; iParameter>=0; iParameter--)
1297  {
1298  Del_Parameter(pParameter->Get_Child(iParameter)->Get_Identifier());
1299  }
1300 
1301  CSG_Parameter *pParent = pParameter->Get_Parent();
1302 
1303  if( pParent )
1304  {
1305  for(iParameter=0; iParameter<pParent->m_nChildren; iParameter++)
1306  {
1307  if( pParent->m_Children[iParameter] == pParameter )
1308  {
1309  pParent->m_nChildren--;
1310 
1311  for( ; iParameter<pParent->m_nChildren; iParameter++)
1312  {
1313  pParent->m_Children[iParameter] = pParent->m_Children[iParameter + 1];
1314  }
1315  }
1316  }
1317 
1318  pParent->m_Children = (CSG_Parameter **)SG_Realloc(pParent->m_Children, pParent->m_nChildren * sizeof(CSG_Parameter *));
1319  }
1320 
1321  delete(pParameter);
1322 
1323  return( true );
1324  }
1325 
1326  return( false );
1327 }
1328 
1329 //---------------------------------------------------------
1331 {
1332  if( m_Parameters && Identifier.Length() )
1333  {
1334  for(int i=0; i<m_nParameters; i++)
1335  {
1336  if( !m_Parameters[i]->m_Identifier.Cmp(Identifier) )
1337  {
1338  return( Del_Parameter(i) );
1339  }
1340  }
1341  }
1342 
1343  return( false );
1344 }
1345 
1346 //---------------------------------------------------------
1348 {
1349  if( m_nParameters > 0 )
1350  {
1351  m_pGrid_System = NULL;
1352 
1353  for(int i=0; i<m_nParameters; i++)
1354  {
1355  delete(m_Parameters[i]);
1356  }
1357 
1358  SG_Free(m_Parameters);
1359 
1360  m_Parameters = NULL;
1361  m_nParameters = 0;
1362  }
1363 
1364  return( true );
1365 }
1366 
1367 
1369 // //
1370 // Callback //
1371 // //
1373 
1374 //---------------------------------------------------------
1375 // Callback function used to react on parameter changes.
1376 // Return value is the previously set callback function.
1378 {
1379  TSG_PFNC_Parameter_Changed Previous = m_Callback;
1380 
1381  m_Callback = Callback;
1382 
1383  for(int i=0; i<m_nParameters; i++)
1384  {
1385  if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters)
1386  {
1387  m_Parameters[i]->asParameters()->Set_Callback_On_Parameter_Changed(Callback);
1388  }
1389  }
1390 
1391  return( Previous );
1392 }
1393 
1394 //---------------------------------------------------------
1395 // If switched off parameter changes will not invoke a
1396 // consecutive call to the On_Parameter_Changed function.
1397 // Return value is the previous state.
1399 {
1400  bool bPrevious = m_bCallback;
1401 
1402  m_bCallback = bActive;
1403 
1404  for(int i=0; i<m_nParameters; i++)
1405  {
1406  if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters)
1407  {
1408  m_Parameters[i]->asParameters()->Set_Callback(bActive);
1409  }
1410  }
1411 
1412  return( bPrevious );
1413 }
1414 
1415 //---------------------------------------------------------
1416 bool CSG_Parameters::_On_Parameter_Changed(CSG_Parameter *pParameter, int Flags)
1417 {
1418  if( m_Callback && m_bCallback )
1419  {
1420  bool bCallback = Set_Callback(false);
1421 
1422  m_Callback(pParameter, Flags);
1423 
1424  Set_Callback(bCallback);
1425 
1426  return( true );
1427  }
1428 
1429  return( false );
1430 }
1431 
1432 
1434 // //
1436 
1437 //---------------------------------------------------------
1438 bool CSG_Parameters::Set_Parameter(const char *ID, CSG_Parameter *pValue) { return( Set_Parameter(CSG_String(ID), pValue) ); }
1439 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) { return( Set_Parameter(CSG_String(ID), pValue) ); }
1441 {
1442  CSG_Parameter *pTarget = Get_Parameter(ID);
1443 
1444  return( pTarget && pValue && pTarget->Get_Type() == pValue->Get_Type() && pTarget->Assign(pValue) );
1445 }
1446 
1447 //---------------------------------------------------------
1448 bool CSG_Parameters::Set_Parameter(const char *ID, void *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1449 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, void *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1450 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, void *Value, int Type)
1451 {
1452  CSG_Parameter *pTarget = Get_Parameter(ID);
1453 
1454  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1455 }
1456 
1457 //---------------------------------------------------------
1458 bool CSG_Parameters::Set_Parameter(const char *ID, CSG_Data_Object *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1459 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, CSG_Data_Object *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1461 {
1462  CSG_Parameter *pTarget = Get_Parameter(ID);
1463 
1464  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1465 }
1466 
1467 //---------------------------------------------------------
1468 bool CSG_Parameters::Set_Parameter(const char *ID, int Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1469 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, int Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1470 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, int Value, int Type)
1471 {
1472  CSG_Parameter *pTarget = Get_Parameter(ID);
1473 
1474  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1475 }
1476 
1477 //---------------------------------------------------------
1478 bool CSG_Parameters::Set_Parameter(const char *ID, double Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1479 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, double Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1480 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, double Value, int Type)
1481 {
1482  CSG_Parameter *pTarget = Get_Parameter(ID);
1483 
1484  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1485 }
1486 
1487 //---------------------------------------------------------
1488 bool CSG_Parameters::Set_Parameter(const char *ID, const CSG_String &Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1489 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1490 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type)
1491 {
1492  CSG_Parameter *pTarget = Get_Parameter(ID);
1493 
1494  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1495 }
1496 
1497 //---------------------------------------------------------
1498 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1499 bool CSG_Parameters::Set_Parameter(const char *ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1500 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1501 
1502 //---------------------------------------------------------
1503 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1504 bool CSG_Parameters::Set_Parameter(const char *ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1505 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1506 
1507 
1509 // //
1511 
1512 //---------------------------------------------------------
1514 {
1515  Set_Callback(false);
1516 
1517  for(int i=0; i<Get_Count(); i++)
1518  {
1519  m_Parameters[i]->Restore_Default();
1520 
1521  if( bClearData )
1522  {
1523  if( m_Parameters[i]->is_DataObject() )
1524  {
1525  m_Parameters[i]->Set_Value(DATAOBJECT_NOTSET);
1526  }
1527  else if( m_Parameters[i]->is_DataObject_List() )
1528  {
1529  m_Parameters[i]->asList()->Del_Items();
1530  }
1531  }
1532  }
1533 
1534  Set_Callback(true);
1535 
1536  return( true );
1537 }
1538 
1539 
1541 // //
1543 
1544 //---------------------------------------------------------
1546 {
1547  return( pSource && pSource != this && Create(*pSource) );
1548 }
1549 
1550 //---------------------------------------------------------
1552 {
1553  if( !pSource || pSource == this )
1554  {
1555  return( false );
1556  }
1557 
1558  //-----------------------------------------------------
1559  int n = 0;
1560 
1561  for(int i=0; i<pSource->Get_Count(); i++)
1562  {
1563  CSG_Parameter *pParameter = Get_Parameter(pSource->Get_Parameter(i)->Get_Identifier());
1564 
1565  if( pParameter && pParameter->Get_Type() == pSource->Get_Parameter(i)->Get_Type() )
1566  {
1567  n++; pParameter->Assign(pSource->Get_Parameter(i));
1568  }
1569  }
1570 
1571  return( n > 0 );
1572 }
1573 
1574 //---------------------------------------------------------
1576 {
1577  if( !pSource || pSource == this )
1578  {
1579  return( false );
1580  }
1581 
1582  Del_Parameters();
1583 
1584  //-----------------------------------------------------
1585  for(int i=0; i<pSource->m_nParameters; i++)
1586  {
1587  _Add(pSource->m_Parameters[i]);
1588 
1589  if( m_Parameters[i]->asParameters() )
1590  {
1591  m_Parameters[i]->asParameters()->Set_Tool(m_pTool);
1592  }
1593  }
1594 
1595  if( pSource->m_pGrid_System )
1596  {
1597  m_pGrid_System = Get_Parameter(pSource->m_pGrid_System->Get_Identifier());
1598  }
1599 
1600  return( m_nParameters == pSource->m_nParameters );
1601 }
1602 
1603 
1605 // //
1607 
1608 //---------------------------------------------------------
1610 {
1611  bool bResult = true; CSG_String sError;
1612 
1613  //-----------------------------------------------------
1614  for(int i=0; i<Get_Count(); i++)
1615  {
1616  if( m_Parameters[i]->Check(bSilent) == false )
1617  {
1618  bResult = false;
1619 
1620  sError.Append(CSG_String::Format("\n%s: %s", m_Parameters[i]->Get_Type_Name().c_str(), m_Parameters[i]->Get_Name()));
1621  }
1622  }
1623 
1624  //-----------------------------------------------------
1625  if( !bResult && !bSilent )
1626  {
1627  SG_UI_Dlg_Message(CSG_String::Format("%s\n%s", _TL("invalid input!"), sError.c_str()), Get_Name() );
1628  }
1629 
1630  return( bResult );
1631 }
1632 
1633 //---------------------------------------------------------
1634 bool CSG_Parameters::DataObjects_Create(void)
1635 {
1636  bool bResult = true;
1637 
1638  for(int i=0; bResult && i<Get_Count(); i++)
1639  {
1640  CSG_Parameter &P = *m_Parameters[i];
1641 
1642  //-------------------------------------------------
1643  if( P.Get_Type() == PARAMETER_TYPE_Parameters )
1644  {
1645  if( !P.asParameters()->DataObjects_Create() )
1646  {
1647  bResult = false;
1648  }
1649  }
1650  else if( P.is_Input() )
1651  {
1652  if( P.is_Enabled() && P.Check(true) == false )
1653  {
1654  bResult = false;
1655 
1656  SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Input Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1657  }
1658  }
1659 
1660  //-------------------------------------------------
1661  else if( P.is_DataObject_List() )
1662  {
1663  for(int j=P.asList()->Get_Item_Count()-1; j>=0; j--)
1664  {
1665  if( m_pManager && !m_pManager->Exists(P.asList()->Get_Item(j)) )
1666  {
1667  P.asList()->Del_Item(j);
1668  }
1669  }
1670  }
1671 
1672  //-------------------------------------------------
1673  else if( P.is_DataObject() && P.is_Enabled() == false && has_GUI() )
1674  {
1675  if( P.asDataObject() != DATAOBJECT_CREATE && (m_pManager && !m_pManager->Exists(P.asDataObject())) )
1676  {
1678  }
1679  }
1680 
1681  else if( P.is_DataObject() )
1682  {
1683  CSG_Data_Object *pObject = P.asDataObject();
1684 
1685  if( pObject != DATAOBJECT_CREATE )
1686  {
1688  {
1689  pObject = (CSG_Data_Object *)DATAOBJECT_CREATE;
1690  }
1691  else if( m_pManager && !m_pManager->Exists(pObject) )
1692  {
1693  pObject = (CSG_Data_Object *)DATAOBJECT_NOTSET;
1694  }
1695 
1696  if( pObject == DATAOBJECT_NOTSET && !P.is_Optional() )
1697  {
1698  pObject = (CSG_Data_Object *)DATAOBJECT_CREATE;
1699  }
1700  }
1701 
1702  if( pObject == DATAOBJECT_CREATE )
1703  {
1704  switch( P.Get_DataObject_Type() )
1705  {
1706  case SG_DATAOBJECT_TYPE_Table : pObject = SG_Create_Table (); break;
1707  case SG_DATAOBJECT_TYPE_Shapes : pObject = SG_Create_Shapes (); break;
1708  case SG_DATAOBJECT_TYPE_PointCloud: pObject = SG_Create_PointCloud(); break;
1709  case SG_DATAOBJECT_TYPE_TIN : pObject = SG_Create_TIN (); break;
1710  case SG_DATAOBJECT_TYPE_Grid : pObject = SG_Create_Grid (); break;
1711  case SG_DATAOBJECT_TYPE_Grids : pObject = SG_Create_Grids (); break;
1712  default : pObject = NULL ; break;
1713  }
1714  }
1715 
1716  if( pObject )
1717  {
1718  if( P.Get_Type() == PARAMETER_TYPE_Shapes
1719  && ((CSG_Parameter_Shapes *)&P)->Get_Shape_Type() != SHAPE_TYPE_Undefined
1720  && ((CSG_Parameter_Shapes *)&P)->Get_Shape_Type() != pObject->asShapes()->Get_Type() )
1721  {
1722  if( has_GUI() && pObject->asShapes()->Get_Type() != SHAPE_TYPE_Undefined )
1723  {
1724  pObject = SG_Create_Shapes (((CSG_Parameter_Shapes *)&P)->Get_Shape_Type());
1725  }
1726  else
1727  {
1728  pObject->asShapes()->Create(((CSG_Parameter_Shapes *)&P)->Get_Shape_Type());
1729  }
1730  }
1731 
1733  {
1734  if( P.Get_Parent() && P.Get_Parent()->asGrid_System() && P.Get_Parent()->asGrid_System()->is_Valid() )
1735  {
1736  CSG_Grid_System System(*P.Get_Parent()->asGrid_System());
1737 
1738  if( P.Get_Type() == PARAMETER_TYPE_Grid && !System.is_Equal(pObject->asGrid ()->Get_System()) )
1739  {
1740  pObject->asGrid ()->Create(System , ((CSG_Parameter_Grid *)&P)->Get_Preferred_Type());
1741  }
1742 
1743  if( P.Get_Type() == PARAMETER_TYPE_Grids && !System.is_Equal(pObject->asGrids()->Get_System()) )
1744  {
1745  pObject->asGrids()->Create(System, 0, 0., ((CSG_Parameter_Grids *)&P)->Get_Preferred_Type());
1746  }
1747  }
1748  }
1749 
1750  if( P.Set_Value(pObject) )
1751  {
1752  pObject->Set_Name(P.Get_Name());
1753  pObject->Get_MetaData().Del_Children();
1754 
1755  if( m_pManager )
1756  {
1757  m_pManager->Add(pObject);
1758  }
1759  }
1760  else
1761  {
1762  delete(pObject);
1763 
1764  bResult = false;
1765 
1766  SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Output Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1767  }
1768  }
1769  else // if( pObject == NULL )
1770  {
1771  if( !P.is_Optional() )
1772  {
1773  bResult = false;
1774 
1775  SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Output Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1776  }
1777  }
1778  }
1779  }
1780 
1781  return( bResult );
1782 }
1783 
1784 //---------------------------------------------------------
1785 bool CSG_Parameters::DataObjects_Synchronize(void)
1786 {
1787  for(int i=0; i<Get_Count(); i++)
1788  {
1789  CSG_Parameter &P = *m_Parameters[i];
1790 
1791  if( P.Get_Type() == PARAMETER_TYPE_Parameters )
1792  {
1793  P.asParameters()->DataObjects_Synchronize();
1794  }
1795 
1796  //-------------------------------------------------
1797  else if( P.is_Output() )
1798  {
1799  if( P.is_DataObject() )
1800  {
1801  CSG_Data_Object *pObject = P.asDataObject();
1802 
1803  if( pObject == DATAOBJECT_CREATE )
1804  {
1806  }
1807  else if( pObject != DATAOBJECT_NOTSET )
1808  {
1809  if( pObject->asShapes() && pObject->asShapes()->Get_Type() == SHAPE_TYPE_Undefined
1810  && (m_pManager == &SG_Get_Data_Manager() || !SG_Get_Data_Manager().Exists(pObject)) )
1811  {
1812  if( m_pManager && !m_pManager->Delete(pObject) )
1813  {
1814  delete(pObject);
1815  }
1816 
1818  }
1819  else
1820  {
1821  if( m_pManager )
1822  {
1823  m_pManager->Add(pObject);
1824 
1825  if( m_pManager == &SG_Get_Data_Manager() )
1826  {
1827  SG_UI_DataObject_Add(pObject, 0);
1828  }
1829  }
1830 
1832  }
1833  }
1834  }
1835 
1836  //---------------------------------------------
1837  else if( P.is_DataObject_List() )
1838  {
1839  for(int j=0; j<P.asList()->Get_Item_Count(); j++)
1840  {
1841  CSG_Data_Object *pObject = P.asList()->Get_Item(j);
1842 
1843  if( m_pManager )
1844  {
1845  m_pManager->Add(pObject);
1846 
1847  if( m_pManager == &SG_Get_Data_Manager() )
1848  {
1849  SG_UI_DataObject_Add(pObject, 0);
1850  }
1851  }
1852 
1854  }
1855  }
1856  }
1857  }
1858 
1859  return( true );
1860 }
1861 
1862 //---------------------------------------------------------
1863 bool CSG_Parameters::DataObjects_Get_Projection(CSG_Projection &Projection) const
1864 {
1865  for(int i=0; i<Get_Count() && !Projection.is_Okay(); i++)
1866  {
1867  CSG_Parameter *p = m_Parameters[i];
1868 
1869  if( p->is_Enabled() && !p->ignore_Projection() )
1870  {
1871  if( p->Get_Type() == PARAMETER_TYPE_Parameters )
1872  {
1873  p->asParameters()->DataObjects_Get_Projection(Projection);
1874  }
1875  else if( p->is_Input() )
1876  {
1877  if( p->is_DataObject()
1878  && p->asDataObject() != DATAOBJECT_NOTSET
1879  && p->asDataObject() != DATAOBJECT_CREATE )
1880  {
1881  Projection = p->asDataObject()->Get_Projection();
1882  }
1883  else if( p->is_DataObject_List() )
1884  {
1885  for(int j=0; j<p->asList()->Get_Item_Count() && !Projection.is_Okay(); j++)
1886  {
1887  Projection = p->asList()->Get_Item(j)->Get_Projection();
1888  }
1889  }
1890  }
1891  }
1892  }
1893 
1894  return( Projection.is_Okay() );
1895 }
1896 
1897 //---------------------------------------------------------
1898 bool CSG_Parameters::DataObjects_Set_Projection(const CSG_Projection &Projection)
1899 {
1900  if( !Projection.is_Okay() )
1901  {
1902  return( false );
1903  }
1904 
1905  for(int i=0; i<Get_Count(); i++)
1906  {
1907  CSG_Parameter *p = m_Parameters[i];
1908 
1909  if( !p->ignore_Projection() )
1910  {
1911  if( p->Get_Type() == PARAMETER_TYPE_Parameters )
1912  {
1913  p->asParameters()->DataObjects_Set_Projection(Projection);
1914  }
1915  else if( p->is_Output() )
1916  {
1917  if( p->is_DataObject()
1918  && p->asDataObject() != DATAOBJECT_NOTSET
1919  && p->asDataObject() != DATAOBJECT_CREATE )
1920  {
1921  p->asDataObject()->Get_Projection() = Projection;
1922  }
1923  else if( p->is_DataObject_List() )
1924  {
1925  for(int j=0; j<p->asList()->Get_Item_Count(); j++)
1926  {
1927  p->asList()->Get_Item(j)->Get_Projection() = Projection;
1928  }
1929  }
1930  }
1931  }
1932  }
1933 
1934  return( true );
1935 }
1936 
1937 
1939 // //
1941 
1942 //---------------------------------------------------------
1943 bool CSG_Parameters::Get_String(CSG_String &String, bool bOptionsOnly)
1944 {
1945  bool bResult = false;
1946 
1947  if( Get_Count() > 0 )
1948  {
1949  if( m_pGrid_System )
1950  {
1951  m_pGrid_System->_Set_String();
1952 
1953  String += CSG_String::Format("%s: %s\n", m_pGrid_System->Get_Name(), m_pGrid_System->asString());
1954  }
1955 
1956  for(int i=0; i<Get_Count(); i++)
1957  {
1958  CSG_Parameter &P = *m_Parameters[i];
1959 
1960  if( (!bOptionsOnly || P.is_Option()) && !P.asGrid_System() && P.is_Enabled() && !P.is_Information() && !(P.Get_Type() == PARAMETER_TYPE_String && ((CSG_Parameter_String *)&P)->is_Password()) )
1961  {
1962  bResult = true;
1963 
1964  P._Set_String(); // forcing update (at scripting level some parameter types can be changed without the Set_Parameter() mechanism)
1965 
1966  CSG_String s(P.asString()); if( s.Length() > 256 ) { s = s.Left(256) + "..."; }
1967 
1968  String += CSG_String::Format("%s: %s\n", P.Get_Name(), s.c_str());
1969  }
1970  }
1971  }
1972 
1973  return( bResult );
1974 }
1975 
1976 //---------------------------------------------------------
1977 bool CSG_Parameters::Msg_String(bool bOptionsOnly)
1978 {
1979  CSG_String Message;
1980 
1981  if( Get_String(Message, bOptionsOnly) )
1982  {
1983  SG_UI_Msg_Add_Execution(CSG_String::Format("\n__________\n[%s] %s:\n", m_Name.c_str(),
1984  bOptionsOnly ? _TL("Options") : _TL("Parameters")),
1985  false, SG_UI_MSG_STYLE_NORMAL
1986  );
1987 
1989 
1990  return( true );
1991  }
1992 
1993  return( false );
1994 }
1995 
1996 
1998 // //
2000 
2001 //---------------------------------------------------------
2002 bool CSG_Parameters::Set_History(CSG_MetaData &MetaData, bool bOptions, bool bDataObjects)
2003 {
2004  if( bOptions ) // get options...
2005  {
2006  for(int i=0; i<Get_Count(); i++)
2007  {
2008  CSG_Parameter &P = *m_Parameters[i];
2009 
2010  if( P.is_Option() && P.is_Enabled() && !P.is_Information() && !(P.Get_Type() == PARAMETER_TYPE_String && ((CSG_Parameter_String *)&P)->is_Password()) )
2011  {
2012  P.Serialize(MetaData, true);
2013  }
2014  else if( P.is_Parameters() )
2015  {
2016  P.asParameters()->Set_History(MetaData, true, false);
2017  }
2018  }
2019  }
2020 
2021  //-----------------------------------------------------
2022  if( bDataObjects ) // get input with history...
2023  {
2024  for(int i=0; i<Get_Count(); i++)
2025  {
2026  CSG_Parameter &P = *m_Parameters[i];
2027 
2028  //---------------------------------------------
2029  if( P.is_Input() )
2030  {
2031  if( P.is_DataObject() && P.asDataObject() )
2032  {
2033  CSG_Data_Object *pObject = P.asDataObject();
2034 
2035  CSG_MetaData *pEntry = MetaData.Add_Child("INPUT");
2036 
2037  pEntry->Add_Property("type" , P.Get_Type_Identifier());
2038  pEntry->Add_Property("id" , P.Get_Identifier ());
2039  pEntry->Add_Property("name" , P.Get_Name ());
2040  pEntry->Add_Property("parms", Get_Identifier ());
2041 
2042  if( P.Get_Type() == PARAMETER_TYPE_Grid
2043  || P.Get_Type() == PARAMETER_TYPE_Grids )
2044  {
2045  pEntry->Add_Property("system", P.Get_Parent()->Get_Identifier());
2046  }
2047 
2048  if( pObject->Get_History().Get_Children_Count() > 0 )
2049  {
2050  pEntry->Add_Children(pObject->Get_History());
2051  }
2052  else if( pObject->Get_File_Name() && *pObject->Get_File_Name() )
2053  {
2054  pEntry = pEntry->Add_Child("FILE", pObject->Get_File_Name());
2055  }
2056  }
2057 
2058  else if( P.is_DataObject_List() && P.asList()->Get_Item_Count() > 0 )
2059  {
2060  CSG_MetaData *pList = MetaData.Add_Child("INPUT_LIST");
2061 
2062  pList->Add_Property("type" , P.Get_Type_Identifier());
2063  pList->Add_Property("id" , P.Get_Identifier ());
2064  pList->Add_Property("name" , P.Get_Name ());
2065  pList->Add_Property("parms", Get_Identifier ());
2066 
2068  {
2069  pList->Add_Property("system", P.Get_Parent()->Get_Identifier());
2070  }
2071 
2072  for(int j=0; j<P.asList()->Get_Item_Count(); j++)
2073  {
2074  CSG_Data_Object *pObject = P.asList()->Get_Item(j);
2075 
2076  CSG_MetaData *pEntry = pList->Add_Child(*pList, false);
2077 
2078  pEntry->Set_Name("INPUT");
2079 
2080  if( !SG_Get_History_Ignore_Lists() && pObject->Get_History().Get_Children_Count() > 0 )
2081  {
2082  pEntry->Add_Children(pObject->Get_History());
2083  }
2084  else if( pObject->Get_File_Name() && *pObject->Get_File_Name() )
2085  {
2086  pEntry = pEntry->Add_Child("FILE", pObject->Get_File_Name());
2087  }
2088  }
2089  }
2090  }
2091 
2092  //---------------------------------------------
2093  else if( P.is_Parameters() )
2094  {
2095  P.asParameters()->Set_History(MetaData, false, true);
2096  }
2097  }
2098  }
2099 
2100  return( true );
2101 }
2102 
2103 
2105 // //
2106 // Grid System //
2107 // //
2109 
2110 //---------------------------------------------------------
2117 {
2118  return( m_pGrid_System && m_pGrid_System->asGrid_System() && m_pGrid_System->Set_Value((void *)&System) );
2119 }
2120 
2121 //---------------------------------------------------------
2128 {
2129  CSG_Grid_System System;
2130 
2131  return( Set_Grid_System(System) );
2132 }
2133 
2134 
2136 // //
2137 // Serialize //
2138 // //
2140 
2141 //---------------------------------------------------------
2143 {
2144  if( Data.Cmp_Name("parameters") )
2145  {
2146  Data.Get_Property("name", m_Name);
2147 
2148  for(int i=0; i<Data.Get_Children_Count(); i++)
2149  {
2150  CSG_Parameter *pParameter = Get_Parameter(Data(i)->Get_Property("id"));
2151 
2152  if( pParameter && pParameter->Serialize(*Data(i), false) )
2153  {
2154  pParameter->has_Changed();
2155  }
2156  }
2157 
2158  return( true );
2159  }
2160 
2161  return( false );
2162 }
2163 
2164 //---------------------------------------------------------
2166 {
2167  Data.Destroy();
2168 
2169  Data.Set_Name("parameters");
2170  Data.Set_Property("name", m_Name);
2171 
2172  for(int i=0; i<Get_Count(); i++)
2173  {
2174  m_Parameters[i]->Serialize(Data, true);
2175  }
2176 
2177  return( true );
2178 }
2179 
2180 //---------------------------------------------------------
2182 {
2183  CSG_MetaData Data; return( Data.Load(File) && Load(Data) );
2184 }
2185 
2186 //---------------------------------------------------------
2187 bool CSG_Parameters::Save(const CSG_String &File) const
2188 {
2189  CSG_MetaData Data; return( Save(Data) && Data.Save(File) );
2190 }
2191 
2192 //---------------------------------------------------------
2193 // SAGA 2.0 compatibility...
2195 {
2196  CSG_Parameter *pParameter = NULL;
2197  CSG_String sLine;
2198 
2199  if( !Stream.is_Open() )
2200  {
2201  return( false );
2202  }
2203 
2204  //-----------------------------------------------------
2205  while( Stream.Read_Line(sLine) && sLine.Cmp("[PARAMETER_ENTRIES_BEGIN]") );
2206 
2207  if( sLine.Cmp("[PARAMETER_ENTRIES_BEGIN]") )
2208  {
2209  return( false );
2210  }
2211 
2212  //-----------------------------------------------------
2213  while( Stream.Read_Line(sLine) && sLine.Cmp("[PARAMETER_ENTRIES_END]") )
2214  {
2215  if( !sLine.Cmp("[PARAMETER_ENTRY_BEGIN]")
2216  && Stream.Read_Line(sLine) && (pParameter = Get_Parameter(sLine)) != NULL
2217  && Stream.Read_Line(sLine) )
2218  {
2219  int i;
2220  double d;
2221  TSG_Rect r;
2222  CSG_String s;
2223  CSG_Table t;
2224 
2225  switch( sLine.asInt() )
2226  {
2227  case 1: // PARAMETER_TYPE_Bool:
2228  case 2: // PARAMETER_TYPE_Int:
2229  case 6: // PARAMETER_TYPE_Choice:
2230  case 11: // PARAMETER_TYPE_Color:
2231  case 15: // PARAMETER_TYPE_Table_Field:
2232  pParameter->Set_Value(Stream.Scan_Int());
2233  break;
2234 
2235  case 3: // PARAMETER_TYPE_Double:
2236  case 4: // PARAMETER_TYPE_Degree:
2237  pParameter->Set_Value(Stream.Scan_Double());
2238  break;
2239 
2240  case 5: // PARAMETER_TYPE_Range:
2241  pParameter->asRange()->Set_Range(Stream.Scan_Double(), Stream.Scan_Double());
2242  break;
2243 
2244  case 7: // PARAMETER_TYPE_String:
2245  case 9: // PARAMETER_TYPE_FilePath:
2246  Stream.Read_Line(sLine);
2247  pParameter->Set_Value(sLine);
2248  break;
2249 
2250  case 8: // PARAMETER_TYPE_Text:
2251  s.Clear();
2252  while( Stream.Read_Line(sLine) && sLine.Cmp("[TEXT_ENTRY_END]") )
2253  {
2254  s += sLine + "\n";
2255  }
2256  pParameter->Set_Value(s);
2257  break;
2258 
2259  case 10: // PARAMETER_TYPE_Font:
2260  Stream.Read(&i, sizeof(i));
2261  pParameter->Set_Value(i);
2262  break;
2263 
2264  case 12: // PARAMETER_TYPE_Colors:
2265  pParameter->asColors()->Serialize(Stream, false, false);
2266  break;
2267 
2268  case 13: // PARAMETER_TYPE_FixedTable:
2269  if( t.Serialize(Stream, false) )
2270  {
2271  pParameter->asTable()->Assign_Values(&t);
2272  }
2273  break;
2274 
2275  case 14: // PARAMETER_TYPE_Grid_System:
2276  Stream.Read(&d, sizeof(d));
2277  Stream.Read(&r, sizeof(r));
2278  pParameter->asGrid_System()->Assign(d, r);
2279  break;
2280 
2281  case 16: // PARAMETER_TYPE_Grid:
2282  case 17: // PARAMETER_TYPE_Table:
2283  case 18: // PARAMETER_TYPE_Shapes:
2284  case 19: // PARAMETER_TYPE_TIN:
2285  case 24: // PARAMETER_TYPE_DataObject_Output:
2286  if( Stream.Read_Line(sLine) )
2287  {
2288  if( !sLine.Cmp("[ENTRY_DATAOBJECT_CREATE]") )
2289  {
2290  pParameter->Set_Value(DATAOBJECT_CREATE);
2291  }
2292  else
2293  {
2294  pParameter->Set_Value(m_pManager ? m_pManager->Find(sLine) : NULL);
2295  }
2296  }
2297  break;
2298 
2299  case 20: // PARAMETER_TYPE_Grid_List:
2300  case 21: // PARAMETER_TYPE_Table_List:
2301  case 22: // PARAMETER_TYPE_Shapes_List:
2302  case 23: // PARAMETER_TYPE_TIN_List:
2303  while( Stream.Read_Line(sLine) && sLine.Cmp("[ENTRY_DATAOBJECTLIST_END]") )
2304  {
2305  CSG_Data_Object *pObject = m_pManager ? m_pManager->Find(sLine) : NULL;
2306 
2307  if( pObject )
2308  {
2309  pParameter->asList()->Add_Item(pObject);
2310  }
2311  }
2312  break;
2313 
2314  case 25: // PARAMETER_TYPE_Parameters:
2315  pParameter->asParameters()->Serialize_Compatibility(Stream);
2316  break;
2317  }
2318  }
2319  }
2320 
2321  return( true );
2322 }
2323 
2324 
2326 // //
2327 // //
2328 // //
2330 
2331 //---------------------------------------------------------
CSG_Parameter::asColors
CSG_Colors * asColors(void) const
Definition: parameter.cpp:1050
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:713
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:140
CSG_Parameters::Assign
bool Assign(CSG_Parameters *pSource)
Definition: parameters.cpp:1545
CSG_Parameter_Date
Definition: parameters.h:577
CSG_Parameter::Set_Value
virtual bool Set_Value(int Value)
Definition: parameter.cpp:814
CSG_Parameters::Get_Description
const CSG_String & Get_Description(void) const
Definition: parameters.h:1741
CSG_Parameter_Range::Set_Min
bool Set_Min(double Min)
Definition: parameter_data.cpp:804
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:128
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1758
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:137
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:129
CSG_Parameter_Choice::Set_Items
bool Set_Items(const SG_Char *String)
Definition: parameter_data.cpp:936
CSG_Parameters::Del_References
void Del_References(void)
Definition: parameters.cpp:395
CSG_Parameter_Grid
Definition: parameters.h:1205
SG_T
#define SG_T(s)
Definition: api_core.h:537
CSG_Parameters::Add_Date
CSG_Parameter * Add_Date(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0)
Definition: parameters.cpp:485
CSG_Parameter_Value::Set_Minimum
void Set_Minimum(double Minimum, bool bOn=true)
Definition: parameter_data.cpp:371
CSG_Parameters::Add_Parameter
CSG_Parameter * Add_Parameter(CSG_Parameter *pParameter)
Definition: parameters.cpp:434
CSG_Parameters::Add_Grid_System
CSG_Parameter * Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
Definition: parameters.cpp:677
SG_Create_Table
CSG_Table * SG_Create_Table(void)
Definition: table.cpp:65
CSG_Parameters::Add_Degree
CSG_Parameter * Add_Degree(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:480
CSG_String::Append
CSG_String & Append(const CSG_String &String)
Definition: api_string.cpp:355
_TL
#define _TL(s)
Definition: api_core.h:1559
CSG_Parameter_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3042
CSG_Parameter_Degree
Definition: parameters.h:552
CSG_Parameter_Parameters
Definition: parameters.h:1576
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:146
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:236
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_DateTime::Now
static CSG_DateTime Now(void)
Definition: datetime.cpp:581
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:148
CSG_Parameters::Set_Grid_System
bool Set_Grid_System(const CSG_Grid_System &System)
Definition: parameters.cpp:2116
CSG_Parameters::Reset_Grid_System
bool Reset_Grid_System(void)
Definition: parameters.cpp:2127
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:562
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:124
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:289
PARAMETER_OPTIONAL
#define PARAMETER_OPTIONAL
Definition: parameters.h:96
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:1102
CSG_Parameters::Get_Owner
void * Get_Owner(void) const
Definition: parameters.h:1716
CSG_Parameter_TIN
Definition: parameters.h:1320
data_manager.h
CSG_Parameter_Table_List
Definition: parameters.h:1476
CSG_Parameter_Value::Set_Maximum
void Set_Maximum(double Maximum, bool bOn=true)
Definition: parameter_data.cpp:391
SG_UI_MSG_STYLE_NORMAL
@ SG_UI_MSG_STYLE_NORMAL
Definition: api_core.h:1572
CSG_Parameters::Add_Data_Type
CSG_Parameter * Add_Data_Type(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="")
Definition: parameters.cpp:521
CSG_Parameters::Del_Parameters
bool Del_Parameters(void)
Definition: parameters.cpp:1347
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
SG_Create_PointCloud
CSG_PointCloud * SG_Create_PointCloud(void)
Definition: pointcloud.cpp:76
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:156
CSG_Parameters::Add_Grid_or_Const
CSG_Parameter * Add_Grid_or_Const(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false, bool bSystem_Dependent=true)
Definition: parameters.cpp:716
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:135
CSG_Grid_System
Definition: grid.h:220
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:769
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:127
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:235
CSG_Parameters::Add_Font
CSG_Parameter * Add_Font(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit=NULL)
Definition: parameters.cpp:609
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1379
CSG_Parameters::Add_Info_Value
CSG_Parameter * Add_Info_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0)
Definition: parameters.cpp:459
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:209
SG_UI_Msg_Add_Execution
void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:526
CSG_MetaData::Set_Property
bool Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
Definition: metadata.cpp:615
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:236
CSG_Parameters::Serialize_Compatibility
bool Serialize_Compatibility(CSG_File &Stream)
Definition: parameters.cpp:2194
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:863
CSG_Parameter_Colors
Definition: parameters.h:962
CSG_Parameter_Choices
Definition: parameters.h:753
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:153
CSG_Parameters::Add_Grids_List
CSG_Parameter * Add_Grids_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
Definition: parameters.cpp:796
CSG_Parameter_Data_Object_Output
Definition: parameters.h:1176
CSG_Tool
Definition: tool.h:135
CSG_Parameters::Add_String
CSG_Parameter * Add_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false, bool bPassword=false)
Definition: parameters.cpp:558
CSG_Parameter::Get_Description
const SG_Char * Get_Description(void) const
Definition: parameter.cpp:617
CSG_Parameters::Add_Double
CSG_Parameter * Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:475
SG_Get_Data_Manager
CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
CSG_Parameters::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameters.cpp:331
CSG_Parameters::DataObjects_Check
bool DataObjects_Check(bool bSilent=false)
Definition: parameters.cpp:1609
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Parameters::Add_Value
CSG_Parameter * Add_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:454
CSG_File::Scan_Int
int Scan_Int(void) const
Definition: api_file.cpp:557
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:142
CSG_Parameter_Table_Field
Definition: parameters.h:1063
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:278
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:1080
CSG_Parameter_Node
Definition: parameters.h:381
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1180
CSG_Parameters::~CSG_Parameters
virtual ~CSG_Parameters(void)
Definition: parameters.cpp:95
SG_Create_TIN
CSG_TIN * SG_Create_TIN(void)
Definition: tin.cpp:63
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:879
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:148
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1130
CSG_Parameters::Push
bool Push(class CSG_Data_Manager *pManager=NULL, bool bRestoreDefaults=true)
Definition: parameters.cpp:262
CSG_Parameter_Font
Definition: parameters.h:901
CSG_Parameter::ignore_Projection
void ignore_Projection(bool bIgnore)
Definition: parameter.cpp:193
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:338
CSG_Parameters::Pop
bool Pop(void)
Definition: parameters.cpp:285
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:559
CSG_File
Definition: api_core.h:1129
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Parameters::Add_Table_Field_or_Const
CSG_Parameter * Add_Table_Field_or_Const(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:837
CSG_Parameters::Add_PointCloud
CSG_Parameter * Add_PointCloud(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:964
tool.h
PARAMETER_INPUT_OPTIONAL
#define PARAMETER_INPUT_OPTIONAL
Definition: parameters.h:103
CSG_Parameter_PointCloud
Definition: parameters.h:1344
CSG_Parameters::Get_String
bool Get_String(CSG_String &String, bool bOptionsOnly)
Definition: parameters.cpp:1943
CSG_Parameters::Msg_String
bool Msg_String(bool bOptionsOnly)
Definition: parameters.cpp:1977
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:158
SSG_Rect
Definition: geo_tools.h:467
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:150
CSG_Parameters::has_GUI
bool has_GUI(void) const
Definition: parameters.cpp:311
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_Parameter::Serialize
bool Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1206
CSG_Parameters::Add_Range
CSG_Parameter * Add_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min=0.0, double Range_Max=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:501
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1588
CSG_Parameters::Add_Info_Range
CSG_Parameter * Add_Info_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min=0.0, double Range_Max=0.0)
Definition: parameters.cpp:506
CSG_Data_Object::asShapes
class CSG_Shapes * asShapes(bool bPolymorph=false) const
Definition: dataobject.cpp:509
CSG_Parameter::is_DataObject_List
bool is_DataObject_List(void) const
Definition: parameter.cpp:310
CSG_Parameter_Text
Definition: parameters.h:839
CSG_Parameter_File_Name::Set_Flag_Multiple
void Set_Flag_Multiple(bool bFlag)
Definition: parameter_data.cpp:1566
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:134
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:132
CSG_Parameter_Shapes
Definition: parameters.h:1289
CSG_Parameter_List::Del_Items
virtual bool Del_Items(void)
Definition: parameter_data.cpp:3084
CSG_Parameter_Fixed_Table
Definition: parameters.h:996
CSG_Grids::Create
virtual bool Create(const CSG_Grids &Grids)
Definition: grids.cpp:319
CSG_MetaData::Cmp_Name
bool Cmp_Name(const CSG_String &String, bool bNoCase=true) const
Definition: metadata.cpp:461
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:736
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:141
CSG_Parameters::Add_TIN_List
CSG_Parameter * Add_TIN_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:951
CSG_Parameter_File_Name::Set_Flag_Save
void Set_Flag_Save(bool bFlag)
Definition: parameter_data.cpp:1561
CSG_Parameters::Set_Name
void Set_Name(const CSG_String &Name)
Definition: parameters.cpp:341
CSG_Colors::Create
bool Create(void)
Definition: api_colors.cpp:210
SG_UI_Dlg_Message
void SG_UI_Dlg_Message(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:368
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:208
CSG_Parameters::Add_TIN_Output
CSG_Parameter * Add_TIN_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:941
CSG_Parameter_Grid_System
Definition: parameters.h:1029
CSG_Parameters::Assign_Values
bool Assign_Values(CSG_Parameters *pSource)
Definition: parameters.cpp:1551
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:166
CSG_Grids::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grids.h:184
CSG_Parameters::Add_FixedTable
CSG_Parameter * Add_FixedTable(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL)
Definition: parameters.cpp:625
CSG_Data_Object::asGrids
class CSG_Grids * asGrids(bool bPolymorph=false) const
Definition: dataobject.cpp:561
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:151
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:126
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1731
CSG_Parameters::Restore_Defaults
bool Restore_Defaults(bool bClearData=false)
Definition: parameters.cpp:1513
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Table::Serialize
bool Serialize(CSG_File &Stream, bool bSave)
Definition: table_io.cpp:690
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:145
CSG_Parameters::Use_Grid_System
bool Use_Grid_System(void)
Definition: parameters.cpp:241
CSG_Parameters::Add_FilePath
CSG_Parameter * Add_FilePath(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false)
Definition: parameters.cpp:569
CSG_Parameter::is_Enabled
bool is_Enabled(bool bCheckEnv=true) const
Definition: parameter.cpp:224
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:381
CSG_Parameter::Set_Default
bool Set_Default(int Value)
Definition: parameter.cpp:920
CSG_Parameter_Data_Type::Set_Data_Types
bool Set_Data_Types(int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="")
Definition: parameter_data.cpp:1151
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bCollapsed=false)
Definition: parameters.cpp:440
CSG_Parameter_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3054
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:133
CSG_Parameter_File_Name
Definition: parameters.h:859
CSG_Parameters::Add_Shapes_List
CSG_Parameter * Add_Shapes_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.cpp:918
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:1052
CSG_Parameters::Add_Grid_List
CSG_Parameter * Add_Grid_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
Definition: parameters.cpp:736
CSG_Parameter_Grids
Definition: parameters.h:1245
CSG_Grid_Resampling::Minimum
@ Minimum
CSG_Parameters::Load
bool Load(const CSG_MetaData &Data)
Definition: parameters.cpp:2142
CSG_File::Scan_Double
double Scan_Double(void) const
Definition: api_file.cpp:562
CSG_Parameters::Get_Tool
class CSG_Tool * Get_Tool(void) const
Definition: parameters.h:1718
SG_UI_DataObject_Update
bool SG_UI_DataObject_Update(CSG_Data_Object *pDataObject, int Show, CSG_Parameters *pParameters)
Definition: api_callback.cpp:633
CSG_Parameters::Add_Reference
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)
Definition: parameters.cpp:361
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:405
CSG_Parameter_Grids_List
Definition: parameters.h:1450
SG_UI_DataObject_Add
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:607
CSG_Parameter_File_Name::Set_Filter
void Set_Filter(const SG_Char *Filter)
Definition: parameter_data.cpp:1543
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:559
CSG_Parameters::Add_Color
CSG_Parameter * Add_Color(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0)
Definition: parameters.cpp:495
CSG_Parameter::asDataType
class CSG_Parameter_Data_Type * asDataType(void) const
Definition: parameter.cpp:1145
CSG_Parameter::Get_Child
CSG_Parameter * Get_Child(int iChild) const
Definition: parameters.h:260
ADD_METHOD
#define ADD_METHOD(method, name)
CSG_Parameter_Grid_List
Definition: parameters.h:1415
CSG_Parameters::Add_Int
CSG_Parameter * Add_Int(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0, int Minimum=0, bool bMinimum=false, int Maximum=0, bool bMaximum=false)
Definition: parameters.cpp:470
CSG_Parameters::Add_Colors
CSG_Parameter * Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Palette=0, int nColors=11, bool bRevert=false)
Definition: parameters.cpp:587
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:287
CSG_DateTime::Get_JDN
double Get_JDN(void) const
Definition: datetime.cpp:411
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:149
CSG_Parameters::Add_Table_List
CSG_Parameter * Add_Table_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:885
CSG_Parameter_Range::Set_Range
bool Set_Range(double Min, double Max)
Definition: parameter_data.cpp:785
CSG_Parameter_Range
Definition: parameters.h:616
CSG_Table::Assign_Values
bool Assign_Values(const CSG_Table &Table)
Definition: table.cpp:378
CSG_Parameters::Add_Table
CSG_Parameter * Add_Table(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:867
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:130
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:390
CSG_Parameters::Add_Parameters
CSG_Parameter * Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:995
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:155
CSG_Parameter::_Set_String
virtual void _Set_String(void)
Definition: parameter.cpp:909
CSG_Parameters::Add_Grids
CSG_Parameter * Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:760
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:238
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_Parameters::Create
bool Create(const CSG_Parameters &Parameters)
Definition: parameters.cpp:124
CSG_Parameters::Add_Table_Fields
CSG_Parameter * Add_Table_Fields(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:850
CSG_Parameters::Add_Grid
CSG_Parameter * Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:690
CSG_File::is_Open
bool is_Open(void) const
Definition: api_core.h:1149
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Parameters::Add_PointCloud_Output
CSG_Parameter * Add_PointCloud_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:972
CSG_Grid_Resampling::Maximum
@ Maximum
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1150
CSG_Parameters::Del_Parameter
bool Del_Parameter(int i)
Definition: parameters.cpp:1283
CSG_Data_Manager::Add
CSG_Data_Object * Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:310
CSG_Grid_Resampling
CSG_Grid_Resampling
Definition: grid.h:156
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:300
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:237
parameters.h
CSG_MetaData::Add_Children
bool Add_Children(const CSG_MetaData &MetaData)
Definition: metadata.cpp:359
CSG_Parameters::Add_Info_String
CSG_Parameter * Add_Info_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false)
Definition: parameters.cpp:563
CSG_Parameters::Add_TIN
CSG_Parameter * Add_TIN(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:933
SG_Create_Grids
CSG_Grids * SG_Create_Grids(void)
Definition: grids.cpp:65
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Parameters::Add_Grids_Output
CSG_Parameter * Add_Grids_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:786
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1378
CSG_Parameter_Shapes_List
Definition: parameters.h:1499
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:663
CSG_Projection
Definition: geo_tools.h:827
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1735
CSG_Parameter_Int
Definition: parameters.h:476
CSG_Parameters::Add_Shapes
CSG_Parameter * Add_Shapes(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.cpp:898
CSG_Table
Definition: table.h:285
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_String::Left
CSG_String Left(size_t count) const
Definition: api_string.cpp:752
CSG_Parameter_Range::Set_Max
bool Set_Max(double Max)
Definition: parameter_data.cpp:822
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:691
PARAMETER_GUI_COLLAPSED
#define PARAMETER_GUI_COLLAPSED
Definition: parameters.h:101
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:259
CSG_Parameter_Grid::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1208
CSG_Parameter::Get_Parent
CSG_Parameter * Get_Parent(void) const
Definition: parameter.cpp:106
CSG_Parameter::is_DataObject
bool is_DataObject(void) const
Definition: parameter.cpp:291
CSG_Parameter_Double
Definition: parameters.h:514
CSG_Parameter_Bool
Definition: parameters.h:401
SG_Get_History_Ignore_Lists
int SG_Get_History_Ignore_Lists(void)
Definition: dataobject.cpp:172
SG_Char
#define SG_Char
Definition: api_core.h:536
CSG_Parameters::Set_Description
void Set_Description(const CSG_String &Description)
Definition: parameters.cpp:351
CSG_String
Definition: api_core.h:563
CSG_Parameters::Set_Tool
void Set_Tool(class CSG_Tool *pTool)
Definition: parameters.cpp:202
CSG_Data_Object::asGrid
class CSG_Grid * asGrid(bool bPolymorph=false) const
Definition: dataobject.cpp:550
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1146
PARAMETER_INFORMATION
#define PARAMETER_INFORMATION
Definition: parameters.h:97
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:129
CSG_MetaData
Definition: metadata.h:88
CSG_Colors::Serialize
bool Serialize(CSG_File &Stream, bool bSave, bool bBinary)
Definition: api_colors.cpp:1320
CSG_Strings::Sort
bool Sort(bool Ascending=true)
Definition: api_string.cpp:1168
CSG_Parameter_Table_Fields
Definition: parameters.h:1103
CSG_Parameter::Check
bool Check(bool bSilent=true)
Definition: parameter.cpp:967
CSG_Parameter_String
Definition: parameters.h:805
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:786
CSG_Parameters::Add_Shapes_Output
CSG_Parameter * Add_Shapes_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:908
CSG_Parameter_Shapes::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1292
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Parameter::has_Changed
bool has_Changed(int Check_Flags=PARAMETER_CHECK_ALL)
Definition: parameter.cpp:901
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:234
CSG_Parameter_Color
Definition: parameters.h:936
CSG_Parameters::Add_Grid_Output
CSG_Parameter * Add_Grid_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:726
CSG_Parameters::CSG_Parameters
CSG_Parameters(void)
Definition: parameters.cpp:65
CSG_Parameters::Destroy
void Destroy(void)
Definition: parameters.cpp:183
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:144
CSG_File::Read_Line
bool Read_Line(CSG_String &Line) const
Definition: api_file.cpp:399
CSG_Parameter_File_Name::Set_Flag_Directory
void Set_Flag_Directory(bool bFlag)
Definition: parameter_data.cpp:1571
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:160
CSG_Parameters::Save
bool Save(CSG_MetaData &Data) const
Definition: parameters.cpp:2165
CSG_Parameters::Add_Table_Output
CSG_Parameter * Add_Table_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:875
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:157
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1149
TSG_PFNC_Parameter_Changed
int(* TSG_PFNC_Parameter_Changed)(CSG_Parameter *pParameter, int Flags)
Definition: parameters.h:1692
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:130
CSG_Parameters::Add_PointCloud_List
CSG_Parameter * Add_PointCloud_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:982
CSG_Parameters::Assign_Parameters
bool Assign_Parameters(CSG_Parameters *pSource)
Definition: parameters.cpp:1575
SG_UI_Get_Window_Main
void * SG_UI_Get_Window_Main(void)
Definition: api_callback.cpp:806
CSG_Parameters::Set_Manager
void Set_Manager(class CSG_Data_Manager *pManager)
Definition: parameters.cpp:223
CSG_Parameters::Set_Identifier
void Set_Identifier(const CSG_String &Identifier)
Definition: parameters.cpp:321
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:162
CSG_Parameters::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: parameters.cpp:1440
CSG_Parameter_Choice
Definition: parameters.h:665
SG_UI_MSG_STYLE_01
@ SG_UI_MSG_STYLE_01
Definition: api_core.h:1579
CSG_Parameters::Get_Name
const CSG_String & Get_Name(void) const
Definition: parameters.h:1738
CSG_Parameter::Set_Enabled
bool Set_Enabled(bool bEnabled=true)
Definition: parameter.cpp:211
CSG_Table::Create
bool Create(void)
Definition: table.cpp:153
CSG_Parameter_Range::Get_Min_Parameter
CSG_Parameter_Double * Get_Min_Parameter(void) const
Definition: parameters.h:626
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Parameters::Add_Choices
CSG_Parameter * Add_Choices(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items)
Definition: parameters.cpp:548
CSG_Parameters::Set_Callback_On_Parameter_Changed
TSG_PFNC_Parameter_Changed Set_Callback_On_Parameter_Changed(TSG_PFNC_Parameter_Changed pCallback)
Definition: parameters.cpp:1377
CSG_Parameter_PointCloud_List
Definition: parameters.h:1553
CSG_Parameter_TIN_List
Definition: parameters.h:1530
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
CSG_Parameters
Definition: parameters.h:1696
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:997
CSG_Parameter::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameter.cpp:534
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:166
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:806
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:553
CSG_Parameter::is_Parameters
bool is_Parameters(void) const
Definition: parameter.cpp:328
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:1053
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:604
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:131
CSG_Parameter_Range::Get_Max_Parameter
CSG_Parameter_Double * Get_Max_Parameter(void) const
Definition: parameters.h:630
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:254
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:159
TSG_Parameter_Type
TSG_Parameter_Type
Definition: parameters.h:123
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:164
CSG_Parameter_Choices::Set_Items
void Set_Items(const CSG_String &Items)
Definition: parameter_data.cpp:1305
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:139
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1154
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:637
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:140
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:152
CSG_Parameter::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter.cpp:956
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int Index) const
Definition: metadata.h:181
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Parameters::Set_History
bool Set_History(CSG_MetaData &History, bool bOptions=true, bool bDataObjects=true)
Definition: parameters.cpp:2002
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Parameters::Set_Callback
bool Set_Callback(bool bActive=true)
Definition: parameters.cpp:1398
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1148
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:239
CSG_Parameter_Table
Definition: parameters.h:1266
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:465
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:305
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:123
CSG_Parameter_Data_Type
Definition: parameters.h:723
CSG_Colors
Definition: api_core.h:1408
PARAMETER_OUTPUT_OPTIONAL
#define PARAMETER_OUTPUT_OPTIONAL
Definition: parameters.h:104
CSG_Parameters::Add_Grid_Resampling
CSG_Parameter * Add_Grid_Resampling(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_Resampling Methods=CSG_Grid_Resampling::Interpolations, CSG_Grid_Resampling Default=CSG_Grid_Resampling::Bicubic_2)
Definition: parameters.cpp:642
CSG_Parameters::Add_Table_Field
CSG_Parameter * Add_Table_Field(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false)
Definition: parameters.cpp:820
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:136
SG_Create_Shapes
CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85
CSG_Parameters::Add_Choice
CSG_Parameter * Add_Choice(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0)
Definition: parameters.cpp:533