#include <Arrays.h>
Public Member Functions | |
Array3 (int width, int height, int depth) | |
Allocate a three-dimensional array. | |
Array3 (int width, int height, int depth, T *data) | |
Bind to an existing three-dimensional array. | |
~Array3 () | |
If previously allocated a three-dimensional array, free it. | |
T & | operator() (int col, int row, int depth) |
Return m_data[(row * m_width + col) * m_depth + depth]. | |
const T & | operator() (int col, int row, int depth) const |
Return m_data[(row * m_width + col) * m_depth + depth]. | |
int | getWidth () const |
Retrieve the array width. | |
int | getHeight () const |
Retrieve the array height. | |
int | getDepth () const |
Retrieve the array depth. | |
const T * | getData () const |
Retrieve the array contents. | |
Private Attributes | |
T * | m_data |
The one-dimensional array of data. | |
int | m_width |
Dimension of the one-dimensional array. | |
int | m_height |
Dimension of the one-dimensional array. | |
int | m_depth |
Dimension of the one-dimensional array. | |
bool | m_managed |
Was the array of data allocated inside this class? |
|
Was the array of data allocated inside this class? If true, the data should be deleted when this class is deleted; otherwise, do nothing: the lifetime of the array of data is governed externally. |