|
SAGA API
v9.6
|
Go to the documentation of this file.
55 #include <wx/string.h>
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
242 #endif // WITH_LIFETIME_TRACKER
250 #ifdef WITH_LIFETIME_TRACKER
260 #endif // WITH_LIFETIME_TRACKER
264 bool 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!");
277 #endif // WITH_LIFETIME_TRACKER
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;
377 m_File_bNative =
false;
382 m_FileName = FileName;
383 m_File_bNative = bNative;
392 if( bNative && !m_File_bNative )
405 return( m_FileName.
c_str() );
411 return( m_File_Type );
461 m_File_bNative =
false;
582 double d = Lower; Lower = Upper; Upper = d;
585 if( Lower != m_NoData_Value[0] || Upper != m_NoData_Value[1] )
587 m_NoData_Value[0] = Lower;
588 m_NoData_Value[1] = Upper;
619 #define Min_Samples 100
621 if( m_Max_Samples != Max_Samples && Max_Samples >=
Min_Samples )
623 m_Max_Samples = Max_Samples;
668 default:
return(
false );
690 default:
return(
false );
703 if( !m.
Load(Stream) )
709 if( m(
"DESCRIPTION") && !m[
"DESCRIPTION"].Get_Content().is_Empty() )
755 if( m_MetaData(
"DESCRIPTION") )
769 return( m_MetaData.
Save(Stream) );
775 if( m_bUpdate || bForce )
800 m_Projection = pObject->m_Projection;
virtual bool Assign(CSG_Data_Object *pObject)
CSG_Data_Object * m_pOwner
bool Save(const CSG_String &File, ESG_CRS_Format Format=ESG_CRS_Format::WKT) const
bool SG_Data_Object_Delete(CSG_Data_Object *pObject)
virtual bool On_Reload(void)=0
void Set_File_Name(const CSG_String &FileName)
virtual bool On_Delete(void)=0
CSG_MetaData & Get_History(void)
const SG_Char * Get_Description(void) const
bool Update(bool bForce=false)
int Get_Managed(void) const
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
bool Save_MetaData(const CSG_String &FileName)
void SG_UI_Console_Print_StdOut(const char *Text, SG_Char End, bool bFlush)
const SG_Char * Get_Name(void) const
@ SG_DATAOBJECT_TYPE_Grids
class CSG_TIN * asTIN(bool bPolymorph=false) const
void * SG_Get_Create_Pointer(void)
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
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.
virtual bool Set_Max_Samples(sLong Max_Samples)
void Set_Update_Flag(bool bOn=true)
class CSG_Shapes * asShapes(bool bPolymorph=false) const
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
virtual bool On_NoData_Changed(void)
class CSG_Grids * asGrids(bool bPolymorph=false) const
sLong SG_DataObject_Get_Max_Samples(void)
CSG_String SG_Get_DataObject_Identifier(TSG_Data_Object_Type Type)
#define DATAOBJECT_CREATE
void SG_Set_History_Depth(int Depth)
virtual bool On_Update(void)
ESG_CRS_Type Get_Type(void) const
const SG_Char * Get_File_Name(bool bNative=true) const
void SG_Set_History_Ignore_Lists(int Ignore)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension(const CSG_String &FileName)
virtual void Set_Modified(bool bOn=true)
bool Load(const CSG_String &File)
class CSG_Table * asTable(bool bPolymorph=false) const
@ SG_DATAOBJECT_TYPE_Grid
bool SG_DataObject_Set_Max_Samples(sLong Max_Samples)
void Set_Name(const CSG_String &Name)
static CSG_String Format(const char *Format,...)
@ SG_DATAOBJECT_TYPE_Shapes
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
bool Get_Update_Flag(void)
bool Delete(void)
Deletes all files associated with this data object if possible. Works only with native SAGA files....
int SG_Get_History_Ignore_Lists(void)
#define SG_META_PROJECTION
class CSG_Grid * asGrid(bool bPolymorph=false) const
@ SG_DATAOBJECT_TYPE_Table
void Set_Description(const CSG_String &Description)
bool Save_History_to_Model(const CSG_String &File) const
int SG_Get_History_Depth(void)
bool is_Empty(void) const
CSG_MetaData & Get_MetaData(void) const
int Get_File_Type(void) const
int g_History_Ignore_Lists
bool Load_MetaData(const CSG_String &FileName)
void Fmt_Name(const char *Format,...)
class CSG_PointCloud * asPointCloud(bool bPolymorph=false) const
static void Track(bool Track=true, bool Offset=false)
Activate/deactivate lifetime tracking (data object construction/destruction). Needs compiler flag WIT...
virtual bool Set_NoData_Value(double Value)
const SG_Char * c_str(void) const
bool Reload(void)
If there is an associated file data can be reloaded with this command.
virtual ~CSG_Data_Object(void)
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
CSG_Projection & Get_Projection(void)
virtual bool Destroy(void)
CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
@ SG_DATAOBJECT_TYPE_PointCloud
static sLong gSG_DataObject_Max_Samples