30 template <
typename VoxelType>
47 template <
typename VoxelType>
56 template <
typename VoxelType>
70 template <
typename VoxelType>
81 template <
typename VoxelType>
84 return m_tBorderValue;
93 template <
typename VoxelType>
96 if(this->m_regValidRegion.containsPoint(
Vector3DInt32(uXPos, uYPos, uZPos)))
98 const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner();
100 int32_t iLocalYPos = uYPos - v3dLowerCorner.
getY();
101 int32_t iLocalZPos = uZPos - v3dLowerCorner.
getZ();
106 iLocalYPos * this->getWidth() +
107 iLocalZPos * this->getWidth() * this->getHeight()
112 return this->getBorderValue();
120 template <
typename VoxelType>
123 return getVoxelAt(v3dPos.
getX(), v3dPos.
getY(), v3dPos.
getZ());
129 template <
typename VoxelType>
132 m_tBorderValue = tBorder;
142 template <
typename VoxelType>
145 if(this->m_regValidRegion.containsPoint(
Vector3DInt32(uXPos, uYPos, uZPos)))
147 const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner();
148 int32_t iLocalXPos = uXPos - v3dLowerCorner.
getX();
149 int32_t iLocalYPos = uYPos - v3dLowerCorner.
getY();
150 int32_t iLocalZPos = uZPos - v3dLowerCorner.
getZ();
155 iLocalYPos * this->getWidth() +
156 iLocalZPos * this->getWidth() * this->getHeight()
173 template <
typename VoxelType>
176 return setVoxelAt(v3dPos.
getX(), v3dPos.
getY(), v3dPos.
getZ(), tValue);
182 template <
typename VoxelType>
185 this->m_regValidRegion = regValidRegion;
188 assert(this->getWidth() > 0);
189 assert(this->getHeight() > 0);
190 assert(this->getDepth() > 0);
193 m_pData =
new VoxelType[this->getWidth() * this->getHeight()* this->getDepth()];
196 this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth());
197 this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth());
198 this->m_fDiagonalLength = sqrtf(static_cast<float>(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth()));
204 template <
typename VoxelType>
207 return this->getWidth() * this->getHeight() * this->getDepth() *
sizeof(
VoxelType);