diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 687b7154..8c4c8b88 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -30,8 +30,8 @@ SET(CORE_INC_FILES include/Vector.inl include/Volume.h include/Volume.inl - include/VolumeIterator.h - include/VolumeIterator.inl + include/VolumeSampler.h + include/VolumeSampler.inl include/VoxelFilters.h ) diff --git a/library/PolyVoxCore/include/GradientEstimators.h b/library/PolyVoxCore/include/GradientEstimators.h index b55848f3..79284ee9 100644 --- a/library/PolyVoxCore/include/GradientEstimators.h +++ b/library/PolyVoxCore/include/GradientEstimators.h @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __PolyVox_GradientEstimators_H__ #define __PolyVox_GradientEstimators_H__ -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include @@ -38,18 +38,18 @@ namespace PolyVox }; template - Vector3DFloat computeCentralDifferenceGradient(const VolumeIterator& volIter); + Vector3DFloat computeCentralDifferenceGradient(const VolumeSampler& volIter); template - Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeIterator& volIter); + Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeSampler& volIter); template - Vector3DFloat computeDecimatedCentralDifferenceGradient(VolumeIterator& volIter); + Vector3DFloat computeDecimatedCentralDifferenceGradient(VolumeSampler& volIter); template - Vector3DFloat computeSobelGradient(const VolumeIterator& volIter); + Vector3DFloat computeSobelGradient(const VolumeSampler& volIter); template - Vector3DFloat computeSmoothSobelGradient(VolumeIterator& volIter); + Vector3DFloat computeSmoothSobelGradient(VolumeSampler& volIter); POLYVOXCORE_API void computeNormalsForVertices(Volume* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod); POLYVOXCORE_API Vector3DFloat computeNormal(Volume* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); diff --git a/library/PolyVoxCore/include/GradientEstimators.inl b/library/PolyVoxCore/include/GradientEstimators.inl index d4770988..1a1ac2f1 100644 --- a/library/PolyVoxCore/include/GradientEstimators.inl +++ b/library/PolyVoxCore/include/GradientEstimators.inl @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { template - Vector3DFloat computeCentralDifferenceGradient(const VolumeIterator& volIter) + Vector3DFloat computeCentralDifferenceGradient(const VolumeSampler& volIter) { //FIXME - bitwise way of doing this? VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; @@ -45,7 +45,7 @@ namespace PolyVox } template - Vector3DFloat computeDecimatedCentralDifferenceGradient(const VolumeIterator& volIter) + Vector3DFloat computeDecimatedCentralDifferenceGradient(const VolumeSampler& volIter) { const uint16_t x = volIter.getPosX(); const uint16_t y = volIter.getPosY(); @@ -70,7 +70,7 @@ namespace PolyVox } template - Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeIterator& volIter) + Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeSampler& volIter) { uint16_t initialX = volIter.getPosX(); uint16_t initialY = volIter.getPosY(); @@ -101,7 +101,7 @@ namespace PolyVox } template - Vector3DFloat computeSobelGradient(const VolumeIterator& volIter) + Vector3DFloat computeSobelGradient(const VolumeSampler& volIter) { static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; @@ -184,7 +184,7 @@ namespace PolyVox } template - Vector3DFloat computeSmoothSobelGradient(VolumeIterator& volIter) + Vector3DFloat computeSmoothSobelGradient(VolumeSampler& volIter) { static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, { {3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } }; diff --git a/library/PolyVoxCore/include/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxForwardDeclarations.h index 7d0ab52a..01c318e0 100644 --- a/library/PolyVoxCore/include/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxForwardDeclarations.h @@ -52,7 +52,7 @@ namespace PolyVox typedef Vector<3,uint32_t> Vector3DUint32; //---------------------------- - template class VolumeIterator; + template class VolumeSampler; } #endif diff --git a/library/PolyVoxCore/include/PolyVoxImpl/Block.h b/library/PolyVoxCore/include/PolyVoxImpl/Block.h index 3cdfdb67..a9c9a474 100644 --- a/library/PolyVoxCore/include/PolyVoxImpl/Block.h +++ b/library/PolyVoxCore/include/PolyVoxImpl/Block.h @@ -33,8 +33,8 @@ namespace PolyVox template class Block { - //Make VolumeIterator a friend - friend class VolumeIterator; + //Make VolumeSampler a friend + friend class VolumeSampler; public: Block(uint16_t uSideLength); Block(const Block& rhs); diff --git a/library/PolyVoxCore/include/PolyVoxImpl/DecimatedSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxImpl/DecimatedSurfaceExtractor.h index 0fcbaac0..524b4469 100644 --- a/library/PolyVoxCore/include/PolyVoxImpl/DecimatedSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxImpl/DecimatedSurfaceExtractor.h @@ -34,9 +34,9 @@ namespace PolyVox uint32_t getDecimatedIndex(uint32_t x, uint32_t y, uint32_t regionWidth); void extractDecimatedSurfaceImpl(Volume* volumeData, uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); - uint32_t computeDecimatedBitmaskForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); - void generateDecimatedIndicesForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); - void generateDecimatedVerticesForSlice(VolumeIterator& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); + uint32_t computeDecimatedBitmaskForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); + void generateDecimatedIndicesForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); + void generateDecimatedVerticesForSlice(VolumeSampler& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); } #endif diff --git a/library/PolyVoxCore/include/PolyVoxImpl/FastSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxImpl/FastSurfaceExtractor.h index 5ae0d479..b5593144 100644 --- a/library/PolyVoxCore/include/PolyVoxImpl/FastSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxImpl/FastSurfaceExtractor.h @@ -33,9 +33,9 @@ namespace PolyVox { void extractFastSurfaceImpl(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); uint32_t getIndex(uint32_t x, uint32_t y, uint32_t regionWidth); - uint32_t computeRoughBitmaskForSlice(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); - void generateRoughIndicesForSlice(VolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); - void generateRoughVerticesForSlice(VolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); + uint32_t computeRoughBitmaskForSlice(VolumeSampler& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); + void generateRoughIndicesForSlice(VolumeSampler& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); + void generateRoughVerticesForSlice(VolumeSampler& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); } #endif diff --git a/library/PolyVoxCore/include/SurfaceExtractor.h b/library/PolyVoxCore/include/SurfaceExtractor.h index ed9bbc31..2135d2b6 100644 --- a/library/PolyVoxCore/include/SurfaceExtractor.h +++ b/library/PolyVoxCore/include/SurfaceExtractor.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma region Headers #include "PolyVoxForwardDeclarations.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include "PolyVoxImpl/TypeDef.h" #include "PolyVoxImpl/CPlusPlusZeroXSupport.h" @@ -47,19 +47,19 @@ namespace PolyVox uint8_t m_uLodLevel; Volume m_volData; - VolumeIterator m_iterVolume; + VolumeSampler m_iterVolume; uint32_t getIndex(uint32_t x, uint32_t y, uint32_t regionWidth); void extractSurfaceForRegionLevel0(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); - uint32_t computeBitmaskForSliceLevel0(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); - void generateIndicesForSliceLevel0(VolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); - void generateVerticesForSliceLevel0(VolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); + uint32_t computeBitmaskForSliceLevel0(VolumeSampler& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); + void generateIndicesForSliceLevel0(VolumeSampler& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); + void generateVerticesForSliceLevel0(VolumeSampler& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); void extractDecimatedSurfaceImpl(Volume* volumeData, uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); - uint32_t computeDecimatedBitmaskForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); - void generateDecimatedIndicesForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); - void generateDecimatedVerticesForSlice(VolumeIterator& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); + uint32_t computeDecimatedBitmaskForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask); + void generateDecimatedIndicesForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]); + void generateDecimatedVerticesForSlice(VolumeSampler& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]); }; } diff --git a/library/PolyVoxCore/include/Volume.h b/library/PolyVoxCore/include/Volume.h index d132fe91..fe4fe524 100644 --- a/library/PolyVoxCore/include/Volume.h +++ b/library/PolyVoxCore/include/Volume.h @@ -106,8 +106,8 @@ namespace PolyVox template class Volume { - //Make VolumeIterator a friend - friend class VolumeIterator; + //Make VolumeSampler a friend + friend class VolumeSampler; public: ///Constructor diff --git a/library/PolyVoxCore/include/Volume.inl b/library/PolyVoxCore/include/Volume.inl index dcfdc944..898d7281 100644 --- a/library/PolyVoxCore/include/Volume.inl +++ b/library/PolyVoxCore/include/Volume.inl @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma region Headers #include "PolyVoxImpl/Block.h" #include "Log.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include "Region.h" #include "Vector.h" diff --git a/library/PolyVoxCore/include/VolumeIterator.h b/library/PolyVoxCore/include/VolumeSampler.h similarity index 86% rename from library/PolyVoxCore/include/VolumeIterator.h rename to library/PolyVoxCore/include/VolumeSampler.h index cd276ea1..5795df5d 100644 --- a/library/PolyVoxCore/include/VolumeIterator.h +++ b/library/PolyVoxCore/include/VolumeSampler.h @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ #pragma endregion -#ifndef __VolumeIterator_H__ -#define __VolumeIterator_H__ +#ifndef __VolumeSampler_H__ +#define __VolumeSampler_H__ #pragma region Headers #include "PolyVoxForwardDeclarations.h" @@ -31,17 +31,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { template - class VolumeIterator + class VolumeSampler { public: - VolumeIterator(Volume& volume); - ~VolumeIterator(); + VolumeSampler(Volume& volume); + ~VolumeSampler(); - bool operator==(const VolumeIterator& rhs); - bool operator<(const VolumeIterator& rhs); - bool operator>(const VolumeIterator& rhs); - bool operator<=(const VolumeIterator& rhs); - bool operator>=(const VolumeIterator& rhs); + bool operator==(const VolumeSampler& rhs); + bool operator<(const VolumeSampler& rhs); + bool operator>(const VolumeSampler& rhs); + bool operator<=(const VolumeSampler& rhs); + bool operator>=(const VolumeSampler& rhs); uint16_t getPosX(void) const; uint16_t getPosY(void) const; @@ -113,6 +113,6 @@ namespace PolyVox }; } -#include "VolumeIterator.inl" +#include "VolumeSampler.inl" #endif diff --git a/library/PolyVoxCore/include/VolumeIterator.inl b/library/PolyVoxCore/include/VolumeSampler.inl similarity index 80% rename from library/PolyVoxCore/include/VolumeIterator.inl rename to library/PolyVoxCore/include/VolumeSampler.inl index c0e429fd..ce363db1 100644 --- a/library/PolyVoxCore/include/VolumeIterator.inl +++ b/library/PolyVoxCore/include/VolumeSampler.inl @@ -32,20 +32,20 @@ namespace PolyVox { #pragma region Constructors/Destructors template - VolumeIterator::VolumeIterator(Volume& volume) + VolumeSampler::VolumeSampler(Volume& volume) :mVolume(volume) { } template - VolumeIterator::~VolumeIterator() + VolumeSampler::~VolumeSampler() { } #pragma endregion #pragma region Operators template - bool VolumeIterator::operator==(const VolumeIterator& rhs) + bool VolumeSampler::operator==(const VolumeSampler& rhs) { //We could just check whether the two mCurrentVoxel pointers are equal, but this may not //be safe in the future if we decide to allow blocks to be shared between volumes @@ -62,7 +62,7 @@ namespace PolyVox } template - bool VolumeIterator::operator<(const VolumeIterator& rhs) + bool VolumeSampler::operator<(const VolumeSampler& rhs) { assert(&mVolume == &rhs.mVolume); @@ -85,21 +85,21 @@ namespace PolyVox } template - bool VolumeIterator::operator>(const VolumeIterator& rhs) + bool VolumeSampler::operator>(const VolumeSampler& rhs) { assert(&mVolume == &rhs.mVolume); return (rhs < *this); } template - bool VolumeIterator::operator<=(const VolumeIterator& rhs) + bool VolumeSampler::operator<=(const VolumeSampler& rhs) { assert(&mVolume == &rhs.mVolume); return (rhs > *this); } template - bool VolumeIterator::operator>=(const VolumeIterator& rhs) + bool VolumeSampler::operator>=(const VolumeSampler& rhs) { assert(&mVolume == &rhs.mVolume); return (rhs < *this); @@ -108,25 +108,25 @@ namespace PolyVox #pragma region Getters template - uint16_t VolumeIterator::getPosX(void) const + uint16_t VolumeSampler::getPosX(void) const { return mXPosInVolume; } template - uint16_t VolumeIterator::getPosY(void) const + uint16_t VolumeSampler::getPosY(void) const { return mYPosInVolume; } template - uint16_t VolumeIterator::getPosZ(void) const + uint16_t VolumeSampler::getPosZ(void) const { return mZPosInVolume; } template - VoxelType VolumeIterator::getSubSampledVoxel(uint8_t uLevel) const + VoxelType VolumeSampler::getSubSampledVoxel(uint8_t uLevel) const { if(uLevel == 0) { @@ -164,7 +164,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::getSubSampledVoxelWithBoundsCheck(uint8_t uLevel) const + VoxelType VolumeSampler::getSubSampledVoxelWithBoundsCheck(uint8_t uLevel) const { const uint8_t uSize = 1 << uLevel; @@ -183,13 +183,13 @@ namespace PolyVox } template - const Volume& VolumeIterator::getVolume(void) const + const Volume& VolumeSampler::getVolume(void) const { return mVolume; } template - VoxelType VolumeIterator::getVoxel(void) const + VoxelType VolumeSampler::getVoxel(void) const { return *mCurrentVoxel; } @@ -197,13 +197,13 @@ namespace PolyVox #pragma region Setters template - void VolumeIterator::setPosition(const Vector3DInt16& v3dNewPos) + void VolumeSampler::setPosition(const Vector3DInt16& v3dNewPos) { setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); } template - void VolumeIterator::setPosition(uint16_t xPos, uint16_t yPos, uint16_t zPos) + void VolumeSampler::setPosition(uint16_t xPos, uint16_t yPos, uint16_t zPos) { mXPosInVolume = xPos; mYPosInVolume = yPos; @@ -232,7 +232,7 @@ namespace PolyVox #pragma region Other template - void VolumeIterator::movePositiveX(void) + void VolumeSampler::movePositiveX(void) { ++mXPosInVolume; if(mXPosInVolume % mVolume.m_uBlockSideLength == 0) @@ -251,7 +251,7 @@ namespace PolyVox #pragma region Peekers template - VoxelType VolumeIterator::peekVoxel1nx1ny1nz(void) const + VoxelType VolumeSampler::peekVoxel1nx1ny1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -261,7 +261,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx1ny0pz(void) const + VoxelType VolumeSampler::peekVoxel1nx1ny0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -271,7 +271,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx1ny1pz(void) const + VoxelType VolumeSampler::peekVoxel1nx1ny1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -281,7 +281,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx0py1nz(void) const + VoxelType VolumeSampler::peekVoxel1nx0py1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -291,7 +291,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx0py0pz(void) const + VoxelType VolumeSampler::peekVoxel1nx0py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -301,7 +301,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx0py1pz(void) const + VoxelType VolumeSampler::peekVoxel1nx0py1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -311,7 +311,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx1py1nz(void) const + VoxelType VolumeSampler::peekVoxel1nx1py1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -321,7 +321,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx1py0pz(void) const + VoxelType VolumeSampler::peekVoxel1nx1py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -331,7 +331,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1nx1py1pz(void) const + VoxelType VolumeSampler::peekVoxel1nx1py1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -343,7 +343,7 @@ namespace PolyVox ////////////////////////////////////////////////////////////////////////// template - VoxelType VolumeIterator::peekVoxel0px1ny1nz(void) const + VoxelType VolumeSampler::peekVoxel0px1ny1nz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -353,7 +353,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel0px1ny0pz(void) const + VoxelType VolumeSampler::peekVoxel0px1ny0pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -363,7 +363,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel0px1ny1pz(void) const + VoxelType VolumeSampler::peekVoxel0px1ny1pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -373,7 +373,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel0px0py1nz(void) const + VoxelType VolumeSampler::peekVoxel0px0py1nz(void) const { if((mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -383,13 +383,13 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel0px0py0pz(void) const + VoxelType VolumeSampler::peekVoxel0px0py0pz(void) const { return *mCurrentVoxel; } template - VoxelType VolumeIterator::peekVoxel0px0py1pz(void) const + VoxelType VolumeSampler::peekVoxel0px0py1pz(void) const { if((mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -399,7 +399,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel0px1py1nz(void) const + VoxelType VolumeSampler::peekVoxel0px1py1nz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -409,7 +409,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel0px1py0pz(void) const + VoxelType VolumeSampler::peekVoxel0px1py0pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -419,7 +419,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel0px1py1pz(void) const + VoxelType VolumeSampler::peekVoxel0px1py1pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -431,7 +431,7 @@ namespace PolyVox ////////////////////////////////////////////////////////////////////////// template - VoxelType VolumeIterator::peekVoxel1px1ny1nz(void) const + VoxelType VolumeSampler::peekVoxel1px1ny1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -441,7 +441,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px1ny0pz(void) const + VoxelType VolumeSampler::peekVoxel1px1ny0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -451,7 +451,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px1ny1pz(void) const + VoxelType VolumeSampler::peekVoxel1px1ny1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -461,7 +461,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px0py1nz(void) const + VoxelType VolumeSampler::peekVoxel1px0py1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -471,7 +471,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px0py0pz(void) const + VoxelType VolumeSampler::peekVoxel1px0py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -481,7 +481,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px0py1pz(void) const + VoxelType VolumeSampler::peekVoxel1px0py1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -491,7 +491,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px1py1nz(void) const + VoxelType VolumeSampler::peekVoxel1px1py1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -501,7 +501,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px1py0pz(void) const + VoxelType VolumeSampler::peekVoxel1px1py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -511,7 +511,7 @@ namespace PolyVox } template - VoxelType VolumeIterator::peekVoxel1px1py1pz(void) const + VoxelType VolumeSampler::peekVoxel1px1py1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { diff --git a/library/PolyVoxCore/include/VoxelFilters.h b/library/PolyVoxCore/include/VoxelFilters.h index 15075935..d433ac1d 100644 --- a/library/PolyVoxCore/include/VoxelFilters.h +++ b/library/PolyVoxCore/include/VoxelFilters.h @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - float computeSmoothedVoxel(VolumeIterator& volIter); + float computeSmoothedVoxel(VolumeSampler& volIter); } #endif \ No newline at end of file diff --git a/library/PolyVoxCore/source/GradientEstimators.cpp b/library/PolyVoxCore/source/GradientEstimators.cpp index 6ae98128..edd9ae57 100644 --- a/library/PolyVoxCore/source/GradientEstimators.cpp +++ b/library/PolyVoxCore/source/GradientEstimators.cpp @@ -16,7 +16,7 @@ namespace PolyVox const Vector3DFloat& v3dPos = iterSurfaceVertex->getPosition() + static_cast(isp.m_v3dRegionPosition); const Vector3DInt32 v3dFloor = static_cast(v3dPos); - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); //Check all corners are within the volume, allowing a boundary for gradient estimation bool lowerCornerInside = volumeData->getEnclosingRegion().containsPoint(v3dFloor,2); @@ -42,7 +42,7 @@ namespace PolyVox { Vector3DFloat v3dGradient; //To store the result - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); const Vector3DInt32 v3dFloor = static_cast(v3dPos); diff --git a/library/PolyVoxCore/source/PolyVoxImpl/DecimatedSurfaceExtractor.cpp b/library/PolyVoxCore/source/PolyVoxImpl/DecimatedSurfaceExtractor.cpp index 9b963a4b..9f195379 100644 --- a/library/PolyVoxCore/source/PolyVoxImpl/DecimatedSurfaceExtractor.cpp +++ b/library/PolyVoxCore/source/PolyVoxImpl/DecimatedSurfaceExtractor.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "IndexedSurfacePatch.h" #include "PolyVoxImpl/MarchingCubesTables.h" #include "Region.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include @@ -77,7 +77,7 @@ namespace PolyVox regSlice0.setUpperCorner(v3dUpperCorner); //Iterator to access the volume data - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); //Compute bitmask for initial slice uint32_t uNoOfNonEmptyCellsForSlice0 = computeDecimatedBitmaskForSlice(volIter, uLevel, regSlice0, offset, bitmask0, 0); @@ -132,7 +132,7 @@ namespace PolyVox }*/ } - uint32_t computeDecimatedBitmaskForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) + uint32_t computeDecimatedBitmaskForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; uint32_t uNoOfNonEmptyCells = 0; @@ -374,7 +374,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void generateDecimatedVerticesForSlice(VolumeIterator& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) + void generateDecimatedVerticesForSlice(VolumeSampler& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; @@ -445,7 +445,7 @@ namespace PolyVox } } - void generateDecimatedIndicesForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) + void generateDecimatedIndicesForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; uint32_t indlist[12]; diff --git a/library/PolyVoxCore/source/PolyVoxImpl/FastSurfaceExtractor.cpp b/library/PolyVoxCore/source/PolyVoxImpl/FastSurfaceExtractor.cpp index 81df910f..1fed6d71 100644 --- a/library/PolyVoxCore/source/PolyVoxImpl/FastSurfaceExtractor.cpp +++ b/library/PolyVoxCore/source/PolyVoxImpl/FastSurfaceExtractor.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxImpl/FastSurfaceExtractor.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include "IndexedSurfacePatch.h" #include "PolyVoxImpl/MarchingCubesTables.h" #include "SurfaceVertex.h" @@ -59,7 +59,7 @@ namespace PolyVox regSlice0.setUpperCorner(Vector3DInt32(regSlice0.getUpperCorner().getX(),regSlice0.getUpperCorner().getY(),regSlice0.getLowerCorner().getZ())); //Iterator to access the volume data - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); //Compute bitmask for initial slice uint32_t uNoOfNonEmptyCellsForSlice0 = computeRoughBitmaskForSlice(volIter, regSlice0, offset, bitmask0, 0); @@ -110,7 +110,7 @@ namespace PolyVox return x + (y * (regionWidth+1)); } - uint32_t computeRoughBitmaskForSlice(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) + uint32_t computeRoughBitmaskForSlice(VolumeSampler& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) { uint32_t uNoOfNonEmptyCells = 0; @@ -348,7 +348,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void generateRoughVerticesForSlice(VolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) + void generateRoughVerticesForSlice(VolumeSampler& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) { //Iterate over each cell in the region for(uint16_t uYVolSpace = regSlice.getLowerCorner().getY(); uYVolSpace <= regSlice.getUpperCorner().getY(); uYVolSpace++) @@ -423,7 +423,7 @@ namespace PolyVox } } - void generateRoughIndicesForSlice(VolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) + void generateRoughIndicesForSlice(VolumeSampler& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) { uint32_t indlist[12]; diff --git a/library/PolyVoxCore/source/SurfaceAdjusters.cpp b/library/PolyVoxCore/source/SurfaceAdjusters.cpp index 7cf1a488..e0da1c4f 100644 --- a/library/PolyVoxCore/source/SurfaceAdjusters.cpp +++ b/library/PolyVoxCore/source/SurfaceAdjusters.cpp @@ -1,6 +1,6 @@ #include "SurfaceAdjusters.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include "GradientEstimators.h" #include "IndexedSurfacePatch.h" #include "PolyVoxImpl/Utility.h" @@ -17,7 +17,7 @@ namespace PolyVox const uint8_t uSmoothingFactor = 2; const float fThreshold = 0.5f; - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); std::vector& vecVertices = isp.getRawVertexData(); std::vector::iterator iterSurfaceVertex = vecVertices.begin(); @@ -78,7 +78,7 @@ namespace PolyVox void adjustDecimatedGeometry(Volume* volumeData, IndexedSurfacePatch& isp, uint8_t val) { - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); std::vector& vecVertices = isp.getRawVertexData(); std::vector::iterator iterSurfaceVertex = vecVertices.begin(); @@ -87,7 +87,7 @@ namespace PolyVox Vector3DFloat v3dPos = iterSurfaceVertex->getPosition() + static_cast(isp.m_v3dRegionPosition); Vector3DInt32 v3dFloor = static_cast(v3dPos); - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); //Check all corners are within the volume, allowing a boundary for gradient estimation bool lowerCornerInside = volumeData->getEnclosingRegion().containsPoint(v3dFloor,1); diff --git a/library/PolyVoxCore/source/SurfaceExtractor.cpp b/library/PolyVoxCore/source/SurfaceExtractor.cpp index 45725a85..e5a81131 100644 --- a/library/PolyVoxCore/source/SurfaceExtractor.cpp +++ b/library/PolyVoxCore/source/SurfaceExtractor.cpp @@ -75,7 +75,7 @@ namespace PolyVox regSlice0.setUpperCorner(Vector3DInt32(regSlice0.getUpperCorner().getX(),regSlice0.getUpperCorner().getY(),regSlice0.getLowerCorner().getZ())); //Iterator to access the volume data - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); //Compute bitmask for initial slice uint32_t uNoOfNonEmptyCellsForSlice0 = computeBitmaskForSliceLevel0(volIter, regSlice0, offset, bitmask0, 0); @@ -121,7 +121,7 @@ namespace PolyVox delete[] vertexIndicesZ1; } - uint32_t SurfaceExtractor::computeBitmaskForSliceLevel0(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) + uint32_t SurfaceExtractor::computeBitmaskForSliceLevel0(VolumeSampler& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) { uint32_t uNoOfNonEmptyCells = 0; @@ -359,7 +359,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void SurfaceExtractor::generateVerticesForSliceLevel0(VolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) + void SurfaceExtractor::generateVerticesForSliceLevel0(VolumeSampler& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) { //Iterate over each cell in the region for(uint16_t uYVolSpace = regSlice.getLowerCorner().getY(); uYVolSpace <= regSlice.getUpperCorner().getY(); uYVolSpace++) @@ -434,7 +434,7 @@ namespace PolyVox } } - void SurfaceExtractor::generateIndicesForSliceLevel0(VolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) + void SurfaceExtractor::generateIndicesForSliceLevel0(VolumeSampler& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) { uint32_t indlist[12]; @@ -588,7 +588,7 @@ namespace PolyVox regSlice0.setUpperCorner(v3dUpperCorner); //Iterator to access the volume data - VolumeIterator volIter(*volumeData); + VolumeSampler volIter(*volumeData); //Compute bitmask for initial slice uint32_t uNoOfNonEmptyCellsForSlice0 = computeDecimatedBitmaskForSlice(volIter, uLevel, regSlice0, offset, bitmask0, 0); @@ -643,7 +643,7 @@ namespace PolyVox }*/ } - uint32_t SurfaceExtractor::computeDecimatedBitmaskForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) + uint32_t SurfaceExtractor::computeDecimatedBitmaskForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; uint32_t uNoOfNonEmptyCells = 0; @@ -885,7 +885,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void SurfaceExtractor::generateDecimatedVerticesForSlice(VolumeIterator& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) + void SurfaceExtractor::generateDecimatedVerticesForSlice(VolumeSampler& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; @@ -956,7 +956,7 @@ namespace PolyVox } } - void SurfaceExtractor::generateDecimatedIndicesForSlice(VolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) + void SurfaceExtractor::generateDecimatedIndicesForSlice(VolumeSampler& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; uint32_t indlist[12]; diff --git a/library/PolyVoxCore/source/SurfaceExtractors.cpp b/library/PolyVoxCore/source/SurfaceExtractors.cpp index 49455b5e..cad1dcca 100644 --- a/library/PolyVoxCore/source/SurfaceExtractors.cpp +++ b/library/PolyVoxCore/source/SurfaceExtractors.cpp @@ -6,7 +6,7 @@ #include "PolyVoxImpl/MarchingCubesTables.h" #include "Region.h" #include "SurfaceAdjusters.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include "PolyVoxImpl/DecimatedSurfaceExtractor.h" #include "PolyVoxImpl/FastSurfaceExtractor.h" diff --git a/library/PolyVoxCore/source/VoxelFilters.cpp b/library/PolyVoxCore/source/VoxelFilters.cpp index b90e40c4..f3a21c25 100644 --- a/library/PolyVoxCore/source/VoxelFilters.cpp +++ b/library/PolyVoxCore/source/VoxelFilters.cpp @@ -1,10 +1,10 @@ #include "VoxelFilters.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" namespace PolyVox { - float computeSmoothedVoxel(VolumeIterator& volIter) + float computeSmoothedVoxel(VolumeSampler& volIter) { assert(volIter.getPosX() >= 1); assert(volIter.getPosY() >= 1); diff --git a/library/PolyVoxUtil/source/Serialization.cpp b/library/PolyVoxUtil/source/Serialization.cpp index 073b7dd6..0c08a359 100644 --- a/library/PolyVoxUtil/source/Serialization.cpp +++ b/library/PolyVoxUtil/source/Serialization.cpp @@ -1,7 +1,7 @@ #include "Serialization.h" #include "Volume.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" #include "PolyVoxImpl/Utility.h" using namespace std; @@ -61,7 +61,7 @@ namespace PolyVox stream.write(reinterpret_cast(&volumeDepthPower), sizeof(volumeDepthPower)); //Write data - VolumeIterator volIter(volume); + VolumeSampler volIter(volume); for(uint16_t z = 0; z < volumeDepth; ++z) { for(uint16_t y = 0; y < volumeHeight; ++y) @@ -143,7 +143,7 @@ namespace PolyVox stream.write(reinterpret_cast(&volumeDepthPower), sizeof(volumeDepthPower)); //Write data - VolumeIterator volIter(volume); + VolumeSampler volIter(volume); uint8_t current = 0; uint32_t runLength = 0; bool firstTime = true; diff --git a/library/PolyVoxUtil/source/VolumeChangeTracker.cpp b/library/PolyVoxUtil/source/VolumeChangeTracker.cpp index 4af768f8..57182ba6 100644 --- a/library/PolyVoxUtil/source/VolumeChangeTracker.cpp +++ b/library/PolyVoxUtil/source/VolumeChangeTracker.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxImpl/Utility.h" #include "Vector.h" #include "Volume.h" -#include "VolumeIterator.h" +#include "VolumeSampler.h" using namespace std; @@ -142,7 +142,7 @@ namespace PolyVox assert(m_bIsLocked); //FIXME - rather than creating a iterator each time we should have one stored - /*VolumeIterator iterVol(*volumeData); + /*VolumeSampler iterVol(*volumeData); iterVol.setPosition(x,y,z); iterVol.setVoxel(value);*/ volumeData->setVoxelAt(x,y,z,value);