#include <RectangleArray.h>
Public Member Functions | |
RectangleArray (unsigned int width=1, unsigned int height=1, Type *data=NULL) | |
RectangleArray (const RectangleArray< Type > &rectangleArray) | |
~RectangleArray (void) | |
unsigned int | getWidth (void) const |
unsigned int | getHeight (void) const |
Type * | getItem (unsigned int x, unsigned int y) |
Type * | operator[] (int i) |
Type const *const | operator[] (int i) const |
void | setItem (unsigned int x, unsigned int y, Type *item) |
void | resize (unsigned int width, unsigned int height) |
void | printToFile (FILE *f) |
void | saveToFile (const std::string &fileName) |
void | setTo (const Type &value) |
void | setBorderTo (const Type &value) |
Template used for work with dynamically initialized array with dimension 2.
BWTA::RectangleArray< Type >::RectangleArray | ( | unsigned int | width = 1 , |
unsigned int | height = 1 , |
||
Type * | data = NULL |
||
) |
Creates the array with the specified proportions.
width | Width of the new array. |
height | Height of the new array. |
BWTA::RectangleArray< Type >::RectangleArray | ( | const RectangleArray< Type > & | rectangleArray | ) |
Copy constructor
BWTA::RectangleArray< Type >::~RectangleArray | ( | void | ) |
Destorys the array and deletes all content of array.
unsigned int BWTA::RectangleArray< Type >::getHeight | ( | void | ) | const |
Gets the height of the array.
Type * BWTA::RectangleArray< Type >::getItem | ( | unsigned int | x, |
unsigned int | y | ||
) |
Gets item of the array on the specified position.
x | horizontal index of the array position. |
y | vertical index of the array position. |
unsigned int BWTA::RectangleArray< Type >::getWidth | ( | void | ) | const |
Gets the width of the array.
Type* BWTA::RectangleArray< Type >::operator[] | ( | int | i | ) | [inline] |
Type const* const BWTA::RectangleArray< Type >::operator[] | ( | int | i | ) | const [inline] |
void BWTA::RectangleArray< Type >::printToFile | ( | FILE * | f | ) |
void BWTA::RectangleArray< Type >::resize | ( | unsigned int | width, |
unsigned int | height | ||
) |
void BWTA::RectangleArray< Type >::saveToFile | ( | const std::string & | fileName | ) |
void BWTA::RectangleArray< Type >::setBorderTo | ( | const Type & | value | ) |
void BWTA::RectangleArray< Type >::setItem | ( | unsigned int | x, |
unsigned int | y, | ||
Type * | item | ||
) |
Sets item of the array on the specified position.
x | horizontal index of the array position. |
y | vertical index of the array position. |
item | new value of the field. |
void BWTA::RectangleArray< Type >::setTo | ( | const Type & | value | ) |
Sets all fields of the array to the specified value