53#ifndef HEADER_INCLUDED__SAGA_API__dataobject_H
54#define HEADER_INCLUDED__SAGA_API__dataobject_H
89#define SG_META_SOURCE "SOURCE"
90#define SG_META_FILEPATH "FILE"
91#define SG_META_DATABASE "DATABASE"
92#define SG_META_PROJECTION "PROJECTION"
93#define SG_META_HISTORY "HISTORY"
129#define DATAOBJECT_NOTSET ((void *)NULL)
130#define DATAOBJECT_CREATE ((void *)1)
200 virtual bool Save (
const char *File,
int Format = 0) = 0;
201 virtual bool Save (
const wchar_t *File,
int Format = 0) = 0;
215 virtual bool Assign (
CSG_Data_Object *pObject,
bool bProgress =
false);
218 void Set_Name (
const char *Name);
219 void Set_Name (
const wchar_t *Name);
220 void Fmt_Name (
const char *Format, ...);
221 void Fmt_Name (
const wchar_t *Format, ...);
222 const SG_Char * Get_Name (
void)
const;
224 void Set_Description (
const CSG_String &Description);
225 const SG_Char * Get_Description (
void)
const;
229 bool Update (
bool bForce =
false);
253 double Get_NoData_Value (
bool bUpper =
false)
const {
return( m_NoData_Value[bUpper ? 1 : 0] ); }
257 return(
SG_is_NaN(Value) || (m_NoData_Value[0] < m_NoData_Value[1] ? m_NoData_Value[0] <= Value && Value <= m_NoData_Value[1] : Value == m_NoData_Value[0]) );
260 bool Save_History_to_Model (
const CSG_String &File)
const;
262 virtual bool Set_Max_Samples (
sLong Max_Samples);
266 static void Track (
bool Track =
true,
bool Offset =
false);
288 virtual bool On_NoData_Changed (
void);
294 static int m_Track_nObjects;
295 static int m_Track_Offset;
297 bool m_bModified, m_bUpdate, m_File_bNative;
299 int m_RefID, m_File_Type, m_Managed{0};
303 double m_NoData_Value[2];
305 CSG_String m_FileName, m_Name, m_Description;
308 CSG_MetaData m_MetaData, *m_pMD_Source, *m_pMD_History, *m_pMD_Database;
310 CSG_Projection m_Projection;
#define SAGA_API_DLL_EXPORT
virtual bool is_Modified(void) const
CSG_Data_Object * m_pOwner
int Get_File_Type(void) const
bool is_NoData_Value(double Value) const
virtual bool is_Valid(void) const =0
int Get_RefID(void) const
Returns the object's reference id (unique).
void Set_Update_Flag(bool bOn=true)
friend class CSG_Data_Collection
int Get_Managed(void) const
bool Save_MetaData(const CSG_String &FileName)
double Get_NoData_Value(bool bUpper=false) const
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
virtual bool Save(const char *File, int Format=0)=0
bool Load_MetaData(const CSG_String &FileName)
virtual bool Destroy(void)
class CSG_PointCloud * asPointCloud(bool bPolymorph=false) const
class CSG_TIN * asTIN(bool bPolymorph=false) const
bool is_File_Native(void) const
virtual bool Save(const CSG_String &File, int Format=0)=0
virtual bool Save(const wchar_t *File, int Format=0)=0
virtual void Set_Modified(bool bOn=true)
class CSG_Shapes * asShapes(bool bPolymorph=false) const
void Set_File_Type(int Type)
CSG_MetaData & Get_History(void)
virtual bool Set_NoData_Value(double Value)
CSG_Data_Object * Get_Owner(void) const
void Set_Owner(CSG_Data_Object *pOwner)
sLong Get_Max_Samples(void) const
virtual bool On_Update(void)
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.
class CSG_Grid * asGrid(bool bPolymorph=false) const
virtual bool On_Reload(void)=0
CSG_MetaData & Get_MetaData_DB(void) const
void Set_File_Name(const CSG_String &FileName)
virtual const CSG_Rect & Get_Extent(void)=0
bool Delete(void)
Deletes all files associated with this data object if possible. Works only with native SAGA files....
const CSG_MetaData & Get_History(void) const
class CSG_Table * asTable(bool bPolymorph=false) const
bool Reload(void)
If there is an associated file data can be reloaded with this command.
SAGA_API_DLL_EXPORT bool SG_Data_Object_Delete(CSG_Data_Object *pObject)
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
@ SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Table
SAGA_API_DLL_EXPORT int SG_Get_History_Depth(void)
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Identifier(TSG_Data_Object_Type Type)
SAGA_API_DLL_EXPORT void SG_Set_History_Depth(int Depth)
SAGA_API_DLL_EXPORT void SG_Set_History_Ignore_Lists(int Ignore)
SAGA_API_DLL_EXPORT sLong SG_DataObject_Get_Max_Samples(void)
SAGA_API_DLL_EXPORT int SG_Get_History_Ignore_Lists(void)
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
SAGA_API_DLL_EXPORT bool SG_DataObject_Set_Max_Samples(sLong Max_Samples)
SAGA_API_DLL_EXPORT void * SG_Get_Create_Pointer(void)