KGrid2D::Generic< Type > Class Template Reference
This template class represents a generic bidimensionnal grid. More...
#include <kgrid2d.h>
Inheritance diagram for KGrid2D::Generic< Type >:

Public Member Functions | |
Generic (uint width=0, uint height=0) | |
virtual | ~Generic () |
void | resize (uint width, uint height) |
void | fill (const Type &value) |
uint | width () const |
uint | height () const |
uint | size () const |
uint | index (const Coord &c) const |
Coord | coord (uint index) const |
const Type & | at (const Coord &c) const |
Type & | at (const Coord &c) |
const Type & | operator[] (const Coord &c) const |
Type & | operator[] (const Coord &c) |
const Type & | at (uint index) const |
Type & | at (uint index) |
const Type & | operator[] (uint index) const |
Type & | operator[] (uint index) |
bool | inside (const Coord &c) const |
void | bound (Coord &c) const |
Protected Attributes | |
uint | _width |
uint | _height |
QValueVector< Type > | _vector |
Detailed Description
template<class Type>
class KGrid2D::Generic< Type >
This template class represents a generic bidimensionnal grid.
Each node contains an element of the template type.
- Since:
- 3.2
Definition at line 96 of file kgrid2d.h.
Constructor & Destructor Documentation
|
Constructor.
|
Member Function Documentation
|
Resize the grid.
Definition at line 111 of file kgrid2d.h. Referenced by KGrid2D::Generic< T >::Generic(). |
|
Fill the nodes with the given value.
|
|
Definition at line 127 of file kgrid2d.h. Referenced by KGrid2D::Generic< T >::Generic(). |
|
Definition at line 131 of file kgrid2d.h. Referenced by KGrid2D::Generic< T >::Generic(). |
|
|
|
Definition at line 140 of file kgrid2d.h. Referenced by KGrid2D::Generic< T >::at(), and KGrid2D::Generic< T >::operator[](). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 188 of file kgrid2d.h. Referenced by KGrid2D::Hexagonal< Type >::neighbours(). |
|
Bound the given coordinate with the grid dimensions.
|
The documentation for this class was generated from the following file: