SAGA API  v9.5
CSG_Grid_System Class Reference

#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_CharGet_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_RectGet_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
 
bool operator== (const CSG_Grid_System &System) const
 
void operator= (const CSG_Grid_System &System)
 
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)
 

Detailed Description

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.

See also
CSG_Grid

Definition at line 199 of file grid.h.

Constructor & Destructor Documentation

◆ CSG_Grid_System() [1/5]

CSG_Grid_System::CSG_Grid_System ( void  )

Definition at line 99 of file grid_system.cpp.

References Destroy().

◆ CSG_Grid_System() [2/5]

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() [3/5]

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() [4/5]

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() [5/5]

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::~CSG_Grid_System ( void  )

Definition at line 129 of file grid_system.cpp.

References Destroy().

Member Function Documentation

◆ Assign() [1/4]

◆ Assign() [2/4]

bool CSG_Grid_System::Assign ( double  Cellsize,
const CSG_Rect Extent 
)

Definition at line 243 of file grid_system.cpp.

References Create().

◆ Assign() [3/4]

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().

◆ Assign() [4/4]

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().

◆ Create() [1/4]

◆ Create() [2/4]

bool CSG_Grid_System::Create ( double  Cellsize,
const CSG_Rect Extent,
int  Precision = -1 
)

◆ Create() [3/4]

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().

◆ Create() [4/4]

bool CSG_Grid_System::Create ( double  Cellsize,
double  xMin,
double  yMin,
int  NX,
int  NY,
int  Precision = -1 
)

◆ Destroy()

bool CSG_Grid_System::Destroy ( void  )

◆ Fit_to_Grid_System()

TSG_Point CSG_Grid_System::Fit_to_Grid_System ( TSG_Point  ptWorld) const
inline

Aligns the world coordinate ptWorld to the rows and columns of the grid system and returns it.

Definition at line 265 of file grid.h.

References SSG_Point::x, and SSG_Point::y.

◆ Fit_xto_Grid_System()

double CSG_Grid_System::Fit_xto_Grid_System ( double  x) const
inline

Aligns the world coordinate x to the rows of the grid system and returns it.

Definition at line 259 of file grid.h.

◆ Fit_yto_Grid_System()

double CSG_Grid_System::Fit_yto_Grid_System ( double  y) const
inline

Aligns the world coordinate y to the columns of the grid system and returns it.

Definition at line 262 of file grid.h.

◆ Get_Cellarea()

double CSG_Grid_System::Get_Cellarea ( void  ) const
inline

Definition at line 232 of file grid.h.

◆ Get_Cellsize()

double CSG_Grid_System::Get_Cellsize ( void  ) const
inline

◆ Get_Extent()

const CSG_Rect& CSG_Grid_System::Get_Extent ( bool  bCells = false) const
inline

◆ Get_Grid_to_World()

TSG_Point CSG_Grid_System::Get_Grid_to_World ( int  xGrid,
int  yGrid 
) const
inline

Definition at line 278 of file grid.h.

References SSG_Point::x, and SSG_Point::y.

◆ Get_IndexFromRowCol()

sLong CSG_Grid_System::Get_IndexFromRowCol ( int  x,
int  y 
) const
inline

Definition at line 355 of file grid.h.

◆ Get_Length()

double CSG_Grid_System::Get_Length ( int  Direction) const
inline

Definition at line 349 of file grid.h.

Referenced by CSG_Grid::Get_Gradient_NeighborDir().

◆ Get_Name()

const SG_Char * CSG_Grid_System::Get_Name ( bool  bShort = true)

◆ Get_NCells()

sLong CSG_Grid_System::Get_NCells ( void  ) const
inline

Definition at line 236 of file grid.h.

◆ Get_Neighbor_Pos()

bool CSG_Grid_System::Get_Neighbor_Pos ( int  Direction,
int  x,
int  y,
int &  xPos,
int &  yPos 
) const
inline

Definition at line 305 of file grid.h.

◆ Get_NX()

int CSG_Grid_System::Get_NX ( void  ) const
inline

Definition at line 234 of file grid.h.

Referenced by Create(), CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().

◆ Get_NY()

int CSG_Grid_System::Get_NY ( void  ) const
inline

◆ Get_Precision()

int CSG_Grid_System::Get_Precision ( void  )
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().

◆ Get_RowColFromIndex()

bool CSG_Grid_System::Get_RowColFromIndex ( int &  x,
int &  y,
sLong  i 
) const
inline

Definition at line 365 of file grid.h.

◆ Get_UnitLength()

static double CSG_Grid_System::Get_UnitLength ( int  Direction)
inlinestatic

Definition at line 350 of file grid.h.

◆ Get_World_to_Grid() [1/2]

bool CSG_Grid_System::Get_World_to_Grid ( int &  xGrid,
int &  yGrid,
double  xWorld,
double  yWorld 
) const
inline

Definition at line 293 of file grid.h.

◆ Get_World_to_Grid() [2/2]

bool CSG_Grid_System::Get_World_to_Grid ( int &  xGrid,
int &  yGrid,
TSG_Point  ptWorld 
) const
inline

Definition at line 298 of file grid.h.

References SSG_Point::x, and SSG_Point::y.

◆ Get_xFrom()

static int CSG_Grid_System::Get_xFrom ( int  Direction,
int  x = 0 
)
inlinestatic

Definition at line 338 of file grid.h.

Referenced by CSG_Grid::Get_Gradient(), and CSG_Tool_Grid::Get_xFrom().

◆ Get_xFromSave()

int CSG_Grid_System::Get_xFromSave ( int  Direction,
int  x 
) const
inline

Definition at line 343 of file grid.h.

◆ Get_xGrid_to_World()

double CSG_Grid_System::Get_xGrid_to_World ( int  xGrid) const
inline

Definition at line 275 of file grid.h.

◆ Get_XMax()

double CSG_Grid_System::Get_XMax ( bool  bCells = false) const
inline

Definition at line 241 of file grid.h.

◆ Get_XMin()

double CSG_Grid_System::Get_XMin ( bool  bCells = false) const
inline

Definition at line 240 of file grid.h.

Referenced by Create(), CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().

◆ Get_XRange()

double CSG_Grid_System::Get_XRange ( bool  bCells = false) const
inline

Definition at line 242 of file grid.h.

◆ Get_xTo()

static int CSG_Grid_System::Get_xTo ( int  Direction,
int  x = 0 
)
inlinestatic

◆ Get_xToSave()

int CSG_Grid_System::Get_xToSave ( int  Direction,
int  x 
) const
inline

Definition at line 341 of file grid.h.

◆ Get_xWorld_to_Grid()

int CSG_Grid_System::Get_xWorld_to_Grid ( double  xWorld) const
inline

◆ Get_yFrom()

static int CSG_Grid_System::Get_yFrom ( int  Direction,
int  y = 0 
)
inlinestatic

Definition at line 339 of file grid.h.

Referenced by CSG_Grid::Get_Gradient(), and CSG_Tool_Grid::Get_yFrom().

◆ Get_yFromSave()

int CSG_Grid_System::Get_yFromSave ( int  Direction,
int  y 
) const
inline

Definition at line 344 of file grid.h.

◆ Get_yGrid_to_World()

double CSG_Grid_System::Get_yGrid_to_World ( int  yGrid) const
inline

Definition at line 276 of file grid.h.

◆ Get_YMax()

double CSG_Grid_System::Get_YMax ( bool  bCells = false) const
inline

Definition at line 245 of file grid.h.

◆ Get_YMin()

double CSG_Grid_System::Get_YMin ( bool  bCells = false) const
inline

Definition at line 244 of file grid.h.

Referenced by Create(), CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().

◆ Get_YRange()

double CSG_Grid_System::Get_YRange ( bool  bCells = false) const
inline

Definition at line 246 of file grid.h.

◆ Get_yTo()

static int CSG_Grid_System::Get_yTo ( int  Direction,
int  y = 0 
)
inlinestatic

◆ Get_yToSave()

int CSG_Grid_System::Get_yToSave ( int  Direction,
int  y 
) const
inline

Definition at line 342 of file grid.h.

◆ Get_yWorld_to_Grid()

int CSG_Grid_System::Get_yWorld_to_Grid ( double  yWorld) const
inline

◆ is_Equal() [1/2]

◆ is_Equal() [2/2]

bool CSG_Grid_System::is_Equal ( double  Cellsize,
const TSG_Rect Extent 
) const

Definition at line 328 of file grid_system.cpp.

◆ is_InGrid() [1/2]

bool CSG_Grid_System::is_InGrid ( int  x,
int  y 
) const
inline

Definition at line 346 of file grid.h.

◆ is_InGrid() [2/2]

bool CSG_Grid_System::is_InGrid ( int  x,
int  y,
int  Rand 
) const
inline

Definition at line 347 of file grid.h.

◆ is_Valid()

◆ operator=()

void CSG_Grid_System::operator= ( const CSG_Grid_System System)

Definition at line 306 of file grid_system.cpp.

References Create().

◆ operator==()

bool CSG_Grid_System::operator== ( const CSG_Grid_System System) const

Definition at line 300 of file grid_system.cpp.

References is_Equal().

◆ Set_Precision()

int CSG_Grid_System::Set_Precision ( int  Decimals)
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.


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