SAGA API Version 9.13
Loading...
Searching...
No Matches
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//---------------------------------------------------------
69
70
72// //
73// //
74// //
76
77//---------------------------------------------------------
82
83//---------------------------------------------------------
88
89//---------------------------------------------------------
90CSG_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//---------------------------------------------------------
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//---------------------------------------------------------
155bool 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
171 CSG_Data_Object **pObjects = (CSG_Data_Object **)m_Objects.Get_Array();
172
173 for(size_t j=i+1; j<Count(); i++, j++)
174 {
175 pObjects[i] = pObjects[j];
176 }
177
178 m_Objects.Dec_Array();
179
180 return( true );
181 }
182
183 return( false );
184}
185
186//---------------------------------------------------------
187bool 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//---------------------------------------------------------
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//---------------------------------------------------------
237CSG_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//---------------------------------------------------------
263CSG_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//---------------------------------------------------------
336CSG_Data_Object * CSG_Data_Manager::Add(const char *File, TSG_Data_Object_Type Type) { return( Add(CSG_String(File), Type) ); }
337CSG_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//---------------------------------------------------------
406CSG_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, "pcx")
425 || SG_File_Cmp_Extension(File, "xpm") )
426 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_grid_image", 1)) != NULL
427 && pImport->Set_Parameter("FILE", File, PARAMETER_TYPE_FilePath)
428 && pImport->Set_Parameter("METHOD", 0) ) // => Automatic
429 {
430 pImport->Set_Manager(this);
431
432 if( pImport->Execute() )
433 {
434 pData = pImport->Get_Parameter("OUT_GRID" )->asDataObject();
435 }
436 }
437
439
440 //-----------------------------------------------------
441 // Image Import (True Color)
442
443 if( !pData
444 && ( SG_File_Cmp_Extension(File, "jpg")
445 || SG_File_Cmp_Extension(File, "png") )
446 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_grid_image", 1)) != NULL
447 && pImport->Set_Parameter("FILE", File, PARAMETER_TYPE_FilePath)
448 && pImport->Set_Parameter("METHOD", 3) ) // => RGB Composite
449 {
450 pImport->Set_Manager(this);
451
452 if( pImport->Execute() )
453 {
454 pData = pImport->Get_Parameter("OUT_GRIDS")->asDataObject();
455 }
456 }
457
459
460 //-----------------------------------------------------
461 // GDAL Import
462
463 if( !pData
464 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 0)) != NULL
465 && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
466 {
467 pImport->Set_Manager(this);
468
469 if( pImport->Execute() )
470 {
471 pData = pImport->Get_Parameter("GRIDS")->asList()->Get_Item(0);
472 }
473 }
474
476
477 //-----------------------------------------------------
478 // OGR Import
479
480 if( !pData
481 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 3)) != NULL
482 && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
483 {
484 pImport->Set_Manager(this);
485
486 if( pImport->Execute() )
487 {
488 pData = pImport->Get_Parameter("SHAPES")->asList()->Get_Item(0);
489 }
490 }
491
493
494 //-----------------------------------------------------
495 // LAZ Import
496
497 if( !pData && (SG_File_Cmp_Extension(File, "las") || SG_File_Cmp_Extension(File, "laz"))
498 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_pdal", 0)) != NULL
499 && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
500 {
501 pImport->Set_Manager(this);
502
503 if( pImport->Execute() )
504 {
505 pData = pImport->Get_Parameter("POINTS")->asList()->Get_Item(0);
506 }
507 }
508
510
511 //-----------------------------------------------------
512 // STL Import
513
514 if( !pData && (SG_File_Cmp_Extension(File, "stl"))
515 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_shapes", 11)) != NULL // Import Stereo Lithography File (STL)
516 && pImport->Set_Parameter("FILE" , File, PARAMETER_TYPE_FilePath)
517 && pImport->Set_Parameter("METHOD", 2) ) // => TIN
518 {
519 CSG_Data_Manager Data; pImport->Set_Manager(&Data);
520
521 if( pImport->Execute() )
522 {
523 Data.Delete(pData = pImport->Get_Parameter("TIN")->asTIN(), true); Add(pData);
524 }
525 }
526
528
529 //-----------------------------------------------------
530 SG_UI_Msg_Lock(false);
531
532 return( pData );
533}
534
535
537// //
539
540//---------------------------------------------------------
543CSG_Table * CSG_Data_Manager::Add_Table(const wchar_t *File) { return( (CSG_Table *)Add(File, SG_DATAOBJECT_TYPE_Table) ); }
545{
546 CSG_Table *pObject = new CSG_Table();
547
548 if( pObject && !Add(pObject) )
549 {
550 delete(pObject); pObject = NULL;
551 }
552
553 return( pObject );
554}
555
556//---------------------------------------------------------
561{
562 CSG_Shapes *pObject = new CSG_Shapes();
563
564 if( pObject && !Add(pObject) )
565 {
566 delete(pObject); pObject = NULL;
567 }
568
569 return( pObject );
570}
571
572//---------------------------------------------------------
577{
578 CSG_PointCloud *pObject = new CSG_PointCloud();
579
580 if( pObject && !Add(pObject) )
581 {
582 delete(pObject); pObject = NULL;
583 }
584
585 return( pObject );
586}
587
588//---------------------------------------------------------
590CSG_TIN * CSG_Data_Manager::Add_TIN(const char *File) { return( (CSG_TIN *)Add(File, SG_DATAOBJECT_TYPE_TIN) ); }
591CSG_TIN * CSG_Data_Manager::Add_TIN(const wchar_t *File) { return( (CSG_TIN *)Add(File, SG_DATAOBJECT_TYPE_TIN) ); }
593{
594 CSG_TIN *pObject = new CSG_TIN();
595
596 if( pObject && !Add(pObject) )
597 {
598 delete(pObject); pObject = NULL;
599 }
600
601 return( pObject );
602}
603
604//---------------------------------------------------------
606CSG_Grid * CSG_Data_Manager::Add_Grid(const char *File) { return( (CSG_Grid *)Add(File, SG_DATAOBJECT_TYPE_Grid) ); }
607CSG_Grid * CSG_Data_Manager::Add_Grid(const wchar_t *File) { return( (CSG_Grid *)Add(File, SG_DATAOBJECT_TYPE_Grid) ); }
609{
610 CSG_Grid *pObject = new CSG_Grid();
611
612 if( pObject && !Add(pObject) )
613 {
614 delete(pObject); pObject = NULL;
615 }
616
617 return( pObject );
618}
619
620//---------------------------------------------------------
623CSG_Grids * CSG_Data_Manager::Add_Grids(const wchar_t *File) { return( (CSG_Grids *)Add(File, SG_DATAOBJECT_TYPE_Grids) ); }
625{
626 CSG_Grids *pObject = new CSG_Grids();
627
628 if( pObject && !Add(pObject) )
629 {
630 delete(pObject); pObject = NULL;
631 }
632
633 return( pObject );
634}
635
636
638// //
640
641//---------------------------------------------------------
642bool CSG_Data_Manager::Delete(CSG_Data_Object *pObject, bool bDetach)
643{
644 CSG_Data_Collection *pCollection = _Get_Collection(pObject);
645
646 return( pCollection && pCollection->Delete(pObject, bDetach) );
647}
648
649//---------------------------------------------------------
650bool CSG_Data_Manager::Delete(bool bDetach, bool bUnsaved)
651{
652 Table ().Delete(bDetach, bUnsaved);
653 Shapes ().Delete(bDetach, bUnsaved);
654 PointCloud().Delete(bDetach, bUnsaved);
655 TIN ().Delete(bDetach, bUnsaved);
656 Grid ().Delete(bDetach, bUnsaved);
657 Grids ().Delete(bDetach, bUnsaved);
658
659 return( true );
660}
661
662
664// //
666
667//---------------------------------------------------------
669{
670 CSG_String s;
671
672 //-----------------------------------------------------
673 if( Table().Count() )
674 {
675 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Table"), Table().Count(), _TL("objects"));
676
677 for(size_t i=0; i<Table().Count(); i++)
678 {
679 CSG_Table *pObject = Table()[i].asTable();
680
681 s += CSG_String::Format("- [%d %s] %s\n",
682 pObject->Get_Count(), _TL("records"),
683 pObject->Get_Name()
684 );
685 }
686 }
687
688 //-----------------------------------------------------
689 if( Shapes().Count() )
690 {
691 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Shapes"), Shapes().Count(), _TL("objects"));
692
693 for(size_t i=0; i<Shapes().Count(); i++)
694 {
695 CSG_Shapes *pObject = Shapes()[i].asShapes();
696
697 s += CSG_String::Format("- [%s; %d %s] %s\n",
698 pObject->Get_Type() == SHAPE_TYPE_Point ? _TL("point" ) :
699 pObject->Get_Type() == SHAPE_TYPE_Points ? _TL("points" ) :
700 pObject->Get_Type() == SHAPE_TYPE_Line ? _TL("line" ) :
701 pObject->Get_Type() == SHAPE_TYPE_Polygon ? _TL("polygon") : _TL("unknown"),
702 pObject->Get_Count(), _TL("records"),
703 pObject->Get_Name()
704 );
705 }
706 }
707
708 //-----------------------------------------------------
709 if( PointCloud().Count() )
710 {
711 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Point Cloud"), PointCloud().Count(), _TL("objects"));
712
713 for(size_t i=0; i<PointCloud().Count(); i++)
714 {
715 CSG_PointCloud *pObject = PointCloud()[i].asPointCloud();
716
717 s += CSG_String::Format("- [%d %s] %s\n",
718 pObject->Get_Count(), _TL("records"),
719 pObject->Get_Name()
720 );
721 }
722 }
723
724 //-----------------------------------------------------
725 if( TIN().Count() )
726 {
727 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("TIN"), TIN().Count(), _TL("objects"));
728
729 for(size_t i=0; i<TIN().Count(); i++)
730 {
731 CSG_TIN *pObject = TIN()[i].asTIN();
732
733 s += CSG_String::Format("- [%d %s] %s\n",
734 pObject->Get_Count(), _TL("nodes"),
735 pObject->Get_Name()
736 );
737 }
738 }
739
740 //-----------------------------------------------------
741 if( Grid().Count() )
742 {
743 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Grid"), Grid().Count(), _TL("objects"));
744
745 for(size_t i=0; i<Grid().Count(); i++)
746 {
747 CSG_Grid *pObject = Grid()[i].asGrid ();
748
749 s += CSG_String::Format("- [%f | %dnx %dny | %fx %fy] %s\n",
750 pObject->Get_Cellsize(), pObject->Get_NX(), pObject->Get_NY(), pObject->Get_XMin(), pObject->Get_YMin(),
751 pObject->Get_Name()
752 );
753 }
754 }
755
756 //-----------------------------------------------------
757 if( Grids().Count() )
758 {
759 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Grid Collection"), Grids().Count(), _TL("objects"));
760
761 for(size_t i=0; i<Grids().Count(); i++)
762 {
763 CSG_Grids *pObject = Grids()[i].asGrids();
764
765 s += CSG_String::Format("- [%f | %dnx %dny %dnz | %fx %fy] %s\n",
766 pObject->Get_Cellsize(), pObject->Get_NX(), pObject->Get_NY(), pObject->Get_NZ(), pObject->Get_XMin(), pObject->Get_YMin(),
767 pObject->Get_Name()
768 );
769 }
770 }
771
772 //-----------------------------------------------------
773 if( s.is_Empty() )
774 {
775 s += CSG_String::Format("%s - %s\n--- %s ---\n", _TL("Data Manager"), _TL("Summary"), _TL("no data"));
776 }
777 else
778 {
779 s.Prepend(CSG_String::Format("%s - %s\n", _TL("Data Manager"), _TL("Summary")));
780 }
781
782 //-----------------------------------------------------
783 return( s );
784}
785
786
788// //
789// //
790// //
792
793//---------------------------------------------------------
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
int SG_UI_Msg_Lock(bool bOn)
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &File, const CSG_String &Extension)
@ SG_UI_DATAOBJECT_UPDATE
Definition api_core.h:1647
#define _TL(s)
Definition api_core.h:1618
CSG_Array_Pointer m_Objects
size_t Count(void) const
CSG_Data_Object * Get(size_t i) const
bool Exists(CSG_Data_Object *pObject) const
bool Delete(CSG_Data_Object *pObject, bool bDetach=false)
TSG_Data_Object_Type m_Type
CSG_Data_Collection(TSG_Data_Object_Type Type)
CSG_Data_Object * Find(const CSG_String &File, bool bNative=true) const
virtual ~CSG_Data_Collection(void)
bool Add(CSG_Data_Object *pObject)
virtual ~CSG_Data_Manager(void)
CSG_PointCloud * Add_PointCloud(void)
CSG_Data_Collection & Grid(void) const
CSG_Table * Add_Table(void)
CSG_Grid * Add_Grid(void)
CSG_Data_Collection & Grids(void) const
CSG_Data_Collection & PointCloud(void) const
CSG_Data_Collection & TIN(void) const
CSG_Data_Object * Add(CSG_Data_Object *pObject)
CSG_Shapes * Add_Shapes(void)
bool Delete(CSG_Data_Object *pObject, bool bDetach=false)
CSG_TIN * Add_TIN(void)
CSG_Data_Collection & Table(void) const
CSG_Grids * Add_Grids(void)
CSG_Data_Collection & Shapes(void) const
CSG_Data_Object * Find(const CSG_String &File, bool bNative=true) const
bool Exists(CSG_Data_Object *pObject) const
CSG_String Get_Summary(void) const
const SG_Char * Get_Name(void) const
virtual bool is_Valid(void) const =0
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.
int Get_NY(void) const
Definition grid.h:564
double Get_YMin(bool bCells=false) const
Definition grid.h:576
double Get_XMin(bool bCells=false) const
Definition grid.h:572
double Get_Cellsize(void) const
Definition grid.h:567
int Get_NX(void) const
Definition grid.h:563
int Get_NZ(void) const
Definition grids.h:190
double Get_Cellsize(void) const
Definition grids.h:195
double Get_XMin(bool bCells=false) const
Definition grids.h:200
double Get_YMin(bool bCells=false) const
Definition grids.h:204
int Get_NX(void) const
Definition grids.h:188
int Get_NY(void) const
Definition grids.h:189
CSG_Data_Object * Get_Item(int Index) const
CSG_TIN * asTIN(void) const
class CSG_Parameter_List * asList(void) const
CSG_Data_Object * asDataObject(void) const
virtual TSG_Shape_Type Get_Type(void) const
Definition shapes.h:814
int Cmp(const CSG_String &String) const
static CSG_String Format(const char *Format,...)
bool is_Empty(void) const
CSG_String & Prepend(const CSG_String &String)
Definition tin.h:222
sLong Get_Count(void) const
Definition table.h:410
bool Delete_Tool(CSG_Tool *pTool) const
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition tool.cpp:874
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition tool.cpp:1584
CSG_Parameter * Get_Parameter(const CSG_String &ID) const
Definition tool.cpp:1567
bool Execute(bool bAddHistory=false)
Definition tool.cpp:560
CSG_Data_Manager & SG_Get_Data_Manager(void)
CSG_Data_Manager g_Data_Manager
TSG_Data_Object_Type
Definition dataobject.h:117
@ SG_DATAOBJECT_TYPE_Undefined
Definition dataobject.h:124
@ SG_DATAOBJECT_TYPE_PointCloud
Definition dataobject.h:123
@ SG_DATAOBJECT_TYPE_Grids
Definition dataobject.h:119
@ SG_DATAOBJECT_TYPE_TIN
Definition dataobject.h:122
@ SG_DATAOBJECT_TYPE_Shapes
Definition dataobject.h:121
@ SG_DATAOBJECT_TYPE_Grid
Definition dataobject.h:118
@ SG_DATAOBJECT_TYPE_Table
Definition dataobject.h:120
#define DATAOBJECT_NOTSET
Definition dataobject.h:129
#define DATAOBJECT_CREATE
Definition dataobject.h:130
@ PARAMETER_TYPE_FilePath
Definition parameters.h:137
@ SHAPE_TYPE_Polygon
Definition shapes.h:105
@ SHAPE_TYPE_Line
Definition shapes.h:104
@ SHAPE_TYPE_Points
Definition shapes.h:103
@ SHAPE_TYPE_Point
Definition shapes.h:102
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)