/usr/include/saga_api/dataobject.h is in libsaga-dev 2.1.2+dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | /**********************************************************
* Version $Id: dataobject.h 1921 2014-01-09 10:24:11Z oconrad $
*********************************************************/
///////////////////////////////////////////////////////////
// //
// SAGA //
// //
// System for Automated Geoscientific Analyses //
// //
// Application Programming Interface //
// //
// Library: SAGA_API //
// //
//-------------------------------------------------------//
// //
// dataobject.h //
// //
// Copyright (C) 2005 by Olaf Conrad //
// //
//-------------------------------------------------------//
// //
// This file is part of 'SAGA - System for Automated //
// Geoscientific Analyses'. //
// //
// This library is free software; you can redistribute //
// it and/or modify it under the terms of the GNU Lesser //
// General Public License as published by the Free //
// Software Foundation, version 2.1 of the License. //
// //
// This library is distributed in the hope that it will //
// be useful, but WITHOUT ANY WARRANTY; without even the //
// implied warranty of MERCHANTABILITY or FITNESS FOR A //
// PARTICULAR PURPOSE. See the GNU Lesser General Public //
// License for more details. //
// //
// You should have received a copy of the GNU Lesser //
// General Public License along with this program; if //
// not, write to the Free Software Foundation, Inc., //
// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
// USA. //
// //
//-------------------------------------------------------//
// //
// contact: Olaf Conrad //
// Institute of Geography //
// University of Goettingen //
// Goldschmidtstr. 5 //
// 37077 Goettingen //
// Germany //
// //
// e-mail: oconrad@saga-gis.org //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#ifndef HEADER_INCLUDED__SAGA_API__dataobject_H
#define HEADER_INCLUDED__SAGA_API__dataobject_H
//---------------------------------------------------------
/** \file dataobject.h
* Base class for data objects and related declarations.
* @see CSG_Data_Object
* @see CSG_History
*/
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#include "mat_tools.h"
#include "metadata.h"
///////////////////////////////////////////////////////////
// //
// Meta-Data //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#define SG_META_EXT_GRID SG_T("mgrd")
#define SG_META_EXT_TABLE SG_T("mtab")
#define SG_META_EXT_SHAPES SG_T("mshp")
#define SG_META_EXT_TIN SG_T("mtin")
#define SG_META_EXT_POINTCLOUD SG_T("mpts")
//---------------------------------------------------------
#define SG_META_SRC SG_T("SOURCE")
#define SG_META_SRC_FILE SG_T("FILE")
#define SG_META_SRC_DB SG_T("DATABASE")
#define SG_META_SRC_PROJ SG_T("PROJECTION")
#define SG_META_HST SG_T("HISTORY")
#define SG_META_HST_FILE SG_T("FILE")
///////////////////////////////////////////////////////////
// //
// Data Objects //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
/**
* Definition of available data types. This is returned by
* the CSG_Data_Object::Get_ObjectType() function to allow
* type checking at run time.
* @see CSG_Data_Object
* @see CSG_Table
* @see CSG_PointCloud
* @see CSG_Shapes
* @see CSG_TIN
* @see CSG_Grid
*/
//---------------------------------------------------------
typedef enum ESG_Data_Object_Type
{
DATAOBJECT_TYPE_Grid,
DATAOBJECT_TYPE_Table,
DATAOBJECT_TYPE_Shapes,
DATAOBJECT_TYPE_TIN,
DATAOBJECT_TYPE_PointCloud,
DATAOBJECT_TYPE_Undefined
}
TSG_Data_Object_Type;
//---------------------------------------------------------
#define DATAOBJECT_NOTSET ((void *)NULL)
#define DATAOBJECT_CREATE ((void *)1)
//---------------------------------------------------------
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Identifier (TSG_Data_Object_Type Type);
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Name (TSG_Data_Object_Type Type);
///////////////////////////////////////////////////////////
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
SAGA_API_DLL_EXPORT void SG_Set_History_Depth (int Depth);
SAGA_API_DLL_EXPORT int SG_Get_History_Depth (void);
///////////////////////////////////////////////////////////
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
/**
* CSG_Data_Object is the base class for all types of data
* sets, which are provided by the SAGA API.
* @see CSG_Table
* @see CSG_Shapes
* @see CSG_TIN
* @see CSG_PointCloud
* @see CSG_Grid
*/
//---------------------------------------------------------
class SAGA_API_DLL_EXPORT CSG_Data_Object
{
public:
CSG_Data_Object(void);
virtual ~CSG_Data_Object(void);
virtual bool Destroy (void);
/// Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
virtual TSG_Data_Object_Type Get_ObjectType (void) const = 0;
virtual bool is_Valid (void) const = 0;
virtual bool Save (const CSG_String &File_Name, int Format = 0) = 0;
const SG_Char * Get_File_Name (void) const { return( m_File_Name ); }
int Get_File_Type (void) const { return( m_File_Type ); }
virtual bool Assign (CSG_Data_Object *pObject);
void Set_Name (const CSG_String &Name);
const SG_Char * Get_Name (void) const { return( m_Name ); }
void Set_Description (const CSG_String &Description);
const SG_Char * Get_Description (void) const { return( m_Description ); }
virtual void Set_Modified (bool bOn = true) { m_bModified = bOn; }
bool is_Modified (void) const { return( m_bModified ); }
bool Update (void);
CSG_MetaData & Get_MetaData (void) const { return( *m_pMetaData ); }
CSG_MetaData & Get_MetaData_DB (void) { return( *m_pMetaData_DB ); }
CSG_MetaData & Get_History (void) { return( *m_pHistory ); }
CSG_Projection & Get_Projection (void) { return( m_Projection ); }
class CSG_Table * asTable (void) { return( Get_ObjectType() == DATAOBJECT_TYPE_Table ? (class CSG_Table *)this : NULL ); }
class CSG_Shapes * asShapes (void) { return( Get_ObjectType() == DATAOBJECT_TYPE_Shapes ? (class CSG_Shapes *)this : NULL ); }
class CSG_TIN * asTIN (void) { return( Get_ObjectType() == DATAOBJECT_TYPE_TIN ? (class CSG_TIN *)this : NULL ); }
class CSG_PointCloud * asPointCloud (void) { return( Get_ObjectType() == DATAOBJECT_TYPE_PointCloud ? (class CSG_PointCloud *)this : NULL ); }
class CSG_Grid * asGrid (void) { return( Get_ObjectType() == DATAOBJECT_TYPE_Grid ? (class CSG_Grid *)this : NULL ); }
bool Set_NoData_Value (double Value);
bool Set_NoData_Value_Range (double loValue, double hiValue);
double Get_NoData_Value (void) const { return( m_NoData_Value ); }
double Get_NoData_hiValue (void) const { return( m_NoData_hiValue ); }
bool is_NoData_Value (double Value) const
{
return( SG_is_NaN(Value) || (m_NoData_Value < m_NoData_hiValue ? m_NoData_Value <= Value && Value <= m_NoData_hiValue : Value == m_NoData_Value) );
}
protected:
void Set_File_Name (const CSG_String &File_Name);
void Set_File_Type (int Type) { m_File_Type = Type; }
bool Load_MetaData (const SG_Char *File_Name);
bool Save_MetaData (const SG_Char *File_Name);
void Set_Update_Flag (bool bOn = true) { m_bUpdate = bOn; }
bool Get_Update_Flag (void) { return( m_bUpdate ); }
virtual bool On_Update (void) { return( true ); }
virtual bool On_NoData_Changed (void) { return( true ); }
private:
bool m_bModified, m_bUpdate;
int m_File_Type;
double m_NoData_Value, m_NoData_hiValue;
CSG_String m_File_Name, m_Name, m_Description;
CSG_MetaData m_MetaData, *m_pMetaData, *m_pHistory, *m_pFile, *m_pProjection, *m_pMetaData_DB;
CSG_Projection m_Projection;
};
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#endif // #ifndef HEADER_INCLUDED__SAGA_API__dataobject_H
|