SAGA API v9.10
Loading...
Searching...
No Matches
CSG_Data_Object Class Referenceabstract

#include <dataobject.h>

Inheritance diagram for CSG_Data_Object:
CSG_Grid CSG_Grids CSG_Table CSG_Shapes CSG_TIN CSG_PointCloud

Public Member Functions

 CSG_Data_Object (void)
virtual ~CSG_Data_Object (void)
virtual bool Destroy (void)
int Get_RefID (void) const
 Returns the object's reference id (unique).
int Get_Managed (void) 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.
virtual bool is_Valid (void) const =0
virtual bool Save (const CSG_String &File, int Format=0)=0
virtual bool Save (const char *File, int Format=0)=0
virtual bool Save (const wchar_t *File, int Format=0)=0
bool Reload (void)
 If there is an associated file data can be reloaded with this command.
bool Delete (void)
 Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success.
void Set_File_Name (const CSG_String &FileName)
const SG_CharGet_File_Name (bool bNative=true) const
int Get_File_Type (void) const
bool is_File_Native (void) const
virtual bool Assign (CSG_Data_Object *pObject, bool bProgress=false)
void Set_Name (const CSG_String &Name)
void Set_Name (const char *Name)
void Set_Name (const wchar_t *Name)
void Fmt_Name (const char *Format,...)
void Fmt_Name (const wchar_t *Format,...)
const SG_CharGet_Name (void) const
void Set_Description (const CSG_String &Description)
const SG_CharGet_Description (void) const
virtual void Set_Modified (bool bOn=true)
virtual bool is_Modified (void) const
bool Update (bool bForce=false)
CSG_Data_ObjectGet_Owner (void) const
void Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaDataGet_MetaData (void) const
CSG_MetaDataGet_MetaData_DB (void) const
CSG_MetaDataGet_History (void)
const CSG_MetaDataGet_History (void) const
virtual const CSG_RectGet_Extent (void)=0
CSG_ProjectionGet_Projection (void)
const CSG_ProjectionGet_Projection (void) const
class CSG_TableasTable (bool bPolymorph=false) const
class CSG_ShapesasShapes (bool bPolymorph=false) const
class CSG_TINasTIN (bool bPolymorph=false) const
class CSG_PointCloudasPointCloud (bool bPolymorph=false) const
class CSG_GridasGrid (bool bPolymorph=false) const
class CSG_GridsasGrids (bool bPolymorph=false) const
virtual bool Set_NoData_Value (double Value)
virtual bool Set_NoData_Value_Range (double Lower, double Upper)
double Get_NoData_Value (bool bUpper=false) const
bool is_NoData_Value (double Value) const
bool Save_History_to_Model (const CSG_String &File) const
virtual bool Set_Max_Samples (sLong Max_Samples)
sLong Get_Max_Samples (void) const

Static Public Member Functions

static void Track (bool Track=true, bool Offset=false)
 Activate/deactivate lifetime tracking (data object construction/destruction). Needs compiler flag WITH_LIFETIME_TRACKER being defined.

Protected Member Functions

void Set_File_Name (const CSG_String &FileName, bool bNative)
void Set_File_Type (int Type)
virtual bool On_Reload (void)=0
virtual bool On_Delete (void)=0
bool Load_MetaData (const CSG_String &FileName)
bool Load_MetaData (CSG_File &Stream)
bool Save_MetaData (const CSG_String &FileName)
bool Save_MetaData (CSG_File &Stream)
void Set_Update_Flag (bool bOn=true)
bool Get_Update_Flag (void)
virtual bool On_Update (void)
virtual bool On_NoData_Changed (void)

Protected Attributes

CSG_Data_Objectm_pOwner

Friends

class CSG_Data_Collection

Detailed Description

CSG_Data_Object is the base class for all types of data sets, which are provided by the SAGA API.

See also
CSG_Table
CSG_Shapes
CSG_TIN
CSG_PointCloud
CSG_Grid
CSG_Grids

Definition at line 179 of file dataobject.h.

Constructor & Destructor Documentation

◆ CSG_Data_Object()

◆ ~CSG_Data_Object()

CSG_Data_Object::~CSG_Data_Object ( void )
virtual

Definition at line 246 of file dataobject.cpp.

References Destroy(), CSG_String::Format(), and SG_UI_Console_Print_StdOut().

Member Function Documentation

◆ asGrid()

CSG_Grid * CSG_Data_Object::asGrid ( bool bPolymorph = false) const

◆ asGrids()

CSG_Grids * CSG_Data_Object::asGrids ( bool bPolymorph = false) const

◆ asPointCloud()

CSG_PointCloud * CSG_Data_Object::asPointCloud ( bool bPolymorph = false) const

Definition at line 543 of file dataobject.cpp.

References Get_ObjectType(), and SG_DATAOBJECT_TYPE_PointCloud.

Referenced by CSG_PointCloud::Assign(), and Get_Extent().

◆ asShapes()

CSG_Shapes * CSG_Data_Object::asShapes ( bool bPolymorph = false) const

◆ Assign()

bool CSG_Data_Object::Assign ( CSG_Data_Object * pObject,
bool bProgress = false )
virtual

◆ asTable()

CSG_Table * CSG_Data_Object::asTable ( bool bPolymorph = false) const

◆ asTIN()

CSG_TIN * CSG_Data_Object::asTIN ( bool bPolymorph = false) const

Definition at line 532 of file dataobject.cpp.

References Get_ObjectType(), and SG_DATAOBJECT_TYPE_TIN.

Referenced by CSG_TIN::Assign(), and Get_Extent().

◆ Delete()

bool CSG_Data_Object::Delete ( void )

Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success.

Definition at line 441 of file dataobject.cpp.

References Get_ObjectType(), On_Delete(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_TIN, SG_File_Delete(), SG_File_Exists(), and SG_File_Set_Extension().

Referenced by Save().

◆ Destroy()

bool CSG_Data_Object::Destroy ( void )
virtual

◆ Fmt_Name() [1/2]

void CSG_Data_Object::Fmt_Name ( const char * Format,
... )

Definition at line 313 of file dataobject.cpp.

References Set_Name().

◆ Fmt_Name() [2/2]

void CSG_Data_Object::Fmt_Name ( const wchar_t * Format,
... )

Definition at line 330 of file dataobject.cpp.

References Set_Name().

◆ Get_Description()

const SG_Char * CSG_Data_Object::Get_Description ( void ) const

◆ Get_Extent()

virtual const CSG_Rect & CSG_Data_Object::Get_Extent ( void )
pure virtual

◆ Get_File_Name()

◆ Get_File_Type()

int CSG_Data_Object::Get_File_Type ( void ) const

Definition at line 413 of file dataobject.cpp.

Referenced by Save().

◆ Get_History() [1/2]

◆ Get_History() [2/2]

const CSG_MetaData & CSG_Data_Object::Get_History ( void ) const
inline

Definition at line 237 of file dataobject.h.

◆ Get_Managed()

int CSG_Data_Object::Get_Managed ( void ) const
inline

Definition at line 192 of file dataobject.h.

Referenced by SG_Data_Object_Delete().

◆ Get_Max_Samples()

◆ Get_MetaData()

CSG_MetaData & CSG_Data_Object::Get_MetaData ( void ) const
inline

Definition at line 234 of file dataobject.h.

Referenced by Assign(), and CSG_Grid::Create().

◆ Get_MetaData_DB()

CSG_MetaData & CSG_Data_Object::Get_MetaData_DB ( void ) const
inline

Definition at line 235 of file dataobject.h.

Referenced by CSG_Grids::Create(), CSG_Table::Load(), and CSG_Table::Save().

◆ Get_Name()

◆ Get_NoData_Value()

◆ Get_ObjectType()

◆ Get_Owner()

CSG_Data_Object * CSG_Data_Object::Get_Owner ( void ) const
inline

Definition at line 231 of file dataobject.h.

References CSG_Data_Object(), and m_pOwner.

Referenced by CSG_Grids::Del_Grids(), and SG_UI_DataObject_Update().

◆ Get_Projection() [1/2]

◆ Get_Projection() [2/2]

const CSG_Projection & CSG_Data_Object::Get_Projection ( void ) const

Definition at line 647 of file dataobject.cpp.

References m_pOwner.

◆ Get_RefID()

int CSG_Data_Object::Get_RefID ( void ) const
inline

Returns the object's reference id (unique).

Definition at line 190 of file dataobject.h.

◆ Get_Update_Flag()

bool CSG_Data_Object::Get_Update_Flag ( void )
inlineprotected

Definition at line 286 of file dataobject.h.

Referenced by On_NoData_Changed().

◆ is_File_Native()

bool CSG_Data_Object::is_File_Native ( void ) const
inline

Definition at line 213 of file dataobject.h.

◆ is_Modified()

virtual bool CSG_Data_Object::is_Modified ( void ) const
inlinevirtual

Reimplemented in CSG_Grids.

Definition at line 228 of file dataobject.h.

Referenced by CSG_Grids::is_Modified(), and CSG_Table::Set_Modified().

◆ is_NoData_Value()

◆ is_Valid()

virtual bool CSG_Data_Object::is_Valid ( void ) const
pure virtual

◆ Load_MetaData() [1/2]

◆ Load_MetaData() [2/2]

bool CSG_Data_Object::Load_MetaData ( CSG_File & Stream)
protected

◆ On_Delete()

virtual bool CSG_Data_Object::On_Delete ( void )
protectedpure virtual

Implemented in CSG_Grid, CSG_Grids, CSG_PointCloud, CSG_Shapes, CSG_Table, and CSG_TIN.

References Load_MetaData(), and Save_MetaData().

Referenced by Delete().

◆ On_NoData_Changed()

bool CSG_Data_Object::On_NoData_Changed ( void )
protectedvirtual

Reimplemented in CSG_Table.

Definition at line 605 of file dataobject.cpp.

References Get_Update_Flag(), and Set_Update_Flag().

Referenced by CSG_Table::On_NoData_Changed(), and Set_NoData_Value_Range().

◆ On_Reload()

virtual bool CSG_Data_Object::On_Reload ( void )
protectedpure virtual

Implemented in CSG_Grid, CSG_Grids, CSG_PointCloud, CSG_Shapes, CSG_Table, and CSG_TIN.

Referenced by Reload().

◆ On_Update()

virtual bool CSG_Data_Object::On_Update ( void )
inlineprotectedvirtual

Reimplemented in CSG_Grid, CSG_Grids, CSG_PointCloud, CSG_Shapes, CSG_Table, and CSG_TIN.

Definition at line 287 of file dataobject.h.

Referenced by CSG_Table::On_Update(), and Update().

◆ Reload()

bool CSG_Data_Object::Reload ( void )

If there is an associated file data can be reloaded with this command.

Definition at line 429 of file dataobject.cpp.

References On_Reload(), and SG_File_Exists().

Referenced by Save().

◆ Save() [1/3]

virtual bool CSG_Data_Object::Save ( const char * File,
int Format = 0 )
pure virtual

◆ Save() [2/3]

virtual bool CSG_Data_Object::Save ( const CSG_String & File,
int Format = 0 )
pure virtual

◆ Save() [3/3]

virtual bool CSG_Data_Object::Save ( const wchar_t * File,
int Format = 0 )
pure virtual

◆ Save_History_to_Model()

bool CSG_Data_Object::Save_History_to_Model ( const CSG_String & File) const

Definition at line 829 of file dataobject.cpp.

References Get_History(), and CSG_Tool_Chain::Save_History_to_Model().

◆ Save_MetaData() [1/2]

◆ Save_MetaData() [2/2]

bool CSG_Data_Object::Save_MetaData ( CSG_File & Stream)
protected

Definition at line 754 of file dataobject.cpp.

References Get_Description(), SG_META_FILEPATH, SG_META_PROJECTION, and Undefined.

◆ Set_Description()

void CSG_Data_Object::Set_Description ( const CSG_String & Description)

Definition at line 355 of file dataobject.cpp.

Referenced by CSG_Grid::Create(), CSG_Table::Create(), and Load_MetaData().

◆ Set_File_Name() [1/2]

void CSG_Data_Object::Set_File_Name ( const CSG_String & FileName)

◆ Set_File_Name() [2/2]

void CSG_Data_Object::Set_File_Name ( const CSG_String & FileName,
bool bNative )
protected

Definition at line 372 of file dataobject.cpp.

References _TL, CSG_String::is_Empty(), and SG_File_Get_Name().

◆ Set_File_Type()

void CSG_Data_Object::Set_File_Type ( int Type)
inlineprotected

Definition at line 275 of file dataobject.h.

Referenced by CSG_Table::Save().

◆ Set_Max_Samples()

bool CSG_Data_Object::Set_Max_Samples ( sLong Max_Samples)
virtual

Reimplemented in CSG_Grids.

Definition at line 621 of file dataobject.cpp.

References Min_Samples, and Update().

Referenced by CSG_Grid::Create(), CSG_Grid::Create(), and CSG_Grids::Set_Max_Samples().

◆ Set_Modified()

virtual void CSG_Data_Object::Set_Modified ( bool bOn = true)
inlinevirtual

◆ Set_Name() [1/3]

void CSG_Data_Object::Set_Name ( const char * Name)

Definition at line 298 of file dataobject.cpp.

References Set_Name().

◆ Set_Name() [2/3]

◆ Set_Name() [3/3]

void CSG_Data_Object::Set_Name ( const wchar_t * Name)

Definition at line 299 of file dataobject.cpp.

References Set_Name().

◆ Set_NoData_Value()

bool CSG_Data_Object::Set_NoData_Value ( double Value)
virtual

◆ Set_NoData_Value_Range()

bool CSG_Data_Object::Set_NoData_Value_Range ( double Lower,
double Upper )
virtual

◆ Set_Owner()

void CSG_Data_Object::Set_Owner ( CSG_Data_Object * pOwner)
inline

Definition at line 232 of file dataobject.h.

References CSG_Data_Object(), and m_pOwner.

◆ Set_Update_Flag()

◆ Track()

void CSG_Data_Object::Track ( bool Track = true,
bool Offset = false )
static

Activate/deactivate lifetime tracking (data object construction/destruction). Needs compiler flag WITH_LIFETIME_TRACKER being defined.

Definition at line 267 of file dataobject.cpp.

References CSG_String::Format(), SG_T, SG_UI_Console_Print_StdOut(), and Track().

Referenced by Track().

◆ Update()

◆ CSG_Data_Collection

friend class CSG_Data_Collection
friend

Definition at line 181 of file dataobject.h.

References CSG_Data_Collection, CSG_Data_Object(), and Destroy().

Referenced by CSG_Data_Collection.

Member Data Documentation

◆ m_pOwner

CSG_Data_Object* CSG_Data_Object::m_pOwner
protected

The documentation for this class was generated from the following files: