#pragma region License /****************************************************************************** This file is part of the PolyVox library Copyright (C) 2006 David Williams This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ #pragma endregion #ifndef __VolumeIterator_H__ #define __VolumeIterator_H__ #pragma region Headers #include "PolyVoxForwardDeclarations.h" #include "PolyVoxCStdInt.h" #pragma endregion namespace PolyVox { template class BlockVolumeIterator { public: BlockVolumeIterator(BlockVolume& volume); ~BlockVolumeIterator(); bool operator==(const BlockVolumeIterator& rhs); bool operator<(const BlockVolumeIterator& rhs); bool operator>(const BlockVolumeIterator& rhs); bool operator<=(const BlockVolumeIterator& rhs); bool operator>=(const BlockVolumeIterator& rhs); std::uint16_t getPosX(void) const; std::uint16_t getPosY(void) const; std::uint16_t getPosZ(void) const; VoxelType getSubSampledVoxel(std::uint8_t uLevel) const; const BlockVolume& getVolume(void) const; VoxelType getVoxel(void) const; void setPosition(const Vector3DInt16& v3dNewPos); void setPosition(std::uint16_t xPos, std::uint16_t yPos, std::uint16_t zPos); void setValidRegion(const Region& region); void setValidRegion(std::uint16_t xFirst, std::uint16_t yFirst, std::uint16_t zFirst, std::uint16_t xLast, std::uint16_t yLast, std::uint16_t zLast); void setVoxel(VoxelType tValue); bool isValidForRegion(void) const; void moveForwardInRegionFast(void); bool moveForwardInRegionXYZ(void); VoxelType peekVoxel1nx1ny1nz(void) const; VoxelType peekVoxel1nx1ny0pz(void) const; VoxelType peekVoxel1nx1ny1pz(void) const; VoxelType peekVoxel1nx0py1nz(void) const; VoxelType peekVoxel1nx0py0pz(void) const; VoxelType peekVoxel1nx0py1pz(void) const; VoxelType peekVoxel1nx1py1nz(void) const; VoxelType peekVoxel1nx1py0pz(void) const; VoxelType peekVoxel1nx1py1pz(void) const; VoxelType peekVoxel0px1ny1nz(void) const; VoxelType peekVoxel0px1ny0pz(void) const; VoxelType peekVoxel0px1ny1pz(void) const; VoxelType peekVoxel0px0py1nz(void) const; VoxelType peekVoxel0px0py0pz(void) const; VoxelType peekVoxel0px0py1pz(void) const; VoxelType peekVoxel0px1py1nz(void) const; VoxelType peekVoxel0px1py0pz(void) const; VoxelType peekVoxel0px1py1pz(void) const; VoxelType peekVoxel1px1ny1nz(void) const; VoxelType peekVoxel1px1ny0pz(void) const; VoxelType peekVoxel1px1ny1pz(void) const; VoxelType peekVoxel1px0py1nz(void) const; VoxelType peekVoxel1px0py0pz(void) const; VoxelType peekVoxel1px0py1pz(void) const; VoxelType peekVoxel1px1py1nz(void) const; VoxelType peekVoxel1px1py0pz(void) const; VoxelType peekVoxel1px1py1pz(void) const; private: //The current volume BlockVolume& mVolume; //The current position in the volume std::uint16_t mXPosInVolume; std::uint16_t mYPosInVolume; std::uint16_t mZPosInVolume; //The position of the current block std::uint16_t mXBlock; std::uint16_t mYBlock; std::uint16_t mZBlock; //The offset into the current block std::uint16_t mXPosInBlock; std::uint16_t mYPosInBlock; std::uint16_t mZPosInBlock; //Other current position information VoxelType* mCurrentVoxel; std::uint32_t mBlockIndexInVolume; std::uint32_t mVoxelIndexInBlock; std::uint16_t mXRegionFirst; std::uint16_t mYRegionFirst; std::uint16_t mZRegionFirst; std::uint16_t mXRegionLast; std::uint16_t mYRegionLast; std::uint16_t mZRegionLast; std::uint16_t mXRegionFirstBlock; std::uint16_t mYRegionFirstBlock; std::uint16_t mZRegionFirstBlock; std::uint16_t mXRegionLastBlock; std::uint16_t mYRegionLastBlock; std::uint16_t mZRegionLastBlock; bool mIsValidForRegion; }; } #include "BlockVolumeIterator.inl" #endif