SAGA API  v9.6
data_manager.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 // data_manager.cpp //
15 // //
16 // Copyright (C) 2013 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 Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49 
50 //---------------------------------------------------------
51 #include "data_manager.h"
52 #include "tool_library.h"
53 
54 
56 // //
57 // //
58 // //
60 
61 //---------------------------------------------------------
63 
64 //---------------------------------------------------------
66 {
67  return( g_Data_Manager );
68 }
69 
70 
72 // //
73 // //
74 // //
76 
77 //---------------------------------------------------------
79 {
80  m_Type = Type;
81 }
82 
83 //---------------------------------------------------------
85 {
86  Delete();
87 }
88 
89 //---------------------------------------------------------
90 CSG_Data_Object * CSG_Data_Collection::Find(const CSG_String &File, bool bNative) const
91 {
92  for(size_t i=0; i<Count(); i++)
93  {
94  if( !File.Cmp(Get(i)->Get_File_Name(bNative)) )
95  {
96  return( Get(i) );
97  }
98  }
99 
100  return( NULL );
101 }
102 
103 //---------------------------------------------------------
105 {
106  for(size_t i=0; i<Count(); i++)
107  {
108  if( pObject == Get(i) )
109  {
110  return( true );
111  }
112  }
113 
114  return( false );
115 }
116 
117 //---------------------------------------------------------
119 {
120  if( pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
121  {
122  if( Exists(pObject) )
123  {
124  return( true );
125  }
126 
127  if( m_Objects.Inc_Array() )
128  {
129  m_Objects[Count() - 1] = pObject;
130 
131  pObject->m_Managed++;
132 
133  return( true );
134  }
135  }
136 
137  return( false );
138 }
139 
140 //---------------------------------------------------------
141 bool CSG_Data_Collection::Delete(CSG_Data_Object *pObject, bool bDetach)
142 {
143  for(size_t i=0; i<Count(); i++)
144  {
145  if( pObject == Get(i) )
146  {
147  return( Delete(i, bDetach) );
148  }
149  }
150 
151  return( false );
152 }
153 
154 //---------------------------------------------------------
155 bool CSG_Data_Collection::Delete(size_t i, bool bDetach)
156 {
157  if( i < Count() )
158  {
159  CSG_Data_Object *pObject = Get(i);
160 
161  if( pObject->m_Managed > 0 )
162  {
163  pObject->m_Managed--;
164  }
165 
166  if( !bDetach && !pObject->m_Managed )
167  {
168  delete(pObject);
169  }
170 
172 
173  for(size_t j=i+1; j<Count(); i++, j++)
174  {
175  pObjects[i] = pObjects[j];
176  }
177 
179 
180  return( true );
181  }
182 
183  return( false );
184 }
185 
186 //---------------------------------------------------------
187 bool CSG_Data_Collection::Delete(bool bDetach, bool bUnsaved)
188 {
189  for(size_t i=Count(); i>0; i--)
190  {
191  if( !bUnsaved || !SG_File_Exists(Get(i - 1)->Get_File_Name()) )
192  {
193  Delete(i - 1, bDetach);
194  }
195  }
196 
197  return( Count() == 0 );
198 }
199 
200 
202 // //
203 // //
204 // //
206 
207 //---------------------------------------------------------
209 {
216 }
217 
218 //---------------------------------------------------------
220 {
221  Delete();
222 
223  delete(m_pTable );
224  delete(m_pShapes );
225  delete(m_pPointCloud);
226  delete(m_pTIN );
227  delete(m_pGrid );
228  delete(m_pGrids );
229 }
230 
231 
233 // //
235 
236 //---------------------------------------------------------
237 CSG_Data_Collection * CSG_Data_Manager::_Get_Collection(CSG_Data_Object *pObject) const
238 {
239  if( pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
240  {
241  switch( pObject->Get_ObjectType() )
242  {
243  case SG_DATAOBJECT_TYPE_Table : return( m_pTable );
244  case SG_DATAOBJECT_TYPE_Shapes : return( m_pShapes );
245  case SG_DATAOBJECT_TYPE_PointCloud: return( m_pPointCloud );
246  case SG_DATAOBJECT_TYPE_TIN : return( m_pTIN );
247  case SG_DATAOBJECT_TYPE_Grid : return( m_pGrid );
248  case SG_DATAOBJECT_TYPE_Grids : return( m_pGrids );
249 
250  default: break;
251  }
252  }
253 
254  return( NULL );
255 }
256 
257 
259 // //
261 
262 //---------------------------------------------------------
263 CSG_Data_Object * CSG_Data_Manager::Find(const CSG_String &File, bool bNative) const
264 {
265  CSG_Data_Object *pObject;
266 
267  if( (pObject = Table ().Find(File, bNative)) != NULL ) return( pObject );
268  if( (pObject = Shapes ().Find(File, bNative)) != NULL ) return( pObject );
269  if( (pObject = PointCloud().Find(File, bNative)) != NULL ) return( pObject );
270  if( (pObject = TIN ().Find(File, bNative)) != NULL ) return( pObject );
271  if( (pObject = Grid ().Find(File, bNative)) != NULL ) return( pObject );
272  if( (pObject = Grids ().Find(File, bNative)) != NULL ) return( pObject );
273 
274  return( NULL );
275 }
276 
277 //---------------------------------------------------------
279 {
280  if( pObject && pObject != DATAOBJECT_CREATE )
281  {
282  if( Table ().Exists(pObject) ) return( true );
283  if( Shapes ().Exists(pObject) ) return( true );
284  if( PointCloud().Exists(pObject) ) return( true );
285  if( TIN ().Exists(pObject) ) return( true );
286  if( Grid ().Exists(pObject) ) return( true );
287  if( Grids ().Exists(pObject) ) return( true );
288 
289  for(size_t i=0; i<Grids().Count(); i++)
290  {
291  for(int j=0; j<Grids(i).Get_Grid_Count(); j++)
292  {
293  if( pObject == Grids(i).Get_Grid_Ptr(j) )
294  {
295  return( true );
296  }
297  }
298  }
299  }
300 
301  return( false );
302 }
303 
304 
306 // //
308 
309 //---------------------------------------------------------
311 {
312  if( pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
313  {
314  if( Exists(pObject) )
315  {
316  return( pObject ); // don't add more than once
317  }
318 
319  CSG_Data_Collection *pCollection = _Get_Collection(pObject);
320 
321  if( pCollection && pCollection->Add(pObject) )
322  {
323  if( this == &g_Data_Manager ) // SAGA API's global data manager ?
324  {
325  SG_UI_DataObject_Add(pObject, SG_UI_DATAOBJECT_UPDATE); // for SAGA GUI !
326  }
327 
328  return( pObject );
329  }
330  }
331 
332  return( NULL );
333 }
334 
335 //---------------------------------------------------------
336 CSG_Data_Object * CSG_Data_Manager::Add(const char *File, TSG_Data_Object_Type Type) { return( Add(CSG_String(File), Type) ); }
337 CSG_Data_Object * CSG_Data_Manager::Add(const wchar_t *File, TSG_Data_Object_Type Type) { return( Add(CSG_String(File), Type) ); }
339 {
340  if( Type == SG_DATAOBJECT_TYPE_Undefined )
341  {
342  if( SG_File_Cmp_Extension(File, "txt" )
343  || SG_File_Cmp_Extension(File, "csv" )
344  || SG_File_Cmp_Extension(File, "dbf" ) )
345  {
347  }
348 
349  if( SG_File_Cmp_Extension(File, "shp" ) )
350  {
352  }
353 
354  if( SG_File_Cmp_Extension(File, "sg-pts-z")
355  || SG_File_Cmp_Extension(File, "sg-pts" )
356  || SG_File_Cmp_Extension(File, "spc" ) )
357  {
359  }
360 
361  if( SG_File_Cmp_Extension(File, "sg-grd-z")
362  || SG_File_Cmp_Extension(File, "sg-grd" )
363  || SG_File_Cmp_Extension(File, "sgrd" )
364  || SG_File_Cmp_Extension(File, "dgm" )
365  || SG_File_Cmp_Extension(File, "grd" ) )
366  {
368  }
369 
370  if( SG_File_Cmp_Extension(File, "sg-gds-z")
371  || SG_File_Cmp_Extension(File, "sg-gds" ) )
372  {
374  }
375  }
376 
377  //-----------------------------------------------------
378  CSG_Data_Object *pObject;
379 
380  switch( Type )
381  {
382  case SG_DATAOBJECT_TYPE_Table : pObject = new CSG_Table (File); break;
383  case SG_DATAOBJECT_TYPE_Shapes : pObject = new CSG_Shapes (File); break;
384  case SG_DATAOBJECT_TYPE_TIN : pObject = new CSG_TIN (File); break;
385  case SG_DATAOBJECT_TYPE_PointCloud: pObject = new CSG_PointCloud(File); break;
386  case SG_DATAOBJECT_TYPE_Grid : pObject = new CSG_Grid (File); break;
387  case SG_DATAOBJECT_TYPE_Grids : pObject = new CSG_Grids (File); break;
388  default : pObject = NULL ; break;
389  }
390 
391  if( pObject )
392  {
393  if( pObject->is_Valid() && Add(pObject) )
394  {
395  return( pObject );
396  }
397 
398  delete(pObject);
399  }
400 
401  //-----------------------------------------------------
402  return( _Add_External(File) );
403 }
404 
405 //---------------------------------------------------------
406 CSG_Data_Object * CSG_Data_Manager::_Add_External(const CSG_String &File)
407 {
408  CSG_Data_Object *pData = NULL;
409 
410  if( !SG_File_Exists(File) )
411  {
412  return( pData );
413  }
414 
415  CSG_Tool *pImport = NULL;
416 
417  SG_UI_Msg_Lock(true);
418 
419  //-----------------------------------------------------
420  // Image Import
421 
422  if( ( SG_File_Cmp_Extension(File, "bmp")
423  || SG_File_Cmp_Extension(File, "gif")
424  || SG_File_Cmp_Extension(File, "jpg")
425  || SG_File_Cmp_Extension(File, "png")
426  || SG_File_Cmp_Extension(File, "pcx")
427  || SG_File_Cmp_Extension(File, "xpm") )
428  && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_grid_image", 1)) != NULL
429  && pImport->Set_Parameter("FILE", File, PARAMETER_TYPE_FilePath) )
430  {
431  pImport->Set_Manager(this);
432 
433  if( pImport->Execute() )
434  {
435  pData = pImport->Get_Parameter("OUT_GRID")->asDataObject();
436  }
437  }
438 
440 
441  //-----------------------------------------------------
442  // GDAL Import
443 
444  if( !pData
445  && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 0)) != NULL
446  && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
447  {
448  pImport->Set_Manager(this);
449 
450  if( pImport->Execute() )
451  {
452  pData = pImport->Get_Parameter("GRIDS")->asList()->Get_Item(0);
453  }
454  }
455 
457 
458  //-----------------------------------------------------
459  // OGR Import
460 
461  if( !pData
462  && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 3)) != NULL
463  && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
464  {
465  pImport->Set_Manager(this);
466 
467  if( pImport->Execute() )
468  {
469  pData = pImport->Get_Parameter("SHAPES")->asList()->Get_Item(0);
470  }
471  }
472 
474 
475  //-----------------------------------------------------
476  // LAZ Import
477 
478  if( !pData && (SG_File_Cmp_Extension(File, "las") || SG_File_Cmp_Extension(File, "laz"))
479  && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_pdal", 0)) != NULL
480  && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
481  {
482  pImport->Set_Manager(this);
483 
484  if( pImport->Execute() )
485  {
486  pData = pImport->Get_Parameter("POINTS")->asList()->Get_Item(0);
487  }
488  }
489 
491 
492  //-----------------------------------------------------
493  // STL Import
494 
495  if( !pData && (SG_File_Cmp_Extension(File, "stl"))
496  && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_shapes", 11)) != NULL // Import Stereo Lithography File (STL)
497  && pImport->Set_Parameter("FILE" , File, PARAMETER_TYPE_FilePath)
498  && pImport->Set_Parameter("METHOD", 2) ) // => TIN
499  {
500  CSG_Data_Manager Data; pImport->Set_Manager(&Data);
501 
502  if( pImport->Execute() )
503  {
504  Data.Delete(pData = pImport->Get_Parameter("TIN")->asTIN(), true); Add(pData);
505  }
506  }
507 
509 
510  //-----------------------------------------------------
511  SG_UI_Msg_Lock(false);
512 
513  return( pData );
514 }
515 
516 
518 // //
520 
521 //---------------------------------------------------------
523 CSG_Table * CSG_Data_Manager::Add_Table(const char *File) { return( (CSG_Table *)Add(File, SG_DATAOBJECT_TYPE_Table) ); }
524 CSG_Table * CSG_Data_Manager::Add_Table(const wchar_t *File) { return( (CSG_Table *)Add(File, SG_DATAOBJECT_TYPE_Table) ); }
526 {
527  CSG_Table *pObject = new CSG_Table();
528 
529  if( pObject && !Add(pObject) )
530  {
531  delete(pObject); pObject = NULL;
532  }
533 
534  return( pObject );
535 }
536 
537 //---------------------------------------------------------
540 CSG_Shapes * CSG_Data_Manager::Add_Shapes(const wchar_t *File) { return( (CSG_Shapes *)Add(File, SG_DATAOBJECT_TYPE_Shapes) ); }
542 {
543  CSG_Shapes *pObject = new CSG_Shapes();
544 
545  if( pObject && !Add(pObject) )
546  {
547  delete(pObject); pObject = NULL;
548  }
549 
550  return( pObject );
551 }
552 
553 //---------------------------------------------------------
558 {
559  CSG_PointCloud *pObject = new CSG_PointCloud();
560 
561  if( pObject && !Add(pObject) )
562  {
563  delete(pObject); pObject = NULL;
564  }
565 
566  return( pObject );
567 }
568 
569 //---------------------------------------------------------
571 CSG_TIN * CSG_Data_Manager::Add_TIN(const char *File) { return( (CSG_TIN *)Add(File, SG_DATAOBJECT_TYPE_TIN) ); }
572 CSG_TIN * CSG_Data_Manager::Add_TIN(const wchar_t *File) { return( (CSG_TIN *)Add(File, SG_DATAOBJECT_TYPE_TIN) ); }
574 {
575  CSG_TIN *pObject = new CSG_TIN();
576 
577  if( pObject && !Add(pObject) )
578  {
579  delete(pObject); pObject = NULL;
580  }
581 
582  return( pObject );
583 }
584 
585 //---------------------------------------------------------
587 CSG_Grid * CSG_Data_Manager::Add_Grid(const char *File) { return( (CSG_Grid *)Add(File, SG_DATAOBJECT_TYPE_Grid) ); }
588 CSG_Grid * CSG_Data_Manager::Add_Grid(const wchar_t *File) { return( (CSG_Grid *)Add(File, SG_DATAOBJECT_TYPE_Grid) ); }
590 {
591  CSG_Grid *pObject = new CSG_Grid();
592 
593  if( pObject && !Add(pObject) )
594  {
595  delete(pObject); pObject = NULL;
596  }
597 
598  return( pObject );
599 }
600 
601 //---------------------------------------------------------
603 CSG_Grids * CSG_Data_Manager::Add_Grids(const char *File) { return( (CSG_Grids *)Add(File, SG_DATAOBJECT_TYPE_Grids) ); }
604 CSG_Grids * CSG_Data_Manager::Add_Grids(const wchar_t *File) { return( (CSG_Grids *)Add(File, SG_DATAOBJECT_TYPE_Grids) ); }
606 {
607  CSG_Grids *pObject = new CSG_Grids();
608 
609  if( pObject && !Add(pObject) )
610  {
611  delete(pObject); pObject = NULL;
612  }
613 
614  return( pObject );
615 }
616 
617 
619 // //
621 
622 //---------------------------------------------------------
623 bool CSG_Data_Manager::Delete(CSG_Data_Object *pObject, bool bDetach)
624 {
625  CSG_Data_Collection *pCollection = _Get_Collection(pObject);
626 
627  return( pCollection && pCollection->Delete(pObject, bDetach) );
628 }
629 
630 //---------------------------------------------------------
631 bool CSG_Data_Manager::Delete(bool bDetach, bool bUnsaved)
632 {
633  Table ().Delete(bDetach, bUnsaved);
634  Shapes ().Delete(bDetach, bUnsaved);
635  PointCloud().Delete(bDetach, bUnsaved);
636  TIN ().Delete(bDetach, bUnsaved);
637  Grid ().Delete(bDetach, bUnsaved);
638  Grids ().Delete(bDetach, bUnsaved);
639 
640  return( true );
641 }
642 
643 
645 // //
647 
648 //---------------------------------------------------------
650 {
651  CSG_String s;
652 
653  //-----------------------------------------------------
654  if( Table().Count() )
655  {
656  s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Table"), Table().Count(), _TL("objects"));
657 
658  for(size_t i=0; i<Table().Count(); i++)
659  {
660  CSG_Table *pObject = Table()[i].asTable();
661 
662  s += CSG_String::Format("- [%d %s] %s\n",
663  pObject->Get_Count(), _TL("records"),
664  pObject->Get_Name()
665  );
666  }
667  }
668 
669  //-----------------------------------------------------
670  if( Shapes().Count() )
671  {
672  s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Shapes"), Shapes().Count(), _TL("objects"));
673 
674  for(size_t i=0; i<Shapes().Count(); i++)
675  {
676  CSG_Shapes *pObject = Shapes()[i].asShapes();
677 
678  s += CSG_String::Format("- [%s; %d %s] %s\n",
679  pObject->Get_Type() == SHAPE_TYPE_Point ? _TL("point" ) :
680  pObject->Get_Type() == SHAPE_TYPE_Points ? _TL("points" ) :
681  pObject->Get_Type() == SHAPE_TYPE_Line ? _TL("line" ) :
682  pObject->Get_Type() == SHAPE_TYPE_Polygon ? _TL("polygon") : _TL("unknown"),
683  pObject->Get_Count(), _TL("records"),
684  pObject->Get_Name()
685  );
686  }
687  }
688 
689  //-----------------------------------------------------
690  if( PointCloud().Count() )
691  {
692  s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Point Cloud"), PointCloud().Count(), _TL("objects"));
693 
694  for(size_t i=0; i<PointCloud().Count(); i++)
695  {
696  CSG_PointCloud *pObject = PointCloud()[i].asPointCloud();
697 
698  s += CSG_String::Format("- [%d %s] %s\n",
699  pObject->Get_Count(), _TL("records"),
700  pObject->Get_Name()
701  );
702  }
703  }
704 
705  //-----------------------------------------------------
706  if( TIN().Count() )
707  {
708  s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("TIN"), TIN().Count(), _TL("objects"));
709 
710  for(size_t i=0; i<TIN().Count(); i++)
711  {
712  CSG_TIN *pObject = TIN()[i].asTIN();
713 
714  s += CSG_String::Format("- [%d %s] %s\n",
715  pObject->Get_Count(), _TL("nodes"),
716  pObject->Get_Name()
717  );
718  }
719  }
720 
721  //-----------------------------------------------------
722  if( Grid().Count() )
723  {
724  s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Grid"), Grid().Count(), _TL("objects"));
725 
726  for(size_t i=0; i<Grid().Count(); i++)
727  {
728  CSG_Grid *pObject = Grid()[i].asGrid ();
729 
730  s += CSG_String::Format("- [%f | %dnx %dny | %fx %fy] %s\n",
731  pObject->Get_Cellsize(), pObject->Get_NX(), pObject->Get_NY(), pObject->Get_XMin(), pObject->Get_YMin(),
732  pObject->Get_Name()
733  );
734  }
735  }
736 
737  //-----------------------------------------------------
738  if( Grids().Count() )
739  {
740  s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Grid Collection"), Grids().Count(), _TL("objects"));
741 
742  for(size_t i=0; i<Grids().Count(); i++)
743  {
744  CSG_Grids *pObject = Grids()[i].asGrids();
745 
746  s += CSG_String::Format("- [%f | %dnx %dny %dnz | %fx %fy] %s\n",
747  pObject->Get_Cellsize(), pObject->Get_NX(), pObject->Get_NY(), pObject->Get_NZ(), pObject->Get_XMin(), pObject->Get_YMin(),
748  pObject->Get_Name()
749  );
750  }
751  }
752 
753  //-----------------------------------------------------
754  if( s.is_Empty() )
755  {
756  s += CSG_String::Format("%s - %s\n--- %s ---\n", _TL("Data Manager"), _TL("Summary"), _TL("no data"));
757  }
758  else
759  {
760  s.Prepend(CSG_String::Format("%s - %s\n", _TL("Data Manager"), _TL("Summary")));
761  }
762 
763  //-----------------------------------------------------
764  return( s );
765 }
766 
767 
769 // //
770 // //
771 // //
773 
774 //---------------------------------------------------------
CSG_Grids::Get_NY
int Get_NY(void) const
Definition: grids.h:186
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
_TL
#define _TL(s)
Definition: api_core.h:1489
g_Data_Manager
CSG_Data_Manager g_Data_Manager
Definition: data_manager.cpp:62
CSG_Data_Collection::Get
CSG_Data_Object * Get(size_t i) const
Definition: data_manager.h:97
CSG_Data_Collection::Count
size_t Count(void) const
Definition: data_manager.h:94
CSG_Data_Collection::Add
bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:118
data_manager.h
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:952
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1373
CSG_Data_Manager::Add_PointCloud
CSG_PointCloud * Add_PointCloud(void)
Definition: data_manager.cpp:557
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Tool
Definition: tool.h:151
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:349
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:258
CSG_Data_Collection
Definition: data_manager.h:89
SG_Get_Data_Manager
CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
CSG_Parameter::asTIN
CSG_TIN * asTIN(void) const
Definition: parameter.cpp:1044
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:278
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:1041
CSG_Data_Manager::Shapes
CSG_Data_Collection & Shapes(void) const
Definition: data_manager.h:137
CSG_String::Prepend
CSG_String & Prepend(const CSG_String &String)
Definition: api_string.cpp:347
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:865
CSG_Array_Pointer::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:388
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1140
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1518
CSG_TIN
Definition: tin.h:222
CSG_Grids::Get_NX
int Get_NX(void) const
Definition: grids.h:185
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:850
CSG_Grid::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:550
CSG_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:541
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Collection::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:104
CSG_Data_Manager::Add_TIN
CSG_TIN * Add_TIN(void)
Definition: data_manager.cpp:573
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Grids::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grids.h:201
CSG_Data_Collection::Find
CSG_Data_Object * Find(const CSG_String &File, bool bNative=true) const
Definition: data_manager.cpp:90
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:471
CSG_Data_Manager::Add_Grid
CSG_Grid * Add_Grid(void)
Definition: data_manager.cpp:589
CSG_Data_Manager::Add_Grids
CSG_Grids * Add_Grids(void)
Definition: data_manager.cpp:605
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:610
CSG_Array_Pointer::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:389
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:538
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:392
CSG_Grid::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:546
CSG_Data_Manager::Add_Table
CSG_Table * Add_Table(void)
Definition: data_manager.cpp:525
CSG_Data_Manager::Delete
bool Delete(CSG_Data_Object *pObject, bool bDetach=false)
Definition: data_manager.cpp:623
CSG_Data_Manager::TIN
CSG_Data_Collection & TIN(void) const
Definition: data_manager.h:135
CSG_Data_Manager::~CSG_Data_Manager
virtual ~CSG_Data_Manager(void)
Definition: data_manager.cpp:219
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Data_Manager::Add
CSG_Data_Object * Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:310
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Grids::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grids.h:197
CSG_Table
Definition: table.h:283
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_Undefined
Definition: dataobject.h:124
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:563
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:570
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:129
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:537
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Data_Manager::Get_Summary
CSG_String Get_Summary(void) const
Definition: data_manager.cpp:649
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const CSG_String &ID) const
Definition: tool.h:188
CSG_Data_Manager::PointCloud
CSG_Data_Collection & PointCloud(void) const
Definition: data_manager.h:136
CSG_Data_Manager::Find
CSG_Data_Object * Find(const CSG_String &File, bool bNative=true) const
Definition: data_manager.cpp:263
CSG_Grid
Definition: grid.h:475
CSG_Grids::Get_Cellsize
double Get_Cellsize(void) const
Definition: grids.h:192
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
CSG_Data_Manager::Grids
CSG_Data_Collection & Grids(void) const
Definition: data_manager.h:139
CSG_Shapes
Definition: shapes.h:775
CSG_Data_Manager::CSG_Data_Manager
CSG_Data_Manager(void)
Definition: data_manager.cpp:208
tool_library.h
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:809
CSG_Data_Collection::m_Objects
CSG_Array_Pointer m_Objects
Definition: data_manager.h:118
CSG_Data_Manager::Grid
CSG_Data_Collection & Grid(void) const
Definition: data_manager.h:138
CSG_Data_Collection::m_Type
TSG_Data_Object_Type m_Type
Definition: data_manager.h:116
CSG_Grids
Definition: grids.h:119
CSG_Data_Manager::Add_Shapes
CSG_Shapes * Add_Shapes(void)
Definition: data_manager.cpp:541
CSG_Data_Collection::Delete
bool Delete(CSG_Data_Object *pObject, bool bDetach=false)
Definition: data_manager.cpp:141
CSG_Data_Manager::Table
CSG_Data_Collection & Table(void) const
Definition: data_manager.h:134
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1115
CSG_Data_Collection::CSG_Data_Collection
CSG_Data_Collection(TSG_Data_Object_Type Type)
Definition: data_manager.cpp:78
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_Data_Collection::~CSG_Data_Collection
virtual ~CSG_Data_Collection(void)
Definition: data_manager.cpp:84
CSG_Grids::Get_NZ
int Get_NZ(void) const
Definition: grids.h:187
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129