SAGA API
v9.6
|
#include <grid.h>
Public Member Functions | |
CSG_Grid_System (void) | |
CSG_Grid_System (const CSG_Grid_System &System, int Precision=-1) | |
bool | Create (const CSG_Grid_System &System, int Precision=-1) |
CSG_Grid_System (double Cellsize, const CSG_Rect &Extent, int Precision=-1) | |
bool | Create (double Cellsize, const CSG_Rect &Extent, int Precision=-1) |
CSG_Grid_System (double Cellsize, double xMin, double yMin, double xMax, double yMax, int Precision=-1) | |
bool | Create (double Cellsize, double xMin, double yMin, double xMax, double yMax, int Precision=-1) |
CSG_Grid_System (double Cellsize, double xMin, double yMin, int NX, int NY, int Precision=-1) | |
bool | Create (double Cellsize, double xMin, double yMin, int NX, int NY, int Precision=-1) |
~CSG_Grid_System (void) | |
bool | Destroy (void) |
bool | Assign (const CSG_Grid_System &System) |
bool | Assign (double Cellsize, const CSG_Rect &Extent) |
bool | Assign (double Cellsize, double xMin, double yMin, double xMax, double yMax) |
bool | Assign (double Cellsize, double xMin, double yMin, int NX, int NY) |
bool | is_Valid (void) const |
const SG_Char * | Get_Name (bool bShort=true) |
double | Get_Cellsize (void) const |
double | Get_Cellarea (void) const |
int | Get_NX (void) const |
int | Get_NY (void) const |
sLong | Get_NCells (void) const |
const CSG_Rect & | Get_Extent (bool bCells=false) const |
double | Get_XMin (bool bCells=false) const |
double | Get_XMax (bool bCells=false) const |
double | Get_XRange (bool bCells=false) const |
double | Get_YMin (bool bCells=false) const |
double | Get_YMax (bool bCells=false) const |
double | Get_YRange (bool bCells=false) const |
CSG_Grid_System & | operator= (const CSG_Grid_System &System) |
bool | operator== (const CSG_Grid_System &System) const |
bool | operator!= (const CSG_Grid_System &System) const |
bool | is_Equal (const CSG_Grid_System &System) const |
bool | is_Equal (double Cellsize, const TSG_Rect &Extent) const |
double | Fit_xto_Grid_System (double x) const |
Aligns the world coordinate x to the rows of the grid system and returns it. More... | |
double | Fit_yto_Grid_System (double y) const |
Aligns the world coordinate y to the columns of the grid system and returns it. More... | |
TSG_Point | Fit_to_Grid_System (TSG_Point ptWorld) const |
Aligns the world coordinate ptWorld to the rows and columns of the grid system and returns it. More... | |
double | Get_xGrid_to_World (int xGrid) const |
double | Get_yGrid_to_World (int yGrid) const |
TSG_Point | Get_Grid_to_World (int xGrid, int yGrid) const |
int | Get_xWorld_to_Grid (double xWorld) const |
int | Get_yWorld_to_Grid (double yWorld) const |
bool | Get_World_to_Grid (int &xGrid, int &yGrid, double xWorld, double yWorld) const |
bool | Get_World_to_Grid (int &xGrid, int &yGrid, TSG_Point ptWorld) const |
bool | Get_Neighbor_Pos (int Direction, int x, int y, int &xPos, int &yPos) const |
int | Get_xToSave (int Direction, int x) const |
int | Get_yToSave (int Direction, int y) const |
int | Get_xFromSave (int Direction, int x) const |
int | Get_yFromSave (int Direction, int y) const |
bool | is_InGrid (int x, int y) const |
bool | is_InGrid (int x, int y, int Rand) const |
double | Get_Length (int Direction) const |
sLong | Get_IndexFromRowCol (int x, int y) const |
bool | Get_RowColFromIndex (int &x, int &y, sLong i) const |
Static Public Member Functions | |
static int | Get_xTo (int Direction, int x=0) |
static int | Get_yTo (int Direction, int y=0) |
static int | Get_xFrom (int Direction, int x=0) |
static int | Get_yFrom (int Direction, int y=0) |
static double | Get_UnitLength (int Direction) |
static int | Set_Precision (int Decimals) |
static int | Get_Precision (void) |
CSG_Grid_System is used by the CSG_Grid class to provide information about the number of rows and columns, the cell size and the georeference, which define the grid. It offers various functions, which help when working with grids.
CSG_Grid_System::CSG_Grid_System | ( | void | ) |
Definition at line 99 of file grid_system.cpp.
References Destroy().
CSG_Grid_System::CSG_Grid_System | ( | const CSG_Grid_System & | System, |
int | Precision = -1 |
||
) |
Definition at line 105 of file grid_system.cpp.
References Create().
CSG_Grid_System::CSG_Grid_System | ( | double | Cellsize, |
const CSG_Rect & | Extent, | ||
int | Precision = -1 |
||
) |
Definition at line 111 of file grid_system.cpp.
References Create().
CSG_Grid_System::CSG_Grid_System | ( | double | Cellsize, |
double | xMin, | ||
double | yMin, | ||
double | xMax, | ||
double | yMax, | ||
int | Precision = -1 |
||
) |
Definition at line 117 of file grid_system.cpp.
References Create().
CSG_Grid_System::CSG_Grid_System | ( | double | Cellsize, |
double | xMin, | ||
double | yMin, | ||
int | NX, | ||
int | NY, | ||
int | Precision = -1 |
||
) |
Definition at line 123 of file grid_system.cpp.
References Create().
CSG_Grid_System::~CSG_Grid_System | ( | void | ) |
Definition at line 129 of file grid_system.cpp.
References Destroy().
bool CSG_Grid_System::Assign | ( | const CSG_Grid_System & | System | ) |
Definition at line 240 of file grid_system.cpp.
References Create().
Referenced by CSG_Parameters::Add_Grid_System(), CSG_Grid_File_Info::Create(), CSG_Parameters_Grid_Target::Get_System(), and CSG_Parameters::Serialize_Compatibility().
bool CSG_Grid_System::Assign | ( | double | Cellsize, |
const CSG_Rect & | Extent | ||
) |
Definition at line 243 of file grid_system.cpp.
References Create().
bool CSG_Grid_System::Assign | ( | double | Cellsize, |
double | xMin, | ||
double | yMin, | ||
double | xMax, | ||
double | yMax | ||
) |
Definition at line 246 of file grid_system.cpp.
References Create().
bool CSG_Grid_System::Assign | ( | double | Cellsize, |
double | xMin, | ||
double | yMin, | ||
int | NX, | ||
int | NY | ||
) |
Definition at line 249 of file grid_system.cpp.
References Create().
bool CSG_Grid_System::Create | ( | const CSG_Grid_System & | System, |
int | Precision = -1 |
||
) |
Definition at line 140 of file grid_system.cpp.
References Get_Cellsize(), Get_NX(), Get_NY(), Get_XMin(), Get_YMin(), and is_Valid().
Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Parameter_Grid_System::_Set_Value(), Assign(), CSG_Grid::Create(), Create(), CSG_Grid_System(), operator=(), and CSG_Tool_Grid::Set_System().
bool CSG_Grid_System::Create | ( | double | Cellsize, |
const CSG_Rect & | Extent, | ||
int | Precision = -1 |
||
) |
Definition at line 162 of file grid_system.cpp.
References Create(), Destroy(), CSG_Rect::Get_Center(), CSG_Rect::Get_XMin(), CSG_Rect::Get_XRange(), CSG_Rect::Get_YMin(), CSG_Rect::Get_YRange(), SSG_Point::x, and SSG_Point::y.
bool CSG_Grid_System::Create | ( | double | Cellsize, |
double | xMin, | ||
double | yMin, | ||
double | xMax, | ||
double | yMax, | ||
int | Precision = -1 |
||
) |
Definition at line 181 of file grid_system.cpp.
References Create().
bool CSG_Grid_System::Create | ( | double | Cellsize, |
double | xMin, | ||
double | yMin, | ||
int | NX, | ||
int | NY, | ||
int | Precision = -1 |
||
) |
Definition at line 187 of file grid_system.cpp.
References Destroy(), CSG_Rect::Inflate(), SG_Get_Rounded(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.
bool CSG_Grid_System::Destroy | ( | void | ) |
Definition at line 223 of file grid_system.cpp.
References CSG_Rect::Create().
Referenced by Create(), CSG_Grid_System(), CSG_Grid::Destroy(), CSG_Parameter_Grid_List::Update_Data(), and ~CSG_Grid_System().
Aligns the world coordinate ptWorld to the rows and columns of the grid system and returns it.
Definition at line 267 of file grid.h.
References SSG_Point::x, and SSG_Point::y.
|
inline |
|
inline |
|
inline |
Definition at line 231 of file grid.h.
Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grids::Create(), Create(), Get_Name(), and CSG_Grid_File_Info::Save().
|
inline |
Definition at line 238 of file grid.h.
Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grid::Get_Value(), and CSG_Parameters_Grid_Target::Set_User_Defined().
|
inline |
Definition at line 280 of file grid.h.
References SSG_Point::x, and SSG_Point::y.
|
inline |
|
inline |
Definition at line 351 of file grid.h.
Referenced by CSG_Grid::Get_Gradient_NeighborDir().
const SG_Char * CSG_Grid_System::Get_Name | ( | bool | bShort = true | ) |
Definition at line 264 of file grid_system.cpp.
References _TL, Get_Cellsize(), Get_NX(), Get_NY(), Get_XMin(), Get_YMin(), is_Valid(), CSG_String::Printf(), and SG_Get_Significant_Decimals().
Referenced by CSG_Parameter_Grid_System::_Set_String().
|
inline |
|
inline |
Definition at line 234 of file grid.h.
Referenced by Create(), CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().
|
inline |
Definition at line 235 of file grid.h.
Referenced by Create(), CSG_Grid::Create(), Get_Name(), CSG_Grid_File_Info::Save(), and CSG_Parameters_Grid_Target::Set_User_Defined().
|
static |
Get the default precision (number of decimals) used to store coordinates and cell sizes. A negative value indicates that this is ignored.
Definition at line 88 of file grid_system.cpp.
Referenced by CSG_Grid_File_Info::Save().
|
inline |
|
inlinestatic |
|
inline |
|
inline |
Definition at line 300 of file grid.h.
References SSG_Point::x, and SSG_Point::y.
|
inlinestatic |
Definition at line 340 of file grid.h.
Referenced by CSG_Grid::Get_Gradient(), and CSG_Tool_Grid::Get_xFrom().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 240 of file grid.h.
Referenced by Create(), CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().
|
inline |
|
inlinestatic |
Definition at line 312 of file grid.h.
Referenced by CSG_Grid::Get_Gradient(), CSG_Grid::Get_Gradient_NeighborDir(), and CSG_Tool_Grid::Get_xTo().
|
inline |
|
inline |
Definition at line 292 of file grid.h.
Referenced by CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), and CSG_Grids::Get_Statistics().
|
inlinestatic |
Definition at line 341 of file grid.h.
Referenced by CSG_Grid::Get_Gradient(), and CSG_Tool_Grid::Get_yFrom().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 244 of file grid.h.
Referenced by Create(), CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().
|
inline |
|
inlinestatic |
Definition at line 326 of file grid.h.
Referenced by CSG_Grid::Get_Gradient(), CSG_Grid::Get_Gradient_NeighborDir(), and CSG_Tool_Grid::Get_yTo().
|
inline |
|
inline |
Definition at line 293 of file grid.h.
Referenced by CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), and CSG_Grids::Get_Statistics().
bool CSG_Grid_System::is_Equal | ( | const CSG_Grid_System & | System | ) | const |
Definition at line 324 of file grid_system.cpp.
References SSG_Rect::xMin, and SSG_Rect::yMin.
Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grids_List::Add_Item(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Get_Grids(), CSG_Parameter::is_Value_Equal(), operator!=(), and operator==().
bool CSG_Grid_System::is_Equal | ( | double | Cellsize, |
const TSG_Rect & | Extent | ||
) | const |
Definition at line 335 of file grid_system.cpp.
|
inline |
|
inline |
bool CSG_Grid_System::is_Valid | ( | void | ) | const |
Definition at line 258 of file grid_system.cpp.
Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), Create(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Get_Grids(), Get_Name(), CSG_Grid::is_Valid(), and CSG_Parameters_Grid_Target::Set_User_Defined().
bool CSG_Grid_System::operator!= | ( | const CSG_Grid_System & | System | ) | const |
Definition at line 313 of file grid_system.cpp.
References is_Equal().
CSG_Grid_System & CSG_Grid_System::operator= | ( | const CSG_Grid_System & | System | ) |
Definition at line 300 of file grid_system.cpp.
References Create().
bool CSG_Grid_System::operator== | ( | const CSG_Grid_System & | System | ) | const |
Definition at line 308 of file grid_system.cpp.
References is_Equal().
|
static |
Set the default precision given as number of decimals used to store coordinates and cell sizes. Ignored if set to a negative value.
Definition at line 75 of file grid_system.cpp.