SAGA API  v9.2
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 //---------------------------------------------------------
140 {
141  return( gSG_DataObject_Max_Samples );
142 }
143 
144 
146 // //
147 // //
148 // //
150 
151 //---------------------------------------------------------
153 
154 void 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  m_MetaData.Set_Name("SAGA_METADATA");
188 
189  m_pMD_Database = m_MetaData.Add_Child(SG_META_DATABASE);
190  m_pMD_Source = m_MetaData.Add_Child(SG_META_SOURCE );
191  m_pMD_History = m_MetaData.Add_Child(SG_META_HISTORY );
192 
193  //-----------------------------------------------------
194  m_File_bNative = false;
195  m_File_Type = 0;
196  m_bModified = true;
197 
198  m_NoData_Value[0] = -99999.;
199  m_NoData_Value[1] = -99999.;
200 
201  m_Max_Samples = gSG_DataObject_Max_Samples;
202 
203  m_Name .Clear();
204  m_Description .Clear();
205 
206  m_bUpdate = false;
207 
208  m_pOwner = NULL;
209 }
210 
211 //---------------------------------------------------------
213 {
214  Destroy();
215 }
216 
217 //---------------------------------------------------------
219 {
220  m_Name.Clear(); m_Description.Clear();
221 
222  m_pMD_Database->Destroy();
223  m_pMD_Source ->Destroy();
224  m_pMD_History ->Destroy();
225 
226  return( true );
227 }
228 
229 
231 // //
233 
234 //---------------------------------------------------------
236 {
237  if( Name.is_Empty() )
238  {
239  m_Name = _TL("Data");
240  }
241  else
242  {
243  m_Name = Name;
244  }
245 }
246 
247 //---------------------------------------------------------
248 void CSG_Data_Object::Fmt_Name(const char *Format, ...)
249 {
250  wxString _s;
251 
252  va_list argptr;
253 
254 #ifdef _SAGA_LINUX
255  wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
256  va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
257 #else
258  va_start(argptr, Format); _s.PrintfV( Format, argptr);
259 #endif
260 
261  va_end(argptr);
262 
263  Set_Name(CSG_String(&_s));
264 }
265 
266 //---------------------------------------------------------
267 void CSG_Data_Object::Fmt_Name(const wchar_t *Format, ...)
268 {
269  wxString _s;
270 
271  va_list argptr;
272 
273 #ifdef _SAGA_LINUX
274  // workaround as we only use wide characters
275  // since wx 2.9.4 so interpret strings as multibyte
276  wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
277  va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
278 #else
279  va_start(argptr, Format); _s.PrintfV( Format, argptr);
280 #endif
281 
282  va_end(argptr);
283 
284  CSG_String s(&_s);
285 
286  Set_Name(CSG_String(&_s));
287 }
288 
289 //---------------------------------------------------------
291 {
292  return( m_Name );
293 }
294 
295 //---------------------------------------------------------
297 {
298  m_Description = Description;
299 }
300 
302 {
303  return( m_Description.is_Empty() && m_pOwner ? m_pOwner->m_Description : m_Description );
304 }
305 
306 //---------------------------------------------------------
308 {
309  Set_File_Name(FileName, false);
310 }
311 
312 //---------------------------------------------------------
313 void CSG_Data_Object::Set_File_Name(const CSG_String &FileName, bool bNative)
314 {
315  if( FileName.is_Empty() )
316  {
317  m_FileName .Clear();
318  m_File_bNative = false;
319  m_bModified = true;
320  }
321  else
322  {
323  m_FileName = FileName;
324  m_File_bNative = bNative;
325  m_bModified = false;
326  m_Name = SG_File_Get_Name(FileName, false);
327  }
328 }
329 
330 //---------------------------------------------------------
331 const SG_Char * CSG_Data_Object::Get_File_Name(bool bNative) const
332 {
333  if( bNative && !m_File_bNative )
334  {
335  return( SG_T("") );
336  }
337 
338  if( m_pOwner )
339  {
341  {
342  return( m_pOwner->m_FileName.c_str() );
343  }
344  }
345 
346  return( m_FileName.c_str() );
347 }
348 
349 //---------------------------------------------------------
351 {
352  return( m_File_Type );
353 }
354 
355 
357 // //
359 
360 //---------------------------------------------------------
361 /*
362 * If the data object has a file asssociation, this function
363 * can be used to reload its content.
364 */
365 //---------------------------------------------------------
367 {
368  return( SG_File_Exists(m_FileName) && On_Reload() );
369 }
370 
371 //---------------------------------------------------------
372 /*
373 * If the data object is stored in a native SAGA format,
374 * this function can be used to delete all files asssociated
375 * with it.
376 */
377 //---------------------------------------------------------
379 {
380  if( m_File_bNative && SG_File_Exists(m_FileName) && On_Delete() )
381  {
382  CSG_String FileName = m_FileName;
383 
384  switch( Get_ObjectType() )
385  {
386  case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
387  case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
388  case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
389  case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
390  case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
391  case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info"); break;
392  default : SG_File_Set_Extension(FileName, "sg-info"); break;
393  }
394 
395  SG_File_Delete(FileName);
396 
397  SG_File_Set_Extension(FileName, "prj"); SG_File_Delete(FileName);
398  SG_File_Set_Extension(FileName, "sg-prj"); SG_File_Delete(FileName);
399 
400  //-------------------------------------------------
401  m_FileName = "";
402  m_File_bNative = false;
403  m_File_Type = 0;
404 
405  m_bModified = true;
406 
407  m_pMD_Database->Destroy();
408 
409  return( true );
410  }
411 
412  return( false );
413 }
414 
415 
417 // //
419 
420 //---------------------------------------------------------
421 /*
422 * Type cast function. Returns NULL if object is not exactly
423 * of class type CSG_Table with bPolymorph = false or of
424 * one of its derivatives (CSG_Shapes, CSG_PointCloud,
425 * CSG_TIN) with bPolymorph = true.
426 */
427 //---------------------------------------------------------
428 CSG_Table * CSG_Data_Object::asTable(bool bPolymorph) const
429 {
430  if( bPolymorph )
431  {
436  ? (CSG_Table *)this : NULL
437  );
438  }
439 
440  return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Table ? (CSG_Table *)this : NULL );
441 }
442 
443 //---------------------------------------------------------
444 /*
445 * Type cast function. Returns NULL if object is not exactly
446 * of class type CSG_Shapes with bPolymorph = false or of
447 * one of its derivatives (CSG_PointCloud) with bPolymorph = true.
448 */
449 //---------------------------------------------------------
450 CSG_Shapes * CSG_Data_Object::asShapes(bool bPolymorph) const
451 {
452  if( bPolymorph )
453  {
456  ? (CSG_Shapes *)this : NULL
457  );
458  }
459 
460  return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes ? (CSG_Shapes *)this : NULL );
461 }
462 
463 //---------------------------------------------------------
464 /*
465 * Type cast function. Returns NULL if object is not exactly
466 * of class type CSG_TIN. The bPolymorph flag has no effect.
467 */
468 //---------------------------------------------------------
469 CSG_TIN * CSG_Data_Object::asTIN(bool bPolymorph) const
470 {
471  return( Get_ObjectType() == SG_DATAOBJECT_TYPE_TIN ? (CSG_TIN *)this : NULL );
472 }
473 
474 //---------------------------------------------------------
475 /*
476 * Type cast function. Returns NULL if object is not exactly
477 * of class type CSG_PointCloud. The bPolymorph flag has no effect.
478 */
479 //---------------------------------------------------------
481 {
482  return( Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud ? (CSG_PointCloud *)this : NULL );
483 }
484 
485 //---------------------------------------------------------
486 /*
487 * Type cast function. Returns NULL if object is not exactly
488 * of class type CSG_Grid. The bPolymorph flag has no effect.
489 */
490 //---------------------------------------------------------
491 CSG_Grid * CSG_Data_Object::asGrid(bool bPolymorph) const
492 {
493  return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Grid ? (CSG_Grid *)this : NULL );
494 }
495 
496 //---------------------------------------------------------
497 /*
498 * Type cast function. Returns NULL if object is not exactly
499 * of class type CSG_Grids. The bPolymorph flag has no effect.
500 */
501 //---------------------------------------------------------
502 CSG_Grids * CSG_Data_Object::asGrids(bool bPolymorph) const
503 {
504  return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids ? (CSG_Grids *)this : NULL );
505 }
506 
507 
509 // //
511 
512 //---------------------------------------------------------
514 {
515  return( Set_NoData_Value_Range(Value, Value) );
516 }
517 
518 //---------------------------------------------------------
519 bool CSG_Data_Object::Set_NoData_Value_Range(double Lower, double Upper)
520 {
521  if( Lower > Upper )
522  {
523  double d = Lower; Lower = Upper; Upper = d;
524  }
525 
526  if( Lower != m_NoData_Value[0] || Upper != m_NoData_Value[1] )
527  {
528  m_NoData_Value[0] = Lower;
529  m_NoData_Value[1] = Upper;
530 
531  Set_Modified();
532 
534 
535  return( true );
536  }
537 
538  return( false );
539 }
540 
541 //---------------------------------------------------------
543 {
544  if( !Get_Update_Flag() )
545  {
546  Set_Update_Flag();
547  }
548 
549  return( true );
550 }
551 
552 
554 // //
556 
557 //---------------------------------------------------------
559 {
560  #define Min_Samples 100
561 
562  if( m_Max_Samples != Max_Samples && Max_Samples >= Min_Samples )
563  {
564  m_Max_Samples = Max_Samples;
565 
566  Update(true);
567  }
568 
569  return( true );
570 }
571 
572 
574 // //
576 
577 //---------------------------------------------------------
579 {
580  return( m_pOwner ? m_pOwner->m_Projection : m_Projection );
581 }
582 
583 //---------------------------------------------------------
585 {
586  return( m_pOwner ? m_pOwner->m_Projection : m_Projection );
587 }
588 
589 
591 // //
593 
594 //---------------------------------------------------------
596 {
597  CSG_String FileName(_FileName);
598 
599  switch( Get_ObjectType() )
600  {
601  case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
602  case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
603  case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
604  case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
605  case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
606  case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info");
607  if( !SG_File_Get_Extension(_FileName).CmpNoCase("spc") ) SG_File_Set_Extension(FileName, "mpts"); break;
608 
609  default: return( false );
610  }
611 
612  CSG_File Stream(FileName, SG_FILE_R, false);
613 
614  return( Load_MetaData(Stream) );
615 }
616 
617 //---------------------------------------------------------
619 {
620  CSG_String FileName(_FileName);
621 
622  switch( Get_ObjectType() )
623  {
624  case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
625  case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
626  case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
627  case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
628  case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
629  case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info"); break;
630 
631  default: return( false );
632  }
633 
634  CSG_File Stream(FileName, SG_FILE_W, false);
635 
636  return( Save_MetaData(Stream) );
637 }
638 
639 //---------------------------------------------------------
641 {
642  CSG_MetaData m;
643 
644  if( !m.Load(Stream) )
645  {
646  return( false );
647  }
648 
649  //-----------------------------------------------------
650  if( m("DESCRIPTION") && !m["DESCRIPTION"].Get_Content().is_Empty() )
651  {
652  Set_Description(m["DESCRIPTION"].Get_Content());
653  }
654 
655  //-----------------------------------------------------
656  m_pMD_Source->Destroy();
657 
658  if( m(SG_META_SOURCE) )
659  m_pMD_Source->Assign(m[SG_META_SOURCE]);
660 
661  //-----------------------------------------------------
662  m_pMD_Database->Destroy();
663 
664  if( m(SG_META_DATABASE) )
665  m_pMD_Database->Assign(m[SG_META_DATABASE]);
666 
667  //-----------------------------------------------------
668  m_MetaData.Del_Child(SG_META_PROJECTION);
669 
670  if( m(SG_META_PROJECTION) && m_Projection.Load(m[SG_META_PROJECTION]) )
671  m_MetaData.Add_Child(m[SG_META_PROJECTION]);
672  else if( m[SG_META_SOURCE](SG_META_PROJECTION) && m_Projection.Load(m[SG_META_SOURCE][SG_META_PROJECTION]) )
674 
675  //-----------------------------------------------------
676  m_pMD_History->Destroy();
677 
678  if( m(SG_META_HISTORY) )
679  m_pMD_History->Assign(m[SG_META_HISTORY]);
680  else
681  m_pMD_History->Add_Child(SG_META_FILEPATH, Get_File_Name());
682 
683  return( true );
684 }
685 
686 //---------------------------------------------------------
688 {
689  //-----------------------------------------------------
690  if( m_MetaData(SG_META_FILEPATH) )
691  m_MetaData(SG_META_FILEPATH)->Set_Content(m_FileName);
692  else
693  m_MetaData.Add_Child(SG_META_FILEPATH, m_FileName);
694 
695  //-----------------------------------------------------
696  if( m_MetaData("DESCRIPTION") )
697  m_MetaData("DESCRIPTION")->Set_Content(Get_Description());
698  else
699  m_MetaData.Add_Child("DESCRIPTION", Get_Description());
700 
701  //-----------------------------------------------------
702  if( m_Projection.Get_Type() == SG_PROJ_TYPE_CS_Undefined )
703  m_MetaData.Del_Child(SG_META_PROJECTION);
704  else if( m_MetaData(SG_META_PROJECTION) )
705  m_Projection.Save(*m_MetaData(SG_META_PROJECTION));
706  else
707  m_Projection.Save(*m_MetaData.Add_Child(SG_META_PROJECTION));
708 
709  //-----------------------------------------------------
710  return( m_MetaData.Save(Stream) );
711 }
712 
713 //---------------------------------------------------------
714 bool CSG_Data_Object::Update(bool bForce)
715 {
716  if( m_bUpdate || bForce )
717  {
718  m_bUpdate = false;
719 
720  bool bResult = On_Update();
721 
722  return( bResult );
723  }
724 
725  return( true );
726 }
727 
728 
730 // //
732 
733 //---------------------------------------------------------
735 {
736  return( false );
737 }
738 
739 
741 // //
743 
744 //---------------------------------------------------------
745 #include "tool_chain.h"
746 
747 //---------------------------------------------------------
749 {
751 }
752 
753 
755 // //
756 // //
757 // //
759 
760 //---------------------------------------------------------
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: dataobject.cpp:734
CSG_Data_Object::m_pOwner
CSG_Data_Object * m_pOwner
Definition: dataobject.h:259
SG_T
#define SG_T(s)
Definition: api_core.h:531
Min_Samples
#define Min_Samples
CSG_MetaData::Del_Child
bool Del_Child(int Index)
Definition: metadata.cpp:329
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Data_Object::On_Reload
virtual bool On_Reload(void)=0
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_Data_Object::On_Delete
virtual bool On_Delete(void)=0
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_Data_Object::Get_Description
const SG_Char * Get_Description(void) const
Definition: dataobject.cpp:301
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
SG_Get_DataObject_Name
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:86
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
tool_chain.h
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Data_Object::asTIN
class CSG_TIN * asTIN(bool bPolymorph=false) const
Definition: dataobject.cpp:469
SG_Get_Create_Pointer
void * SG_Get_Create_Pointer(void)
Definition: dataobject.cpp:65
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
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_Data_Object::Set_Max_Samples
virtual bool Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:558
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_File
Definition: api_core.h:1116
CSG_Projection::Get_Type
TSG_Projection_Type Get_Type(void) const
Definition: geo_tools.h:887
CSG_Data_Object::asShapes
class CSG_Shapes * asShapes(bool bPolymorph=false) const
Definition: dataobject.cpp:450
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
CSG_Projection::Load
bool Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
Definition: projections.cpp:413
CSG_TIN
Definition: tin.h:222
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
SG_META_SOURCE
#define SG_META_SOURCE
Definition: dataobject.h:89
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Object::On_NoData_Changed
virtual bool On_NoData_Changed(void)
Definition: dataobject.cpp:542
CSG_Data_Object::asGrids
class CSG_Grids * asGrids(bool bPolymorph=false) const
Definition: dataobject.cpp:502
SG_DataObject_Get_Max_Samples
sLong SG_DataObject_Get_Max_Samples(void)
Definition: dataobject.cpp:139
SG_Get_DataObject_Identifier
CSG_String SG_Get_DataObject_Identifier(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:71
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
SG_META_HISTORY
#define SG_META_HISTORY
Definition: dataobject.h:93
sLong
signed long long sLong
Definition: api_core.h:158
SG_Set_History_Depth
void SG_Set_History_Depth(int Depth)
Definition: dataobject.cpp:154
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:275
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
SG_Set_History_Ignore_Lists
void SG_Set_History_Ignore_Lists(int Ignore)
Definition: dataobject.cpp:167
SG_File_Get_Extension
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension(const CSG_String &FileName)
Definition: api_file.cpp:953
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
dataobject.h
CSG_Data_Object::asTable
class CSG_Table * asTable(bool bPolymorph=false) const
Definition: dataobject.cpp:428
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
SG_DataObject_Set_Max_Samples
bool SG_DataObject_Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:126
CSG_Tool_Chain::Save_History_to_Model
static bool Save_History_to_Model(const CSG_MetaData &History, const CSG_String &File)
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_MetaData::Assign
bool Assign(const CSG_MetaData &MetaData, bool bAddChildren=true)
Definition: metadata.cpp:761
CSG_Projection
Definition: geo_tools.h:833
CSG_Table
Definition: table.h:283
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
CSG_Data_Object::Get_Update_Flag
bool Get_Update_Flag(void)
Definition: dataobject.h:274
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Data_Object::Delete
bool Delete(void)
Deletes all files associated with this data object if possible. Works only with native SAGA files....
Definition: dataobject.cpp:378
SG_Get_History_Ignore_Lists
int SG_Get_History_Ignore_Lists(void)
Definition: dataobject.cpp:172
SG_Char
#define SG_Char
Definition: api_core.h:530
SG_META_PROJECTION
#define SG_META_PROJECTION
Definition: dataobject.h:92
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:557
CSG_Data_Object::asGrid
class CSG_Grid * asGrid(bool bPolymorph=false) const
Definition: dataobject.cpp:491
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
SG_META_DATABASE
#define SG_META_DATABASE
Definition: dataobject.h:91
CSG_MetaData
Definition: metadata.h:88
CSG_Data_Object::Set_Description
void Set_Description(const CSG_String &Description)
Definition: dataobject.cpp:296
CSG_Data_Object::Save_History_to_Model
bool Save_History_to_Model(const CSG_String &File) const
Definition: dataobject.cpp:748
SG_Get_History_Depth
int SG_Get_History_Depth(void)
Definition: dataobject.cpp:159
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_PROJ_TYPE_CS_Undefined
@ SG_PROJ_TYPE_CS_Undefined
Definition: geo_tools.h:784
CSG_Data_Object::Get_File_Type
int Get_File_Type(void) const
Definition: dataobject.cpp:350
g_History_Ignore_Lists
int g_History_Ignore_Lists
Definition: dataobject.cpp:165
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
CSG_Data_Object::Fmt_Name
void Fmt_Name(const char *Format,...)
Definition: dataobject.cpp:248
CSG_Data_Object::asPointCloud
class CSG_PointCloud * asPointCloud(bool bPolymorph=false) const
Definition: dataobject.cpp:480
CSG_Grid
Definition: grid.h:473
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
CSG_Projection::Save
bool Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
Definition: projections.cpp:421
CSG_Shapes
Definition: shapes.h:773
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Data_Object::CSG_Data_Object
CSG_Data_Object(void)
Definition: dataobject.cpp:185
CSG_PointCloud
Definition: pointcloud.h:105
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_Data_Object::Reload
bool Reload(void)
If there is an associated file data can be reloaded with this command.
Definition: dataobject.cpp:366
CSG_Data_Object::~CSG_Data_Object
virtual ~CSG_Data_Object(void)
Definition: dataobject.cpp:212
CSG_Grids
Definition: grids.h:119
g_History_Depth
int g_History_Depth
Definition: dataobject.cpp:152
CSG_Data_Object::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
Definition: dataobject.cpp:519
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
SG_Get_DataObject_Class_Name
CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:101
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
SG_META_FILEPATH
#define SG_META_FILEPATH
Definition: dataobject.h:90
gSG_DataObject_Max_Samples
static sLong gSG_DataObject_Max_Samples
Definition: dataobject.cpp:123