SAGA API  v9.5
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)
441 {
442  return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Node, 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_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit)
643 {
644  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Grid_System, 0);
645 
646  if( pInit )
647  {
648  pParameter->asGrid_System()->Assign(*pInit);
649  }
650 
651  return( pParameter );
652 }
653 
654 //---------------------------------------------------------
655 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)
656 {
657  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
658 
659  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
660  {
661  SystemID = pParent->Get_Identifier();
662  }
663  else if( bSystem_Dependent && m_pGrid_System )
664  {
665  SystemID = m_pGrid_System->Get_Identifier();
666  }
667  else
668  {
669  pParent = Add_Grid_System(pParent ? pParent->Get_Identifier() : SG_T(""), ID + "_GRIDSYSTEM", _TL("Grid system"), "");
670  SystemID = pParent->Get_Identifier();
671  }
672 
673  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grid, Constraint);
674 
675  ((CSG_Parameter_Grid *)pParameter)->Set_Preferred_Type(Preferred_Type);
676 
677  return( pParameter );
678 }
679 
680 //---------------------------------------------------------
681 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)
682 {
683  CSG_Parameter *pParameter = Add_Grid(ParentID, ID, Name, Description, PARAMETER_INPUT_OPTIONAL, bSystem_Dependent);
684 
685  ((CSG_Parameter_Grid *)pParameter)->Add_Default(Value, Minimum, bMinimum, Maximum, bMaximum);
686 
687  return( pParameter );
688 }
689 
690 //---------------------------------------------------------
691 CSG_Parameter * CSG_Parameters::Add_Grid_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
692 {
693  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
694 
695  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Grid);
696 
697  return( pParameter );
698 }
699 
700 //---------------------------------------------------------
701 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)
702 {
703  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
704 
705  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
706  {
707  SystemID = pParent->Get_Identifier();
708  }
709  else if( bSystem_Dependent && m_pGrid_System && !((Constraint & PARAMETER_OUTPUT) && (Constraint & PARAMETER_OPTIONAL)) )
710  {
711  SystemID = m_pGrid_System->Get_Identifier();
712  }
713 
714  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grid_List, Constraint);
715 
716  return( pParameter );
717 }
718 
719 
721 // //
723 
724 //---------------------------------------------------------
725 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)
726 {
727  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
728 
729  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
730  {
731  SystemID = pParent->Get_Identifier();
732  }
733  else if( bSystem_Dependent && m_pGrid_System )
734  {
735  SystemID = m_pGrid_System->Get_Identifier();
736  }
737  else
738  {
739  pParent = Add_Grid_System(pParent ? pParent->Get_Identifier() : SG_T(""), ID + "_GRIDSYSTEM", _TL("Grid system"), "");
740  SystemID = pParent->Get_Identifier();
741  }
742 
743  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grids, Constraint);
744 
745  ((CSG_Parameter_Grids *)pParameter)->Set_Preferred_Type(Preferred_Type);
746 
747  return( pParameter );
748 }
749 
750 //---------------------------------------------------------
751 CSG_Parameter * CSG_Parameters::Add_Grids_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
752 {
753  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
754 
755  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Grids);
756 
757  return( pParameter );
758 }
759 
760 //---------------------------------------------------------
761 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)
762 {
763  CSG_String SystemID; CSG_Parameter *pParent = Get_Parameter(ParentID);
764 
765  if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
766  {
767  SystemID = pParent->Get_Identifier();
768  }
769  else if( bSystem_Dependent && m_pGrid_System && !((Constraint & PARAMETER_OUTPUT) && (Constraint & PARAMETER_OPTIONAL)) )
770  {
771  SystemID = m_pGrid_System->Get_Identifier();
772  }
773 
774  CSG_Parameter *pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grids_List, Constraint);
775 
776  return( pParameter );
777 }
778 
779 
781 // //
783 
784 //---------------------------------------------------------
785 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)
786 {
787  CSG_Parameter *pParent = Get_Parameter(ParentID);
788 
789  if( pParent && (
790  pParent->Get_Type() == PARAMETER_TYPE_Table
791  || pParent->Get_Type() == PARAMETER_TYPE_Shapes
792  || pParent->Get_Type() == PARAMETER_TYPE_TIN
793  || pParent->Get_Type() == PARAMETER_TYPE_PointCloud) )
794  {
795  return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_Field, bAllowNone ? PARAMETER_OPTIONAL : 0) );
796  }
797 
798  return( NULL );
799 }
800 
801 //---------------------------------------------------------
802 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)
803 {
804  CSG_Parameter *pParameter = Add_Table_Field(ParentID, ID, Name, Description, true);
805 
806  if( pParameter )
807  {
808  ((CSG_Parameter_Table_Field *)pParameter)->Add_Default(Value, Minimum, bMinimum, Maximum, bMaximum);
809  }
810 
811  return( pParameter );
812 }
813 
814 //---------------------------------------------------------
815 CSG_Parameter * CSG_Parameters::Add_Table_Fields(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
816 {
817  CSG_Parameter *pParent = Get_Parameter(ParentID);
818 
819  if( pParent && (
820  pParent->Get_Type() == PARAMETER_TYPE_Table
821  || pParent->Get_Type() == PARAMETER_TYPE_Shapes
822  || pParent->Get_Type() == PARAMETER_TYPE_TIN
823  || pParent->Get_Type() == PARAMETER_TYPE_PointCloud) )
824  {
825  return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_Fields, 0) );
826  }
827 
828  return( NULL );
829 }
830 
831 //---------------------------------------------------------
832 CSG_Parameter * CSG_Parameters::Add_Table(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
833 {
834  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table, Constraint);
835 
836  return( pParameter );
837 }
838 
839 //---------------------------------------------------------
840 CSG_Parameter * CSG_Parameters::Add_Table_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
841 {
842  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
843 
844  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Table);
845 
846  return( pParameter );
847 }
848 
849 //---------------------------------------------------------
850 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)
851 {
852  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_List, Constraint);
853 
854  return( pParameter );
855 }
856 
857 
859 // //
861 
862 //---------------------------------------------------------
863 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)
864 {
865  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Shapes, Constraint);
866 
867  ((CSG_Parameter_Shapes *)pParameter)->Set_Shape_Type(Shape_Type);
868 
869  return( pParameter );
870 }
871 
872 //---------------------------------------------------------
873 CSG_Parameter * CSG_Parameters::Add_Shapes_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
874 {
875  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
876 
877  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Shapes);
878 
879  return( pParameter );
880 }
881 
882 //---------------------------------------------------------
883 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)
884 {
885  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Shapes_List, Constraint);
886 
887  ((CSG_Parameter_Shapes_List *)pParameter)->Set_Shape_Type(Type);
888 
889  return( pParameter );
890 }
891 
892 
894 // //
896 
897 //---------------------------------------------------------
898 CSG_Parameter * CSG_Parameters::Add_TIN(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
899 {
900  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_TIN, Constraint);
901 
902  return( pParameter );
903 }
904 
905 //---------------------------------------------------------
906 CSG_Parameter * CSG_Parameters::Add_TIN_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
907 {
908  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
909 
910  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_TIN);
911 
912  return( pParameter );
913 }
914 
915 //---------------------------------------------------------
916 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)
917 {
918  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_TIN_List, Constraint);
919 
920  return( pParameter );
921 }
922 
923 
925 // //
927 
928 //---------------------------------------------------------
929 CSG_Parameter * CSG_Parameters::Add_PointCloud(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
930 {
931  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_PointCloud, Constraint);
932 
933  return( pParameter );
934 }
935 
936 //---------------------------------------------------------
937 CSG_Parameter * CSG_Parameters::Add_PointCloud_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
938 {
939  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
940 
941  ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_PointCloud);
942 
943  return( pParameter );
944 }
945 
946 //---------------------------------------------------------
947 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)
948 {
949  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_PointCloud_List, Constraint);
950 
951  return( pParameter );
952 }
953 
954 
956 // //
958 
959 //---------------------------------------------------------
960 CSG_Parameter * CSG_Parameters::Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
961 {
962  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Parameters, 0);
963 
964  pParameter->asParameters()->m_Callback = m_Callback;
965  pParameter->asParameters()->m_pTool = m_pTool;
966 
967  return( pParameter );
968 }
969 
970 
972 // //
974 
975 //---------------------------------------------------------
976 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)
977 {
978  switch( Type ) // Check if Type is valid...
979  {
980  case PARAMETER_TYPE_Bool :
981  case PARAMETER_TYPE_Int :
984  case PARAMETER_TYPE_Date :
985  case PARAMETER_TYPE_Color :
986  break;
987 
988  default: // if not valid set Type to [double]...
989  Type = PARAMETER_TYPE_Double;
990  }
991 
992  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, Type, bInformation ? PARAMETER_INFORMATION : 0);
993 
994  bool bCallback = Set_Callback(false);
995 
996  if( !bInformation )
997  {
998  if( Type == PARAMETER_TYPE_Int
999  || Type == PARAMETER_TYPE_Double
1000  || Type == PARAMETER_TYPE_Degree )
1001  {
1002  pParameter->asValue()->Set_Minimum(Minimum, bMinimum);
1003  pParameter->asValue()->Set_Maximum(Maximum, bMaximum);
1004  }
1005  }
1006 
1007  pParameter->Set_Value(Value);
1008 
1009  Set_Callback(bCallback);
1010 
1011  if( !bInformation )
1012  {
1013  switch( Type )
1014  {
1015  case PARAMETER_TYPE_Bool :
1016  case PARAMETER_TYPE_Int :
1017  case PARAMETER_TYPE_Color :
1018  pParameter->Set_Default((int)Value);
1019  break;
1020 
1021  case PARAMETER_TYPE_Date :
1022  pParameter->Set_Default(pParameter->asString());
1023  break;
1024 
1025  default:
1026  pParameter->Set_Default( Value);
1027  }
1028  }
1029 
1030  return( pParameter );
1031 }
1032 
1033 //---------------------------------------------------------
1034 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)
1035 {
1036  //-----------------------------------------------------
1037  if( Default_Min > Default_Max )
1038  {
1039  double d = Default_Min;
1040  Default_Min = Default_Max;
1041  Default_Max = d;
1042  }
1043 
1044  //-----------------------------------------------------
1045  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Range, bInformation ? PARAMETER_INFORMATION : 0);
1046 
1047  pParameter->asRange()->Get_Min_Parameter()->Set_Minimum(Minimum, bMinimum);
1048  pParameter->asRange()->Get_Min_Parameter()->Set_Maximum(Maximum, bMaximum);
1049  pParameter->asRange()->Get_Min_Parameter()->Set_Default(Default_Min);
1050  pParameter->asRange()->Set_Min(Default_Min);
1051 
1052  pParameter->asRange()->Get_Max_Parameter()->Set_Minimum(Minimum, bMinimum);
1053  pParameter->asRange()->Get_Max_Parameter()->Set_Maximum(Maximum, bMaximum);
1054  pParameter->asRange()->Get_Max_Parameter()->Set_Default(Default_Max);
1055  pParameter->asRange()->Set_Max(Default_Max);
1056 
1057  return( pParameter );
1058 }
1059 
1060 //---------------------------------------------------------
1061 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)
1062 {
1063  CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, bLongText ? PARAMETER_TYPE_Text : PARAMETER_TYPE_String, bInformation ? PARAMETER_INFORMATION : 0);
1064 
1065  bool bCallback = Set_Callback(false);
1066  pParameter->Set_Value (String);
1067  pParameter->Set_Default(String);
1068  Set_Callback(bCallback);
1069 
1070  ((CSG_Parameter_String *)pParameter)->Set_Password(bPassword);
1071 
1072  return( pParameter );
1073 }
1074 
1075 
1077 // //
1079 
1080 //---------------------------------------------------------
1081 #ifdef _DEBUG
1082 #include <wx/debug.h>
1083 #include <wx/string.h>
1084 #endif
1085 
1086 //---------------------------------------------------------
1087 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)
1088 {
1089 #ifdef _DEBUG
1090  wxASSERT_MSG(!ID.is_Empty() , wxString::Format("CSG_Parameter::_Add(): Parameter ID is empty!"));
1091  wxASSERT_MSG(!Get_Parameter(ID), wxString::Format("CSG_Parameter::_Add(): Parameter ID \"%s\" is already in use!", ID.c_str()));
1092 #endif
1093 
1094  CSG_Parameter *pParameter;
1095 
1096  switch( Type )
1097  {
1098  default:
1099  return( NULL );
1100 
1101  case PARAMETER_TYPE_Node : pParameter = new CSG_Parameter_Node (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1102 
1103  case PARAMETER_TYPE_Bool : pParameter = new CSG_Parameter_Bool (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1104  case PARAMETER_TYPE_Int : pParameter = new CSG_Parameter_Int (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1105  case PARAMETER_TYPE_Double : pParameter = new CSG_Parameter_Double (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1106  case PARAMETER_TYPE_Degree : pParameter = new CSG_Parameter_Degree (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1107  case PARAMETER_TYPE_Date : pParameter = new CSG_Parameter_Date (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1108  case PARAMETER_TYPE_Range : pParameter = new CSG_Parameter_Range (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1109  case PARAMETER_TYPE_Data_Type : pParameter = new CSG_Parameter_Data_Type (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1110  case PARAMETER_TYPE_Choice : pParameter = new CSG_Parameter_Choice (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1111  case PARAMETER_TYPE_Choices : pParameter = new CSG_Parameter_Choices (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1112 
1113  case PARAMETER_TYPE_String : pParameter = new CSG_Parameter_String (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1114  case PARAMETER_TYPE_Text : pParameter = new CSG_Parameter_Text (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1115  case PARAMETER_TYPE_FilePath : pParameter = new CSG_Parameter_File_Name (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1116 
1117  case PARAMETER_TYPE_Font : pParameter = new CSG_Parameter_Font (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1118  case PARAMETER_TYPE_Color : pParameter = new CSG_Parameter_Color (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1119  case PARAMETER_TYPE_Colors : pParameter = new CSG_Parameter_Colors (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1120  case PARAMETER_TYPE_FixedTable : pParameter = new CSG_Parameter_Fixed_Table (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1121  case PARAMETER_TYPE_Grid_System : pParameter = new CSG_Parameter_Grid_System (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1122  case PARAMETER_TYPE_Table_Field : pParameter = new CSG_Parameter_Table_Field (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1123  case PARAMETER_TYPE_Table_Fields : pParameter = new CSG_Parameter_Table_Fields (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1124 
1125  case PARAMETER_TYPE_DataObject_Output: pParameter = new CSG_Parameter_Data_Object_Output(this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1126  case PARAMETER_TYPE_Grid : pParameter = new CSG_Parameter_Grid (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1127  case PARAMETER_TYPE_Grids : pParameter = new CSG_Parameter_Grids (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1128  case PARAMETER_TYPE_Table : pParameter = new CSG_Parameter_Table (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1129  case PARAMETER_TYPE_Shapes : pParameter = new CSG_Parameter_Shapes (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1130  case PARAMETER_TYPE_TIN : pParameter = new CSG_Parameter_TIN (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1131  case PARAMETER_TYPE_PointCloud : pParameter = new CSG_Parameter_PointCloud (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1132 
1133  case PARAMETER_TYPE_Grid_List : pParameter = new CSG_Parameter_Grid_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1134  case PARAMETER_TYPE_Grids_List : pParameter = new CSG_Parameter_Grids_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1135  case PARAMETER_TYPE_Table_List : pParameter = new CSG_Parameter_Table_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1136  case PARAMETER_TYPE_Shapes_List : pParameter = new CSG_Parameter_Shapes_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1137  case PARAMETER_TYPE_TIN_List : pParameter = new CSG_Parameter_TIN_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1138  case PARAMETER_TYPE_PointCloud_List : pParameter = new CSG_Parameter_PointCloud_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1139 
1140  case PARAMETER_TYPE_Parameters : pParameter = new CSG_Parameter_Parameters (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1141  }
1142 
1143  m_Parameters = (CSG_Parameter **)SG_Realloc(m_Parameters, (m_nParameters + 1) * sizeof(CSG_Parameter *));
1144  m_Parameters[m_nParameters++] = pParameter;
1145 
1146  pParameter->_Set_String();
1147 
1148  return( pParameter );
1149 }
1150 
1151 //---------------------------------------------------------
1152 CSG_Parameter * CSG_Parameters::_Add(CSG_Parameter *pSource)
1153 {
1154  CSG_Parameter *pParameter = !pSource ? NULL : _Add(
1155  pSource->Get_Parent() ? pSource->Get_Parent()->Get_Identifier() : SG_T(""),
1156  pSource->Get_Identifier (),
1157  pSource->Get_Name (),
1158  pSource->Get_Description(),
1159  pSource->Get_Type (),
1160  pSource->m_Constraint
1161  );
1162 
1163  if( pParameter )
1164  {
1165  pParameter->Assign(pSource);
1166  }
1167 
1168  return( pParameter );
1169 }
1170 
1171 
1173 // //
1175 
1176 //---------------------------------------------------------
1177 CSG_Parameter * CSG_Parameters::Get_Parameter(int i, bool MsgOnError) const
1178 {
1179  if( i >= 0 && i < m_nParameters )
1180  {
1181  return( m_Parameters[i] );
1182  }
1183 
1184  if( MsgOnError )
1185  {
1186  SG_UI_Msg_Add_Error(CSG_String::Format("%s index=[%d]", _TL("Could not find requested parameter!"), i));
1187  }
1188 
1189  return( NULL );
1190 }
1191 
1192 //---------------------------------------------------------
1193 CSG_Parameter * CSG_Parameters::Get_Parameter(const char *ID, bool MsgOnError) const { return( Get_Parameter(CSG_String(ID), MsgOnError) ); }
1194 CSG_Parameter * CSG_Parameters::Get_Parameter(const wchar_t *ID, bool MsgOnError) const { return( Get_Parameter(CSG_String(ID), MsgOnError) ); }
1195 CSG_Parameter * CSG_Parameters::Get_Parameter(const CSG_String &ID, bool MsgOnError) const
1196 {
1197  if( m_Parameters && !ID.is_Empty() )
1198  {
1199  for(int i=0; i<m_nParameters; i++)
1200  {
1201  if( m_Parameters[i]->Cmp_Identifier(ID) )
1202  {
1203  return( m_Parameters[i] );
1204  }
1205  }
1206 
1207  //-------------------------------------------------
1208  if( ID.Find('.') > 0 ) // id not found? check for sub-parameter ('id.id')!
1209  {
1210  CSG_Parameter *pParameter = Get_Parameter(ID.BeforeFirst('.'));
1211 
1212  if( pParameter )
1213  {
1214  switch( pParameter->Get_Type() )
1215  {
1217  return( pParameter->asParameters()->Get_Parameter(ID.AfterFirst('.')) );
1218 
1219  case PARAMETER_TYPE_Range :
1220  if( !ID.AfterFirst('.').CmpNoCase("min") || !ID.AfterFirst('.').CmpNoCase("minimum") )
1221  {
1222  return( pParameter->asRange()->Get_Min_Parameter() );
1223  }
1224 
1225  if( !ID.AfterFirst('.').CmpNoCase("max") || !ID.AfterFirst('.').CmpNoCase("maximum") )
1226  {
1227  return( pParameter->asRange()->Get_Max_Parameter() );
1228  }
1229  break;
1230 
1231  default:
1232  break;
1233  }
1234  }
1235  }
1236 
1237  //-------------------------------------------------
1238  if( MsgOnError )
1239  {
1240  SG_UI_Msg_Add_Error(CSG_String::Format("%s id=[%s]", _TL("Could not find requested parameter!"), ID.c_str()));
1241  }
1242  }
1243 
1244  return( NULL );
1245 }
1246 
1247 //---------------------------------------------------------
1248 bool CSG_Parameters::Del_Parameter(int iParameter)
1249 {
1250  if( m_Parameters && iParameter >= 0 && iParameter < m_nParameters )
1251  {
1252  CSG_Parameter *pParameter = m_Parameters[iParameter];
1253 
1254  for(m_nParameters--; iParameter<m_nParameters; iParameter++)
1255  {
1256  m_Parameters[iParameter] = m_Parameters[iParameter + 1];
1257  }
1258 
1259  m_Parameters = (CSG_Parameter **)SG_Realloc(m_Parameters, m_nParameters * sizeof(CSG_Parameter *));
1260 
1261  for(iParameter=pParameter->Get_Children_Count()-1; iParameter>=0; iParameter--)
1262  {
1263  Del_Parameter(pParameter->Get_Child(iParameter)->Get_Identifier());
1264  }
1265 
1266  CSG_Parameter *pParent = pParameter->Get_Parent();
1267 
1268  if( pParent )
1269  {
1270  for(iParameter=0; iParameter<pParent->m_nChildren; iParameter++)
1271  {
1272  if( pParent->m_Children[iParameter] == pParameter )
1273  {
1274  pParent->m_nChildren--;
1275 
1276  for( ; iParameter<pParent->m_nChildren; iParameter++)
1277  {
1278  pParent->m_Children[iParameter] = pParent->m_Children[iParameter + 1];
1279  }
1280  }
1281  }
1282 
1283  pParent->m_Children = (CSG_Parameter **)SG_Realloc(pParent->m_Children, pParent->m_nChildren * sizeof(CSG_Parameter *));
1284  }
1285 
1286  delete(pParameter);
1287 
1288  return( true );
1289  }
1290 
1291  return( false );
1292 }
1293 
1294 //---------------------------------------------------------
1296 {
1297  if( m_Parameters && Identifier.Length() )
1298  {
1299  for(int i=0; i<m_nParameters; i++)
1300  {
1301  if( !m_Parameters[i]->m_Identifier.Cmp(Identifier) )
1302  {
1303  return( Del_Parameter(i) );
1304  }
1305  }
1306  }
1307 
1308  return( false );
1309 }
1310 
1311 //---------------------------------------------------------
1313 {
1314  if( m_nParameters > 0 )
1315  {
1316  m_pGrid_System = NULL;
1317 
1318  for(int i=0; i<m_nParameters; i++)
1319  {
1320  delete(m_Parameters[i]);
1321  }
1322 
1323  SG_Free(m_Parameters);
1324 
1325  m_Parameters = NULL;
1326  m_nParameters = 0;
1327  }
1328 
1329  return( true );
1330 }
1331 
1332 
1334 // //
1335 // Callback //
1336 // //
1338 
1339 //---------------------------------------------------------
1340 // Callback function used to react on parameter changes.
1341 // Return value is the previously set callback function.
1343 {
1344  TSG_PFNC_Parameter_Changed Previous = m_Callback;
1345 
1346  m_Callback = Callback;
1347 
1348  for(int i=0; i<m_nParameters; i++)
1349  {
1350  if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters)
1351  {
1352  m_Parameters[i]->asParameters()->Set_Callback_On_Parameter_Changed(Callback);
1353  }
1354  }
1355 
1356  return( Previous );
1357 }
1358 
1359 //---------------------------------------------------------
1360 // If switched off parameter changes will not invoke a
1361 // consecutive call to the On_Parameter_Changed function.
1362 // Return value is the previous state.
1364 {
1365  bool bPrevious = m_bCallback;
1366 
1367  m_bCallback = bActive;
1368 
1369  for(int i=0; i<m_nParameters; i++)
1370  {
1371  if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters)
1372  {
1373  m_Parameters[i]->asParameters()->Set_Callback(bActive);
1374  }
1375  }
1376 
1377  return( bPrevious );
1378 }
1379 
1380 //---------------------------------------------------------
1381 bool CSG_Parameters::_On_Parameter_Changed(CSG_Parameter *pParameter, int Flags)
1382 {
1383  if( m_Callback && m_bCallback )
1384  {
1385  bool bCallback = Set_Callback(false);
1386 
1387  m_Callback(pParameter, Flags);
1388 
1389  Set_Callback(bCallback);
1390 
1391  return( true );
1392  }
1393 
1394  return( false );
1395 }
1396 
1397 
1399 // //
1401 
1402 //---------------------------------------------------------
1403 bool CSG_Parameters::Set_Parameter(const char *ID, CSG_Parameter *pValue) { return( Set_Parameter(CSG_String(ID), pValue) ); }
1404 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) { return( Set_Parameter(CSG_String(ID), pValue) ); }
1406 {
1407  CSG_Parameter *pTarget = Get_Parameter(ID);
1408 
1409  return( pTarget && pValue && pTarget->Get_Type() == pValue->Get_Type() && pTarget->Assign(pValue) );
1410 }
1411 
1412 //---------------------------------------------------------
1413 bool CSG_Parameters::Set_Parameter(const char *ID, void *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1414 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, void *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1415 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, void *Value, int Type)
1416 {
1417  CSG_Parameter *pTarget = Get_Parameter(ID);
1418 
1419  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1420 }
1421 
1422 //---------------------------------------------------------
1423 bool CSG_Parameters::Set_Parameter(const char *ID, CSG_Data_Object *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1424 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, CSG_Data_Object *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1426 {
1427  CSG_Parameter *pTarget = Get_Parameter(ID);
1428 
1429  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1430 }
1431 
1432 //---------------------------------------------------------
1433 bool CSG_Parameters::Set_Parameter(const char *ID, int Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1434 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, int Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1435 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, int Value, int Type)
1436 {
1437  CSG_Parameter *pTarget = Get_Parameter(ID);
1438 
1439  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1440 }
1441 
1442 //---------------------------------------------------------
1443 bool CSG_Parameters::Set_Parameter(const char *ID, double Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1444 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, double Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1445 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, double Value, int Type)
1446 {
1447  CSG_Parameter *pTarget = Get_Parameter(ID);
1448 
1449  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1450 }
1451 
1452 //---------------------------------------------------------
1453 bool CSG_Parameters::Set_Parameter(const char *ID, const CSG_String &Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1454 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1455 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type)
1456 {
1457  CSG_Parameter *pTarget = Get_Parameter(ID);
1458 
1459  return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1460 }
1461 
1462 //---------------------------------------------------------
1463 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1464 bool CSG_Parameters::Set_Parameter(const char *ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1465 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1466 
1467 //---------------------------------------------------------
1468 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1469 bool CSG_Parameters::Set_Parameter(const char *ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1470 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1471 
1472 
1474 // //
1476 
1477 //---------------------------------------------------------
1479 {
1480  Set_Callback(false);
1481 
1482  for(int i=0; i<Get_Count(); i++)
1483  {
1484  m_Parameters[i]->Restore_Default();
1485 
1486  if( bClearData )
1487  {
1488  if( m_Parameters[i]->is_DataObject() )
1489  {
1490  m_Parameters[i]->Set_Value(DATAOBJECT_NOTSET);
1491  }
1492  else if( m_Parameters[i]->is_DataObject_List() )
1493  {
1494  m_Parameters[i]->asList()->Del_Items();
1495  }
1496  }
1497  }
1498 
1499  Set_Callback(true);
1500 
1501  return( true );
1502 }
1503 
1504 
1506 // //
1508 
1509 //---------------------------------------------------------
1511 {
1512  return( pSource && pSource != this && Create(*pSource) );
1513 }
1514 
1515 //---------------------------------------------------------
1517 {
1518  if( !pSource || pSource == this )
1519  {
1520  return( false );
1521  }
1522 
1523  //-----------------------------------------------------
1524  int n = 0;
1525 
1526  for(int i=0; i<pSource->Get_Count(); i++)
1527  {
1528  CSG_Parameter *pParameter = Get_Parameter(pSource->Get_Parameter(i)->Get_Identifier());
1529 
1530  if( pParameter && pParameter->Get_Type() == pSource->Get_Parameter(i)->Get_Type() )
1531  {
1532  n++; pParameter->Assign(pSource->Get_Parameter(i));
1533  }
1534  }
1535 
1536  return( n > 0 );
1537 }
1538 
1539 //---------------------------------------------------------
1541 {
1542  if( !pSource || pSource == this )
1543  {
1544  return( false );
1545  }
1546 
1547  Del_Parameters();
1548 
1549  //-----------------------------------------------------
1550  for(int i=0; i<pSource->m_nParameters; i++)
1551  {
1552  _Add(pSource->m_Parameters[i]);
1553 
1554  if( m_Parameters[i]->asParameters() )
1555  {
1556  m_Parameters[i]->asParameters()->Set_Tool(m_pTool);
1557  }
1558  }
1559 
1560  if( pSource->m_pGrid_System )
1561  {
1562  m_pGrid_System = Get_Parameter(pSource->m_pGrid_System->Get_Identifier());
1563  }
1564 
1565  return( m_nParameters == pSource->m_nParameters );
1566 }
1567 
1568 
1570 // //
1572 
1573 //---------------------------------------------------------
1575 {
1576  bool bResult = true; CSG_String sError;
1577 
1578  //-----------------------------------------------------
1579  for(int i=0; i<Get_Count(); i++)
1580  {
1581  if( m_Parameters[i]->Check(bSilent) == false )
1582  {
1583  bResult = false;
1584 
1585  sError.Append(CSG_String::Format("\n%s: %s", m_Parameters[i]->Get_Type_Name().c_str(), m_Parameters[i]->Get_Name()));
1586  }
1587  }
1588 
1589  //-----------------------------------------------------
1590  if( !bResult && !bSilent )
1591  {
1592  SG_UI_Dlg_Message(CSG_String::Format("%s\n%s", _TL("invalid input!"), sError.c_str()), Get_Name() );
1593  }
1594 
1595  return( bResult );
1596 }
1597 
1598 //---------------------------------------------------------
1599 bool CSG_Parameters::DataObjects_Create(void)
1600 {
1601  bool bResult = true;
1602 
1603  for(int i=0; bResult && i<Get_Count(); i++)
1604  {
1605  CSG_Parameter &P = *m_Parameters[i];
1606 
1607  //-------------------------------------------------
1608  if( P.Get_Type() == PARAMETER_TYPE_Parameters )
1609  {
1610  if( !P.asParameters()->DataObjects_Create() )
1611  {
1612  bResult = false;
1613  }
1614  }
1615  else if( P.is_Input() )
1616  {
1617  if( P.is_Enabled() && P.Check(true) == false )
1618  {
1619  bResult = false;
1620 
1621  SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Input Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1622  }
1623  }
1624 
1625  //-------------------------------------------------
1626  else if( P.is_DataObject_List() )
1627  {
1628  for(int j=P.asList()->Get_Item_Count()-1; j>=0; j--)
1629  {
1630  if( m_pManager && !m_pManager->Exists(P.asList()->Get_Item(j)) )
1631  {
1632  P.asList()->Del_Item(j);
1633  }
1634  }
1635  }
1636 
1637  //-------------------------------------------------
1638  else if( P.is_DataObject() && P.is_Enabled() == false && has_GUI() )
1639  {
1640  if( P.asDataObject() != DATAOBJECT_CREATE && (m_pManager && !m_pManager->Exists(P.asDataObject())) )
1641  {
1643  }
1644  }
1645 
1646  else if( P.is_DataObject() )
1647  {
1648  CSG_Data_Object *pObject = P.asDataObject();
1649 
1650  if( pObject != DATAOBJECT_CREATE )
1651  {
1653  {
1654  pObject = (CSG_Data_Object *)DATAOBJECT_CREATE;
1655  }
1656  else if( m_pManager && !m_pManager->Exists(pObject) )
1657  {
1658  pObject = (CSG_Data_Object *)DATAOBJECT_NOTSET;
1659  }
1660 
1661  if( pObject == DATAOBJECT_NOTSET && !P.is_Optional() )
1662  {
1663  pObject = (CSG_Data_Object *)DATAOBJECT_CREATE;
1664  }
1665  }
1666 
1667  if( pObject == DATAOBJECT_CREATE )
1668  {
1669  switch( P.Get_DataObject_Type() )
1670  {
1671  case SG_DATAOBJECT_TYPE_Table : pObject = SG_Create_Table (); break;
1672  case SG_DATAOBJECT_TYPE_Shapes : pObject = SG_Create_Shapes (); break;
1673  case SG_DATAOBJECT_TYPE_PointCloud: pObject = SG_Create_PointCloud(); break;
1674  case SG_DATAOBJECT_TYPE_TIN : pObject = SG_Create_TIN (); break;
1675  case SG_DATAOBJECT_TYPE_Grid : pObject = SG_Create_Grid (); break;
1676  case SG_DATAOBJECT_TYPE_Grids : pObject = SG_Create_Grids (); break;
1677  default : pObject = NULL ; break;
1678  }
1679  }
1680 
1681  if( pObject )
1682  {
1683  if( P.Get_Type() == PARAMETER_TYPE_Shapes
1684  && ((CSG_Parameter_Shapes *)&P)->Get_Shape_Type() != SHAPE_TYPE_Undefined
1685  && ((CSG_Parameter_Shapes *)&P)->Get_Shape_Type() != pObject->asShapes()->Get_Type() )
1686  {
1687  if( has_GUI() && pObject->asShapes()->Get_Type() != SHAPE_TYPE_Undefined )
1688  {
1689  pObject = SG_Create_Shapes (((CSG_Parameter_Shapes *)&P)->Get_Shape_Type());
1690  }
1691  else
1692  {
1693  pObject->asShapes()->Create(((CSG_Parameter_Shapes *)&P)->Get_Shape_Type());
1694  }
1695  }
1696 
1698  {
1699  if( P.Get_Parent() && P.Get_Parent()->asGrid_System() && P.Get_Parent()->asGrid_System()->is_Valid() )
1700  {
1701  CSG_Grid_System System(*P.Get_Parent()->asGrid_System());
1702 
1703  if( P.Get_Type() == PARAMETER_TYPE_Grid && !System.is_Equal(pObject->asGrid ()->Get_System()) )
1704  {
1705  pObject->asGrid ()->Create(System , ((CSG_Parameter_Grid *)&P)->Get_Preferred_Type());
1706  }
1707 
1708  if( P.Get_Type() == PARAMETER_TYPE_Grids && !System.is_Equal(pObject->asGrids()->Get_System()) )
1709  {
1710  pObject->asGrids()->Create(System, 0, 0., ((CSG_Parameter_Grids *)&P)->Get_Preferred_Type());
1711  }
1712  }
1713  }
1714 
1715  if( P.Set_Value(pObject) )
1716  {
1717  pObject->Set_Name(P.Get_Name());
1718  pObject->Get_MetaData().Del_Children();
1719 
1720  if( m_pManager )
1721  {
1722  m_pManager->Add(pObject);
1723  }
1724  }
1725  else
1726  {
1727  delete(pObject);
1728 
1729  bResult = false;
1730 
1731  SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Output Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1732  }
1733  }
1734  else // if( pObject == NULL )
1735  {
1736  if( !P.is_Optional() )
1737  {
1738  bResult = false;
1739 
1740  SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Output Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1741  }
1742  }
1743  }
1744  }
1745 
1746  return( bResult );
1747 }
1748 
1749 //---------------------------------------------------------
1750 bool CSG_Parameters::DataObjects_Synchronize(void)
1751 {
1752  for(int i=0; i<Get_Count(); i++)
1753  {
1754  CSG_Parameter &P = *m_Parameters[i];
1755 
1756  if( P.Get_Type() == PARAMETER_TYPE_Parameters )
1757  {
1758  P.asParameters()->DataObjects_Synchronize();
1759  }
1760 
1761  //-------------------------------------------------
1762  else if( P.is_Output() )
1763  {
1764  if( P.is_DataObject() )
1765  {
1766  CSG_Data_Object *pObject = P.asDataObject();
1767 
1768  if( pObject == DATAOBJECT_CREATE )
1769  {
1771  }
1772  else if( pObject != DATAOBJECT_NOTSET )
1773  {
1774  if( pObject->asShapes() && pObject->asShapes()->Get_Type() == SHAPE_TYPE_Undefined
1775  && (m_pManager == &SG_Get_Data_Manager() || !SG_Get_Data_Manager().Exists(pObject)) )
1776  {
1777  if( m_pManager && !m_pManager->Delete(pObject) )
1778  {
1779  delete(pObject);
1780  }
1781 
1783  }
1784  else
1785  {
1786  if( m_pManager )
1787  {
1788  m_pManager->Add(pObject);
1789 
1790  if( m_pManager == &SG_Get_Data_Manager() )
1791  {
1792  SG_UI_DataObject_Add(pObject, 0);
1793  }
1794  }
1795 
1797  }
1798  }
1799  }
1800 
1801  //---------------------------------------------
1802  else if( P.is_DataObject_List() )
1803  {
1804  for(int j=0; j<P.asList()->Get_Item_Count(); j++)
1805  {
1806  CSG_Data_Object *pObject = P.asList()->Get_Item(j);
1807 
1808  if( m_pManager )
1809  {
1810  m_pManager->Add(pObject);
1811 
1812  if( m_pManager == &SG_Get_Data_Manager() )
1813  {
1814  SG_UI_DataObject_Add(pObject, 0);
1815  }
1816  }
1817 
1819  }
1820  }
1821  }
1822  }
1823 
1824  return( true );
1825 }
1826 
1827 //---------------------------------------------------------
1828 bool CSG_Parameters::DataObjects_Get_Projection(CSG_Projection &Projection) const
1829 {
1830  for(int i=0; i<Get_Count() && !Projection.is_Okay(); i++)
1831  {
1832  CSG_Parameter *p = m_Parameters[i];
1833 
1834  if( p->is_Enabled() && !p->ignore_Projection() )
1835  {
1836  if( p->Get_Type() == PARAMETER_TYPE_Parameters )
1837  {
1838  p->asParameters()->DataObjects_Get_Projection(Projection);
1839  }
1840  else if( p->is_Input() )
1841  {
1842  if( p->is_DataObject()
1843  && p->asDataObject() != DATAOBJECT_NOTSET
1844  && p->asDataObject() != DATAOBJECT_CREATE )
1845  {
1846  Projection = p->asDataObject()->Get_Projection();
1847  }
1848  else if( p->is_DataObject_List() )
1849  {
1850  for(int j=0; j<p->asList()->Get_Item_Count() && !Projection.is_Okay(); j++)
1851  {
1852  Projection = p->asList()->Get_Item(j)->Get_Projection();
1853  }
1854  }
1855  }
1856  }
1857  }
1858 
1859  return( Projection.is_Okay() );
1860 }
1861 
1862 //---------------------------------------------------------
1863 bool CSG_Parameters::DataObjects_Set_Projection(const CSG_Projection &Projection)
1864 {
1865  if( !Projection.is_Okay() )
1866  {
1867  return( false );
1868  }
1869 
1870  for(int i=0; i<Get_Count(); i++)
1871  {
1872  CSG_Parameter *p = m_Parameters[i];
1873 
1874  if( !p->ignore_Projection() )
1875  {
1876  if( p->Get_Type() == PARAMETER_TYPE_Parameters )
1877  {
1878  p->asParameters()->DataObjects_Set_Projection(Projection);
1879  }
1880  else if( p->is_Output() )
1881  {
1882  if( p->is_DataObject()
1883  && p->asDataObject() != DATAOBJECT_NOTSET
1884  && p->asDataObject() != DATAOBJECT_CREATE )
1885  {
1886  p->asDataObject()->Get_Projection() = Projection;
1887  }
1888  else if( p->is_DataObject_List() )
1889  {
1890  for(int j=0; j<p->asList()->Get_Item_Count(); j++)
1891  {
1892  p->asList()->Get_Item(j)->Get_Projection() = Projection;
1893  }
1894  }
1895  }
1896  }
1897  }
1898 
1899  return( true );
1900 }
1901 
1902 
1904 // //
1906 
1907 //---------------------------------------------------------
1908 bool CSG_Parameters::Get_String(CSG_String &String, bool bOptionsOnly)
1909 {
1910  bool bResult = false;
1911 
1912  if( Get_Count() > 0 )
1913  {
1914  if( m_pGrid_System )
1915  {
1916  m_pGrid_System->_Set_String();
1917 
1918  String += CSG_String::Format("%s: %s\n", m_pGrid_System->Get_Name(), m_pGrid_System->asString());
1919  }
1920 
1921  for(int i=0; i<Get_Count(); i++)
1922  {
1923  CSG_Parameter &P = *m_Parameters[i];
1924 
1925  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()) )
1926  {
1927  bResult = true;
1928 
1929  P._Set_String(); // forcing update (at scripting level some parameter types can be changed without the Set_Parameter() mechanism)
1930 
1931  CSG_String s(P.asString()); if( s.Length() > 256 ) { s = s.Left(256) + "..."; }
1932 
1933  String += CSG_String::Format("%s: %s\n", P.Get_Name(), s.c_str());
1934  }
1935  }
1936  }
1937 
1938  return( bResult );
1939 }
1940 
1941 //---------------------------------------------------------
1942 bool CSG_Parameters::Msg_String(bool bOptionsOnly)
1943 {
1944  CSG_String Message;
1945 
1946  if( Get_String(Message, bOptionsOnly) )
1947  {
1948  SG_UI_Msg_Add_Execution(CSG_String::Format("\n__________\n[%s] %s:\n", m_Name.c_str(),
1949  bOptionsOnly ? _TL("Options") : _TL("Parameters")),
1950  false, SG_UI_MSG_STYLE_NORMAL
1951  );
1952 
1954 
1955  return( true );
1956  }
1957 
1958  return( false );
1959 }
1960 
1961 
1963 // //
1965 
1966 //---------------------------------------------------------
1967 bool CSG_Parameters::Set_History(CSG_MetaData &MetaData, bool bOptions, bool bDataObjects)
1968 {
1969  if( bOptions ) // get options...
1970  {
1971  for(int i=0; i<Get_Count(); i++)
1972  {
1973  CSG_Parameter &P = *m_Parameters[i];
1974 
1975  if( P.is_Option() && P.is_Enabled() && !P.is_Information() && !(P.Get_Type() == PARAMETER_TYPE_String && ((CSG_Parameter_String *)&P)->is_Password()) )
1976  {
1977  P.Serialize(MetaData, true);
1978  }
1979  else if( P.is_Parameters() )
1980  {
1981  P.asParameters()->Set_History(MetaData, true, false);
1982  }
1983  }
1984  }
1985 
1986  //-----------------------------------------------------
1987  if( bDataObjects ) // get input with history...
1988  {
1989  for(int i=0; i<Get_Count(); i++)
1990  {
1991  CSG_Parameter &P = *m_Parameters[i];
1992 
1993  //---------------------------------------------
1994  if( P.is_Input() )
1995  {
1996  if( P.is_DataObject() && P.asDataObject() )
1997  {
1998  CSG_Data_Object *pObject = P.asDataObject();
1999 
2000  CSG_MetaData *pEntry = MetaData.Add_Child("INPUT");
2001 
2002  pEntry->Add_Property("type" , P.Get_Type_Identifier());
2003  pEntry->Add_Property("id" , P.Get_Identifier ());
2004  pEntry->Add_Property("name" , P.Get_Name ());
2005  pEntry->Add_Property("parms", Get_Identifier ());
2006 
2007  if( P.Get_Type() == PARAMETER_TYPE_Grid
2008  || P.Get_Type() == PARAMETER_TYPE_Grids )
2009  {
2010  pEntry->Add_Property("system", P.Get_Parent()->Get_Identifier());
2011  }
2012 
2013  if( pObject->Get_History().Get_Children_Count() > 0 )
2014  {
2015  pEntry->Add_Children(pObject->Get_History());
2016  }
2017  else if( pObject->Get_File_Name() && *pObject->Get_File_Name() )
2018  {
2019  pEntry = pEntry->Add_Child("FILE", pObject->Get_File_Name());
2020  }
2021  }
2022 
2023  else if( P.is_DataObject_List() && P.asList()->Get_Item_Count() > 0 )
2024  {
2025  CSG_MetaData *pList = MetaData.Add_Child("INPUT_LIST");
2026 
2027  pList->Add_Property("type" , P.Get_Type_Identifier());
2028  pList->Add_Property("id" , P.Get_Identifier ());
2029  pList->Add_Property("name" , P.Get_Name ());
2030  pList->Add_Property("parms", Get_Identifier ());
2031 
2033  {
2034  pList->Add_Property("system", P.Get_Parent()->Get_Identifier());
2035  }
2036 
2037  for(int j=0; j<P.asList()->Get_Item_Count(); j++)
2038  {
2039  CSG_Data_Object *pObject = P.asList()->Get_Item(j);
2040 
2041  CSG_MetaData *pEntry = pList->Add_Child(*pList, false);
2042 
2043  pEntry->Set_Name("INPUT");
2044 
2045  if( !SG_Get_History_Ignore_Lists() && pObject->Get_History().Get_Children_Count() > 0 )
2046  {
2047  pEntry->Add_Children(pObject->Get_History());
2048  }
2049  else if( pObject->Get_File_Name() && *pObject->Get_File_Name() )
2050  {
2051  pEntry = pEntry->Add_Child("FILE", pObject->Get_File_Name());
2052  }
2053  }
2054  }
2055  }
2056 
2057  //---------------------------------------------
2058  else if( P.is_Parameters() )
2059  {
2060  P.asParameters()->Set_History(MetaData, false, true);
2061  }
2062  }
2063  }
2064 
2065  return( true );
2066 }
2067 
2068 
2070 // //
2071 // Grid System //
2072 // //
2074 
2075 //---------------------------------------------------------
2082 {
2083  return( m_pGrid_System && m_pGrid_System->asGrid_System() && m_pGrid_System->Set_Value((void *)&System) );
2084 }
2085 
2086 //---------------------------------------------------------
2093 {
2094  CSG_Grid_System System;
2095 
2096  return( Set_Grid_System(System) );
2097 }
2098 
2099 
2101 // //
2102 // Serialize //
2103 // //
2105 
2106 //---------------------------------------------------------
2108 {
2109  if( Data.Cmp_Name("parameters") )
2110  {
2111  Data.Get_Property("name", m_Name);
2112 
2113  for(int i=0; i<Data.Get_Children_Count(); i++)
2114  {
2115  CSG_Parameter *pParameter = Get_Parameter(Data(i)->Get_Property("id"));
2116 
2117  if( pParameter && pParameter->Serialize(*Data(i), false) )
2118  {
2119  pParameter->has_Changed();
2120  }
2121  }
2122 
2123  return( true );
2124  }
2125 
2126  return( false );
2127 }
2128 
2129 //---------------------------------------------------------
2131 {
2132  Data.Destroy();
2133 
2134  Data.Set_Name("parameters");
2135  Data.Set_Property("name", m_Name);
2136 
2137  for(int i=0; i<Get_Count(); i++)
2138  {
2139  m_Parameters[i]->Serialize(Data, true);
2140  }
2141 
2142  return( true );
2143 }
2144 
2145 //---------------------------------------------------------
2147 {
2148  CSG_MetaData Data; return( Data.Load(File) && Load(Data) );
2149 }
2150 
2151 //---------------------------------------------------------
2152 bool CSG_Parameters::Save(const CSG_String &File) const
2153 {
2154  CSG_MetaData Data; return( Save(Data) && Data.Save(File) );
2155 }
2156 
2157 //---------------------------------------------------------
2158 // SAGA 2.0 compatibility...
2160 {
2161  CSG_Parameter *pParameter = NULL;
2162  CSG_String sLine;
2163 
2164  if( !Stream.is_Open() )
2165  {
2166  return( false );
2167  }
2168 
2169  //-----------------------------------------------------
2170  while( Stream.Read_Line(sLine) && sLine.Cmp("[PARAMETER_ENTRIES_BEGIN]") );
2171 
2172  if( sLine.Cmp("[PARAMETER_ENTRIES_BEGIN]") )
2173  {
2174  return( false );
2175  }
2176 
2177  //-----------------------------------------------------
2178  while( Stream.Read_Line(sLine) && sLine.Cmp("[PARAMETER_ENTRIES_END]") )
2179  {
2180  if( !sLine.Cmp("[PARAMETER_ENTRY_BEGIN]")
2181  && Stream.Read_Line(sLine) && (pParameter = Get_Parameter(sLine)) != NULL
2182  && Stream.Read_Line(sLine) )
2183  {
2184  int i;
2185  double d;
2186  TSG_Rect r;
2187  CSG_String s;
2188  CSG_Table t;
2189 
2190  switch( sLine.asInt() )
2191  {
2192  case 1: // PARAMETER_TYPE_Bool:
2193  case 2: // PARAMETER_TYPE_Int:
2194  case 6: // PARAMETER_TYPE_Choice:
2195  case 11: // PARAMETER_TYPE_Color:
2196  case 15: // PARAMETER_TYPE_Table_Field:
2197  pParameter->Set_Value(Stream.Scan_Int());
2198  break;
2199 
2200  case 3: // PARAMETER_TYPE_Double:
2201  case 4: // PARAMETER_TYPE_Degree:
2202  pParameter->Set_Value(Stream.Scan_Double());
2203  break;
2204 
2205  case 5: // PARAMETER_TYPE_Range:
2206  pParameter->asRange()->Set_Range(Stream.Scan_Double(), Stream.Scan_Double());
2207  break;
2208 
2209  case 7: // PARAMETER_TYPE_String:
2210  case 9: // PARAMETER_TYPE_FilePath:
2211  Stream.Read_Line(sLine);
2212  pParameter->Set_Value(sLine);
2213  break;
2214 
2215  case 8: // PARAMETER_TYPE_Text:
2216  s.Clear();
2217  while( Stream.Read_Line(sLine) && sLine.Cmp("[TEXT_ENTRY_END]") )
2218  {
2219  s += sLine + "\n";
2220  }
2221  pParameter->Set_Value(s);
2222  break;
2223 
2224  case 10: // PARAMETER_TYPE_Font:
2225  Stream.Read(&i, sizeof(i));
2226  pParameter->Set_Value(i);
2227  break;
2228 
2229  case 12: // PARAMETER_TYPE_Colors:
2230  pParameter->asColors()->Serialize(Stream, false, false);
2231  break;
2232 
2233  case 13: // PARAMETER_TYPE_FixedTable:
2234  if( t.Serialize(Stream, false) )
2235  {
2236  pParameter->asTable()->Assign_Values(&t);
2237  }
2238  break;
2239 
2240  case 14: // PARAMETER_TYPE_Grid_System:
2241  Stream.Read(&d, sizeof(d));
2242  Stream.Read(&r, sizeof(r));
2243  pParameter->asGrid_System()->Assign(d, r);
2244  break;
2245 
2246  case 16: // PARAMETER_TYPE_Grid:
2247  case 17: // PARAMETER_TYPE_Table:
2248  case 18: // PARAMETER_TYPE_Shapes:
2249  case 19: // PARAMETER_TYPE_TIN:
2250  case 24: // PARAMETER_TYPE_DataObject_Output:
2251  if( Stream.Read_Line(sLine) )
2252  {
2253  if( !sLine.Cmp("[ENTRY_DATAOBJECT_CREATE]") )
2254  {
2255  pParameter->Set_Value(DATAOBJECT_CREATE);
2256  }
2257  else
2258  {
2259  pParameter->Set_Value(m_pManager ? m_pManager->Find(sLine) : NULL);
2260  }
2261  }
2262  break;
2263 
2264  case 20: // PARAMETER_TYPE_Grid_List:
2265  case 21: // PARAMETER_TYPE_Table_List:
2266  case 22: // PARAMETER_TYPE_Shapes_List:
2267  case 23: // PARAMETER_TYPE_TIN_List:
2268  while( Stream.Read_Line(sLine) && sLine.Cmp("[ENTRY_DATAOBJECTLIST_END]") )
2269  {
2270  CSG_Data_Object *pObject = m_pManager ? m_pManager->Find(sLine) : NULL;
2271 
2272  if( pObject )
2273  {
2274  pParameter->asList()->Add_Item(pObject);
2275  }
2276  }
2277  break;
2278 
2279  case 25: // PARAMETER_TYPE_Parameters:
2280  pParameter->asParameters()->Serialize_Compatibility(Stream);
2281  break;
2282  }
2283  }
2284  }
2285 
2286  return( true );
2287 }
2288 
2289 
2291 // //
2292 // //
2293 // //
2295 
2296 //---------------------------------------------------------
CSG_Parameter::asColors
CSG_Colors * asColors(void) const
Definition: parameter.cpp:1035
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:140
CSG_Parameters::Assign
bool Assign(CSG_Parameters *pSource)
Definition: parameters.cpp:1510
CSG_Parameter_Date
Definition: parameters.h:572
CSG_Parameter::Set_Value
virtual bool Set_Value(int Value)
Definition: parameter.cpp:799
CSG_Parameters::Get_Description
const CSG_String & Get_Description(void) const
Definition: parameters.h:1735
CSG_Parameter_Range::Set_Min
bool Set_Min(double Min)
Definition: parameter_data.cpp:802
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1752
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
CSG_Parameter_Choice::Set_Items
bool Set_Items(const SG_Char *String)
Definition: parameter_data.cpp:934
CSG_Parameters::Del_References
void Del_References(void)
Definition: parameters.cpp:395
CSG_Parameter_Grid
Definition: parameters.h:1199
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:642
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:1489
CSG_Parameter_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3032
CSG_Parameter_Degree
Definition: parameters.h:547
CSG_Parameter_Parameters
Definition: parameters.h:1570
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
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:147
CSG_Parameters::Set_Grid_System
bool Set_Grid_System(const CSG_Grid_System &System)
Definition: parameters.cpp:2081
CSG_Parameters::Reset_Grid_System
bool Reset_Grid_System(void)
Definition: parameters.cpp:2092
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:547
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:285
PARAMETER_OPTIONAL
#define PARAMETER_OPTIONAL
Definition: parameters.h:96
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:1063
CSG_Parameters::Get_Owner
void * Get_Owner(void) const
Definition: parameters.h:1710
CSG_Parameter_TIN
Definition: parameters.h:1314
data_manager.h
CSG_Parameter_Table_List
Definition: parameters.h:1470
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:1502
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:1312
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:155
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:681
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
CSG_Grid_System
Definition: grid.h:200
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
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:1373
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:204
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:530
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:440
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:232
CSG_Parameters::Serialize_Compatibility
bool Serialize_Compatibility(CSG_File &Stream)
Definition: parameters.cpp:2159
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:857
CSG_Parameter_Colors
Definition: parameters.h:957
CSG_Parameter_Choices
Definition: parameters.h:748
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:152
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:761
CSG_Parameter_Data_Object_Output
Definition: parameters.h:1170
CSG_Tool
Definition: tool.h:151
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:602
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:1574
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:543
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Parameter_Table_Field
Definition: parameters.h:1057
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:1041
CSG_Parameter_Node
Definition: parameters.h:376
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1141
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:147
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1091
CSG_Parameters::Push
bool Push(class CSG_Data_Manager *pManager=NULL, bool bRestoreDefaults=true)
Definition: parameters.cpp:262
CSG_Parameter_Font
Definition: parameters.h:896
CSG_Parameter::ignore_Projection
void ignore_Projection(bool bIgnore)
Definition: parameter.cpp:178
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:328
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:531
CSG_File
Definition: api_core.h:1124
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:802
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:929
tool.h
PARAMETER_INPUT_OPTIONAL
#define PARAMETER_INPUT_OPTIONAL
Definition: parameters.h:102
CSG_Parameter_PointCloud
Definition: parameters.h:1338
CSG_Parameters::Get_String
bool Get_String(CSG_String &String, bool bOptionsOnly)
Definition: parameters.cpp:1908
CSG_Parameters::Msg_String
bool Msg_String(bool bOptionsOnly)
Definition: parameters.cpp:1942
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:157
SSG_Rect
Definition: geo_tools.h:464
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:149
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:1165
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:1518
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:295
CSG_Parameter_Text
Definition: parameters.h:834
CSG_Parameter_File_Name::Set_Flag_Multiple
void Set_Flag_Multiple(bool bFlag)
Definition: parameter_data.cpp:1564
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
CSG_Parameter_Shapes
Definition: parameters.h:1283
CSG_Parameter_List::Del_Items
virtual bool Del_Items(void)
Definition: parameter_data.cpp:3074
CSG_Parameter_Fixed_Table
Definition: parameters.h:991
CSG_Grids::Create
virtual bool Create(const CSG_Grids &Grids)
Definition: grids.cpp:271
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:734
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:140
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:916
CSG_Parameter_File_Name::Set_Flag_Save
void Set_Flag_Save(bool bFlag)
Definition: parameter_data.cpp:1559
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:369
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:207
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:906
CSG_Parameter_Grid_System
Definition: parameters.h:1024
CSG_Parameters::Assign_Values
bool Assign_Values(CSG_Parameters *pSource)
Definition: parameters.cpp:1516
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:165
CSG_Grids::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grids.h:181
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:150
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1725
CSG_Parameters::Restore_Defaults
bool Restore_Defaults(bool bClearData=false)
Definition: parameters.cpp:1478
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Table::Serialize
bool Serialize(CSG_File &Stream, bool bSave)
Definition: table_io.cpp:538
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
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:209
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:905
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:1149
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:385
CSG_Parameter_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3044
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Parameter_File_Name
Definition: parameters.h:854
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:883
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:1038
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:701
CSG_Parameter_Grids
Definition: parameters.h:1239
CSG_Parameters::Load
bool Load(const CSG_MetaData &Data)
Definition: parameters.cpp:2107
CSG_File::Scan_Double
double Scan_Double(void) const
Definition: api_file.cpp:548
CSG_Parameters::Get_Tool
class CSG_Tool * Get_Tool(void) const
Definition: parameters.h:1712
SG_UI_DataObject_Update
bool SG_UI_DataObject_Update(CSG_Data_Object *pDataObject, int Show, CSG_Parameters *pParameters)
Definition: api_callback.cpp:624
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:1444
SG_UI_DataObject_Add
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:611
CSG_Parameter_File_Name::Set_Filter
void Set_Filter(const SG_Char *Filter)
Definition: parameter_data.cpp:1541
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:1106
CSG_Parameter::Get_Child
CSG_Parameter * Get_Child(int iChild) const
Definition: parameters.h:256
CSG_Parameter_Grid_List
Definition: parameters.h:1409
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:240
CSG_DateTime::Get_JDN
double Get_JDN(void) const
Definition: datetime.cpp:411
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:148
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:850
CSG_Parameter_Range::Set_Range
bool Set_Range(double Min, double Max)
Definition: parameter_data.cpp:783
CSG_Parameter_Range
Definition: parameters.h:611
CSG_Table::Assign_Values
bool Assign_Values(const CSG_Table &Table)
Definition: table.cpp:395
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:832
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
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:960
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:154
CSG_Parameter::_Set_String
virtual void _Set_String(void)
Definition: parameter.cpp:894
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:725
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:234
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:815
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:655
CSG_File::is_Open
bool is_Open(void) const
Definition: api_core.h:1143
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:937
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1111
CSG_Parameters::Del_Parameter
bool Del_Parameter(int i)
Definition: parameters.cpp:1248
CSG_Data_Manager::Add
CSG_Data_Object * Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:310
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:233
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:898
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:751
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1372
CSG_Parameter_Shapes_List
Definition: parameters.h:1493
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
CSG_Projection
Definition: geo_tools.h:824
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1729
CSG_Parameter_Int
Definition: parameters.h:471
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:863
CSG_Table
Definition: table.h:283
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:705
CSG_Parameter_Range::Set_Max
bool Set_Max(double Max)
Definition: parameter_data.cpp:820
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:644
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:255
CSG_Parameter_Grid::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1202
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:276
CSG_Parameter_Double
Definition: parameters.h:509
CSG_Parameter_Bool
Definition: parameters.h:396
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:1107
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:1168
CSG_Strings::Sort
bool Sort(bool Ascending=true)
Definition: api_string.cpp:1121
CSG_Parameter_Table_Fields
Definition: parameters.h:1097
CSG_Parameter::Check
bool Check(bool bSilent=true)
Definition: parameter.cpp:952
CSG_Parameter_String
Definition: parameters.h:800
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:873
CSG_Parameter_Shapes::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1286
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:886
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:234
CSG_Parameter_Color
Definition: parameters.h:931
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:691
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:143
CSG_Parameter_File_Name::Set_Flag_Directory
void Set_Flag_Directory(bool bFlag)
Definition: parameter_data.cpp:1569
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:159
CSG_Parameters::Save
bool Save(CSG_MetaData &Data) const
Definition: parameters.cpp:2130
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:840
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:156
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1110
TSG_PFNC_Parameter_Changed
int(* TSG_PFNC_Parameter_Changed)(CSG_Parameter *pParameter, int Flags)
Definition: parameters.h:1686
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:129
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:947
CSG_Parameters::Assign_Parameters
bool Assign_Parameters(CSG_Parameters *pSource)
Definition: parameters.cpp:1540
SG_UI_Get_Window_Main
void * SG_UI_Get_Window_Main(void)
Definition: api_callback.cpp:784
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:161
CSG_Parameters::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: parameters.cpp:1405
CSG_Parameter_Choice
Definition: parameters.h:660
SG_UI_MSG_STYLE_01
@ SG_UI_MSG_STYLE_01
Definition: api_core.h:1509
CSG_Parameters::Get_Name
const CSG_String & Get_Name(void) const
Definition: parameters.h:1732
CSG_Parameter::Set_Enabled
bool Set_Enabled(bool bEnabled=true)
Definition: parameter.cpp:196
CSG_Table::Create
bool Create(void)
Definition: table.cpp:139
CSG_Parameter_Range::Get_Min_Parameter
CSG_Parameter_Double * Get_Min_Parameter(void) const
Definition: parameters.h:621
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:1342
CSG_Parameter_PointCloud_List
Definition: parameters.h:1547
CSG_Parameter_TIN_List
Definition: parameters.h:1524
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
CSG_Parameters
Definition: parameters.h:1690
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:993
CSG_Parameter::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameter.cpp:519
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:809
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:557
CSG_Parameter::is_Parameters
bool is_Parameters(void) const
Definition: parameter.cpp:313
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:1037
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:589
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter_Range::Get_Max_Parameter
CSG_Parameter_Double * Get_Max_Parameter(void) const
Definition: parameters.h:625
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:239
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:158
TSG_Parameter_Type
TSG_Parameter_Type
Definition: parameters.h:122
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
CSG_Parameter_Choices::Set_Items
void Set_Items(const CSG_String &Items)
Definition: parameter_data.cpp:1303
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:138
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1115
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:637
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:151
CSG_Parameter::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter.cpp:941
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int Index) const
Definition: metadata.h:180
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:1967
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Parameters::Set_Callback
bool Set_Callback(bool bActive=true)
Definition: parameters.cpp:1363
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1109
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:235
CSG_Parameter_Table
Definition: parameters.h:1260
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:258
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:123
CSG_Parameter_Data_Type
Definition: parameters.h:718
CSG_Colors
Definition: api_core.h:1338
PARAMETER_OUTPUT_OPTIONAL
#define PARAMETER_OUTPUT_OPTIONAL
Definition: parameters.h:103
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:785
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
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