24 #define BORDER_LOWX(val) (val > this->mVolume->getEnclosingRegion().getLowerCorner().getX())
25 #define BORDER_HIGHX(val) (val < this->mVolume->getEnclosingRegion().getUpperCorner().getX())
26 #define BORDER_LOWY(val) (val > this->mVolume->getEnclosingRegion().getLowerCorner().getY())
27 #define BORDER_HIGHY(val) (val < this->mVolume->getEnclosingRegion().getUpperCorner().getY())
28 #define BORDER_LOWZ(val) (val > this->mVolume->getEnclosingRegion().getLowerCorner().getZ())
29 #define BORDER_HIGHZ(val) (val < this->mVolume->getEnclosingRegion().getUpperCorner().getZ())
33 template <
typename VoxelType>
37 ,m_bIsCurrentPositionValidInX(false)
38 ,m_bIsCurrentPositionValidInY(false)
39 ,m_bIsCurrentPositionValidInZ(false)
43 template <
typename VoxelType>
48 template <
typename VoxelType>
51 return (m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ) ? *mCurrentVoxel : this->mVolume->
getBorderValue();
54 template <
typename VoxelType>
57 setPosition(v3dNewPos.
getX(), v3dNewPos.
getY(), v3dNewPos.
getZ());
60 template <
typename VoxelType>
63 this->mXPosInVolume = xPos;
64 this->mYPosInVolume = yPos;
65 this->mZPosInVolume = zPos;
67 const Vector3DInt32& v3dLowerCorner = this->mVolume->m_regValidRegion.getLowerCorner();
72 const int32_t uVoxelIndex = iLocalXPos +
73 iLocalYPos * this->mVolume->getWidth() +
74 iLocalZPos * this->mVolume->getWidth() * this->mVolume->getHeight();
76 mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex;
78 m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(xPos);
79 m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(yPos);
80 m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(zPos);
83 template <
typename VoxelType>
87 if(m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ)
89 *mCurrentVoxel = tValue;
98 template <
typename VoxelType>
101 this->mXPosInVolume++;
106 template <
typename VoxelType>
109 this->mYPosInVolume++;
110 mCurrentVoxel += this->mVolume->
getWidth();
111 m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(this->mYPosInVolume);
114 template <
typename VoxelType>
117 this->mZPosInVolume++;
118 mCurrentVoxel += this->mVolume->
getWidth() * this->mVolume->getHeight();
119 m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(this->mZPosInVolume);
122 template <
typename VoxelType>
125 this->mXPosInVolume--;
130 template <
typename VoxelType>
133 this->mYPosInVolume--;
134 mCurrentVoxel -= this->mVolume->
getWidth();
135 m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(this->mYPosInVolume);
138 template <
typename VoxelType>
141 this->mZPosInVolume--;
142 mCurrentVoxel -= this->mVolume->
getWidth() * this->mVolume->getHeight();
143 m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(this->mZPosInVolume);
146 template <
typename VoxelType>
151 return *(mCurrentVoxel - 1 - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight());
153 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume-1);
156 template <
typename VoxelType>
161 return *(mCurrentVoxel - 1 - this->mVolume->getWidth());
163 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume);
166 template <
typename VoxelType>
171 return *(mCurrentVoxel - 1 - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight());
173 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume-1,this->mZPosInVolume+1);
176 template <
typename VoxelType>
181 return *(mCurrentVoxel - 1 - this->mVolume->getWidth() * this->mVolume->getHeight());
183 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume-1);
186 template <
typename VoxelType>
191 return *(mCurrentVoxel - 1);
193 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume);
196 template <
typename VoxelType>
201 return *(mCurrentVoxel - 1 + this->mVolume->getWidth() * this->mVolume->getHeight());
203 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume,this->mZPosInVolume+1);
206 template <
typename VoxelType>
211 return *(mCurrentVoxel - 1 + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight());
213 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume-1);
216 template <
typename VoxelType>
221 return *(mCurrentVoxel - 1 + this->mVolume->getWidth());
223 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume);
226 template <
typename VoxelType>
231 return *(mCurrentVoxel - 1 + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight());
233 return this->mVolume->
getVoxelAt(this->mXPosInVolume-1,this->mYPosInVolume+1,this->mZPosInVolume+1);
238 template <
typename VoxelType>
243 return *(mCurrentVoxel - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight());
245 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume-1);
248 template <
typename VoxelType>
253 return *(mCurrentVoxel - this->mVolume->getWidth());
255 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume);
258 template <
typename VoxelType>
263 return *(mCurrentVoxel - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight());
265 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume-1,this->mZPosInVolume+1);
268 template <
typename VoxelType>
273 return *(mCurrentVoxel - this->mVolume->getWidth() * this->mVolume->getHeight());
275 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume-1);
278 template <
typename VoxelType>
281 return *mCurrentVoxel;
284 template <
typename VoxelType>
289 return *(mCurrentVoxel + this->mVolume->getWidth() * this->mVolume->getHeight());
291 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume,this->mZPosInVolume+1);
294 template <
typename VoxelType>
299 return *(mCurrentVoxel + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight());
301 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume-1);
304 template <
typename VoxelType>
309 return *(mCurrentVoxel + this->mVolume->getWidth());
311 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume);
314 template <
typename VoxelType>
319 return *(mCurrentVoxel + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight());
321 return this->mVolume->
getVoxelAt(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume+1);
326 template <
typename VoxelType>
331 return *(mCurrentVoxel + 1 - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight());
333 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume-1);
336 template <
typename VoxelType>
341 return *(mCurrentVoxel + 1 - this->mVolume->getWidth());
343 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume);
346 template <
typename VoxelType>
351 return *(mCurrentVoxel + 1 - this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight());
353 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume-1,this->mZPosInVolume+1);
356 template <
typename VoxelType>
361 return *(mCurrentVoxel + 1 - this->mVolume->getWidth() * this->mVolume->getHeight());
363 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume-1);
366 template <
typename VoxelType>
371 return *(mCurrentVoxel + 1);
373 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume);
376 template <
typename VoxelType>
381 return *(mCurrentVoxel + 1 + this->mVolume->getWidth() * this->mVolume->getHeight());
383 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume,this->mZPosInVolume+1);
386 template <
typename VoxelType>
391 return *(mCurrentVoxel + 1 + this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight());
393 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume-1);
396 template <
typename VoxelType>
401 return *(mCurrentVoxel + 1 + this->mVolume->getWidth());
403 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume);
406 template <
typename VoxelType>
411 return *(mCurrentVoxel + 1 + this->mVolume->getWidth() + this->mVolume->getWidth() * this->mVolume->getHeight());
413 return this->mVolume->
getVoxelAt(this->mXPosInVolume+1,this->mYPosInVolume+1,this->mZPosInVolume+1);