81 default :
return(
"UNDEFINED" );
96 default :
return(
_TL(
"Undefined" ) );
111 default :
return(
"CSG_DataObject" );
128 if( Max_Samples >= 0 )
207 static int RefCount = 0;
211 m_RefID = ++RefCount;
216 m_File_bNative =
false;
219 m_NoData_Value[0] = -99999.;
220 m_NoData_Value[1] = -99999.;
226 m_MetaData.Set_Name(
"SAGA_METADATA");
232 #ifdef WITH_LIFETIME_TRACKER
250 #ifdef WITH_LIFETIME_TRACKER
264bool CSG_Data_Object::m_Track =
false;
int CSG_Data_Object::m_Track_nObjects = 0;
int CSG_Data_Object::m_Track_Offset = 0;
269 #ifdef WITH_LIFETIME_TRACKER
270 m_Track =
Track; m_Track_Offset = Offset ? m_Track_nObjects : 0;
273 m_Track ?
SG_T(
"ON") :
SG_T(
"OFF"), m_Track_Offset ?
SG_T(
"ON") :
SG_T(
"OFF"), m_Track_nObjects
276 SG_UI_Console_Print_StdOut(
"CSG_Data_Object::Track() functionality (aka data object lifetime tracker) has not been built for this configuration!");
283 m_Name.Clear(); m_Description.Clear();
285 m_pMD_Database->Destroy();
286 m_pMD_Source ->Destroy();
287 m_pMD_History ->Destroy();
304 m_Name =
_TL(
"Data");
315 wxString _s; va_list argptr;
318 wxString _Format(Format); _Format.Replace(
"%s",
"%ls");
319 va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
321 va_start(argptr, Format); _s.PrintfV( Format, argptr);
332 wxString _s; va_list argptr;
337 wxString _Format(Format); _Format.Replace(
"%s",
"%ls");
338 va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
340 va_start(argptr, Format); _s.PrintfV( Format, argptr);
357 m_Description = Description;
362 return( m_Description.is_Empty() &&
m_pOwner ?
m_pOwner->m_Description : m_Description );
377 m_File_bNative =
false;
382 m_FileName = FileName;
383 m_File_bNative = bNative;
386 if( m_Name.is_Empty() || m_Name.Cmp(
_TL(
"Data")) == 0 )
396 if( bNative && !m_File_bNative )
405 return(
m_pOwner->m_FileName.c_str() );
409 return( m_FileName.c_str() );
415 return( m_File_Type );
465 m_File_bNative =
false;
470 m_pMD_Database->Destroy();
586 double d = Lower; Lower = Upper; Upper = d;
589 if( Lower != m_NoData_Value[0] || Upper != m_NoData_Value[1] )
591 m_NoData_Value[0] = Lower;
592 m_NoData_Value[1] = Upper;
623 #define Min_Samples 100
625 if( m_Max_Samples != Max_Samples && Max_Samples >=
Min_Samples )
627 m_Max_Samples = Max_Samples;
676 default:
return(
false );
698 default:
return(
false );
711 if( !m.
Load(Stream) )
717 if( m(
"DESCRIPTION") && !m[
"DESCRIPTION"].Get_Content().is_Empty() )
729 m_pMD_Database->Destroy();
743 m_pMD_History->Destroy();
763 if( m_MetaData(
"DESCRIPTION") )
777 return( m_MetaData.Save(Stream) );
783 if( m_bUpdate || bForce )
809 m_Projection = pObject->m_Projection;
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)
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)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension(const CSG_String &File)
const SG_Char * Get_Name(void) const
CSG_Data_Object * m_pOwner
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)
virtual bool Set_Max_Samples(sLong Max_Samples)
int Get_Managed(void) const
bool Save_MetaData(const CSG_String &FileName)
bool Get_Update_Flag(void)
CSG_MetaData & Get_MetaData(void) const
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)
class CSG_Shapes * asShapes(bool bPolymorph=false) const
virtual ~CSG_Data_Object(void)
CSG_MetaData & Get_History(void)
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)
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....
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.
static CSG_String Format(const char *Format,...)
bool is_Empty(void) const
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)
@ SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Table
#define DATAOBJECT_CREATE
#define SG_META_PROJECTION