9#if !defined(__positerators_h)
10#define __positerators_h
39 void calc_offsets(
int rowoff,
int sliceoff) {
40 RowAdjust = rowoff + (lx0 - lx1);
41 SliceAdjust = sliceoff + rowoff*(ly0 - ly1) + (lx0 - lx1);
47 { this->operator=(source); }
49 int xinit,
int yinit,
int zinit,
50 int x0,
int y0,
int z0,
int x1,
int y1,
int z1,
51 int rowoff,
int sliceoff) :
52 iter(sourceptr), lazyptr(lazyp), x(xinit), y(yinit), z(zinit),
53 lx0(x0), ly0(y0), lz0(z0), lx1(x1), ly1(y1), lz1(z1)
54 { calc_offsets(rowoff,sliceoff); }
60 { x++;
if (x>lx1) { x=lx0; y++;
61 if (y>ly1) { y=ly0; z++;
if (z>lz1) { ++iter; }
62 else { iter+=SliceAdjust; } }
63 else { iter+=RowAdjust; } }
64 else { ++iter;}
return *
this; }
67 {
return iter == it.iter; }
69 {
return iter != it.iter; }
71 inline void getposition(
int &rx,
int &ry,
int &rz)
const
72 { rx= x; ry = y; rz = z; }
73 inline const int& getx()
const {
return x; }
74 inline const int& gety()
const {
return y; }
75 inline const int& getz()
const {
return z; }
79 { iter = source.iter; lazyptr = source.lazyptr;
80 lx0=source.lx0; ly0=source.ly0; lz0=source.lz0;
81 lx1=source.lx1; ly1=source.ly1; lz1=source.lz1;
82 x=source.x; y=source.y; z=source.z;
83 RowAdjust = source.RowAdjust; SliceAdjust = source.SliceAdjust;
86 inline T& operator*()
const
87 { lazyptr->set_whole_cache_validity(
false);
return *iter;}
111 void calc_offsets(
int rowoff,
int sliceoff) {
112 RowAdjust = rowoff + (lx0 - lx1);
113 SliceAdjust = sliceoff + rowoff*(ly0 - ly1) + (lx0 - lx1);
119 { this->operator=(source); }
121 int xinit,
int yinit,
int zinit,
122 int x0,
int y0,
int z0,
int x1,
int y1,
int z1,
123 int rowoff,
int sliceoff) :
124 iter(sourceptr), x(xinit), y(yinit), z(zinit),
125 lx0(x0), ly0(y0), lz0(z0), lx1(x1), ly1(y1), lz1(z1)
126 { calc_offsets(rowoff,sliceoff); }
132 { x++;
if (x>lx1) { x=lx0; y++;
133 if (y>ly1) { y=ly0; z++;
if (z>lz1) { ++iter; }
134 else { iter+=SliceAdjust; } }
135 else { iter+=RowAdjust; } }
136 else { ++iter;}
return *
this; }
139 {
return iter == it.iter; }
141 {
return iter != it.iter; }
143 inline void getposition(
int &rx,
int &ry,
int &rz)
const
144 { rx= x; ry = y; rz = z; }
145 inline const int& getx()
const {
return x; }
146 inline const int& gety()
const {
return y; }
147 inline const int& getz()
const {
return z; }
151 { iter = source.iter;
152 lx0=source.lx0; ly0=source.ly0; lz0=source.lz0;
153 lx1=source.lx1; ly1=source.ly1; lz1=source.lz1;
154 x=source.x; y=source.y; z=source.z;
155 RowAdjust = source.RowAdjust; SliceAdjust = source.SliceAdjust;
158 inline const T& operator*()
const {
return *iter;}
Definition: positerators.h:96
Definition: positerators.h:23