SAGA API  v9.9
parameter.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 // parameter.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 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49 
50 //---------------------------------------------------------
51 #include "parameters.h"
52 #include "data_manager.h"
53 #include "tool.h"
54 #include "tool_library.h"
55 
56 
58 // //
59 // //
60 // //
62 
63 //---------------------------------------------------------
64 CSG_Parameter::CSG_Parameter(CSG_Parameters *pParameters, CSG_Parameter *pParent, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description, int Constraint)
65 {
66  m_pParameters = pParameters;
67  m_pParent = pParent;
68  m_Identifier = Identifier;
69  m_Name = Name;
70  m_Description = Description;
71  m_Constraint = Constraint;
72 
73  m_bEnabled = true;
74 
75  //-----------------------------------------------------
76  m_nChildren = 0;
77  m_Children = NULL;
78 
79  if( m_pParent )
80  {
81  m_pParent->_Add_Child(this);
82  }
83 }
84 
85 //---------------------------------------------------------
87 {
88  if( m_Children )
89  {
90  SG_Free(m_Children);
91  }
92 }
93 
94 
96 // //
98 
99 //---------------------------------------------------------
101 {
102  return( m_pParameters );
103 }
104 
105 //---------------------------------------------------------
107 {
108  return( m_pParent );
109 }
110 
111 //---------------------------------------------------------
113 {
114  return( m_pParameters ? m_pParameters->Get_Manager() : NULL );
115 }
116 
117 
119 // //
121 
122 //---------------------------------------------------------
124 {
126 }
127 
128 //---------------------------------------------------------
130 {
132 }
133 
134 
136 // //
138 
139 //---------------------------------------------------------
141 {
142  if( bOn )
143  {
144  m_Constraint |= PARAMETER_GUI_COLLAPSED;
145  }
146  else
147  {
148  m_Constraint &= ~PARAMETER_GUI_COLLAPSED;
149  }
150 
151  return( is_Collapsed() );
152 }
153 
154 //---------------------------------------------------------
156 {
157  if( bOn )
158  {
159  m_Constraint &= ~PARAMETER_NOT_FOR_GUI;
160  }
161  else
162  {
163  m_Constraint |= PARAMETER_NOT_FOR_GUI;
164  }
165 }
166 
167 //---------------------------------------------------------
169 {
170  if( bOn )
171  {
172  m_Constraint &= ~PARAMETER_NOT_FOR_CMD;
173  }
174  else
175  {
176  m_Constraint |= PARAMETER_NOT_FOR_CMD;
177  }
178 }
179 
180 //---------------------------------------------------------
182 {
183  return( !(m_Constraint & PARAMETER_NOT_FOR_GUI) && (Get_Parent() == NULL || Get_Parent()->do_UseInGUI()) );
184 }
185 
186 //---------------------------------------------------------
188 {
189  return( !(m_Constraint & PARAMETER_NOT_FOR_CMD) && (Get_Parent() == NULL || Get_Parent()->do_UseInCMD()) );
190 }
191 
192 //---------------------------------------------------------
194 {
195  if( bIgnore )
196  {
197  m_Constraint &= ~PARAMETER_IGNORE_PROJECTION;
198  }
199  else
200  {
201  m_Constraint |= PARAMETER_IGNORE_PROJECTION;
202  }
203 }
204 
205 
207 // //
209 
210 //---------------------------------------------------------
211 bool CSG_Parameter::Set_Enabled(bool bEnabled)
212 {
213  if( m_bEnabled != bEnabled )
214  {
215  m_bEnabled = bEnabled;
216 
217  return( !bEnabled );
218  }
219 
220  return( bEnabled );
221 }
222 
223 //---------------------------------------------------------
224 bool CSG_Parameter::is_Enabled(bool bCheckEnv) const
225 {
226  if( bCheckEnv )
227  {
228  if( !do_UseInGUI() && m_pParameters->has_GUI() )
229  {
230  return( false );
231  }
232 
233  if( !do_UseInCMD() && !m_pParameters->has_GUI() )
234  {
235  return( false );
236  }
237  }
238 
239  return( m_bEnabled && (m_pParent == NULL || m_pParent->is_Enabled()) );
240 }
241 
242 //---------------------------------------------------------
244 {
245  for(int i=0; i<Get_Children_Count(); i++)
246  {
247  Get_Child(i)->Set_Enabled(bEnabled);
248  }
249 
250  return( true );
251 }
252 
253 //---------------------------------------------------------
254 bool CSG_Parameter::is_Option(void) const
255 {
256  if( !is_Information() )
257  {
258  switch( Get_Type() )
259  {
260  case PARAMETER_TYPE_Bool :
261  case PARAMETER_TYPE_Int :
262  case PARAMETER_TYPE_Double :
263  case PARAMETER_TYPE_Degree :
264  case PARAMETER_TYPE_Date :
265  case PARAMETER_TYPE_Range :
267  case PARAMETER_TYPE_Choice :
269  case PARAMETER_TYPE_String :
270  case PARAMETER_TYPE_Text :
272  case PARAMETER_TYPE_Font :
273  case PARAMETER_TYPE_Color :
274  case PARAMETER_TYPE_Colors :
280  return( true );
281 
282  default:
283  return( false );
284  }
285  }
286 
287  return( false );
288 }
289 
290 //---------------------------------------------------------
292 {
293  switch( Get_Type() )
294  {
296  case PARAMETER_TYPE_Grid :
297  case PARAMETER_TYPE_Grids :
298  case PARAMETER_TYPE_Table :
299  case PARAMETER_TYPE_Shapes :
300  case PARAMETER_TYPE_TIN :
302  return( true );
303 
304  default:
305  return( false );
306  }
307 }
308 
309 //---------------------------------------------------------
311 {
312  switch( Get_Type() )
313  {
320  return( true );
321 
322  default:
323  return( false );
324  }
325 }
326 
327 //---------------------------------------------------------
329 {
330  return( Get_Type() == PARAMETER_TYPE_Parameters );
331 }
332 
333 //---------------------------------------------------------
335 {
336  switch( Get_Type() )
337  {
339  case PARAMETER_TYPE_Node :
341  return( false );
342 
343  case PARAMETER_TYPE_String :
344  return( ((CSG_Parameter_String *)this)->is_Password() == false );
345 
346  default:
347  return( !is_Information() );
348  }
349 }
350 
351 //---------------------------------------------------------
353 {
354  if( pParameter && pParameter->Get_Type() == Get_Type() )
355  {
356  switch( Get_Type() )
357  {
358  //-------------------------------------------------
360  case PARAMETER_TYPE_Choice :
361  {
362  bool bResult = pParameter->asChoice()->Get_Count() == asChoice()->Get_Count();
363 
364  for(int i=0; bResult && i<asChoice()->Get_Count(); i++)
365  {
366  bResult = SG_STR_CMP(pParameter->asChoice()->Get_Item(i), asChoice()->Get_Item(i)) == 0;
367  }
368 
369  return( bResult );
370  }
371 
372  //-------------------------------------------------
374  {
375  bool bResult = pParameter->asChoices()->Get_Item_Count() == asChoices()->Get_Item_Count();
376 
377  for(int i=0; bResult && i<asChoices()->Get_Item_Count(); i++)
378  {
379  bResult = SG_STR_CMP(pParameter->asChoices()->Get_Item(i), asChoices()->Get_Item(i)) == 0;
380  }
381 
382  return( bResult );
383  }
384 
385  //-------------------------------------------------
386  case PARAMETER_TYPE_FixedTable : return( pParameter->asTable()->is_Compatible(asTable()) );
387 
388  //-------------------------------------------------
390  {
391  bool bResult = pParameter->asParameters()->Get_Count() == asParameters()->Get_Count();
392 
393  for(int i=0; bResult && i<asParameters()->Get_Count(); i++)
394  {
395  bResult = pParameter->asParameters()->Get_Parameter(i)->is_Compatible(asParameters()->Get_Parameter(i));
396  }
397 
398  return( bResult );
399  }
400 
401  //-------------------------------------------------
402  default:
403  return( true );
404  }
405  }
406 
407  return( false );
408 }
409 
410 //---------------------------------------------------------
412 {
413  if( pParameter && pParameter->Get_Type() == Get_Type() )
414  {
415  switch( Get_Type() )
416  {
417  case PARAMETER_TYPE_Node : return( true );
418 
419  //-------------------------------------------------
420  case PARAMETER_TYPE_Bool : return( pParameter->asBool () == asBool () );
423  case PARAMETER_TYPE_Choice :
424  case PARAMETER_TYPE_Color :
425  case PARAMETER_TYPE_Int : return( pParameter->asInt () == asInt () );
426  case PARAMETER_TYPE_Date :
427  case PARAMETER_TYPE_Degree :
428  case PARAMETER_TYPE_Double : return( pParameter->asDouble() == asDouble() );
429 
431  case PARAMETER_TYPE_Font :
432  case PARAMETER_TYPE_Text :
434  case PARAMETER_TYPE_String : return( SG_STR_CMP(pParameter->asString(), asString()) == 0 );
435 
436  case PARAMETER_TYPE_Range : return( pParameter->asRange()->Get_Min() == asRange()->Get_Min()
437  && pParameter->asRange()->Get_Max() == asRange()->Get_Max() );
438 
439  case PARAMETER_TYPE_Grid_System : return( pParameter->asGrid_System()->is_Equal(*asGrid_System()) );
440 
441  //-------------------------------------------------
443  {
444  bool bResult = pParameter->asChoices()->Get_Selection_Count() == asChoices()->Get_Selection_Count();
445 
446  for(int i=0; bResult && i<asChoices()->Get_Selection_Count(); i++)
447  {
448  bResult = pParameter->asChoices()->Get_Selection_Index(i) == asChoices()->Get_Selection_Index(i);
449  }
450 
451  return( bResult );
452  }
453 
454  //-------------------------------------------------
455  case PARAMETER_TYPE_Colors :
456  {
457  bool bResult = pParameter->asColors()->Get_Count() == asColors()->Get_Count();
458 
459  for(int i=0; bResult && i<asColors()->Get_Count(); i++)
460  {
461  bResult = pParameter->asColors()->Get_Color(i) == asColors()->Get_Color(i);
462  }
463 
464  return( bResult );
465  }
466 
467  //-------------------------------------------------
469  {
470  bool bResult = pParameter->asTable()->is_Compatible(asTable()) && pParameter->asTable()->Get_Count() == asTable()->Get_Count();
471 
472  for(int i=0; bResult && i<asTable()->Get_Count(); i++)
473  {
474  CSG_Table_Record *pA = pParameter->asTable()->Get_Record(i), *pB = asTable()->Get_Record(i);
475 
476  for(int j=0; bResult && j<asTable()->Get_Field_Count(); j++)
477  {
478  bResult = SG_STR_CMP(pA->asString(j), pB->asString(j)) == 0;
479  }
480  }
481 
482  return( bResult );
483  }
484 
485  //-------------------------------------------------
487  case PARAMETER_TYPE_Grid :
488  case PARAMETER_TYPE_Grids :
489  case PARAMETER_TYPE_Table :
490  case PARAMETER_TYPE_Shapes :
491  case PARAMETER_TYPE_TIN :
492  case PARAMETER_TYPE_PointCloud : return( pParameter->asDataObject() == asDataObject() );
493 
494  //-------------------------------------------------
501  {
502  bool bResult = pParameter->asList()->Get_Item_Count() == asList()->Get_Item_Count();
503 
504  for(int i=0; bResult && i<asList()->Get_Item_Count(); i++)
505  {
506  bResult = pParameter->asList()->Get_Item(i) == asList()->Get_Item(i);
507  }
508 
509  return( bResult );
510  }
511 
512  //-------------------------------------------------
514  {
515  bool bResult = pParameter->asParameters()->Get_Count() == asParameters()->Get_Count();
516 
517  for(int i=0; bResult && i<asParameters()->Get_Count(); i++)
518  {
519  bResult = pParameter->asParameters()->Get_Parameter(i)->is_Value_Equal(asParameters()->Get_Parameter(i));
520  }
521 
522  return( bResult );
523  }
524 
525  //-------------------------------------------------
526  default: break;
527  }
528  }
529 
530  return( false );
531 }
532 
533 //---------------------------------------------------------
535 {
536  switch( Get_Type() )
537  {
538  default : return( SG_DATAOBJECT_TYPE_Undefined );
539  case PARAMETER_TYPE_Grid :
541  case PARAMETER_TYPE_Grids :
543  case PARAMETER_TYPE_Table :
545  case PARAMETER_TYPE_Shapes :
547  case PARAMETER_TYPE_TIN :
553  }
554 }
555 
556 
558 // //
560 
561 //---------------------------------------------------------
563 {
564  return( m_Identifier );
565 }
566 
567 //---------------------------------------------------------
568 bool CSG_Parameter::Cmp_Identifier(const CSG_String &Identifier) const
569 {
570  return( !m_Identifier.Cmp(Identifier) || !m_Identifier.Cmp(Identifier + ".Default") );
571 }
572 
573 //---------------------------------------------------------
577 //---------------------------------------------------------
579 {
581 
582  if( ID.Length() > 0 )
583  {
584  ID += "_";
585  }
586 
587  ID += Get_Identifier();
588 
589  ID.Replace(".", "_");
590  ID.Replace("|", "_");
591  ID.Replace(" ", "_");
592 
593  return( ID );
594 }
595 
596 //---------------------------------------------------------
598 {
599  m_Name = Name;
600 
601  return( true );
602 }
603 
604 const SG_Char * CSG_Parameter::Get_Name(void) const
605 {
606  return( m_Name );
607 }
608 
609 //---------------------------------------------------------
611 {
612  m_Description = Description;
613 
614  return( true );
615 }
616 
618 {
619  return( m_Description );
620 }
621 
622 //---------------------------------------------------------
624 {
625  return( Get_Description(Flags, SG_T("\n")) );
626 }
627 
628 //---------------------------------------------------------
629 CSG_String CSG_Parameter::Get_Description(int Flags, const SG_Char *Separator) const
630 {
631  #define SEPARATE if( !s.is_Empty() ) { s.Append(Separator); }
632 
633  if( !Separator || !Separator[0] )
634  {
635  return( Get_Description(Flags) );
636  }
637 
638  CSG_String s;
639 
640  //-----------------------------------------------------
641  if( (Flags & PARAMETER_DESCRIPTION_NAME) != 0 )
642  {
643  SEPARATE; s += CSG_String::Format("%s", Get_Name());
644  }
645 
646  //-----------------------------------------------------
647  if( (Flags & PARAMETER_DESCRIPTION_TYPE) != 0 )
648  {
649  SEPARATE;
650 
652  {
653  s += CSG_String::Format("%s %s", Get_Type_Name().c_str(), SG_Get_DataObject_Name(Get_DataObject_Type()).c_str());
654  }
655  else
656  {
657  s += CSG_String::Format("%s", Get_Type_Name().c_str());
658  }
659 
660  if( is_DataObject() || is_DataObject_List() )
661  {
662  s += CSG_String::Format(", %s", is_Input() ? _TL("input") : _TL("output"));
663 
664  if( is_Optional() )
665  {
666  s += CSG_String::Format(", %s", _TL("optional"));
667  }
668  }
669 
670  if( do_UseInGUI() != do_UseInCMD() )
671  {
672  if( m_pParameters->has_GUI() || do_UseInGUI() )
673  {
674  s += CSG_String::Format("\n[%s]", do_UseInGUI() ? SG_T("GUI") : SG_T("CMD"));
675  }
676  }
677  }
678 
679  //-----------------------------------------------------
680  if( (Flags & PARAMETER_DESCRIPTION_OPTIONAL) != 0 && is_Optional() )
681  {
682  SEPARATE; s += CSG_String::Format("%s", _TL("optional"));
683  }
684 
685  //-----------------------------------------------------
686  if( (Flags & PARAMETER_DESCRIPTION_PROPERTIES) != 0 )
687  {
688  switch( Get_Type() )
689  {
690  default:
691  break;
692 
694  SEPARATE; s += CSG_String::Format("%s:", _TL("Available Choices"));
695 
696  for(int i=0; i<asChoice()->Get_Count(); i++)
697  {
698  s += CSG_String::Format("%s[%d] %s", Separator, i, asChoice()->Get_Item(i));
699  }
700  break;
701 
702  case PARAMETER_TYPE_Choice :
703  if( do_UseInCMD() || asChoice()->Get_Count() < 32 )
704  {
705  SEPARATE; s += CSG_String::Format("%s:", _TL("Available Choices"));
706 
707  for(int i=0; i<asChoice()->Get_Count(); i++)
708  {
709  s += CSG_String::Format("%s[%d] %s", Separator, i, asChoice()->Get_Item(i));
710  }
711  }
712  else
713  {
714  SEPARATE; s += CSG_String::Format("%d %s:", asChoice()->Get_Count(), _TL("Choices"));
715  }
716  break;
717 
719  if( do_UseInCMD() || asChoices()->Get_Item_Count() < 32 )
720  {
721  SEPARATE; s += CSG_String::Format("%s:", _TL("Available Choices"));
722 
723  for(int i=0; i<asChoices()->Get_Item_Count(); i++)
724  {
725  s += CSG_String::Format("%s[%d] %s", Separator, i, asChoices()->Get_Item(i).c_str());
726  }
727  }
728  else
729  {
730  SEPARATE; s += CSG_String::Format("%d %s:", asChoices()->Get_Item_Count(), _TL("Choices"));
731  }
732  break;
733 
734  case PARAMETER_TYPE_Int :
735  if( asValue()->has_Minimum() )
736  {
737  SEPARATE; s += CSG_String::Format("%s: %d", _TL("Minimum"), (int)asValue()->Get_Minimum());
738  }
739 
740  if( asValue()->has_Maximum() )
741  {
742  SEPARATE; s += CSG_String::Format("%s: %d", _TL("Maximum"), (int)asValue()->Get_Maximum());
743  }
744  break;
745 
746  case PARAMETER_TYPE_Double :
747  case PARAMETER_TYPE_Degree :
748 // case PARAMETER_TYPE_Range :
749  if( asValue()->has_Minimum() )
750  {
751  SEPARATE; s += CSG_String::Format("%s: %f", _TL("Minimum"), asValue()->Get_Minimum());
752  }
753 
754  if( asValue()->has_Maximum() )
755  {
756  SEPARATE; s += CSG_String::Format("%s: %f", _TL("Maximum"), asValue()->Get_Maximum());
757  }
758  break;
759 
761  SEPARATE; s += CSG_String::Format("%d %s:%s", asTable()->Get_Field_Count(), _TL("Fields"), Separator);
762 
763  for(int i=0; i<asTable()->Get_Field_Count(); i++)
764  {
765  s += CSG_String::Format("- %d. [%s] %s%s", i + 1, SG_Data_Type_Get_Name(asTable()->Get_Field_Type(i)).c_str(), asTable()->Get_Field_Name(i), Separator);
766  }
767  break;
768 
770  SEPARATE; s += CSG_String::Format("%d %s", asParameters()->Get_Count(), _TL("Parameters"));
771 
772  if( do_UseInCMD() )
773  {
774  s += CSG_String::Format(":%s", Separator);
775 
776  for(int i=0; i<asParameters()->Get_Count(); i++)
777  {
778  s += CSG_String::Format("- %d. %s%s", i + 1, asParameters()->Get_Parameter(i)->Get_Description(Flags, Separator).c_str(), Separator);
779  }
780  }
781  break;
782  }
783 
784  if( !m_Default.is_Empty() )
785  {
786  SEPARATE; s += CSG_String::Format("%s: %s", _TL("Default"), m_Default.c_str());
787  }
788  }
789 
790  //-----------------------------------------------------
791  if( (Flags & PARAMETER_DESCRIPTION_TEXT) != 0 && m_Description.Length() > 0 )
792  {
793  SEPARATE; s += m_Description;
794  }
795 
796  //-----------------------------------------------------
797  #undef SEPARATE
798 
799  return( s );
800 }
801 
802 
804 // //
806 
807 //---------------------------------------------------------
812 
813 //---------------------------------------------------------
815 {
816  switch( _Set_Value(Value) )
817  {
819  return( false );
820 
822  has_Changed();
823  }
824 
825  return( true );
826 }
827 
828 //---------------------------------------------------------
829 bool CSG_Parameter::Set_Value(double Value)
830 {
831  switch( _Set_Value(Value) )
832  {
834  return( false );
835 
837  has_Changed();
838  }
839 
840  return( true );
841 }
842 
843 //---------------------------------------------------------
844 bool CSG_Parameter::Set_Value(const char *Value) { return( Set_Value(CSG_String(Value)) ); }
845 bool CSG_Parameter::Set_Value(const wchar_t *Value) { return( Set_Value(CSG_String(Value)) ); }
847 {
848  switch( _Set_Value(Value) )
849  {
851  return( false );
852 
854  has_Changed();
855  }
856 
857  return( true );
858 }
859 
860 //---------------------------------------------------------
861 bool CSG_Parameter::Set_Value(void *Value)
862 {
863  switch( _Set_Value(Value) )
864  {
866  return( false );
867 
869  has_Changed();
870  }
871 
872  return( true );
873 }
874 
875 //---------------------------------------------------------
877 {
878  if( Value )
879  {
880  switch( Value->Get_Type() )
881  {
882  default:
883  break;
884 
887  return( Set_Value(Value->asInt()) );
888  }
889  }
890 
891  return( Assign(Value) );
892 }
893 
894 //---------------------------------------------------------
896 {
897  return( false );
898 }
899 
900 //---------------------------------------------------------
901 bool CSG_Parameter::has_Changed(int Check_Flags)
902 {
903  _Set_String();
904 
905  return( m_pParameters && m_pParameters->_On_Parameter_Changed(this, Check_Flags) );
906 }
907 
908 //---------------------------------------------------------
910 {
911  // nop
912 }
913 
914 
916 // //
918 
919 //---------------------------------------------------------
921 {
922  m_Default.Printf("%d", Value);
923 
924  return( true );
925 }
926 
927 //---------------------------------------------------------
928 bool CSG_Parameter::Set_Default(double Value)
929 {
930  m_Default.Printf("%f", Value);
931 
932  return( true );
933 }
934 
935 //---------------------------------------------------------
937 {
938  m_Default = Value;
939 
940  return( true );
941 }
942 
943 //---------------------------------------------------------
945 {
946  return( m_Default );
947 }
948 
949 //---------------------------------------------------------
951 {
952  return( m_Default.Cmp(asString()) == 0 );
953 }
954 
955 //---------------------------------------------------------
957 {
958  return( Set_Value(m_Default) );
959 }
960 
961 
963 // //
965 
966 //---------------------------------------------------------
967 bool CSG_Parameter::Check(bool bSilent)
968 {
970  {
971  return( asParameters()->DataObjects_Check(bSilent) );
972  }
973 
974  //-----------------------------------------------------
976  {
977  if( m_pParameters->Get_Manager() )
978  {
979  bool bExists = false; CSG_Data_Manager &Manager = *m_pParameters->Get_Manager();
980 
981  for(size_t i=0; !bExists && i<Manager.Grid ().Count(); i++)
982  {
983  bExists = Manager.Grid (i).Get_System() == *asGrid_System();
984  }
985 
986  for(size_t i=0; !bExists && i<Manager.Grids().Count(); i++)
987  {
988  bExists = Manager.Grids(i).Get_System() == *asGrid_System();
989  }
990 
991  if( bExists == false )
992  {
993  Set_Value((void *)NULL);
994  }
995  }
996 
997  return( true ); // ( false );
998  }
999 
1000  //-----------------------------------------------------
1001  if( is_DataObject() )
1002  {
1003  if( is_Input() || (is_Output() && asDataObject() != DATAOBJECT_CREATE) )
1004  {
1005  if( m_pParameters->Get_Manager() && !m_pParameters->Get_Manager()->Exists(asDataObject()) )
1006  {
1008  }
1009  }
1010 
1011  return( is_Optional() || !is_Enabled() || asDataObject() );
1012  }
1013 
1014  //-----------------------------------------------------
1015  else if( is_DataObject_List() )
1016  {
1017  for(int j=asList()->Get_Item_Count()-1; j>=0; j--)
1018  {
1019  CSG_Data_Object *pDataObject = asList()->Get_Item(j);
1020 
1021  if( !pDataObject || (m_pParameters->Get_Manager() && !m_pParameters->Get_Manager()->Exists(pDataObject)) )
1022  {
1023  asList()->Del_Item(j, false);
1024  }
1025  }
1026 
1027  _Set_String();
1028 
1029  asList()->Update_Data();
1030 
1031  return( is_Optional() || !is_Enabled() || is_Output() || asList()->Get_Item_Count() > 0 );
1032  }
1033 
1034  //-----------------------------------------------------
1035  return( true );
1036 }
1037 
1038 
1040 // //
1042 
1043 //---------------------------------------------------------
1044 int CSG_Parameter::_asInt (void) const { return( 0 ); }
1045 double CSG_Parameter::_asDouble (void) const { return( 0. ); }
1046 void * CSG_Parameter::_asPointer (void) const { return( NULL ); }
1047 const SG_Char * CSG_Parameter::_asString (void) const { return( m_String ); }
1048 
1049 //---------------------------------------------------------
1051 const SG_Char * CSG_Parameter::asFont (void) const { return( Get_Type() != PARAMETER_TYPE_Font ? NULL : (const SG_Char *)asPointer() ); }
1054 
1055 //---------------------------------------------------------
1057 {
1058  int Method;
1059 
1060  if( Get_Type() == PARAMETER_TYPE_Choice && asChoice()->Get_Data(Method) )
1061  {
1062  switch( Method )
1063  {
1064  case (int)CSG_Grid_Resampling::NearestNeighbour: return( CSG_Grid_Resampling::NearestNeighbour );
1065  case (int)CSG_Grid_Resampling::Bilinear : return( CSG_Grid_Resampling::Bilinear );
1066  case (int)CSG_Grid_Resampling::Bicubic_1 : return( CSG_Grid_Resampling::Bicubic_1 );
1067  case (int)CSG_Grid_Resampling::Bicubic_2 : return( CSG_Grid_Resampling::Bicubic_2 );
1068  case (int)CSG_Grid_Resampling::Mean_Nodes : return( CSG_Grid_Resampling::Mean_Nodes );
1069  case (int)CSG_Grid_Resampling::Mean_Cells : return( CSG_Grid_Resampling::Mean_Cells );
1072  case (int)CSG_Grid_Resampling::Majority : return( CSG_Grid_Resampling::Majority );
1073  }
1074  }
1075 
1077 }
1078 
1079 //---------------------------------------------------------
1081 CSG_Grid * CSG_Parameter::asGrid (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Grid ? NULL : (CSG_Grid *)pObject ); }
1082 CSG_Grids * CSG_Parameter::asGrids (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Grids ? NULL : (CSG_Grids *)pObject ); }
1083 CSG_TIN * CSG_Parameter::asTIN (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_TIN ? NULL : (CSG_TIN *)pObject ); }
1084 CSG_PointCloud * CSG_Parameter::asPointCloud (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_PointCloud ? NULL : (CSG_PointCloud *)pObject ); }
1085 
1086 //---------------------------------------------------------
1088 {
1089  CSG_Data_Object *pObject = asDataObject();
1090 
1091  if( pObject && pObject != DATAOBJECT_CREATE
1092  && (pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes
1093  || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud) )
1094  {
1095  return( (CSG_Shapes *)pObject );
1096  }
1097 
1098  return( NULL );
1099 }
1100 
1101 //---------------------------------------------------------
1103 {
1104  switch( Get_Type() )
1105  {
1106  default: {
1107  CSG_Data_Object *pObject = asDataObject();
1108 
1109  if( pObject && pObject != DATAOBJECT_CREATE
1110  && (pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Table
1111  || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes
1112  || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_TIN
1113  || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud) )
1114  {
1115  return( (CSG_Table *)pObject );
1116  }
1117  } break;
1118 
1119  case PARAMETER_TYPE_Grids :
1120  return( asGrids() ? asGrids()->Get_Attributes_Ptr() : NULL );
1121 
1123  return( (CSG_Table *)asPointer() );
1124  }
1125 
1126  return( NULL );
1127 }
1128 
1129 //---------------------------------------------------------
1131 {
1137  {
1138  return( (CSG_Parameter_Value *)this );
1139  }
1140 
1141  return( NULL );
1142 }
1143 
1147  && Get_Type() != PARAMETER_TYPE_Data_Type ? NULL : (CSG_Parameter_Choice *)this ); }
1152 
1153 //---------------------------------------------------------
1154 CSG_Parameter_List * CSG_Parameter::asList (void) const { return( !is_DataObject_List() ? NULL : (CSG_Parameter_List *)this ); }
1161 
1162 
1164 // //
1166 
1167 //---------------------------------------------------------
1168 void CSG_Parameter::_Add_Child(CSG_Parameter *pChild)
1169 {
1170  m_Children = (CSG_Parameter **)SG_Realloc(m_Children, (m_nChildren + 1) * sizeof(CSG_Parameter *));
1171  m_Children[m_nChildren++] = pChild;
1172 }
1173 
1174 
1176 // //
1178 
1179 //---------------------------------------------------------
1181 {
1182  if( pSource && Get_Type() == pSource->Get_Type() )
1183  {
1184  m_bEnabled = pSource->m_bEnabled;
1185  m_Default = pSource->m_Default;
1186 
1187  Set_Collapsed(pSource->is_Collapsed());
1188 
1189  if( _Assign(pSource) )
1190  {
1191  _Set_String();
1192 
1193  return( true );
1194  }
1195  }
1196 
1197  return( false );
1198 }
1199 
1201 {
1202  return( true );
1203 }
1204 
1205 //---------------------------------------------------------
1206 bool CSG_Parameter::Serialize(CSG_MetaData &MetaData, bool bSave)
1207 {
1208  if( bSave )
1209  {
1211  {
1212  return( true );
1213  }
1214 
1215  CSG_MetaData &Child = *MetaData.Add_Child(
1216  is_Option () ? "OPTION" :
1217  is_DataObject () ? "DATA" :
1218  is_DataObject_List() ? "DATA_LIST" : "PARAMETER"
1219  );
1220 
1221  Child.Add_Property("type" , Get_Type_Identifier ());
1222  Child.Add_Property("id" , Get_Identifier ());
1223  Child.Add_Property("name" , Get_Name ());
1224  Child.Add_Property("parms", Get_Parameters()->Get_Identifier());
1225 
1226  _Serialize(Child, bSave);
1227 
1228  return( true );
1229  }
1230  else if( MetaData.Cmp_Property("type", Get_Type_Identifier())
1231  && MetaData.Cmp_Property("id" , Get_Identifier ())
1232  && _Serialize(MetaData, bSave) )
1233  {
1234  _Set_String();
1235 
1236  return( true );
1237  }
1238 
1239  return( false );
1240 }
1241 
1242 bool CSG_Parameter::_Serialize(CSG_MetaData &Entry, bool bSave)
1243 {
1244  Entry.Set_Content("-");
1245 
1246  return( true );
1247 }
1248 
1249 
1251 // //
1252 // Coordinate System Reference Picker //
1253 // //
1255 
1256 //---------------------------------------------------------
1258 {
1259  // nop...
1260 }
1261 
1262 //---------------------------------------------------------
1264 {
1265  m_pParameters = &Parameters;
1266 
1267  Parameters.Add_String(ParentID, "CRS_STRING", _TL("Coordinate System Definition"),
1268  _TL("Supported formats comprise PROJ and WKT strings, object codes (e.g. \"EPSG:4326\")."), ""
1269  )->Set_UseInGUI(false);
1270 
1271  return( true );
1272 }
1273 
1274 
1276 // //
1278 
1279 //---------------------------------------------------------
1281 {
1282  if( !m_pParameters || !m_pParameters->has_GUI() || m_pCRS )
1283  {
1284  return( false );
1285  }
1286 
1287  m_pCRS = SG_Get_Tool_Library_Manager().Create_Tool("pj_proj4", 15, true); // CCRS_Picker
1288 
1289  if( !m_pCRS )
1290  {
1291  return( false );
1292  }
1293 
1294  m_pCRS->Set_Parameter("CRS_STRING", (*m_pParameters)["CRS_STRING"].asString());
1295 
1296  m_pParameters->Add_Parameters((*m_pParameters)("CRS_STRING")->Get_Parent(),
1297  "CRS_PICKER", _TL("Coordinate Reference System"), _TL("")
1298  )->asParameters()->Create(*m_pCRS->Get_Parameters());
1299 
1300  return( true );
1301 }
1302 
1303 //---------------------------------------------------------
1305 {
1306  if( m_pCRS )
1307  {
1308  m_pParameters->Del_Parameter("CRS_PICKER");
1309 
1311 
1312  m_pCRS = NULL;
1313 
1314  return( true );
1315  }
1316 
1317  return( false );
1318 }
1319 
1320 
1322 // //
1324 
1325 //---------------------------------------------------------
1327 {
1328  if( pParameter->Cmp_Identifier("CRS_PICKER") )
1329  {
1330  pParameters->Set_Parameter("CRS_STRING", (*pParameter->asParameters())("CRS_WKT")->asString());
1331  }
1332 
1333  return( true );
1334 }
1335 
1336 //---------------------------------------------------------
1338 {
1339  return( true );
1340 }
1341 
1342 
1344 // //
1346 
1347 //---------------------------------------------------------
1348 bool CSG_Parameters_CRSPicker::Get_CRS(CSG_Projection &Projection, bool bMessage) const
1349 {
1350  if( Projection.Create((*m_pParameters)["CRS_STRING"].asString()) )
1351  {
1352  if( bMessage )
1353  {
1354  SG_UI_Msg_Add_Execution(CSG_String::Format("\n%s: %s\n", _TL("CRS"), Projection.Get_PROJ().c_str()), false);
1355  }
1356 
1357  return( true );
1358  }
1359 
1360  if( bMessage )
1361  {
1362  SG_UI_Msg_Add_Execution(CSG_String::Format("\n%s: %s\n", _TL("Warning"), _TL("undefined coordinate reference system")), false);
1363  }
1364 
1365  return( false );
1366 }
1367 
1368 
1370 // //
1371 // Grid Target Selector //
1372 // //
1374 
1375 //---------------------------------------------------------
1377 {
1378  m_pParameters = NULL;
1379 }
1380 
1381 //---------------------------------------------------------
1382 bool CSG_Parameters_Grid_Target::Create(CSG_Parameters *pParameters, bool bAddDefaultGrid, CSG_Parameter *pParent, const CSG_String &Prefix)
1383 {
1384  return( Create(pParameters, bAddDefaultGrid, pParent ? pParent->Get_Identifier() : SG_T(""), Prefix) );
1385 }
1386 
1387 bool CSG_Parameters_Grid_Target::Create(CSG_Parameters *pParameters, bool bAddDefaultGrid, const CSG_String &ParentID, const CSG_String &Prefix)
1388 {
1389  if( pParameters == NULL )
1390  {
1391  return( false );
1392  }
1393 
1394  m_pParameters = pParameters;
1395  m_Prefix = Prefix;
1396 
1397  //-----------------------------------------------------
1398  CSG_String TargetID(m_Prefix + "DEFINITION");
1399 
1400  m_pParameters->Add_Choice(
1401  ParentID, TargetID, _TL("Target Grid System"),
1402  _TL(""),
1403  CSG_String::Format("%s|%s",
1404  _TL("user defined"),
1405  _TL("grid or grid system")
1406  ), 0
1407  );
1408 
1409  //-----------------------------------------------------
1410  m_pParameters->Add_Double(TargetID, m_Prefix + "USER_SIZE", _TL("Cellsize"), _TL(""), 1., 0., true);
1411  m_pParameters->Add_Double(TargetID, m_Prefix + "USER_XMIN", _TL("West" ), _TL(""), 0.);
1412  m_pParameters->Add_Double(TargetID, m_Prefix + "USER_XMAX", _TL("East" ), _TL(""), 100.);
1413  m_pParameters->Add_Double(TargetID, m_Prefix + "USER_YMIN", _TL("South" ), _TL(""), 0.);
1414  m_pParameters->Add_Double(TargetID, m_Prefix + "USER_YMAX", _TL("North" ), _TL(""), 100.);
1415  m_pParameters->Add_Int (TargetID, m_Prefix + "USER_COLS", _TL("Columns" ), _TL("Number of cells in East-West direction." ), 101, 1, true);
1416  m_pParameters->Add_Int (TargetID, m_Prefix + "USER_ROWS", _TL("Rows" ), _TL("Number of cells in North-South direction."), 101, 1, true);
1417  m_pParameters->Add_Bool (TargetID, m_Prefix + "USER_FLAT", _TL("Rounding"), _TL("Round bounding coordinates to multiples of cell size. Ignored if cell size has decimal places."), true);
1418  m_pParameters->Add_Choice(TargetID, m_Prefix + "USER_FITS", _TL("Fit" ), _TL(""),
1419  CSG_String::Format("%s|%s",
1420  _TL("nodes"),
1421  _TL("cells")
1422  ), 0
1423  );
1424 
1425  //-----------------------------------------------------
1426  m_pParameters->Add_Grid_System(TargetID, m_Prefix + "SYSTEM", _TL("Grid System"), _TL(""));
1427 
1428  m_pParameters->Add_Grid(m_Prefix + "SYSTEM", m_Prefix + "TEMPLATE", _TL("Target System"),
1429  _TL("use this grid's system for output grids"), PARAMETER_INPUT_OPTIONAL, false
1430  )->Set_UseInGUI(false);
1431 
1432  //-----------------------------------------------------
1433  if( bAddDefaultGrid )
1434  {
1435  Add_Grid(m_Prefix + "OUT_GRID", _TL("Target Grid"), false);
1436  }
1437 
1438  return( true );
1439 }
1440 
1441 
1443 // //
1445 
1446 //---------------------------------------------------------
1448 {
1449  return( pParameter && pParameters && m_pParameters && m_pParameters->Cmp_Identifier(pParameters->Get_Identifier())
1450  && On_Parameter_Changed(pParameters, pParameter, m_Prefix)
1451  );
1452 }
1453 
1454 //---------------------------------------------------------
1456 {
1457  if( !pParameters || !pParameter )
1458  {
1459  return( false );
1460  }
1461 
1462  if( !pParameter->Cmp_Identifier(Prefix + "USER_SIZE")
1463  && !pParameter->Cmp_Identifier(Prefix + "USER_XMIN")
1464  && !pParameter->Cmp_Identifier(Prefix + "USER_XMAX")
1465  && !pParameter->Cmp_Identifier(Prefix + "USER_YMIN")
1466  && !pParameter->Cmp_Identifier(Prefix + "USER_YMAX")
1467  && !pParameter->Cmp_Identifier(Prefix + "USER_ROWS")
1468  && !pParameter->Cmp_Identifier(Prefix + "USER_COLS")
1469  && !pParameter->Cmp_Identifier(Prefix + "USER_FLAT")
1470  && !pParameter->Cmp_Identifier(Prefix + "USER_FITS") )
1471  {
1472  return( true );
1473  }
1474 
1475  CSG_Parameter *pSize = (*pParameters)(Prefix + "USER_SIZE");
1476  CSG_Parameter *pXMin = (*pParameters)(Prefix + "USER_XMIN");
1477  CSG_Parameter *pXMax = (*pParameters)(Prefix + "USER_XMAX");
1478  CSG_Parameter *pYMin = (*pParameters)(Prefix + "USER_YMIN");
1479  CSG_Parameter *pYMax = (*pParameters)(Prefix + "USER_YMAX");
1480  CSG_Parameter *pRows = (*pParameters)(Prefix + "USER_ROWS");
1481  CSG_Parameter *pCols = (*pParameters)(Prefix + "USER_COLS");
1482  CSG_Parameter *pFlat = (*pParameters)(Prefix + "USER_FLAT");
1483  CSG_Parameter *pFits = (*pParameters)(Prefix + "USER_FITS");
1484 
1485  double Size = pSize->asDouble();
1486 
1487  double xMin = pXMin->asDouble(), xMax = pXMax->asDouble();
1488  double yMin = pYMin->asDouble(), yMax = pYMax->asDouble();
1489 
1490  //-----------------------------------------------------
1491  bool bChanged = true;
1492 
1493  if( pParameter->Cmp_Identifier(pFits->Get_Identifier()) )
1494  {
1495  if( pFits->asInt() == 0 ) // fit cells >> fit nodes
1496  {
1497  xMin += 0.5 * Size; xMax -= 0.5 * Size;
1498  yMin += 0.5 * Size; yMax -= 0.5 * Size;
1499  }
1500  }
1501  else
1502  {
1503  if( pFits->asInt() == 1 ) // fit cells >> fit nodes
1504  {
1505  xMin += 0.5 * Size; xMax -= 0.5 * Size;
1506  yMin += 0.5 * Size; yMax -= 0.5 * Size;
1507  }
1508 
1509  if( pParameter->Cmp_Identifier(pSize->Get_Identifier()) && Size > 0. )
1510  {
1511  xMax = xMin + Size * (int)(0.5 + (xMax - xMin) / Size);
1512  yMax = yMin + Size * (int)(0.5 + (yMax - yMin) / Size);
1513  }
1514  else if( pParameter->Cmp_Identifier(pCols->Get_Identifier()) && pCols->asInt() > 0 )
1515  {
1516  xMax = xMin + Size * (pCols->asInt() - 1);
1517  }
1518  else if( pParameter->Cmp_Identifier(pXMin->Get_Identifier()) )
1519  {
1520  xMax = xMin + Size * (xMin > xMax ? (pCols->asInt() - 1) : (int)(0.5 + (xMax - xMin) / Size));
1521  }
1522  else if( pParameter->Cmp_Identifier(pXMax->Get_Identifier()) )
1523  {
1524  xMin = xMax - Size * (xMin > xMax ? (pCols->asInt() - 1) : (int)(0.5 + (xMax - xMin) / Size));
1525  }
1526  else if( pParameter->Cmp_Identifier(pRows->Get_Identifier()) && pRows->asInt() > 0 )
1527  {
1528  yMax = yMin + Size * (pRows->asInt() - 1);
1529  }
1530  else if( pParameter->Cmp_Identifier(pYMin->Get_Identifier()) )
1531  {
1532  yMax = yMin + Size * (yMin > yMax ? (pRows->asInt() - 1) : (int)(0.5 + (yMax - yMin) / Size));
1533  }
1534  else if( pParameter->Cmp_Identifier(pYMax->Get_Identifier()) )
1535  {
1536  yMin = yMax - Size * (yMin > yMax ? (pRows->asInt() - 1) : (int)(0.5 + (yMax - yMin) / Size));
1537  }
1538  else if( pParameter->Cmp_Identifier(pFlat->Get_Identifier()) )
1539  {
1540  bChanged = pFlat->asBool();
1541  }
1542  else
1543  {
1544  bChanged = false; // none of the relevant parameters did change so far
1545  }
1546  }
1547 
1548  //-----------------------------------------------------
1549  if( bChanged )
1550  {
1551  if( (pParameter->Cmp_Identifier(pSize->Get_Identifier()) || pParameter->Cmp_Identifier(pFlat->Get_Identifier()))
1552  && pFlat->asBool() && !M_HAS_DECIMALS(Size) ) // rounding of bounds
1553  {
1554  xMin = floor(xMin / Size) * Size; xMax = ceil(xMax / Size) * Size;
1555  yMin = floor(yMin / Size) * Size; yMax = ceil(yMax / Size) * Size;
1556  }
1557 
1558  pCols->Set_Value(1 + (int)((xMax - xMin) / Size));
1559  pRows->Set_Value(1 + (int)((yMax - yMin) / Size));
1560 
1561  if( pFits->asInt() == 1 )
1562  {
1563  xMin -= 0.5 * Size; xMax += 0.5 * Size;
1564  yMin -= 0.5 * Size; yMax += 0.5 * Size;
1565  }
1566 
1567  pXMin->Set_Value(xMin);
1568  pXMax->Set_Value(xMax);
1569  pYMin->Set_Value(yMin);
1570  pYMax->Set_Value(yMax);
1571 
1572  return( true );
1573  }
1574 
1575  //-----------------------------------------------------
1576  CSG_Parameter *pZSize = (*pParameters)(Prefix + "USER_ZSIZE");
1577  CSG_Parameter *pZMin = (*pParameters)(Prefix + "USER_ZMIN" );
1578  CSG_Parameter *pZMax = (*pParameters)(Prefix + "USER_ZMAX" );
1579  CSG_Parameter *pZNum = (*pParameters)(Prefix + "USER_ZNUM" );
1580 
1581  if( pZSize && pZMin && pZMax && pZNum )
1582  {
1583  double zSize = pZSize->asDouble(), zMin = pZMin ->asDouble(), zMax = pZMax ->asDouble();
1584 
1585  bChanged = true;
1586 
1587  if ( pParameter->Cmp_Identifier(pZSize->Get_Identifier()) && zSize > 0. )
1588  {
1589  zMax = zMin + zSize * (int)(0.5 + (zMax - zMin) / zSize);
1590  }
1591  else if( pParameter->Cmp_Identifier(pZNum->Get_Identifier()) && pZNum->asInt() > 0 )
1592  {
1593  zMax = zMin + zSize * pZNum->asInt();
1594  }
1595  else if( pParameter->Cmp_Identifier(pZMin->Get_Identifier()) )
1596  {
1597  zMax = zMin + zSize * (zMin > zMax ? pZNum->asInt() : (int)(0.5 + (zMax - zMin) / zSize));
1598  }
1599  else if( pParameter->Cmp_Identifier(pZMax->Get_Identifier()) )
1600  {
1601  zMin = zMax - zSize * (zMin > zMax ? pZNum->asInt() : (int)(0.5 + (zMax - zMin) / zSize));
1602  }
1603  else
1604  {
1605  bChanged = false;
1606  }
1607 
1608  if( bChanged )
1609  {
1610  pZNum->Set_Value(1 + (int)((zMax - zMin) / zSize));
1611 
1612  pZMin->Set_Value(zMin);
1613  pZMax->Set_Value(zMax);
1614  }
1615  }
1616 
1617  return( true );
1618 }
1619 
1620 //---------------------------------------------------------
1622 {
1623  return( pParameter && pParameters && m_pParameters && m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) == 0
1624  && On_Parameters_Enable(pParameters, pParameter, m_Prefix)
1625  );
1626 }
1627 
1628 //---------------------------------------------------------
1630 {
1631  if( !pParameter || !pParameters || !(pParameter = (*pParameters)(Prefix + "DEFINITION")) )
1632  {
1633  return( false );
1634  }
1635 
1636  pParameters->Set_Enabled(Prefix + "SYSTEM" , pParameter->asInt() == 1);
1637  pParameters->Set_Enabled(Prefix + "TEMPLATE" , pParameter->asInt() == 1);
1638 
1639  pParameters->Set_Enabled(Prefix + "USER_SIZE", pParameter->asInt() == 0);
1640  pParameters->Set_Enabled(Prefix + "USER_XMIN", pParameter->asInt() == 0);
1641  pParameters->Set_Enabled(Prefix + "USER_XMAX", pParameter->asInt() == 0);
1642  pParameters->Set_Enabled(Prefix + "USER_YMIN", pParameter->asInt() == 0);
1643  pParameters->Set_Enabled(Prefix + "USER_YMAX", pParameter->asInt() == 0);
1644  pParameters->Set_Enabled(Prefix + "USER_ROWS", pParameter->asInt() == 0);
1645  pParameters->Set_Enabled(Prefix + "USER_COLS", pParameter->asInt() == 0);
1646  pParameters->Set_Enabled(Prefix + "USER_FLAT", pParameter->asInt() == 0);
1647  pParameters->Set_Enabled(Prefix + "USER_FITS", pParameter->asInt() == 0);
1648  pParameters->Set_Enabled(Prefix + "USER_OPTS", pParameter->asInt() == 0);
1649  pParameters->Set_Enabled(Prefix + "USER_Z" , pParameter->asInt() == 0);
1650 
1651  return( true );
1652 }
1653 
1654 
1656 // //
1658 
1659 //---------------------------------------------------------
1668 bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, const TSG_Rect &Extent, int Rows, int Rounding)
1669 {
1670  if( !m_pParameters->Get_Tool() || !m_pParameters->Get_Tool()->has_GUI() ) // no cancel button, so set parameters directly
1671  {
1672  pParameters = m_pParameters;
1673  }
1674 
1675  if( !m_pParameters || !pParameters || m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) )
1676  {
1677  return( false );
1678  }
1679 
1680  if( Rows < 1 && (Rows = (*m_pParameters)(m_Prefix + "USER_ROWS")->asInt()) < 1 )
1681  {
1682  Rows = 100;
1683  }
1684 
1685  //-----------------------------------------------------
1686  CSG_Rect r(Extent);
1687 
1688  if( r.Get_XRange() == 0. && r.Get_YRange() == 0. )
1689  {
1690  r.Inflate(0.5 * Rows, false); // assume cellsize = 1.
1691  }
1692  else if( r.Get_XRange() == 0. )
1693  {
1694  double d = 0.5 * r.Get_YRange() / Rows; r.xMin -= d; r.xMax += d; // inflate by half cellsize
1695  }
1696  else if( r.Get_YRange() == 0. )
1697  {
1698  double d = 0.5 * r.Get_XRange() / Rows; r.yMin -= d; r.yMax += d; // inflate by half cellsize
1699  }
1700 
1701  //-----------------------------------------------------
1702  double Size = r.Get_YRange() / (Rows - 1);
1703 
1704  int Cols = 1 + (int)(0.5 + r.Get_XRange() / Size);
1705 
1706  if( Rounding > 0 ) // rounding of cell size!
1707  {
1708  Size = SG_Get_Rounded_To_SignificantFigures(Size, Rounding);
1709 
1710  r.xMin = r.Get_XCenter() - Size * Cols / 2.;
1711  r.yMin = r.Get_YCenter() - Size * Rows / 2.;
1712  r.yMax = r.Get_YMin () + Size * (Rows - 1);
1713  }
1714 
1715  r.xMax = r.Get_XMin() + Size * (Cols - 1);
1716 
1717  //-----------------------------------------------------
1718  if( (*pParameters)(m_Prefix + "USER_FLAT")->asBool() && !M_HAS_DECIMALS(Size) ) // rounding of bounds
1719  {
1720  r.xMin = floor(r.xMin / Size) * Size; r.xMax = ceil(r.xMax / Size) * Size;
1721  r.yMin = floor(r.yMin / Size) * Size; r.yMax = ceil(r.yMax / Size) * Size;
1722  }
1723 
1724  //-----------------------------------------------------
1725  if( (*pParameters)(m_Prefix + "USER_FITS")->asInt() == 1 ) // fit to cells
1726  {
1727  r.Inflate(0.5 * Size, false);
1728  }
1729 
1730  bool bCallback = pParameters->Set_Callback(false);
1731 
1732  pParameters->Set_Parameter(m_Prefix + "USER_SIZE", Size );
1733  pParameters->Set_Parameter(m_Prefix + "USER_XMIN", r.Get_XMin());
1734  pParameters->Set_Parameter(m_Prefix + "USER_XMAX", r.Get_XMax());
1735  pParameters->Set_Parameter(m_Prefix + "USER_YMIN", r.Get_YMin());
1736  pParameters->Set_Parameter(m_Prefix + "USER_YMAX", r.Get_YMax());
1737  pParameters->Set_Parameter(m_Prefix + "USER_COLS", Cols );
1738  pParameters->Set_Parameter(m_Prefix + "USER_ROWS", Rows );
1739 
1740  pParameters->Set_Callback(bCallback);
1741 
1742  return( true );
1743 }
1744 
1745 //---------------------------------------------------------
1750 bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, CSG_Shapes *pPoints, int Scale, int Rounding)
1751 {
1752  if( !pPoints || pPoints->Get_Count() <= 0 || pPoints->Get_Extent().Get_Area() <= 0. )
1753  {
1754  return( false );
1755  }
1756 
1757  CSG_Rect r(pPoints->Get_Extent());
1758 
1759  double Size = sqrt(r.Get_Area() / pPoints->Get_Count()) / (Scale > 1 ? Scale : 1); // edge length of a square given as average area per point (cell size)
1760 
1761  if( Size >= 1. && Rounding > 0 )
1762  {
1763  Size = SG_Get_Rounded_To_SignificantFigures(Size, Rounding);
1764 
1765  r.xMin = Size * floor(r.xMin / Size);
1766  r.xMax = Size * ceil (r.xMax / Size);
1767  r.yMin = Size * floor(r.yMin / Size);
1768  r.yMax = Size * ceil (r.yMax / Size);
1769  }
1770 
1771  int Rows = 1 + (int)(0.5 + r.Get_YRange() / Size);
1772 
1773  return( Set_User_Defined(pParameters, r, Rows, 0) );
1774 }
1775 
1776 //---------------------------------------------------------
1781 {
1782  return( System.is_Valid() && Set_User_Defined(pParameters, System.Get_Extent(), System.Get_NY(), 0) );
1783 }
1784 
1785 //---------------------------------------------------------
1789 bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, double xMin, double yMin, double Cellsize, int nx, int ny)
1790 {
1791  return( Set_User_Defined(pParameters, CSG_Grid_System(Cellsize, xMin, yMin, nx, ny)) );
1792 }
1793 
1794 //---------------------------------------------------------
1798 bool CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels(CSG_Parameters *pParameters, double zMin, double zMax, int nLevels, int Rounding)
1799 {
1800  if( !m_pParameters->Get_Tool()->has_GUI() ) // no cancel button, so set parameters directly
1801  {
1802  pParameters = m_pParameters;
1803  }
1804 
1805  if( !m_pParameters || !pParameters || m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) )
1806  {
1807  return( false );
1808  }
1809 
1810  if( nLevels < 1 )
1811  {
1812  nLevels = 100;
1813  }
1814 
1815  //-----------------------------------------------------
1816  if( zMin > zMax )
1817  {
1818  double z = zMin; zMin = zMax; zMax = z;
1819  }
1820 
1821  if( zMax - zMin <= 0. )
1822  {
1823  zMin -= 0.5 * nLevels;
1824  zMax += 0.5 * nLevels; // assume cellsize = 1.
1825  }
1826 
1827  //-----------------------------------------------------
1828  double Size = (zMax - zMin) / (nLevels - 1.);
1829 
1830  if( Rounding > 0 )
1831  {
1832  Size = SG_Get_Rounded_To_SignificantFigures(Size, Rounding);
1833 
1834  zMin = Size * floor(zMin / Size);
1835  zMax = Size * ceil (zMax / Size);
1836  }
1837 
1838  //-----------------------------------------------------
1839  if( (*pParameters)(m_Prefix + "USER_FITS")->asInt() == 1 )
1840  {
1841  zMin -= 0.5 * Size;
1842  zMax += 0.5 * Size;
1843  }
1844 
1845  bool bCallback = pParameters->Set_Callback(false);
1846 
1847  pParameters->Set_Parameter(m_Prefix + "USER_ZSIZE", Size );
1848  pParameters->Set_Parameter(m_Prefix + "USER_ZMIN" , zMin );
1849  pParameters->Set_Parameter(m_Prefix + "USER_ZMAX" , zMax );
1850  pParameters->Set_Parameter(m_Prefix + "USER_ZNUM" , nLevels);
1851 
1852  pParameters->Set_Callback(bCallback);
1853 
1854  return( true );
1855 }
1856 
1857 
1859 // //
1861 
1862 //---------------------------------------------------------
1863 bool CSG_Parameters_Grid_Target::Add_Grid(const CSG_String &Identifier, const CSG_String &Name, bool bOptional)
1864 {
1865  if( !m_pParameters || Identifier.Length() == 0 || (*m_pParameters)(Identifier) != NULL )
1866  {
1867  return( false );
1868  }
1869 
1870  CSG_Parameter *pTarget = (*m_pParameters)(m_Prefix + "DEFINITION");
1871  CSG_Parameter *pSystem = NULL;
1872 
1873  for(int i=0; i<pTarget->Get_Children_Count() && !pSystem; i++)
1874  {
1875  if( pTarget->Get_Child(i)->Get_Type() == PARAMETER_TYPE_Grid_System )
1876  {
1877  pSystem = pTarget->Get_Child(i);
1878  }
1879  }
1880 
1881  m_pParameters->Add_Grid(pSystem ? pSystem->Get_Identifier() : SG_T(""), Identifier, Name, _TL(""), bOptional ? PARAMETER_OUTPUT_OPTIONAL : PARAMETER_OUTPUT, false);
1882 
1883  if( bOptional && m_pParameters->Get_Tool()->has_GUI() )
1884  {
1885  CSG_Parameter *pNode = (*m_pParameters)(m_Prefix + "USER_OPTS");
1886 
1887  if( !pNode )
1888  {
1889  pNode = m_pParameters->Add_Node(pTarget->Get_Identifier(), m_Prefix + "USER_OPTS", _TL("Optional Target Grids"), _TL(""));
1890  }
1891 
1892  m_pParameters->Add_Bool(pNode->Get_Identifier(), Identifier + "_CREATE", Name, _TL(""), false);
1893  }
1894 
1895  return( true );
1896 }
1897 
1898 //---------------------------------------------------------
1899 bool CSG_Parameters_Grid_Target::Add_Grids(const CSG_String &Identifier, const CSG_String &Name, bool bOptional, bool bZLevels)
1900 {
1901  if( !m_pParameters || Identifier.Length() == 0 || (*m_pParameters)(Identifier) != NULL )
1902  {
1903  return( false );
1904  }
1905 
1906  CSG_Parameter *pTarget = (*m_pParameters)(m_Prefix + "DEFINITION");
1907  CSG_Parameter *pSystem = NULL;
1908 
1909  for(int i=0; i<pTarget->Get_Children_Count() && !pSystem; i++)
1910  {
1911  if( pTarget->Get_Child(i)->Get_Type() == PARAMETER_TYPE_Grid_System )
1912  {
1913  pSystem = pTarget->Get_Child(i);
1914  }
1915  }
1916 
1917  m_pParameters->Add_Grids(pSystem ? pSystem->Get_Identifier() : SG_T(""), Identifier, Name, _TL(""), bOptional ? PARAMETER_OUTPUT_OPTIONAL : PARAMETER_OUTPUT, false);
1918 
1919  if( bOptional && m_pParameters->Get_Tool()->has_GUI() )
1920  {
1921  CSG_Parameter *pNode = (*m_pParameters)(m_Prefix + "USER_OPTS");
1922 
1923  if( !pNode )
1924  {
1925  pNode = m_pParameters->Add_Node(pTarget->Get_Identifier(), m_Prefix + "USER_OPTS", _TL("Optional Target Grids"), _TL(""));
1926  }
1927 
1928  m_pParameters->Add_Bool(pNode->Get_Identifier(), Identifier + "_CREATE", Name, _TL(""), false);
1929  }
1930 
1931  if( bZLevels )
1932  {
1933  pTarget = m_pParameters->Add_Node(pTarget, "USER_Z", _TL("Z Levels"), _TL(""));
1934 
1935  m_pParameters->Add_Double(pTarget, m_Prefix + "USER_ZSIZE", _TL("Cellsize"), _TL(""), 1., 0., true);
1936  m_pParameters->Add_Double(pTarget, m_Prefix + "USER_ZMIN" , _TL("Bottom" ), _TL(""), 0.);
1937  m_pParameters->Add_Double(pTarget, m_Prefix + "USER_ZMAX" , _TL("Top" ), _TL(""), 100.);
1938  m_pParameters->Add_Int (pTarget, m_Prefix + "USER_ZNUM" , _TL("Levels" ), _TL(""), 101, 1, true);
1939  }
1940 
1941  return( true );
1942 }
1943 
1944 
1946 // //
1948 
1949 //---------------------------------------------------------
1951 {
1952  return( Get_System(m_pParameters) );
1953 }
1954 
1955 //---------------------------------------------------------
1957 {
1958  CSG_Grid_System System;
1959 
1960  if( pParameters && (*pParameters)(m_Prefix + "DEFINITION") )
1961  {
1962  if( (*pParameters)(m_Prefix + "DEFINITION")->asInt() == 0 ) // user defined
1963  {
1964  if( (*pParameters)(m_Prefix + "USER_SIZE")
1965  && (*pParameters)(m_Prefix + "USER_XMIN")
1966  && (*pParameters)(m_Prefix + "USER_YMIN")
1967  && (*pParameters)(m_Prefix + "USER_XMAX")
1968  && (*pParameters)(m_Prefix + "USER_YMAX")
1969  && (*pParameters)(m_Prefix + "USER_FITS") )
1970  {
1971  double Size = (*pParameters)(m_Prefix + "USER_SIZE")->asDouble();
1972 
1973  CSG_Rect r(
1974  (*pParameters)(m_Prefix + "USER_XMIN")->asDouble(),
1975  (*pParameters)(m_Prefix + "USER_YMIN")->asDouble(),
1976  (*pParameters)(m_Prefix + "USER_XMAX")->asDouble(),
1977  (*pParameters)(m_Prefix + "USER_YMAX")->asDouble()
1978  );
1979 
1980  if( (*pParameters)(m_Prefix + "USER_FITS")->asInt() == 1 )
1981  {
1982  r.Deflate(0.5 * Size, false);
1983  }
1984 
1985  System.Assign(Size, r);
1986  }
1987  }
1988  else if( (*pParameters)(m_Prefix + "SYSTEM") )
1989  {
1990  CSG_Parameter *pParameter = (*pParameters)(m_Prefix + "SYSTEM");
1991 
1992  if( pParameter->asGrid_System() )
1993  {
1994  System.Assign(*pParameter->asGrid_System());
1995  }
1996  }
1997  }
1998 
1999  return( System );
2000 }
2001 
2002 //---------------------------------------------------------
2004 {
2005  if( !m_pParameters )
2006  {
2007  return( NULL );
2008  }
2009 
2010  CSG_Parameter *pParameter = (*m_pParameters)(Identifier);
2011 
2012  if( !pParameter || pParameter->Get_Type() != PARAMETER_TYPE_Grid )
2013  {
2014  return( NULL );
2015  }
2016 
2017  CSG_Grid_System System(Get_System());
2018 
2019  if( !System.is_Valid() )
2020  {
2021  return( NULL );
2022  }
2023 
2024  CSG_Parameter *pSystem = pParameter->Get_Parent();
2025 
2026  if( pSystem->asGrid_System() && !pSystem->asGrid_System()->is_Equal(System) )
2027  {
2028  pSystem->asGrid_System()->Create(System);
2029  }
2030 
2031  CSG_Grid *pGrid = NULL;
2032 
2033  if( (*m_pParameters)(m_Prefix + "DEFINITION")->asInt() == 0 && m_pParameters->Get_Tool()->has_GUI() )
2034  {
2035  if( (*m_pParameters)(Identifier + "_CREATE") == NULL
2036  || (*m_pParameters)(Identifier + "_CREATE")->asBool() )
2037  {
2038  pGrid = SG_Create_Grid(System, Type);
2039  }
2040  }
2041  else
2042  {
2043  pGrid = pParameter->asGrid();
2044 
2045  if( pParameter->asDataObject() == DATAOBJECT_CREATE || (!pGrid && !pParameter->is_Optional()) )
2046  {
2047  pGrid = SG_Create_Grid(System, Type);
2048  }
2049  else if( pGrid && (pGrid->Get_Type() != Type || !pGrid->Get_System().is_Equal(System)) )
2050  {
2051  pGrid->Create(System, Type);
2052  }
2053  }
2054 
2055  if( pGrid )
2056  {
2057  if( pGrid != pParameter->asGrid() )
2058  {
2059  pParameter->Set_Value(pGrid);
2060  }
2061 
2062  if( m_pParameters->Get_Manager() )
2063  {
2064  m_pParameters->Get_Manager()->Add(pGrid);
2065 
2066  if( m_pParameters->Get_Manager() == &SG_Get_Data_Manager() ) // prevent that local data manager send their data objects to gui
2067  {
2069  }
2070  }
2071  }
2072 
2073  return( pGrid );
2074 }
2075 
2076 
2078 // //
2080 
2081 //---------------------------------------------------------
2083 {
2084  return( Get_Grid(m_Prefix + "OUT_GRID", Type) );
2085 }
2086 
2087 //---------------------------------------------------------
2089 {
2090  if( !m_pParameters )
2091  {
2092  return( NULL );
2093  }
2094 
2095  CSG_Parameter *pParameter = (*m_pParameters)(Identifier);
2096 
2097  if( !pParameter || pParameter->Get_Type() != PARAMETER_TYPE_Grids )
2098  {
2099  return( NULL );
2100  }
2101 
2102  CSG_Grid_System System(Get_System());
2103 
2104  if( !System.is_Valid() )
2105  {
2106  return( NULL );
2107  }
2108 
2109  CSG_Parameter *pSystem = pParameter->Get_Parent();
2110 
2111  if( pSystem->asGrid_System() && !pSystem->asGrid_System()->is_Equal(System) )
2112  {
2113  pSystem->asGrid_System()->Create(System);
2114  }
2115 
2116  CSG_Grids *pGrids = NULL;
2117 
2118  if( (*m_pParameters)(m_Prefix + "DEFINITION")->asInt() == 0 && m_pParameters->Get_Tool()->has_GUI() )
2119  {
2120  if( (*m_pParameters)(Identifier + "_CREATE") == NULL
2121  || (*m_pParameters)(Identifier + "_CREATE")->asBool() )
2122  {
2123  pGrids = SG_Create_Grids(System, 0, 0., Type);
2124  }
2125  }
2126  else
2127  {
2128  pGrids = pParameter->asGrids();
2129 
2130  if( pParameter->asPointer() == DATAOBJECT_CREATE || (!pGrids && !pParameter->is_Optional()) )
2131  {
2132  pGrids = SG_Create_Grids(System, 0, 0., Type);
2133  }
2134  else if( pGrids && (pGrids->Get_Type() != Type || !pGrids->Get_System().is_Equal(System)) )
2135  {
2136  pGrids->Create(System, 0, 0., Type);
2137  }
2138  }
2139 
2140  if( pGrids && pGrids != pParameter->asGrids() )
2141  {
2142  pParameter->Set_Value(pGrids);
2143 
2144  if( m_pParameters->Get_Manager() )
2145  {
2146  m_pParameters->Get_Manager()->Add(pGrids);
2147 
2148  if( m_pParameters->Get_Manager() == &SG_Get_Data_Manager() ) // prevent that local data manager send their data objects to gui
2149  {
2151  }
2152  }
2153  }
2154 
2155  //-----------------------------------------------------
2156  if( pGrids
2157  && (*m_pParameters)(m_Prefix + "USER_ZSIZE")
2158  && (*m_pParameters)(m_Prefix + "USER_ZMIN" )
2159  && (*m_pParameters)(m_Prefix + "USER_ZNUM" ) )
2160  {
2161  int nz = (*m_pParameters)(m_Prefix + "USER_ZNUM" )->asInt ();
2162  double z = (*m_pParameters)(m_Prefix + "USER_ZMIN" )->asDouble();
2163  double dz = (*m_pParameters)(m_Prefix + "USER_ZSIZE")->asDouble();
2164 
2165  pGrids->Del_Grids();
2166 
2167  for(int iz=0; iz<nz; iz++, z+=dz)
2168  {
2169  pGrids->Add_Grid(z);
2170  }
2171  }
2172 
2173  return( pGrids );
2174 }
2175 
2176 //---------------------------------------------------------
2178 {
2179  return( Get_Grids(m_Prefix + "OUT_GRIDS", Type) );
2180 }
2181 
2182 
2184 // //
2185 // //
2186 // //
2188 
2189 //---------------------------------------------------------
CSG_Parameter::asColors
CSG_Colors * asColors(void) const
Definition: parameter.cpp:1050
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:547
CSG_Parameter::asGridsList
class CSG_Parameter_Grids_List * asGridsList(void) const
Definition: parameter.cpp:1156
CSG_Rect
Definition: geo_tools.h:474
CSG_Parameter_Date
Definition: parameters.h:577
CSG_Parameter::Set_Value
virtual bool Set_Value(int Value)
Definition: parameter.cpp:814
CSG_Parameter::asPointer
void * asPointer(void) const
Definition: parameters.h:290
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:128
CSG_Parameter_Choices::Get_Selection_Count
int Get_Selection_Count(void) const
Definition: parameters.h:768
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1758
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:137
CSG_Parameters_Grid_Target::Add_Grid
bool Add_Grid(const CSG_String &ID, const CSG_String &Name, bool bOptional)
Definition: parameter.cpp:1863
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:129
CSG_Rect::Deflate
CSG_Rect & Deflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:818
SG_T
#define SG_T(s)
Definition: api_core.h:537
CSG_Parameters_CRSPicker::On_Parameters_Enable
static bool On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: parameter.cpp:1337
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Parameters::Add_Grid_System
CSG_Parameter * Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
Definition: parameters.cpp:677
_TL
#define _TL(s)
Definition: api_core.h:1559
CSG_Parameter::asShapesList
class CSG_Parameter_Shapes_List * asShapesList(void) const
Definition: parameter.cpp:1158
CSG_Parameter::Set_Collapsed
bool Set_Collapsed(bool bOn=true)
Definition: parameter.cpp:140
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:146
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Parameter::m_String
CSG_String m_String
Definition: parameters.h:336
CSG_Parameter_Range::Get_Max
double Get_Max(void) const
Definition: parameter_data.cpp:834
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:562
CSG_Parameter::asInt
int asInt(void) const
Definition: parameters.h:286
CSG_Parameters::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: parameters.h:1721
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:124
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:289
CSG_Parameter::Get_Type_Name
CSG_String Get_Type_Name(void) const
Definition: parameter.cpp:129
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:1102
CSG_Table_Record
Definition: table.h:130
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:140
data_manager.h
CSG_Parameter_Table_List
Definition: parameters.h:1476
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:506
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:156
CSG_Parameter::asTINList
class CSG_Parameter_TIN_List * asTINList(void) const
Definition: parameter.cpp:1159
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:135
CSG_Parameter::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1200
CSG_Grid_System
Definition: grid.h:220
CSG_Parameter::asDate
class CSG_Parameter_Date * asDate(void) const
Definition: parameter.cpp:1144
SG_Get_DataObject_Name
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:86
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:402
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:127
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:235
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1379
SG_Get_Rounded_To_SignificantFigures
double SG_Get_Rounded_To_SignificantFigures(double Value, int Decimals)
Definition: mat_tools.cpp:107
SG_UI_Msg_Add_Execution
void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:526
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:236
CSG_Parameter_Choices
Definition: parameters.h:753
CSG_Parameter::is_Compatible
bool is_Compatible(CSG_Parameter *pParameter) const
Definition: parameter.cpp:352
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:153
CSG_Parameter_Data_Object_Output
Definition: parameters.h:1176
CSG_Parameters::Add_String
CSG_Parameter * Add_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false, bool bPassword=false)
Definition: parameters.cpp:558
CSG_Parameter::Get_Description
const SG_Char * Get_Description(void) const
Definition: parameter.cpp:617
CSG_Parameters::Add_Double
CSG_Parameter * Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:475
CSG_Parameters_Grid_Target::Set_User_Defined
bool Set_User_Defined(CSG_Parameters *pParameters, const TSG_Rect &Extent, int Rows=0, int Rounding=2)
Definition: parameter.cpp:1668
SG_Get_Data_Manager
CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
CSG_Grid_System::Create
bool Create(const CSG_Grid_System &System, int Precision=-1)
Definition: grid_system.cpp:146
CSG_Parameters::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameters.cpp:331
CSG_Parameter::asTIN
CSG_TIN * asTIN(void) const
Definition: parameter.cpp:1083
CSG_Parameter_Choices::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:764
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:468
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Grids::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grids.h:172
CSG_Parameter::do_UseInCMD
bool do_UseInCMD(void) const
Definition: parameter.cpp:187
M_HAS_DECIMALS
#define M_HAS_DECIMALS(x)
Definition: mat_tools.h:147
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:142
CSG_Parameters_Grid_Target::Create
bool Create(CSG_Parameters *pParameters, bool bAddDefaultGrid, CSG_Parameter *pParent, const CSG_String &Prefix="")
Definition: parameter.cpp:1382
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:361
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:278
CSG_Parameter::_asString
virtual const SG_Char * _asString(void) const
Definition: parameter.cpp:1047
CSG_Parameter::_asDouble
virtual double _asDouble(void) const
Definition: parameter.cpp:1045
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Data_Object::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const =0
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:1080
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1180
CSG_Parameter_Value
Definition: parameters.h:440
SG_STR_CMP
#define SG_STR_CMP(s1, s2)
Definition: api_core.h:544
CSG_Rect::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:513
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:148
CSG_Parameter::CSG_Parameter
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter.cpp:64
CSG_Parameter::Set_UseInCMD
void Set_UseInCMD(bool bOn=false)
Definition: parameter.cpp:168
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1130
CSG_Parameter::Set_Description
bool Set_Description(const CSG_String &Description)
Definition: parameter.cpp:610
CSG_Parameter::Get_Parameters
CSG_Parameters * Get_Parameters(void) const
Definition: parameter.cpp:100
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:865
CSG_Parameters_CRSPicker::Get_CRS
bool Get_CRS(CSG_Projection &Projection, bool bMessage=false) const
Definition: parameter.cpp:1348
CSG_Parameter::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter.cpp:808
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:559
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
tool.h
PARAMETER_INPUT_OPTIONAL
#define PARAMETER_INPUT_OPTIONAL
Definition: parameters.h:103
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:468
SG_Parameter_Type_Get_Name
CSG_String SG_Parameter_Type_Get_Name(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:64
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:158
SSG_Rect
Definition: geo_tools.h:467
CSG_Parameter::asGridList
class CSG_Parameter_Grid_List * asGridList(void) const
Definition: parameter.cpp:1155
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:150
CSG_Parameters::has_GUI
bool has_GUI(void) const
Definition: parameters.cpp:311
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_Parameter::Serialize
bool Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1206
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1283
CSG_Table::is_Compatible
bool is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const
Definition: table.cpp:413
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1588
CSG_Parameter::asGrid
CSG_Grid * asGrid(void) const
Definition: parameter.cpp:1081
CSG_Parameter::is_DataObject_List
bool is_DataObject_List(void) const
Definition: parameter.cpp:310
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:134
CSG_Parameter::ignore_Projection
bool ignore_Projection(void) const
Definition: parameters.h:255
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:132
CSG_TIN
Definition: tin.h:222
CSG_Grids::Create
virtual bool Create(const CSG_Grids &Grids)
Definition: grids.cpp:319
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:141
CSG_Parameters_Grid_Target::On_Parameter_Changed
bool On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: parameter.cpp:1447
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:510
CSG_Colors::Get_Count
int Get_Count(void) const
Definition: api_core.h:1424
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:208
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:507
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:166
CSG_Grids::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grids.h:184
CSG_Parameter::_asInt
virtual int _asInt(void) const
Definition: parameter.cpp:1044
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:151
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:126
CSG_Colors::Get_Color
long Get_Color(int Index) const
Definition: api_core.h:1436
CSG_Parameter_List::Update_Data
virtual bool Update_Data(void)
Definition: parameters.h:1381
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1731
SG_PARAMETER_DATA_SET_CHANGED
#define SG_PARAMETER_DATA_SET_CHANGED
Definition: parameters.h:197
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Parameter::asPointCloud
CSG_PointCloud * asPointCloud(void) const
Definition: parameter.cpp:1084
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(void)
Definition: tool.h:165
CSG_Grid_System::is_Equal
bool is_Equal(const CSG_Grid_System &System) const
Definition: grid_system.cpp:393
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:145
CSG_Parameter::asShapes
CSG_Shapes * asShapes(void) const
Definition: parameter.cpp:1087
CSG_Parameter::is_Enabled
bool is_Enabled(bool bCheckEnv=true) const
Definition: parameter.cpp:224
PARAMETER_DESCRIPTION_OPTIONAL
#define PARAMETER_DESCRIPTION_OPTIONAL
Definition: parameters.h:109
CSG_Parameter::Set_Default
bool Set_Default(int Value)
Definition: parameter.cpp:920
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bCollapsed=false)
Definition: parameters.cpp:440
CSG_Parameter_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3054
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:133
CSG_Parameter::_Serialize
virtual bool _Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1242
CSG_Parameter_File_Name
Definition: parameters.h:859
CSG_Parameters_Grid_Target::Get_Grid
CSG_Grid * Get_Grid(const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float)
Definition: parameter.cpp:2003
SG_Parameter_Type_Get_Identifier
CSG_String SG_Parameter_Type_Get_Identifier(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:114
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:1052
CSG_Grid_Resampling::Minimum
@ Minimum
CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels
bool Set_User_Defined_ZLevels(CSG_Parameters *pParameters, double zMin, double zMax, int nLevels, int Rounding=2)
Definition: parameter.cpp:1798
CSG_Parameters::Get_Tool
class CSG_Tool * Get_Tool(void) const
Definition: parameters.h:1718
CSG_Parameter::Set_Name
bool Set_Name(const CSG_String &Name)
Definition: parameter.cpp:597
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:405
CSG_Parameter_Grids_List
Definition: parameters.h:1450
CSG_Parameter_Choice::Get_Count
int Get_Count(void) const
Definition: parameters.h:688
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
SG_UI_DataObject_Add
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:607
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:559
CSG_Parameter::asDataType
class CSG_Parameter_Data_Type * asDataType(void) const
Definition: parameter.cpp:1145
CSG_Parameter::_asPointer
virtual void * _asPointer(void) const
Definition: parameter.cpp:1046
CSG_Parameter::Get_Child
CSG_Parameter * Get_Child(int iChild) const
Definition: parameters.h:260
PARAMETER_DESCRIPTION_TYPE
#define PARAMETER_DESCRIPTION_TYPE
Definition: parameters.h:108
CSG_Parameter_Grid_List
Definition: parameters.h:1415
CSG_Parameter::~CSG_Parameter
virtual ~CSG_Parameter(void)
Definition: parameter.cpp:86
CSG_Parameter::is_Serializable
bool is_Serializable(void) const
Definition: parameter.cpp:334
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:400
CSG_Parameters_Grid_Target::Add_Grids
bool Add_Grids(const CSG_String &ID, const CSG_String &Name, bool bOptional, bool bZLevels=false)
Definition: parameter.cpp:1899
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_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:287
CSG_Parameters_Grid_Target::Get_Grids
CSG_Grids * Get_Grids(const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float)
Definition: parameter.cpp:2088
SG_PARAMETER_DATA_SET_FALSE
#define SG_PARAMETER_DATA_SET_FALSE
Definition: parameters.h:195
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:149
CSG_Parameters_Grid_Target::CSG_Parameters_Grid_Target
CSG_Parameters_Grid_Target(void)
Definition: parameter.cpp:1376
CSG_Parameter::Get_CmdID
CSG_String Get_CmdID(void) const
Definition: parameter.cpp:578
CSG_Parameter::asPointCloudList
class CSG_Parameter_PointCloud_List * asPointCloudList(void) const
Definition: parameter.cpp:1160
CSG_Parameter_Range
Definition: parameters.h:616
PARAMETER_IGNORE_PROJECTION
#define PARAMETER_IGNORE_PROJECTION
Definition: parameters.h:98
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:130
CSG_Parameter::Toggle_Value
virtual bool Toggle_Value(void)
Definition: parameter.cpp:895
CSG_Parameters::Add_Parameters
CSG_Parameter * Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:995
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:155
SG_Data_Type_Get_Name
CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort)
Definition: api_core.cpp:123
CSG_Parameter::_Set_String
virtual void _Set_String(void)
Definition: parameter.cpp:909
CSG_Parameters::Add_Grids
CSG_Parameter * Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:760
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:238
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:468
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_Grid
CSG_Parameter * Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:690
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_String::Replace
size_t Replace(const CSG_String &Old, const CSG_String &New, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_Parameter::is_Value_Equal
bool is_Value_Equal(CSG_Parameter *pParameter) const
Definition: parameter.cpp:411
CSG_Grid_Resampling::Maximum
@ Maximum
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:810
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1150
CSG_Parameters::Del_Parameter
bool Del_Parameter(int i)
Definition: parameters.cpp:1283
CSG_Data_Manager::Add
CSG_Data_Object * Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:310
CSG_Parameter::Set_UseInGUI
void Set_UseInGUI(bool bOn=false)
Definition: parameter.cpp:155
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:259
CSG_Grid_Resampling
CSG_Grid_Resampling
Definition: grid.h:156
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:237
parameters.h
CSG_Projection::Get_PROJ
const CSG_String & Get_PROJ(void) const
Definition: geo_tools.h:890
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_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1378
CSG_Parameter_Shapes_List
Definition: parameters.h:1499
CSG_Projection
Definition: geo_tools.h:827
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1735
CSG_Tool::has_GUI
bool has_GUI(void) const
Definition: tool.cpp:239
CSG_Parameter::asGrid_Resampling
CSG_Grid_Resampling asGrid_Resampling(void) const
Definition: parameter.cpp:1056
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false, bool bWithCMD=true) const
Definition: tool_library.cpp:836
CSG_Table
Definition: table.h:285
CSG_Parameters_CRSPicker::Activate_GUI
bool Activate_GUI(bool bReset=false)
Definition: parameter.cpp:1280
CSG_MetaData::Cmp_Property
bool Cmp_Property(const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:671
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
PARAMETER_NOT_FOR_GUI
#define PARAMETER_NOT_FOR_GUI
Definition: parameters.h:99
SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_Undefined
Definition: dataobject.h:124
PARAMETER_GUI_COLLAPSED
#define PARAMETER_GUI_COLLAPSED
Definition: parameters.h:101
CSG_Parameter::Get_Default
const CSG_String & Get_Default(void) const
Definition: parameter.cpp:944
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:259
CSG_Parameter_Choice::Get_Item
const SG_Char * Get_Item(int Index) const
Definition: parameter_data.cpp:994
CSG_Parameter::Get_Parent
CSG_Parameter * Get_Parent(void) const
Definition: parameter.cpp:106
CSG_Parameter::is_DataObject
bool is_DataObject(void) const
Definition: parameter.cpp:291
CSG_Grid_System::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:262
PARAMETER_NOT_FOR_CMD
#define PARAMETER_NOT_FOR_CMD
Definition: parameters.h:100
SG_Char
#define SG_Char
Definition: api_core.h:536
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:563
CSG_Parameter::asTableFields
class CSG_Parameter_Table_Fields * asTableFields(void) const
Definition: parameter.cpp:1151
CSG_Parameter::Set_Children_Enabled
bool Set_Children_Enabled(bool bEnabled=true)
Definition: parameter.cpp:243
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1146
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_Parameter_Table_Fields
Definition: parameters.h:1103
CSG_Parameter::Check
bool Check(bool bSilent=true)
Definition: parameter.cpp:967
CSG_Parameter_String
Definition: parameters.h:805
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
PARAMETER_DESCRIPTION_TEXT
#define PARAMETER_DESCRIPTION_TEXT
Definition: parameters.h:111
CSG_Parameter::has_Changed
bool has_Changed(int Check_Flags=PARAMETER_CHECK_ALL)
Definition: parameter.cpp:901
CSG_Parameter::asDouble
double asDouble(void) const
Definition: parameters.h:288
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:144
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:468
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:160
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:520
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:508
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:505
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:157
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1149
CSG_Rect::Inflate
CSG_Rect & Inflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:808
CSG_Parameter_Choices::Get_Selection_Index
int Get_Selection_Index(int i) const
Definition: parameters.h:771
CSG_Parameter::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: parameter.cpp:112
CSG_Grid
Definition: grid.h:501
CSG_Parameter::asTableList
class CSG_Parameter_Table_List * asTableList(void) const
Definition: parameter.cpp:1157
CSG_Data_Manager::Grids
CSG_Data_Collection & Grids(void) const
Definition: data_manager.h:139
CSG_Parameter::do_UseInGUI
bool do_UseInGUI(void) const
Definition: parameter.cpp:181
CSG_Parameter::is_Collapsed
bool is_Collapsed(void) const
Definition: parameters.h:233
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:521
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:162
CSG_Parameters::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: parameters.cpp:1440
CSG_Parameter_Choice
Definition: parameters.h:665
CSG_Parameter_Choices::Get_Item
const CSG_String & Get_Item(int i) const
Definition: parameters.h:765
PARAMETER_DESCRIPTION_PROPERTIES
#define PARAMETER_DESCRIPTION_PROPERTIES
Definition: parameters.h:110
CSG_Parameter::Set_Enabled
bool Set_Enabled(bool bEnabled=true)
Definition: parameter.cpp:211
CSG_Shapes
Definition: shapes.h:772
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
CSG_Grids::Add_Grid
bool Add_Grid(double Z)
Definition: grids.cpp:726
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Parameter_PointCloud_List
Definition: parameters.h:1553
CSG_Parameters_CRSPicker::On_Parameter_Changed
static bool On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: parameter.cpp:1326
CSG_Parameter_TIN_List
Definition: parameters.h:1530
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
CSG_Parameters
Definition: parameters.h:1696
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:997
CSG_Parameter::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameter.cpp:534
CSG_Parameter_Range::Get_Min
double Get_Min(void) const
Definition: parameter_data.cpp:816
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_Parameter::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameter.cpp:568
CSG_Parameter::is_Parameters
bool is_Parameters(void) const
Definition: parameter.cpp:328
CSG_Parameter::asGrids
CSG_Grids * asGrids(void) const
Definition: parameter.cpp:1082
CSG_Parameter_List
Definition: parameters.h:1370
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:1053
CSG_Data_Manager::Grid
CSG_Data_Collection & Grid(void) const
Definition: data_manager.h:138
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:604
CSG_Parameter::asFont
const SG_Char * asFont(void) const
Definition: parameter.cpp:1051
CSG_Parameter::is_Default
virtual bool is_Default(void) const
Definition: parameter.cpp:950
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:131
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:254
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:96
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
CSG_Grids
Definition: grids.h:119
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:159
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:164
CSG_Parameters_CRSPicker::Deactivate_GUI
bool Deactivate_GUI(void)
Definition: parameter.cpp:1304
SEPARATE
#define SEPARATE
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:139
CSG_Parameters_CRSPicker::Create
bool Create(CSG_Parameters &Parameters, const CSG_String &ParentID="")
Definition: parameter.cpp:1263
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1154
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:140
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:152
CSG_Parameter::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter.cpp:956
CSG_Parameters_Grid_Target::On_Parameters_Enable
bool On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: parameter.cpp:1621
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:511
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Parameters::Set_Callback
bool Set_Callback(bool bActive=true)
Definition: parameters.cpp:1398
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1148
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:239
PARAMETER_DESCRIPTION_NAME
#define PARAMETER_DESCRIPTION_NAME
Definition: parameters.h:107
CSG_Parameters_CRSPicker::CSG_Parameters_CRSPicker
CSG_Parameters_CRSPicker(void)
Definition: parameter.cpp:1257
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:465
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:305
CSG_Parameters_Grid_Target::Get_System
CSG_Grid_System Get_System(void) const
Definition: parameter.cpp:1950
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:123
CSG_Parameter_Data_Type
Definition: parameters.h:723
CSG_Grid_Resampling::NearestNeighbour
@ NearestNeighbour
CSG_Colors
Definition: api_core.h:1408
CSG_Grids::Del_Grids
bool Del_Grids(bool bDetach=false)
Definition: grids.cpp:891
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:285
PARAMETER_OUTPUT_OPTIONAL
#define PARAMETER_OUTPUT_OPTIONAL
Definition: parameters.h:104
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:136
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