1 #ifndef ARRAY2D_PRIVATE_H 2 #define ARRAY2D_PRIVATE_H 10 template<
typename Type >
class Array2D;
44 return mX == other.mX && mY == other.mY && mWidth == other.mWidth && mHeight == other.mHeight;
49 return !(*
this == other);
53 int x()
const {
return mX; }
54 int y()
const {
return mY; }
56 int width()
const {
return mWidth; }
57 int height()
const {
return mHeight; }
60 : mWidth(w), mHeight(h)
79 template<
typename T >
91 static Itr end(
int w,
int h) {
return Itr(w, h, w, 0); }
95 return QPoint(
x(),
y());
99 Itr(
int w,
int h,
int x,
int y)
113 template<
typename Type >
133 QPoint pt = QPoint(
x(),
y());
134 return QPair<QPoint, const Type &> (pt, mArray(pt));
156 #endif // ARRAY2D_PRIVATE_H static Itr end(int w, int h)
Definition: array2d_private.h:91
bool operator==(const Array2DItrTemplate &other) const
Definition: array2d_private.h:42
static Itr start(const Array2D< Type > &arr)
Definition: array2d_private.h:128
int width() const
Definition: array2d_private.h:56
int width() const
Definition: array2d.h:81
Array2DPointWrapper(const Array2D< T > &arr)
Definition: array2d_private.h:80
A lightweight class to allow looping through all the data in an Array2D, outputting QPairs of (positi...
Definition: array2d_private.h:114
Array2DPointAndConstDataWrapper(const Array2D< Type > &arr)
Definition: array2d_private.h:118
static Itr end(const Array2D< Type > &arr)
Definition: array2d_private.h:129
Itr begin() const
Definition: array2d_private.h:123
Array2DItrTemplate(int w, int h, int x, int y)
Definition: array2d_private.h:59
int x() const
Definition: array2d_private.h:53
Itr end() const
Definition: array2d_private.h:86
Definition: array2d_private.h:19
Definition: array2d_private.h:89
const Array2D< Type > & mArray
Definition: array2d_private.h:148
bool operator!=(const Array2DItrTemplate &other) const
Definition: array2d_private.h:47
QPoint operator*() const
Definition: array2d_private.h:93
QPair< QPoint, const Type & > operator*() const
Definition: array2d_private.h:131
The Array2D class is basically a 2D implementation of QVector.
Definition: array2d.h:35
Definition: array2d_private.h:127
Itr begin() const
Definition: array2d_private.h:85
An almost-implemented iterator object that iterates through all positions in a rectangle.
Definition: array2d_private.h:29
int y() const
Definition: array2d_private.h:54
Array2DItrTemplate & operator++()
Definition: array2d_private.h:31
int mWidth
Definition: array2d_private.h:105
Itr end() const
Definition: array2d_private.h:124
static Itr start(int w, int h)
Definition: array2d_private.h:90
int height() const
Definition: array2d_private.h:57
int mHeight
Definition: array2d_private.h:106
A lightweight class to allow looping through all the valid indices in Array2D.
Definition: array2d_private.h:75