|
DP3
|
The envelope class for a 2-D grid with regular or irregular axes. -. More...
#include <Grid.h>
Public Types | |
| using | Location = std::pair< size_t, size_t > |
| Define Location: A location on a 2-D grid. More... | |
Public Member Functions | |
| Grid () | |
| Default constructor creates empty axes. More... | |
| Grid (Axis::ShPtr first, Axis::ShPtr second) | |
| Create a grid using the given axes. More... | |
| Grid (const std::vector< Box > &domains, bool sort=false) | |
| Grid (const std::vector< Grid > &grids, bool sort=false) | |
| bool | checkIntervals (const Grid &that) const |
| Check if the corresponding intervals in this and that grid are the same. More... | |
| Box | getBoundingBox () const |
| Get the bounding box of the grid. More... | |
| Box | getBoundingBox (const Location &start, const Location &end) const |
| Get the bounding box of part of the grid. More... | |
| Point | getCellCenter (const Location &location) const |
| Get the coordinates of the center of the given cell. More... | |
| unsigned int | getCellId (const Location &location) const |
| Get the cell id from an (x,y) location. More... | |
| Location | getCellLocation (unsigned int id) const |
| Get the (x,y) location from a cell id. More... | |
| bool | isDefault () const |
| Is it the default grid? More... | |
| Location | locate (const Point &point, bool biasRight=true) const |
| std::pair< size_t, size_t > | shape () const |
| Get the grid shape (nx,ny). More... | |
| size_t | size () const |
| Get the total number of cells. More... | |
| void | toDomains (std::vector< Box > &domains) const |
| Convert the grid to domain boxes and append them to the vector. More... | |
| const Axis::ShPtr & | getAxis (size_t n) const |
| const Axis::ShPtr & | operator[] (size_t n) const |
| size_t | nx () const |
| size_t | ny () const |
| Box | getCell (const Location &location) const |
| Box | getCell (unsigned int id) const |
| Grid | subset (const Box &) const |
| Grid | subset (const Box &, Location &index) const |
| Grid | subset (const Location &start, const Location &end) const |
| bool | operator< (const Grid &that) const |
| bool | operator> (const Grid &that) const |
The envelope class for a 2-D grid with regular or irregular axes. -.
| using dp3::parmdb::Grid::Location = std::pair<size_t, size_t> |
Define Location: A location on a 2-D grid.
|
inline |
Default constructor creates empty axes.
|
inline |
Create a grid using the given axes.
| dp3::parmdb::Grid::Grid | ( | const std::vector< Grid > & | grids, |
| bool | sort = false |
||
| ) |
Create a grid from a series of grids. They have to be in order of startY,startX. They are sorted if needed. The grids in the vector must span a rectangular grid, otherwise an exception is thrown. Its axes can be regular (RegularAxis) or irregular (OrderedAxis). The vector can be empty. In that case a default Grid is created.
|
inline |
Create a grid from a series of domains. They have to be in order of startY,startX. They are sorted if needed. The domains in the vector must span a rectangular grid, otherwise an exception is thrown. The vector can be empty. In that case a default Grid is created.
| bool dp3::parmdb::Grid::checkIntervals | ( | const Grid & | that | ) | const |
Check if the corresponding intervals in this and that grid are the same.
|
inline |
Get the given axis.
|
inline |
Get the bounding box of the grid.
Get the bounding box of part of the grid.
Get the blc and trc coordinates of the given cell.
|
inline |
Get the coordinates of the center of the given cell.
|
inline |
Get the cell id from an (x,y) location.
|
inline |
Get the (x,y) location from a cell id.
|
inline |
Is it the default grid?
Give the (x,y) location of the cell containing the given point. If the point is on the edge, the left or right cell is chosen depending on the value of biasRight.
|
inline |
Get the sizes of the axes.
|
inline |
|
inline |
Define an ordering functions to be able to sort grids. The ordering is on startY,startX.
|
inline |
|
inline |
|
inline |
Get the grid shape (nx,ny).
|
inline |
Get the total number of cells.
Apply the given domain to this grid. It means that the subset of this grid is returned which is covered by that domain. Optionally the location of the start point in this grid is filled.
| void dp3::parmdb::Grid::toDomains | ( | std::vector< Box > & | domains | ) | const |
Convert the grid to domain boxes and append them to the vector.