|
| Grid () |
|
| Grid (float cellsize, int sizex, int sizey) |
|
| Grid (const QRectF rect_metric, const float cellsize) |
| create from a metric rect More...
|
|
bool | loadGridFromFile (const QString &fileName) |
| load a grid from an ASCII grid file the coordinates and cell size remain as in the grid file. More...
|
|
| Grid (const Grid< T > &toCopy) |
|
| ~Grid () |
|
void | clear () |
|
bool | setup (const float cellsize, const int sizex, const int sizey) |
|
bool | setup (const QRectF &rect, const double cellsize) |
|
bool | setup (const Grid< T > &source) |
|
void | initialize (const T &value) |
|
void | wipe () |
| write 0-bytes with memcpy to the whole area More...
|
|
void | wipe (const T value) |
| overwrite the whole area with "value" size of T must be the size of "int" ERRORNOUS!!! More...
|
|
void | copy (const Grid< T > &source) |
| copies the content of the source grid to this grid. More...
|
|
Grid< double > * | toDouble () const |
| create a double grid (same size as this grid) and convert this grid to double values. More...
|
|
int | sizeX () const |
|
int | sizeY () const |
|
float | metricSizeX () const |
|
float | metricSizeY () const |
|
QRectF | metricRect () const |
| get the metric rectangle of the grid More...
|
|
void | setMetricRect (QRectF rect) |
| set the metric rectangle. Use with care! No further checks are executed! More...
|
|
QRect | rectangle () const |
| get the rectangle of the grid in terms of indices More...
|
|
float | cellsize () const |
| get the length of one pixel of the grid More...
|
|
int | count () const |
| returns the number of elements of the grid More...
|
|
bool | isEmpty () const |
| returns false if the grid was not setup More...
|
|
const T & | operator() (const int ix, const int iy) const |
| access (const) with index variables. use int. More...
|
|
const T & | operator() (const float x, const float y) const |
| access (const) using metric variables. use float. More...
|
|
const T & | operator[] (const QPoint &p) const |
| access value of grid with a QPoint More...
|
|
T & | operator[] (const int idx) const |
| use the square brackets to access by index More...
|
|
T & | operator[] (const QPointF &p) |
| use the square bracket to access by QPointF More...
|
|
T & | operator[] (const QPoint &p) |
| use the square bracket to access by QPoint More...
|
|
T & | valueAtIndex (const QPoint &pos) |
| value at position defined by a QPoint defining the two indices (x,y) More...
|
|
T & | valueAtIndex (const int ix, const int iy) |
| const value at position defined by indices (x,y) More...
|
|
T & | valueAtIndex (const int index) |
| get a ref ot value at (one-dimensional) index 'index'. More...
|
|
int | index (const int ix, const int iy) |
| get the 0-based index of the cell with indices ix and iy. More...
|
|
int | index (const QPoint &pos) |
| get the 0-based index of the cell at 'pos'. More...
|
|
const T & | constValueAtIndex (const QPoint &pos) const |
| value at position defined by a (integer) QPoint More...
|
|
const T & | constValueAtIndex (const int ix, const int iy) const |
| value at position defined by a pair of integer coordinates More...
|
|
const T & | constValueAtIndex (const int index) const |
| value at position defined by the index within the grid More...
|
|
T & | valueAt (const QPointF &posf) |
| value at position defined by metric coordinates (QPointF) More...
|
|
const T & | constValueAt (const QPointF &posf) const |
| value at position defined by metric coordinates (QPointF) More...
|
|
T & | valueAt (const float x, const float y) |
| value at position defined by metric coordinates (x,y) More...
|
|
const T & | constValueAt (const float x, const float y) const |
| value at position defined by metric coordinates (x,y) More...
|
|
bool | coordValid (const float x, const float y) const |
|
bool | coordValid (const QPointF &pos) const |
|
QPoint | indexAt (const QPointF &pos) const |
| get index of value at position pos (metric) More...
|
|
QPoint | indexOf (const int index) const |
| get index (x/y) of the (linear) index 'index' (0..count-1) More...
|
|
bool | isIndexValid (const QPoint &pos) const |
| return true, if position is within the grid More...
|
|
bool | isIndexValid (const int x, const int y) const |
| return true, if index is within the grid More...
|
|
int | index2 (int idx) const |
| returns the index of an aligned grid (with the same size and matching origin) with the double cell size (e.g. to scale from a 10m grid to a 20m grid) More...
|
|
int | index5 (int idx) const |
| returns the index of an aligned grid (the same size) with the 5 times bigger cells (e.g. to scale from a 2m grid to a 10m grid) More...
|
|
int | index10 (int idx) const |
| returns the index of an aligned grid (the same size) with the 10 times bigger cells (e.g. to scale from a 2m grid to a 20m grid) More...
|
|
void | validate (QPoint &pos) const |
| force More...
|
|
QPointF | cellCenterPoint (const QPoint &pos) const |
| get the (metric) centerpoint of cell with index pos More...
|
|
QPointF | cellCenterPoint (const int &index) const |
| get the metric cell center point of the cell given by index 'index' More...
|
|
QPointF | cellCenterPoint (T *ptr) |
| get the metric cell center point of the cell given py the pointer More...
|
|
QRectF | cellRect (const QPoint &pos) const |
| get the metric rectangle of the cell with index @pos More...
|
|
T * | begin () const |
| get "iterator" pointer More...
|
|
T * | end () const |
| get iterator end-pointer More...
|
|
QPoint | indexOf (const T *element) const |
| retrieve index (x/y) of the pointer element. returns -1/-1 if element is not valid. More...
|
|
T | max () const |
| retrieve the maximum value of a grid More...
|
|
T | min () const |
| retrieve the minimum value of a grid More...
|
|
T | sum () const |
| retrieve the sum of the grid More...
|
|
T | avg () const |
| retrieve the average value of a grid More...
|
|
void | add (const T &summand) |
|
void | multiply (const T &factor) |
|
void | limit (const T min_value, const T max_value) |
| limit each cell value to (including) min_value and (including) max_value More...
|
|
Grid< T > | averaged (const int factor, const int offsetx=0, const int offsety=0) const |
| creates a grid with lower resolution and averaged cell values. More...
|
|
Grid< T > | normalized (const T targetvalue) const |
| normalized returns a normalized grid, in a way that the sum() = More...
|
|
T * | ptr (int x, int y) |
| get a pointer to the element indexed by "x" and "y" More...
|
|
double | distance (const QPoint &p1, const QPoint &p2) |
| distance (metric) between p1 and p2 More...
|
|
const QPoint | randomPosition () const |
| returns a (valid) random position within the grid More...
|
|
int | floodFill (QPoint start, T old_color, T color, int max_fill=-1) |
| applies a flood fill algorithm to the grid starting at 'start' fills the contingent area with value 'old_color' with 'color' (or stops when 'max_fill' pixels have been filled) returns the number of filled pixels More...
|
|
template<class T>
class Grid< T >
Grid class (template).
Orientation The grid is oriented as typically coordinates on the northern hemisphere: higher y-values -> north, higher x-values-> east. The projection is reversed for drawing on screen (Viewport). N (0/2) (1/2) (2/2) W (0/1) (1/1) (2/1) E (0/0) (1/0) (2/0) S