SAGA API Version 9.12
Loading...
Searching...
No Matches
dataobject.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// dataobject.cpp //
15// //
16// Copyright (C) 2005 by Olaf Conrad //
17// //
18//-------------------------------------------------------//
19// //
20// This file is part of 'SAGA - System for Automated //
21// Geoscientific Analyses'. //
22// //
23// This library is free software; you can redistribute //
24// it and/or modify it under the terms of the GNU Lesser //
25// General Public License as published by the Free //
26// Software Foundation, either version 2.1 of the //
27// License, or (at your option) any later version. //
28// //
29// This library is distributed in the hope that it will //
30// be useful, but WITHOUT ANY WARRANTY; without even the //
31// implied warranty of MERCHANTABILITY or FITNESS FOR A //
32// PARTICULAR PURPOSE. See the GNU Lesser General Public //
33// License for more details. //
34// //
35// You should have received a copy of the GNU Lesser //
36// General Public License along with this program; if //
37// not, see <http://www.gnu.org/licenses/>. //
38// //
39//-------------------------------------------------------//
40// //
41// contact: Olaf Conrad //
42// Institute of Geography //
43// University of Goettingen //
44// Goldschmidtstr. 5 //
45// 37077 Goettingen //
46// Germany //
47// //
48// e-mail: oconrad@saga-gis.org //
49// //
51
52//---------------------------------------------------------
53#include "dataobject.h"
54
55#include <wx/string.h>
56
57
59// //
60// //
61// //
63
64//---------------------------------------------------------
66{
67 return( DATAOBJECT_CREATE );
68}
69
70//---------------------------------------------------------
72{
73 switch( Type )
74 {
75 case SG_DATAOBJECT_TYPE_Grid : return( "GRID" );
76 case SG_DATAOBJECT_TYPE_Grids : return( "GRIDS" );
77 case SG_DATAOBJECT_TYPE_Table : return( "TABLE" );
78 case SG_DATAOBJECT_TYPE_Shapes : return( "SHAPES" );
79 case SG_DATAOBJECT_TYPE_TIN : return( "TIN" );
80 case SG_DATAOBJECT_TYPE_PointCloud: return( "POINTS" );
81 default : return( "UNDEFINED" );
82 }
83}
84
85//---------------------------------------------------------
87{
88 switch( Type )
89 {
90 case SG_DATAOBJECT_TYPE_Grid : return( _TL("Grid" ) );
91 case SG_DATAOBJECT_TYPE_Grids : return( _TL("Grids" ) );
92 case SG_DATAOBJECT_TYPE_Table : return( _TL("Table" ) );
93 case SG_DATAOBJECT_TYPE_Shapes : return( _TL("Shapes" ) );
94 case SG_DATAOBJECT_TYPE_TIN : return( _TL("TIN" ) );
95 case SG_DATAOBJECT_TYPE_PointCloud: return( _TL("Point Cloud") );
96 default : return( _TL("Undefined" ) );
97 }
98}
99
100//---------------------------------------------------------
102{
103 switch( Type )
104 {
105 case SG_DATAOBJECT_TYPE_Grid : return( "CSG_Grid" );
106 case SG_DATAOBJECT_TYPE_Grids : return( "CSG_Grids" );
107 case SG_DATAOBJECT_TYPE_Table : return( "CSG_Table" );
108 case SG_DATAOBJECT_TYPE_Shapes : return( "CSG_Shapes" );
109 case SG_DATAOBJECT_TYPE_TIN : return( "CSG_TIN" );
110 case SG_DATAOBJECT_TYPE_PointCloud: return( "CSG_PointCloud" );
111 default : return( "CSG_DataObject" );
112 }
113}
114
115
117// //
118// Data Object Statistics //
119// //
121
122//---------------------------------------------------------
124
125//---------------------------------------------------------
127{
128 if( Max_Samples >= 0 )
129 {
130 gSG_DataObject_Max_Samples = Max_Samples;
131
132 return( true );
133 }
134
135 return( false );
136}
137
138//---------------------------------------------------------
143
144
146// //
147// //
148// //
150
151//---------------------------------------------------------
153
154void SG_Set_History_Depth (int Depth)
155{
156 g_History_Depth = Depth;
157}
158
160{
161 return( g_History_Depth );
162}
163
164//---------------------------------------------------------
166
168{
169 g_History_Ignore_Lists = Ignore != 0;
170}
171
173{
174 return( g_History_Ignore_Lists );
175}
176
177
179// //
180// //
181// //
183
184//---------------------------------------------------------
186{
187 if( pObject && !pObject->Get_Managed() )
188 {
189 delete(pObject);
190
191 return( true );
192 }
193
194 return( false );
195}
196
197
199// //
200// //
201// //
203
204//---------------------------------------------------------
206{
207 static int RefCount = 0;
208
209 #pragma omp critical
210 {
211 m_RefID = ++RefCount;
212 }
213
214 m_pOwner = NULL;
215
216 m_File_bNative = false;
217 m_File_Type = 0;
218
219 m_NoData_Value[0] = -99999.;
220 m_NoData_Value[1] = -99999.;
221
222 m_Max_Samples = gSG_DataObject_Max_Samples;
223 m_bModified = true;
224 m_bUpdate = false;
225
226 m_MetaData.Set_Name("SAGA_METADATA");
227
228 m_pMD_Database = m_MetaData.Add_Child(SG_META_DATABASE);
229 m_pMD_Source = m_MetaData.Add_Child(SG_META_SOURCE );
230 m_pMD_History = m_MetaData.Add_Child(SG_META_HISTORY );
231
232 #ifdef WITH_LIFETIME_TRACKER
233 #pragma omp critical
234 {
235 ++m_Track_nObjects;
236
237 if( m_Track )
238 {
239 SG_UI_Console_Print_StdOut(CSG_String::Format("data object (refid=%04d) constructed, new object count is %d", m_RefID, m_Track_nObjects - m_Track_Offset));
240 }
241 }
242 #endif // WITH_LIFETIME_TRACKER
243}
244
245//---------------------------------------------------------
247{
248 Destroy();
249
250 #ifdef WITH_LIFETIME_TRACKER
251 #pragma omp critical
252 {
253 --m_Track_nObjects;
254
255 if( m_Track )
256 {
257 SG_UI_Console_Print_StdOut(CSG_String::Format("data object (refid=%04d) destructed, new object count is %d", m_RefID, m_Track_nObjects - m_Track_Offset));
258 }
259 }
260 #endif // WITH_LIFETIME_TRACKER
261}
262
263//---------------------------------------------------------
264bool CSG_Data_Object::m_Track = false; int CSG_Data_Object::m_Track_nObjects = 0; int CSG_Data_Object::m_Track_Offset = 0;
265
266//---------------------------------------------------------
267void CSG_Data_Object::Track(bool Track, bool Offset)
268{
269 #ifdef WITH_LIFETIME_TRACKER
270 m_Track = Track; m_Track_Offset = Offset ? m_Track_nObjects : 0;
271
272 SG_UI_Console_Print_StdOut(CSG_String::Format("data object construction/destruction tracker, state=%s, offset=%s, current object count is %d",
273 m_Track ? SG_T("ON") : SG_T("OFF"), m_Track_Offset ? SG_T("ON") : SG_T("OFF"), m_Track_nObjects
274 ));
275 #else
276 SG_UI_Console_Print_StdOut("CSG_Data_Object::Track() functionality (aka data object lifetime tracker) has not been built for this configuration!");
277 #endif // WITH_LIFETIME_TRACKER
278}
279
280//---------------------------------------------------------
282{
283 m_Name.Clear(); m_Description.Clear();
284
285 m_pMD_Database->Destroy();
286 m_pMD_Source ->Destroy();
287 m_pMD_History ->Destroy();
288
289 return( true );
290}
291
292
294// //
296
297//---------------------------------------------------------
298void CSG_Data_Object::Set_Name(const char *Name) { Set_Name(CSG_String(Name)); }
299void CSG_Data_Object::Set_Name(const wchar_t *Name) { Set_Name(CSG_String(Name)); }
301{
302 if( Name.is_Empty() )
303 {
304 m_Name = _TL("Data");
305 }
306 else
307 {
308 m_Name = Name;
309 }
310}
311
312//---------------------------------------------------------
313void CSG_Data_Object::Fmt_Name(const char *Format, ...)
314{
315 wxString _s; va_list argptr;
316
317#ifdef _SAGA_LINUX
318 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
319 va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
320#else
321 va_start(argptr, Format); _s.PrintfV( Format, argptr);
322#endif
323
324 va_end(argptr);
325
326 Set_Name(CSG_String(&_s));
327}
328
329//---------------------------------------------------------
330void CSG_Data_Object::Fmt_Name(const wchar_t *Format, ...)
331{
332 wxString _s; va_list argptr;
333
334#ifdef _SAGA_LINUX
335 // workaround as we only use wide characters
336 // since wx 2.9.4 so interpret strings as multibyte
337 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
338 va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
339#else
340 va_start(argptr, Format); _s.PrintfV( Format, argptr);
341#endif
342
343 va_end(argptr);
344
345 Set_Name(CSG_String(&_s));
346}
347
348//---------------------------------------------------------
350{
351 return( m_Name );
352}
353
354//---------------------------------------------------------
356{
357 m_Description = Description;
358}
359
361{
362 return( m_Description.is_Empty() && m_pOwner ? m_pOwner->m_Description : m_Description );
363}
364
365//---------------------------------------------------------
367{
368 Set_File_Name(FileName, false);
369}
370
371//---------------------------------------------------------
372void CSG_Data_Object::Set_File_Name(const CSG_String &FileName, bool bNative)
373{
374 if( FileName.is_Empty() )
375 {
376 m_FileName = "";
377 m_FileLayer = "";
378 m_File_bNative = false;
379 m_bModified = true;
380 }
381 else
382 {
383 m_FileName = FileName.BeforeFirst('|');
384 m_FileLayer = FileName.AfterFirst ('|');
385 m_File_bNative = bNative;
386 m_bModified = false;
387
388 if( m_Name.is_Empty() || m_Name.Cmp(_TL("Data")) == 0 )
389 {
390 m_Name = SG_File_Get_Name(FileName, false);
391 }
392 }
393}
394
395//---------------------------------------------------------
396const SG_Char * CSG_Data_Object::Get_File_Name(bool bNative) const
397{
398 if( bNative && !m_File_bNative )
399 {
400 return( SG_T("") );
401 }
402
403 if( m_pOwner )
404 {
405 if( m_pOwner->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids )
406 {
407 return( m_pOwner->m_FileName.c_str() );
408 }
409 }
410
411 return( m_FileName.c_str() );
412}
413
414//---------------------------------------------------------
416{
417 m_FileLayer = Layer;
418}
419
420//---------------------------------------------------------
422{
423 return( m_FileLayer );
424}
425
427{
428 return( bFullPath && !m_FileLayer.is_Empty() ? m_FileName + "|" + m_FileLayer : m_FileName );
429}
430
431//---------------------------------------------------------
433{
434 return( m_File_Type );
435}
436
437
439// //
441
442//---------------------------------------------------------
443/*
444* If the data object has a file association, this function
445* can be used to reload its content.
446*/
447//---------------------------------------------------------
449{
450 return( SG_File_Exists(m_FileName) && On_Reload() );
451}
452
453//---------------------------------------------------------
454/*
455* If the data object is stored in a native SAGA format,
456* this function can be used to delete all files associated
457* with it.
458*/
459//---------------------------------------------------------
461{
462 if( m_File_bNative && SG_File_Exists(m_FileName) && On_Delete() )
463 {
464 CSG_String FileName = m_FileName;
465
466 switch( Get_ObjectType() )
467 {
468 case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
469 case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
470 case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
471 case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
472 case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
473 case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info"); break;
474 default : SG_File_Set_Extension(FileName, "sg-info"); break;
475 }
476
477 SG_File_Delete(FileName);
478
479 SG_File_Set_Extension(FileName, "prj"); SG_File_Delete(FileName);
480 SG_File_Set_Extension(FileName, "sg-prj"); SG_File_Delete(FileName);
481
482 //-------------------------------------------------
483 m_FileName = "";
484 m_FileLayer = "";
485 m_File_bNative = false;
486 m_File_Type = 0;
487
488 m_bModified = true;
489
490 m_pMD_Database->Destroy();
491
492 return( true );
493 }
494
495 return( false );
496}
497
498
500// //
502
503//---------------------------------------------------------
504/*
505* Type cast function. Returns NULL if object is not exactly
506* of class type CSG_Table with bPolymorph = false or of
507* one of its derivatives (CSG_Shapes, CSG_PointCloud,
508* CSG_TIN) with bPolymorph = true.
509*/
510//---------------------------------------------------------
511CSG_Table * CSG_Data_Object::asTable(bool bPolymorph) const
512{
513 if( bPolymorph )
514 {
519 ? (CSG_Table *)this : NULL
520 );
521 }
522
523 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Table ? (CSG_Table *)this : NULL );
524}
525
526//---------------------------------------------------------
527/*
528* Type cast function. Returns NULL if object is not exactly
529* of class type CSG_Shapes with bPolymorph = false or of
530* one of its derivatives (CSG_PointCloud) with bPolymorph = true.
531*/
532//---------------------------------------------------------
533CSG_Shapes * CSG_Data_Object::asShapes(bool bPolymorph) const
534{
535 if( bPolymorph )
536 {
539 ? (CSG_Shapes *)this : NULL
540 );
541 }
542
543 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes ? (CSG_Shapes *)this : NULL );
544}
545
546//---------------------------------------------------------
547/*
548* Type cast function. Returns NULL if object is not exactly
549* of class type CSG_TIN. The bPolymorph flag has no effect.
550*/
551//---------------------------------------------------------
552CSG_TIN * CSG_Data_Object::asTIN(bool bPolymorph) const
553{
554 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_TIN ? (CSG_TIN *)this : NULL );
555}
556
557//---------------------------------------------------------
558/*
559* Type cast function. Returns NULL if object is not exactly
560* of class type CSG_PointCloud. The bPolymorph flag has no effect.
561*/
562//---------------------------------------------------------
564{
565 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud ? (CSG_PointCloud *)this : NULL );
566}
567
568//---------------------------------------------------------
569/*
570* Type cast function. Returns NULL if object is not exactly
571* of class type CSG_Grid. The bPolymorph flag has no effect.
572*/
573//---------------------------------------------------------
574CSG_Grid * CSG_Data_Object::asGrid(bool bPolymorph) const
575{
576 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Grid ? (CSG_Grid *)this : NULL );
577}
578
579//---------------------------------------------------------
580/*
581* Type cast function. Returns NULL if object is not exactly
582* of class type CSG_Grids. The bPolymorph flag has no effect.
583*/
584//---------------------------------------------------------
585CSG_Grids * CSG_Data_Object::asGrids(bool bPolymorph) const
586{
587 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids ? (CSG_Grids *)this : NULL );
588}
589
590
592// //
594
595//---------------------------------------------------------
597{
598 return( Set_NoData_Value_Range(Value, Value) );
599}
600
601//---------------------------------------------------------
602bool CSG_Data_Object::Set_NoData_Value_Range(double Lower, double Upper)
603{
604 if( Lower > Upper )
605 {
606 double d = Lower; Lower = Upper; Upper = d;
607 }
608
609 if( Lower != m_NoData_Value[0] || Upper != m_NoData_Value[1] )
610 {
611 m_NoData_Value[0] = Lower;
612 m_NoData_Value[1] = Upper;
613
614 Set_Modified();
615
617
618 return( true );
619 }
620
621 return( false );
622}
623
624//---------------------------------------------------------
626{
627 if( !Get_Update_Flag() )
628 {
630 }
631
632 return( true );
633}
634
635
637// //
639
640//---------------------------------------------------------
642{
643 #define Min_Samples 100
644
645 if( m_Max_Samples != Max_Samples && Max_Samples >= Min_Samples )
646 {
647 m_Max_Samples = Max_Samples;
648
649 Update(true);
650 }
651
652 return( true );
653}
654
655
657// //
659
660//---------------------------------------------------------
662{
663 return( m_pOwner ? m_pOwner->m_Projection : m_Projection );
664}
665
666//---------------------------------------------------------
668{
669 return( m_pOwner ? m_pOwner->m_Projection : m_Projection );
670}
671
672
674// //
676
677//---------------------------------------------------------
679{
680 CSG_String FileName(_FileName);
681
682 switch( Get_ObjectType() )
683 {
684 case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
685 case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
686 case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
687 case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
688 case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
689 case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info");
690 if( !SG_File_Get_Extension(_FileName).CmpNoCase("spc") )
691 {
692 SG_File_Set_Extension(FileName, "mpts");
693 }
694 break;
695
696 default: return( false );
697 }
698
699 CSG_File Stream(FileName, SG_FILE_R, false);
700
701 return( Load_MetaData(Stream) );
702}
703
704//---------------------------------------------------------
706{
707 CSG_String FileName(_FileName);
708
709 switch( Get_ObjectType() )
710 {
711 case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
712 case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
713 case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
714 case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
715 case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
716 case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info"); break;
717
718 default: return( false );
719 }
720
721 CSG_File Stream(FileName, SG_FILE_W, false);
722
723 return( Save_MetaData(Stream) );
724}
725
726//---------------------------------------------------------
728{
729 CSG_MetaData m;
730
731 if( !m.Load(Stream) )
732 {
733 return( false );
734 }
735
736 //-----------------------------------------------------
737 if( m("DESCRIPTION") && !m["DESCRIPTION"].Get_Content().is_Empty() )
738 {
739 Set_Description(m["DESCRIPTION"].Get_Content());
740 }
741
742 //-----------------------------------------------------
743 m_pMD_Source->Destroy();
744
745 if( m(SG_META_SOURCE) )
746 m_pMD_Source->Assign(m[SG_META_SOURCE]);
747
748 //-----------------------------------------------------
749 m_pMD_Database->Destroy();
750
751 if( m(SG_META_DATABASE) )
752 m_pMD_Database->Assign(m[SG_META_DATABASE]);
753
754 //-----------------------------------------------------
755 m_MetaData.Del_Child(SG_META_PROJECTION);
756
757 if( m(SG_META_PROJECTION) && m_Projection.Load(m[SG_META_PROJECTION]) )
758 m_MetaData.Add_Child(m[SG_META_PROJECTION]);
760 m_MetaData.Add_Child(m[SG_META_SOURCE][SG_META_PROJECTION]);
761
762 //-----------------------------------------------------
763 m_pMD_History->Destroy();
764
765 if( m(SG_META_HISTORY) )
766 m_pMD_History->Assign(m[SG_META_HISTORY]);
767 else
768 m_pMD_History->Add_Child(SG_META_FILEPATH, Get_File_Name());
769
770 return( true );
771}
772
773//---------------------------------------------------------
775{
776 //-----------------------------------------------------
777 if( m_MetaData(SG_META_FILEPATH) )
778 m_MetaData(SG_META_FILEPATH)->Set_Content(m_FileName);
779 else
780 m_MetaData.Add_Child(SG_META_FILEPATH, m_FileName);
781
782 //-----------------------------------------------------
783 if( m_MetaData("DESCRIPTION") )
784 m_MetaData("DESCRIPTION")->Set_Content(Get_Description());
785 else
786 m_MetaData.Add_Child("DESCRIPTION", Get_Description());
787
788 //-----------------------------------------------------
789 if( m_Projection.Get_Type() == ESG_CRS_Type::Undefined )
790 m_MetaData.Del_Child(SG_META_PROJECTION);
791 else if( m_MetaData(SG_META_PROJECTION) )
792 m_Projection.Save(*m_MetaData(SG_META_PROJECTION));
793 else
794 m_Projection.Save(*m_MetaData.Add_Child(SG_META_PROJECTION));
795
796 //-----------------------------------------------------
797 return( m_MetaData.Save(Stream) );
798}
799
800//---------------------------------------------------------
801bool CSG_Data_Object::Update(bool bForce)
802{
803 if( m_bUpdate || bForce )
804 {
805 m_bUpdate = false;
806
807 bool bResult = On_Update();
808
809 return( bResult );
810 }
811
812 return( true );
813}
814
815
817// //
819
820//---------------------------------------------------------
821bool CSG_Data_Object::Assign(CSG_Data_Object *pObject, bool bProgress)
822{
823 if( pObject )// && pObject->is_Valid() )
824 {
825 Destroy();
826
827 m_Name = pObject->Get_Name();
828 m_Description = pObject->Get_Description();
829 m_Projection = pObject->m_Projection;
830 Get_MetaData() = pObject->Get_MetaData();
831 // Get_History () = pObject->Get_History ();
832 Set_NoData_Value_Range(pObject->m_NoData_Value[0], pObject->m_NoData_Value[1]);
833
834 return( true );
835 }
836
837 return( false );
838}
839
840
842// //
844
845//---------------------------------------------------------
846#include "tool_chain.h"
847
848//---------------------------------------------------------
853
854
856// //
857// //
858// //
860
861//---------------------------------------------------------
void SG_UI_Console_Print_StdOut(const char *Text, SG_Char End, bool bFlush)
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
signed long long sLong
Definition api_core.h:158
#define SG_T(s)
Definition api_core.h:537
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &File, const CSG_String &Extension)
#define SG_Char
Definition api_core.h:536
#define _TL(s)
Definition api_core.h:1610
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension(const CSG_String &File)
@ SG_FILE_W
Definition api_core.h:1154
@ SG_FILE_R
Definition api_core.h:1153
const SG_Char * Get_Name(void) const
CSG_Data_Object * m_pOwner
Definition dataobject.h:274
int Get_File_Type(void) const
virtual bool On_NoData_Changed(void)
void Set_Name(const CSG_String &Name)
void Set_Update_Flag(bool bOn=true)
Definition dataobject.h:288
virtual bool Set_Max_Samples(sLong Max_Samples)
int Get_Managed(void) const
Definition dataobject.h:192
bool Save_MetaData(const CSG_String &FileName)
const CSG_String & Get_File_Layer(void) const
bool Get_Update_Flag(void)
Definition dataobject.h:289
CSG_MetaData & Get_MetaData(void) const
Definition dataobject.h:237
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
const SG_Char * Get_File_Name(bool bNative=true) const
bool Load_MetaData(const CSG_String &FileName)
bool Update(bool bForce=false)
virtual bool Destroy(void)
class CSG_PointCloud * asPointCloud(bool bPolymorph=false) const
class CSG_TIN * asTIN(bool bPolymorph=false) const
void Set_Description(const CSG_String &Description)
virtual void Set_Modified(bool bOn=true)
Definition dataobject.h:230
class CSG_Shapes * asShapes(bool bPolymorph=false) const
virtual ~CSG_Data_Object(void)
CSG_MetaData & Get_History(void)
Definition dataobject.h:239
virtual bool Set_NoData_Value(double Value)
virtual bool Assign(CSG_Data_Object *pObject, bool bProgress=false)
const SG_Char * Get_Description(void) const
virtual bool On_Update(void)
Definition dataobject.h:290
bool Save_History_to_Model(const CSG_String &File) const
CSG_Projection & Get_Projection(void)
virtual bool On_Delete(void)=0
class CSG_Grids * asGrids(bool bPolymorph=false) const
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.
void Fmt_Name(const char *Format,...)
class CSG_Grid * asGrid(bool bPolymorph=false) const
virtual bool On_Reload(void)=0
void Set_File_Name(const CSG_String &FileName)
bool Delete(void)
Deletes all files associated with this data object if possible. Works only with native SAGA files....
void Set_File_Layer(const CSG_String &Layer)
static void Track(bool Track=true, bool Offset=false)
Activate/deactivate lifetime tracking (data object construction/destruction). Needs compiler flag WIT...
class CSG_Table * asTable(bool bPolymorph=false) const
bool Reload(void)
If there is an associated file data can be reloaded with this command.
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition metadata.cpp:786
void Destroy(void)
Definition metadata.cpp:140
CSG_String AfterFirst(char Character) const
CSG_String BeforeFirst(char Character) const
static CSG_String Format(const char *Format,...)
bool is_Empty(void) const
Definition tin.h:222
static bool Save_History_to_Model(const CSG_MetaData &History, const CSG_String &File)
int g_History_Depth
int SG_Get_History_Depth(void)
void * SG_Get_Create_Pointer(void)
void SG_Set_History_Depth(int Depth)
bool SG_Data_Object_Delete(CSG_Data_Object *pObject)
sLong SG_DataObject_Get_Max_Samples(void)
static sLong gSG_DataObject_Max_Samples
void SG_Set_History_Ignore_Lists(int Ignore)
int SG_Get_History_Ignore_Lists(void)
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
bool SG_DataObject_Set_Max_Samples(sLong Max_Samples)
CSG_String SG_Get_DataObject_Identifier(TSG_Data_Object_Type Type)
int g_History_Ignore_Lists
CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
#define Min_Samples
TSG_Data_Object_Type
Definition dataobject.h:117
@ 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_CREATE
Definition dataobject.h:130
#define SG_META_DATABASE
Definition dataobject.h:91
#define SG_META_HISTORY
Definition dataobject.h:93
#define SG_META_FILEPATH
Definition dataobject.h:90
#define SG_META_SOURCE
Definition dataobject.h:89
#define SG_META_PROJECTION
Definition dataobject.h:92