diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index d11c529a..86ffb5a4 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -2,7 +2,7 @@ using namespace PolyVox; -void createSphereInVolume(BlockVolume& volData, float fRadius, uint8 uValue) +void createSphereInVolume(Volume& volData, float fRadius, uint8 uValue) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getSideLength() / 2, volData.getSideLength() / 2, volData.getSideLength() / 2); @@ -30,7 +30,7 @@ void createSphereInVolume(BlockVolume& volData, float fRadius, uint8 uVal } } -void createCubeInVolume(BlockVolume& volData, Vector3DUint16 lowerCorner, Vector3DUint16 upperCorner, uint8 uValue) +void createCubeInVolume(Volume& volData, Vector3DUint16 lowerCorner, Vector3DUint16 upperCorner, uint8 uValue) { //This three-level for loop iterates over every voxel between the specified corners for (int z = lowerCorner.getZ(); z <= upperCorner.getZ(); z++) diff --git a/examples/OpenGL/Shapes.h b/examples/OpenGL/Shapes.h index e9d903c3..0e2a46eb 100644 --- a/examples/OpenGL/Shapes.h +++ b/examples/OpenGL/Shapes.h @@ -1,9 +1,9 @@ #ifndef __OpenGLExample_Shapes_H__ #define __OpenGLExample_Shapes_H__ -#include "PolyVoxCore/BlockVolume.h" +#include "PolyVoxCore/Volume.h" -void createSphereInVolume(PolyVox::BlockVolume& volData, float fRadius, PolyVox::uint8 uValue); -void createCubeInVolume(PolyVox::BlockVolume& volData, PolyVox::Vector3DUint16 lowerCorner, PolyVox::Vector3DUint16 upperCorner, PolyVox::uint8 uValue); +void createSphereInVolume(PolyVox::Volume& volData, float fRadius, PolyVox::uint8 uValue); +void createCubeInVolume(PolyVox::Volume& volData, PolyVox::Vector3DUint16 lowerCorner, PolyVox::Vector3DUint16 upperCorner, PolyVox::uint8 uValue); #endif //__OpenGLExample_Shapes_H__ \ No newline at end of file diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index bd2000ff..9f9df4fb 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -1,4 +1,4 @@ -#include "PolyVoxCore/BlockVolume.h" +#include "PolyVoxCore/Volume.h" #include "PolyVoxCore/IndexedSurfacePatch.h" #include "PolyVoxCore/SurfaceExtractors.h" #include "PolyVoxCore/Utility.h" @@ -42,7 +42,7 @@ int g_frameCounter = 0; bool g_bUseOpenGLVertexBufferObjects; //Creates a volume 128x128x128 -BlockVolume g_volData(logBase2(g_uVolumeSideLength)); +Volume g_volData(logBase2(g_uVolumeSideLength)); //Rather than storing one big mesh, the volume is broken into regions and a mesh is stored for each region OpenGLSurfacePatch g_openGLSurfacePatches[g_uVolumeSideLengthInRegions][g_uVolumeSideLengthInRegions][g_uVolumeSideLengthInRegions]; diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index aea06539..fcf78988 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -24,10 +24,6 @@ SET(CORE_SRC_FILES SET(CORE_INC_FILES include/PolyVoxCore/Block.h include/PolyVoxCore/Block.inl - include/PolyVoxCore/BlockVolume.h - include/PolyVoxCore/BlockVolume.inl - include/PolyVoxCore/BlockVolumeIterator.h - include/PolyVoxCore/BlockVolumeIterator.inl include/PolyVoxCore/Constants.h include/PolyVoxCore/Enums.h include/PolyVoxCore/GradientEstimators.h @@ -44,6 +40,10 @@ SET(CORE_INC_FILES include/PolyVoxCore/Utility.h include/PolyVoxCore/Vector.h include/PolyVoxCore/Vector.inl + include/PolyVoxCore/Volume.h + include/PolyVoxCore/Volume.inl + include/PolyVoxCore/VolumeIterator.h + include/PolyVoxCore/VolumeIterator.inl include/PolyVoxCore/VoxelFilters.h ) diff --git a/library/include/PolyVoxCore/Block.h b/library/include/PolyVoxCore/Block.h index 2c55fe5c..a4f3fa9e 100644 --- a/library/include/PolyVoxCore/Block.h +++ b/library/include/PolyVoxCore/Block.h @@ -33,8 +33,8 @@ namespace PolyVox template class Block { - //Make BlockVolumeIterator a friend - friend class BlockVolumeIterator; + //Make VolumeIterator a friend + friend class VolumeIterator; public: Block(uint8 uSideLengthPower); Block(const Block& rhs); diff --git a/library/include/PolyVoxCore/GradientEstimators.h b/library/include/PolyVoxCore/GradientEstimators.h index 11bb77d0..3b9bb5d9 100644 --- a/library/include/PolyVoxCore/GradientEstimators.h +++ b/library/include/PolyVoxCore/GradientEstimators.h @@ -22,28 +22,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __PolyVox_GradientEstimators_H__ #define __PolyVox_GradientEstimators_H__ -#include "BlockVolumeIterator.h" +#include "VolumeIterator.h" #include namespace PolyVox { template - Vector3DFloat computeCentralDifferenceGradient(const BlockVolumeIterator& volIter); + Vector3DFloat computeCentralDifferenceGradient(const VolumeIterator& volIter); template - Vector3DFloat computeSmoothCentralDifferenceGradient(BlockVolumeIterator& volIter); + Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeIterator& volIter); template - Vector3DFloat computeDecimatedCentralDifferenceGradient(BlockVolumeIterator& volIter); + Vector3DFloat computeDecimatedCentralDifferenceGradient(VolumeIterator& volIter); template - Vector3DFloat computeSobelGradient(const BlockVolumeIterator& volIter); + Vector3DFloat computeSobelGradient(const VolumeIterator& volIter); template - Vector3DFloat computeSmoothSobelGradient(BlockVolumeIterator& volIter); + Vector3DFloat computeSmoothSobelGradient(VolumeIterator& volIter); - POLYVOX_API void computeNormalsForVertices(BlockVolume* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod); - POLYVOX_API Vector3DFloat computeNormal(BlockVolume* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); + POLYVOX_API void computeNormalsForVertices(Volume* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod); + POLYVOX_API Vector3DFloat computeNormal(Volume* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); } #include "GradientEstimators.inl" diff --git a/library/include/PolyVoxCore/GradientEstimators.inl b/library/include/PolyVoxCore/GradientEstimators.inl index 204d83de..d5680c15 100644 --- a/library/include/PolyVoxCore/GradientEstimators.inl +++ b/library/include/PolyVoxCore/GradientEstimators.inl @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { template - Vector3DFloat computeCentralDifferenceGradient(const BlockVolumeIterator& volIter) + Vector3DFloat computeCentralDifferenceGradient(const VolumeIterator& volIter) { //FIXME - bitwise way of doing this? VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; @@ -45,7 +45,7 @@ namespace PolyVox } template - Vector3DFloat computeDecimatedCentralDifferenceGradient(const BlockVolumeIterator& volIter) + Vector3DFloat computeDecimatedCentralDifferenceGradient(const VolumeIterator& volIter) { const uint16 x = volIter.getPosX(); const uint16 y = volIter.getPosY(); @@ -70,7 +70,7 @@ namespace PolyVox } template - Vector3DFloat computeSmoothCentralDifferenceGradient(BlockVolumeIterator& volIter) + Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeIterator& volIter) { uint16 initialX = volIter.getPosX(); uint16 initialY = volIter.getPosY(); @@ -101,7 +101,7 @@ namespace PolyVox } template - Vector3DFloat computeSobelGradient(const BlockVolumeIterator& volIter) + Vector3DFloat computeSobelGradient(const VolumeIterator& 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(BlockVolumeIterator& volIter) + Vector3DFloat computeSmoothSobelGradient(VolumeIterator& 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/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 9f1b61a7..5d81fc00 100644 --- a/library/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -29,11 +29,11 @@ namespace PolyVox { template class Block; - //---------- BlockVolume ---------- - template class BlockVolume; - typedef BlockVolume FloatBlockVolume; - typedef BlockVolume UInt8BlockVolume; - typedef BlockVolume UInt16BlockVolume; + //---------- Volume ---------- + template class Volume; + typedef Volume FloatVolume; + typedef Volume UInt8Volume; + typedef Volume UInt16Volume; //--------------------------------- class IndexedSurfacePatch; @@ -53,7 +53,7 @@ namespace PolyVox typedef Vector<3,uint32> Vector3DUint32; //---------------------------- - template class BlockVolumeIterator; + template class VolumeIterator; } #endif diff --git a/library/include/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h b/library/include/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h index 61c4c1a9..dbc1c3ba 100644 --- a/library/include/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h +++ b/library/include/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h @@ -34,11 +34,11 @@ namespace PolyVox { uint32 getDecimatedIndex(uint32 x, uint32 y); - void extractDecimatedSurfaceImpl(BlockVolume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); - uint32 computeInitialDecimatedBitmaskForSlice(BlockVolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask); - uint32 computeDecimatedBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask, uint8 *previousBitmask); - void generateDecimatedIndicesForSlice(BlockVolumeIterator& volIter, uint8 uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]); - void generateDecimatedVerticesForSlice(BlockVolumeIterator& volIter, uint8 uLevel, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]); + void extractDecimatedSurfaceImpl(Volume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); + uint32 computeInitialDecimatedBitmaskForSlice(VolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask); + uint32 computeDecimatedBitmaskForSliceFromPrevious(VolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask, uint8 *previousBitmask); + void generateDecimatedIndicesForSlice(VolumeIterator& volIter, uint8 uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]); + void generateDecimatedVerticesForSlice(VolumeIterator& volIter, uint8 uLevel, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]); } #endif diff --git a/library/include/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h b/library/include/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h index c4d4419b..73969707 100644 --- a/library/include/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h +++ b/library/include/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h @@ -32,12 +32,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - void extractFastSurfaceImpl(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); + void extractFastSurfaceImpl(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); uint32 getIndex(uint32 x, uint32 y); - uint32 computeInitialRoughBitmaskForSlice(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask); - uint32 computeRoughBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask, uint8 *previousBitmask); - void generateRoughIndicesForSlice(BlockVolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]); - void generateRoughVerticesForSlice(BlockVolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]); + uint32 computeInitialRoughBitmaskForSlice(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask); + uint32 computeRoughBitmaskForSliceFromPrevious(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8 *bitmask, uint8 *previousBitmask); + void generateRoughIndicesForSlice(VolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]); + void generateRoughVerticesForSlice(VolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]); } #endif diff --git a/library/include/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.h b/library/include/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.h index bbccc3b8..bd7b6ef8 100644 --- a/library/include/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.h +++ b/library/include/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.h @@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - void extractReferenceSurfaceImpl(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); + void extractReferenceSurfaceImpl(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); int32 getIndexFor(const Vector3DFloat& pos, int32 vertexIndicesX[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1], int32 vertexIndicesY[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1], int32 vertexIndicesZ[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]); void setIndexFor(const Vector3DFloat& pos, int32 newIndex, int32 vertexIndicesX[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1], int32 vertexIndicesY[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1], int32 vertexIndicesZ[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]); } diff --git a/library/include/PolyVoxCore/SurfaceAdjusters.h b/library/include/PolyVoxCore/SurfaceAdjusters.h index 153a5ad1..14dee71c 100644 --- a/library/include/PolyVoxCore/SurfaceAdjusters.h +++ b/library/include/PolyVoxCore/SurfaceAdjusters.h @@ -32,8 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - POLYVOX_API void smoothRegionGeometry(BlockVolume* volumeData, IndexedSurfacePatch& isp); - POLYVOX_API void adjustDecimatedGeometry(BlockVolume* volumeData, IndexedSurfacePatch& isp, uint8 val); + POLYVOX_API void smoothRegionGeometry(Volume* volumeData, IndexedSurfacePatch& isp); + POLYVOX_API void adjustDecimatedGeometry(Volume* volumeData, IndexedSurfacePatch& isp, uint8 val); } #endif \ No newline at end of file diff --git a/library/include/PolyVoxCore/SurfaceExtractors.h b/library/include/PolyVoxCore/SurfaceExtractors.h index 8ef3c589..2a083849 100644 --- a/library/include/PolyVoxCore/SurfaceExtractors.h +++ b/library/include/PolyVoxCore/SurfaceExtractors.h @@ -34,8 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - POLYVOX_API void extractSurface(BlockVolume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); - POLYVOX_API void extractReferenceSurface(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); + POLYVOX_API void extractSurface(Volume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); + POLYVOX_API void extractReferenceSurface(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); } #endif diff --git a/library/include/PolyVoxCore/BlockVolume.h b/library/include/PolyVoxCore/Volume.h similarity index 75% rename from library/include/PolyVoxCore/BlockVolume.h rename to library/include/PolyVoxCore/Volume.h index fa6412a0..02fee274 100644 --- a/library/include/PolyVoxCore/BlockVolume.h +++ b/library/include/PolyVoxCore/Volume.h @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ #pragma endregion -#ifndef __PolyVox_BlockVolume_H__ -#define __PolyVox_BlockVolume_H__ +#ifndef __PolyVox_Volume_H__ +#define __PolyVox_Volume_H__ #pragma region Headers #include "PolyVoxForwardDeclarations.h" @@ -33,17 +33,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { template - class BlockVolume + class Volume { - //Make BlockVolumeIterator a friend - friend class BlockVolumeIterator; + //Make VolumeIterator a friend + friend class VolumeIterator; public: - BlockVolume(uint8 uSideLengthPower, uint8 uBlockSideLengthPower = 5); - BlockVolume(const BlockVolume& rhs); - ~BlockVolume(); + Volume(uint8 uSideLengthPower, uint8 uBlockSideLengthPower = 5); + Volume(const Volume& rhs); + ~Volume(); - BlockVolume& operator=(const BlockVolume& rhs); + Volume& operator=(const Volume& rhs); Region getEnclosingRegion(void) const; uint16 getSideLength(void) const; @@ -55,10 +55,10 @@ namespace PolyVox bool containsPoint(const Vector3DFloat& pos, float boundary) const; bool containsPoint(const Vector3DInt32& pos, uint16 boundary) const; - BlockVolumeIterator firstVoxel(void); + VolumeIterator firstVoxel(void); void idle(uint32 uAmount); bool isRegionHomogenous(const Region& region); - BlockVolumeIterator lastVoxel(void); + VolumeIterator lastVoxel(void); private: Block* getHomogenousBlock(VoxelType tHomogenousValue) const; @@ -80,11 +80,11 @@ namespace PolyVox }; //Some handy typedefs - typedef BlockVolume FloatBlockVolume; - typedef BlockVolume UInt8BlockVolume; - typedef BlockVolume UInt16BlockVolume; + typedef Volume FloatVolume; + typedef Volume UInt8Volume; + typedef Volume UInt16Volume; } -#include "BlockVolume.inl" +#include "Volume.inl" #endif diff --git a/library/include/PolyVoxCore/BlockVolume.inl b/library/include/PolyVoxCore/Volume.inl similarity index 81% rename from library/include/PolyVoxCore/BlockVolume.inl rename to library/include/PolyVoxCore/Volume.inl index 7512b831..b51360eb 100644 --- a/library/include/PolyVoxCore/BlockVolume.inl +++ b/library/include/PolyVoxCore/Volume.inl @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma region Headers #include "Block.h" -#include "BlockVolumeIterator.h" +#include "VolumeIterator.h" #include "Region.h" #include "Vector.h" @@ -33,7 +33,7 @@ namespace PolyVox { #pragma region Constructors/Destructors template - BlockVolume::BlockVolume(uint8 uSideLengthPower, uint8 uBlockSideLengthPower) + Volume::Volume(uint8 uSideLengthPower, uint8 uBlockSideLengthPower) :m_pBlocks(0) { //Check the volume size is sensible. This corresponds to a side length of 65536 voxels @@ -71,13 +71,13 @@ namespace PolyVox } template - BlockVolume::BlockVolume(const BlockVolume& rhs) + Volume::Volume(const Volume& rhs) { *this = rhs; } template - BlockVolume::~BlockVolume() + Volume::~Volume() { for(uint32 i = 0; i < m_uNoOfBlocksInVolume; ++i) { @@ -88,7 +88,7 @@ namespace PolyVox #pragma region Operators template - BlockVolume& BlockVolume::operator=(const BlockVolume& rhs) + Volume& Volume::operator=(const Volume& rhs) { if (this == &rhs) { @@ -122,19 +122,19 @@ namespace PolyVox #pragma region Getters template - Region BlockVolume::getEnclosingRegion(void) const + Region Volume::getEnclosingRegion(void) const { return Region(Vector3DInt32(0,0,0), Vector3DInt32(m_uSideLength-1,m_uSideLength-1,m_uSideLength-1)); } template - uint16 BlockVolume::getSideLength(void) const + uint16 Volume::getSideLength(void) const { return m_uSideLength; } template - VoxelType BlockVolume::getVoxelAt(uint16 uXPos, uint16 uYPos, uint16 uZPos) const + VoxelType Volume::getVoxelAt(uint16 uXPos, uint16 uYPos, uint16 uZPos) const { assert(uXPos < getSideLength()); assert(uYPos < getSideLength()); @@ -159,7 +159,7 @@ namespace PolyVox } template - VoxelType BlockVolume::getVoxelAt(const Vector3DUint16& v3dPos) const + VoxelType Volume::getVoxelAt(const Vector3DUint16& v3dPos) const { assert(v3dPos.getX() < m_uSideLength); assert(v3dPos.getY() < m_uSideLength); @@ -171,7 +171,7 @@ namespace PolyVox #pragma region Setters template - void BlockVolume::setVoxelAt(uint16 uXPos, uint16 uYPos, uint16 uZPos, VoxelType tValue) + void Volume::setVoxelAt(uint16 uXPos, uint16 uYPos, uint16 uZPos, VoxelType tValue) { const uint16 blockX = uXPos >> m_uBlockSideLengthPower; const uint16 blockY = uYPos >> m_uBlockSideLengthPower; @@ -207,7 +207,7 @@ namespace PolyVox } template - void BlockVolume::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) + void Volume::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) { setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); } @@ -215,7 +215,7 @@ namespace PolyVox #pragma region Other template - bool BlockVolume::containsPoint(const Vector3DFloat& pos, float boundary) const + bool Volume::containsPoint(const Vector3DFloat& pos, float boundary) const { return (pos.getX() <= m_uSideLength - 1 - boundary) && (pos.getY() <= m_uSideLength - 1 - boundary) @@ -226,7 +226,7 @@ namespace PolyVox } template - bool BlockVolume::containsPoint(const Vector3DInt32& pos, uint16 boundary) const + bool Volume::containsPoint(const Vector3DInt32& pos, uint16 boundary) const { return (pos.getX() <= m_uSideLength - 1 - boundary) && (pos.getY() <= m_uSideLength - 1 - boundary) @@ -237,22 +237,22 @@ namespace PolyVox } template - BlockVolumeIterator BlockVolume::firstVoxel(void) + VolumeIterator Volume::firstVoxel(void) { - BlockVolumeIterator iter(*this); + VolumeIterator iter(*this); iter.setPosition(0,0,0); return iter; } template - void BlockVolume::idle(uint32 uAmount) + void Volume::idle(uint32 uAmount) { } template - bool BlockVolume::isRegionHomogenous(const Region& region) + bool Volume::isRegionHomogenous(const Region& region) { - BlockVolumeIterator iter(*this); + VolumeIterator iter(*this); iter.setValidRegion(region); iter.setPosition(static_cast(region.getLowerCorner())); @@ -272,9 +272,9 @@ namespace PolyVox } template - BlockVolumeIterator BlockVolume::lastVoxel(void) + VolumeIterator Volume::lastVoxel(void) { - BlockVolumeIterator iter(*this); + VolumeIterator iter(*this); iter.setPosition(m_uSideLength-1,m_uSideLength-1,m_uSideLength-1); return iter; } @@ -282,7 +282,7 @@ namespace PolyVox #pragma region Private Implementation template - Block* BlockVolume::getHomogenousBlock(VoxelType tHomogenousValue) const + Block* Volume::getHomogenousBlock(VoxelType tHomogenousValue) const { typename std::map*>::iterator iterResult = m_pHomogenousBlocks.find(tHomogenousValue); if(iterResult == m_pHomogenousBlocks.end()) diff --git a/library/include/PolyVoxCore/BlockVolumeIterator.h b/library/include/PolyVoxCore/VolumeIterator.h similarity index 85% rename from library/include/PolyVoxCore/BlockVolumeIterator.h rename to library/include/PolyVoxCore/VolumeIterator.h index d3643bcc..4b69527e 100644 --- a/library/include/PolyVoxCore/BlockVolumeIterator.h +++ b/library/include/PolyVoxCore/VolumeIterator.h @@ -31,23 +31,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { template - class BlockVolumeIterator + class VolumeIterator { public: - BlockVolumeIterator(BlockVolume& volume); - ~BlockVolumeIterator(); + VolumeIterator(Volume& volume); + ~VolumeIterator(); - 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); + 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); uint16 getPosX(void) const; uint16 getPosY(void) const; uint16 getPosZ(void) const; VoxelType getSubSampledVoxel(uint8 uLevel) const; - const BlockVolume& getVolume(void) const; + const Volume& getVolume(void) const; VoxelType getVoxel(void) const; void setPosition(const Vector3DInt16& v3dNewPos); @@ -92,7 +92,7 @@ namespace PolyVox private: //The current volume - BlockVolume& mVolume; + Volume& mVolume; //The current position in the volume uint16 mXPosInVolume; @@ -132,6 +132,6 @@ namespace PolyVox }; } -#include "BlockVolumeIterator.inl" +#include "VolumeIterator.inl" #endif diff --git a/library/include/PolyVoxCore/BlockVolumeIterator.inl b/library/include/PolyVoxCore/VolumeIterator.inl similarity index 82% rename from library/include/PolyVoxCore/BlockVolumeIterator.inl rename to library/include/PolyVoxCore/VolumeIterator.inl index 61446636..0c2d2d9b 100644 --- a/library/include/PolyVoxCore/BlockVolumeIterator.inl +++ b/library/include/PolyVoxCore/VolumeIterator.inl @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma region Headers #include "Block.h" -#include "BlockVolume.h" +#include "Volume.h" #include "Vector.h" #include "Region.h" @@ -32,20 +32,20 @@ namespace PolyVox { #pragma region Constructors/Destructors template - BlockVolumeIterator::BlockVolumeIterator(BlockVolume& volume) + VolumeIterator::VolumeIterator(Volume& volume) :mVolume(volume) { } template - BlockVolumeIterator::~BlockVolumeIterator() + VolumeIterator::~VolumeIterator() { } #pragma endregion #pragma region Operators template - bool BlockVolumeIterator::operator==(const BlockVolumeIterator& rhs) + bool VolumeIterator::operator==(const VolumeIterator& 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 BlockVolumeIterator::operator<(const BlockVolumeIterator& rhs) + bool VolumeIterator::operator<(const VolumeIterator& rhs) { assert(&mVolume == &rhs.mVolume); @@ -85,21 +85,21 @@ namespace PolyVox } template - bool BlockVolumeIterator::operator>(const BlockVolumeIterator& rhs) + bool VolumeIterator::operator>(const VolumeIterator& rhs) { assert(&mVolume == &rhs.mVolume); return (rhs < *this); } template - bool BlockVolumeIterator::operator<=(const BlockVolumeIterator& rhs) + bool VolumeIterator::operator<=(const VolumeIterator& rhs) { assert(&mVolume == &rhs.mVolume); return (rhs > *this); } template - bool BlockVolumeIterator::operator>=(const BlockVolumeIterator& rhs) + bool VolumeIterator::operator>=(const VolumeIterator& rhs) { assert(&mVolume == &rhs.mVolume); return (rhs < *this); @@ -108,25 +108,25 @@ namespace PolyVox #pragma region Getters template - uint16 BlockVolumeIterator::getPosX(void) const + uint16 VolumeIterator::getPosX(void) const { return mXPosInVolume; } template - uint16 BlockVolumeIterator::getPosY(void) const + uint16 VolumeIterator::getPosY(void) const { return mYPosInVolume; } template - uint16 BlockVolumeIterator::getPosZ(void) const + uint16 VolumeIterator::getPosZ(void) const { return mZPosInVolume; } template - VoxelType BlockVolumeIterator::getSubSampledVoxel(uint8 uLevel) const + VoxelType VolumeIterator::getSubSampledVoxel(uint8 uLevel) const { if(uLevel == 0) { @@ -164,13 +164,13 @@ namespace PolyVox } template - const BlockVolume& BlockVolumeIterator::getVolume(void) const + const Volume& VolumeIterator::getVolume(void) const { return mVolume; } template - VoxelType BlockVolumeIterator::getVoxel(void) const + VoxelType VolumeIterator::getVoxel(void) const { return *mCurrentVoxel; } @@ -178,13 +178,13 @@ namespace PolyVox #pragma region Setters template - void BlockVolumeIterator::setPosition(const Vector3DInt16& v3dNewPos) + void VolumeIterator::setPosition(const Vector3DInt16& v3dNewPos) { setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); } template - void BlockVolumeIterator::setPosition(uint16 xPos, uint16 yPos, uint16 zPos) + void VolumeIterator::setPosition(uint16 xPos, uint16 yPos, uint16 zPos) { mXPosInVolume = xPos; mYPosInVolume = yPos; @@ -211,13 +211,13 @@ namespace PolyVox } template - void BlockVolumeIterator::setValidRegion(const Region& region) + void VolumeIterator::setValidRegion(const Region& region) { setValidRegion(region.getLowerCorner().getX(),region.getLowerCorner().getY(),region.getLowerCorner().getZ(),region.getUpperCorner().getX(),region.getUpperCorner().getY(),region.getUpperCorner().getZ()); } template - void BlockVolumeIterator::setValidRegion(uint16 xFirst, uint16 yFirst, uint16 zFirst, uint16 xLast, uint16 yLast, uint16 zLast) + void VolumeIterator::setValidRegion(uint16 xFirst, uint16 yFirst, uint16 zFirst, uint16 xLast, uint16 yLast, uint16 zLast) { mXRegionFirst = xFirst; mYRegionFirst = yFirst; @@ -239,13 +239,13 @@ namespace PolyVox #pragma region Other template - bool BlockVolumeIterator::isValidForRegion(void) const + bool VolumeIterator::isValidForRegion(void) const { return mIsValidForRegion; } template - void BlockVolumeIterator::moveForwardInRegionFast(void) + void VolumeIterator::moveForwardInRegionFast(void) { mXPosInBlock++; mCurrentVoxel++; @@ -331,7 +331,7 @@ namespace PolyVox } template - bool BlockVolumeIterator::moveForwardInRegionXYZ(void) + bool VolumeIterator::moveForwardInRegionXYZ(void) { if(mXPosInVolume < mXRegionLast) { @@ -386,7 +386,7 @@ namespace PolyVox #pragma region Peekers template - VoxelType BlockVolumeIterator::peekVoxel1nx1ny1nz(void) const + VoxelType VolumeIterator::peekVoxel1nx1ny1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -396,7 +396,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx1ny0pz(void) const + VoxelType VolumeIterator::peekVoxel1nx1ny0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -406,7 +406,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx1ny1pz(void) const + VoxelType VolumeIterator::peekVoxel1nx1ny1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -416,7 +416,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx0py1nz(void) const + VoxelType VolumeIterator::peekVoxel1nx0py1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -426,7 +426,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx0py0pz(void) const + VoxelType VolumeIterator::peekVoxel1nx0py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -436,7 +436,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx0py1pz(void) const + VoxelType VolumeIterator::peekVoxel1nx0py1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -446,7 +446,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx1py1nz(void) const + VoxelType VolumeIterator::peekVoxel1nx1py1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -456,7 +456,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx1py0pz(void) const + VoxelType VolumeIterator::peekVoxel1nx1py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -466,7 +466,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1nx1py1pz(void) const + VoxelType VolumeIterator::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)) { @@ -478,7 +478,7 @@ namespace PolyVox ////////////////////////////////////////////////////////////////////////// template - VoxelType BlockVolumeIterator::peekVoxel0px1ny1nz(void) const + VoxelType VolumeIterator::peekVoxel0px1ny1nz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -488,7 +488,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel0px1ny0pz(void) const + VoxelType VolumeIterator::peekVoxel0px1ny0pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -498,7 +498,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel0px1ny1pz(void) const + VoxelType VolumeIterator::peekVoxel0px1ny1pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -508,7 +508,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel0px0py1nz(void) const + VoxelType VolumeIterator::peekVoxel0px0py1nz(void) const { if((mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -518,13 +518,13 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel0px0py0pz(void) const + VoxelType VolumeIterator::peekVoxel0px0py0pz(void) const { return *mCurrentVoxel; } template - VoxelType BlockVolumeIterator::peekVoxel0px0py1pz(void) const + VoxelType VolumeIterator::peekVoxel0px0py1pz(void) const { if((mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -534,7 +534,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel0px1py1nz(void) const + VoxelType VolumeIterator::peekVoxel0px1py1nz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -544,7 +544,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel0px1py0pz(void) const + VoxelType VolumeIterator::peekVoxel0px1py0pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -554,7 +554,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel0px1py1pz(void) const + VoxelType VolumeIterator::peekVoxel0px1py1pz(void) const { if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -566,7 +566,7 @@ namespace PolyVox ////////////////////////////////////////////////////////////////////////// template - VoxelType BlockVolumeIterator::peekVoxel1px1ny1nz(void) const + VoxelType VolumeIterator::peekVoxel1px1ny1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -576,7 +576,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px1ny0pz(void) const + VoxelType VolumeIterator::peekVoxel1px1ny0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -586,7 +586,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px1ny1pz(void) const + VoxelType VolumeIterator::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)) { @@ -596,7 +596,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px0py1nz(void) const + VoxelType VolumeIterator::peekVoxel1px0py1nz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0)) { @@ -606,7 +606,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px0py0pz(void) const + VoxelType VolumeIterator::peekVoxel1px0py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -616,7 +616,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px0py1pz(void) const + VoxelType VolumeIterator::peekVoxel1px0py1pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -626,7 +626,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px1py1nz(void) const + VoxelType VolumeIterator::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)) { @@ -636,7 +636,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px1py0pz(void) const + VoxelType VolumeIterator::peekVoxel1px1py0pz(void) const { if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1)) { @@ -646,7 +646,7 @@ namespace PolyVox } template - VoxelType BlockVolumeIterator::peekVoxel1px1py1pz(void) const + VoxelType VolumeIterator::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/include/PolyVoxCore/VoxelFilters.h b/library/include/PolyVoxCore/VoxelFilters.h index 5d52c823..79f1721c 100644 --- a/library/include/PolyVoxCore/VoxelFilters.h +++ b/library/include/PolyVoxCore/VoxelFilters.h @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - float computeSmoothedVoxel(BlockVolumeIterator& volIter); + float computeSmoothedVoxel(VolumeIterator& volIter); } #endif \ No newline at end of file diff --git a/library/include/PolyVoxUtil/Serialization.h b/library/include/PolyVoxUtil/Serialization.h index a0186fc1..60e85874 100644 --- a/library/include/PolyVoxUtil/Serialization.h +++ b/library/include/PolyVoxUtil/Serialization.h @@ -31,11 +31,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - POLYVOX_API BlockVolume* loadVolumeRaw(std::istream& stream); - POLYVOX_API void saveVolumeRaw(std::ostream& stream, BlockVolume& volume); + POLYVOX_API Volume* loadVolumeRaw(std::istream& stream); + POLYVOX_API void saveVolumeRaw(std::ostream& stream, Volume& volume); - POLYVOX_API BlockVolume* loadVolumeRle(std::istream& stream); - POLYVOX_API void saveVolumeRle(std::ostream& stream, BlockVolume& volume); + POLYVOX_API Volume* loadVolumeRle(std::istream& stream); + POLYVOX_API void saveVolumeRle(std::ostream& stream, Volume& volume); } #endif diff --git a/library/include/PolyVoxUtil/VolumeChangeTracker.h b/library/include/PolyVoxUtil/VolumeChangeTracker.h index 2a9f5c9f..3e0586b3 100644 --- a/library/include/PolyVoxUtil/VolumeChangeTracker.h +++ b/library/include/PolyVoxUtil/VolumeChangeTracker.h @@ -44,14 +44,14 @@ namespace PolyVox Region getEnclosingRegion(void) const; int32 getLastModifiedTimeForRegion(uint16 uX, uint16 uY, uint16 uZ); uint16 getSideLength(void); - BlockVolume* getVolumeData(void) const; + Volume* getVolumeData(void) const; uint8 getVoxelAt(const Vector3DUint16& pos); uint8 getVoxelAt(uint16 uX, uint16 uY, uint16 uZ); //Setters void setAllRegionsModified(void); void setLockedVoxelAt(uint16 x, uint16 y, uint16 z, uint8 value); - void setVolumeData(BlockVolume* volumeDataToSet); + void setVolumeData(Volume* volumeDataToSet); void setVoxelAt(uint16 x, uint16 y, uint16 z, uint8 value); //Others @@ -62,7 +62,7 @@ namespace PolyVox private: bool m_bIsLocked; Region m_regLastLocked; - BlockVolume* volumeData; + Volume* volumeData; //It's not what the block class was designed for, but it //provides a handy way of storing a 3D grid of values. diff --git a/library/source/PolyVoxCore/GradientEstimators.cpp b/library/source/PolyVoxCore/GradientEstimators.cpp index d68becb4..3e50d43a 100644 --- a/library/source/PolyVoxCore/GradientEstimators.cpp +++ b/library/source/PolyVoxCore/GradientEstimators.cpp @@ -8,7 +8,7 @@ using namespace std; namespace PolyVox { - POLYVOX_API void computeNormalsForVertices(BlockVolume* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod) + POLYVOX_API void computeNormalsForVertices(Volume* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod) { std::vector& vecVertices = isp.getRawVertexData(); std::vector::iterator iterSurfaceVertex = vecVertices.begin(); @@ -17,7 +17,7 @@ namespace PolyVox const Vector3DFloat& v3dPos = iterSurfaceVertex->getPosition() + static_cast(isp.m_v3dRegionPosition); const Vector3DInt32 v3dFloor = static_cast(v3dPos); - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); //Check all corners are within the volume, allowing a boundary for gradient estimation bool lowerCornerInside = volumeData->containsPoint(v3dFloor,2); @@ -39,11 +39,11 @@ namespace PolyVox } } - Vector3DFloat computeNormal(BlockVolume* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod) + Vector3DFloat computeNormal(Volume* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod) { Vector3DFloat v3dGradient; //To store the result - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); const Vector3DInt32 v3dFloor = static_cast(v3dPos); diff --git a/library/source/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.cpp b/library/source/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.cpp index 322aa3a9..84964e27 100644 --- a/library/source/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.cpp +++ b/library/source/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.cpp @@ -21,12 +21,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h" -#include "PolyVoxCore/BlockVolume.h" +#include "PolyVoxCore/Volume.h" #include "PolyVoxCore/GradientEstimators.h" #include "PolyVoxCore/IndexedSurfacePatch.h" #include "PolyVoxCore/MarchingCubesTables.h" #include "PolyVoxCore/Region.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/VolumeIterator.h" #include @@ -39,7 +39,7 @@ namespace PolyVox return x + (y * (POLYVOX_REGION_SIDE_LENGTH+1)); } - void extractDecimatedSurfaceImpl(BlockVolume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch) + void extractDecimatedSurfaceImpl(Volume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch) { singleMaterialPatch->clear(); @@ -73,7 +73,7 @@ namespace PolyVox regSlice0.setUpperCorner(v3dUpperCorner); //Iterator to access the volume data - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); //Compute bitmask for initial slice uint32 uNoOfNonEmptyCellsForSlice0 = computeInitialDecimatedBitmaskForSlice(volIter, uLevel, regSlice0, offset, bitmask0); @@ -128,7 +128,7 @@ namespace PolyVox }*/ } - uint32 computeInitialDecimatedBitmaskForSlice(BlockVolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask) + uint32 computeInitialDecimatedBitmaskForSlice(VolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask) { const uint8 uStepSize = uLevel == 0 ? 1 : 1 << uLevel; uint32 uNoOfNonEmptyCells = 0; @@ -297,7 +297,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - uint32 computeDecimatedBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, uint8* previousBitmask) + uint32 computeDecimatedBitmaskForSliceFromPrevious(VolumeIterator& volIter, uint8 uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, uint8* previousBitmask) { const uint8 uStepSize = uLevel == 0 ? 1 : 1 << uLevel; uint32 uNoOfNonEmptyCells = 0; @@ -423,7 +423,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void generateDecimatedVerticesForSlice(BlockVolumeIterator& volIter, uint8 uLevel, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]) + void generateDecimatedVerticesForSlice(VolumeIterator& volIter, uint8 uLevel, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]) { const uint8 uStepSize = uLevel == 0 ? 1 : 1 << uLevel; @@ -494,7 +494,7 @@ namespace PolyVox } } - void generateDecimatedIndicesForSlice(BlockVolumeIterator& volIter, uint8 uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]) + void generateDecimatedIndicesForSlice(VolumeIterator& volIter, uint8 uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]) { const uint8 uStepSize = uLevel == 0 ? 1 : 1 << uLevel; uint32 indlist[12]; diff --git a/library/source/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.cpp b/library/source/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.cpp index f4203db5..90623b17 100644 --- a/library/source/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.cpp +++ b/library/source/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/VolumeIterator.h" #include "PolyVoxCore/IndexedSurfacePatch.h" #include "PolyVoxCore/MarchingCubesTables.h" #include "PolyVoxCore/SurfaceVertex.h" @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - void extractFastSurfaceImpl(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch) + void extractFastSurfaceImpl(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch) { singleMaterialPatch->clear(); @@ -59,7 +59,7 @@ namespace PolyVox regSlice0.setUpperCorner(Vector3DInt32(regSlice0.getUpperCorner().getX(),regSlice0.getUpperCorner().getY(),regSlice0.getLowerCorner().getZ())); //Iterator to access the volume data - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); //Compute bitmask for initial slice uint32 uNoOfNonEmptyCellsForSlice0 = computeInitialRoughBitmaskForSlice(volIter, regSlice0, offset, bitmask0); @@ -110,7 +110,7 @@ namespace PolyVox return x + (y * (POLYVOX_REGION_SIDE_LENGTH+1)); } - uint32 computeInitialRoughBitmaskForSlice(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask) + uint32 computeInitialRoughBitmaskForSlice(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask) { uint32 uNoOfNonEmptyCells = 0; @@ -260,7 +260,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - uint32 computeRoughBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, uint8* previousBitmask) + uint32 computeRoughBitmaskForSliceFromPrevious(VolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, uint8* previousBitmask) { uint32 uNoOfNonEmptyCells = 0; @@ -376,7 +376,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void generateRoughVerticesForSlice(BlockVolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]) + void generateRoughVerticesForSlice(VolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32 vertexIndicesX[],int32 vertexIndicesY[],int32 vertexIndicesZ[]) { //Iterate over each cell in the region volIter.setPosition(regSlice.getLowerCorner().getX(),regSlice.getLowerCorner().getY(), regSlice.getLowerCorner().getZ()); @@ -443,7 +443,7 @@ namespace PolyVox }while(volIter.moveForwardInRegionXYZ());//For each cell } - void generateRoughIndicesForSlice(BlockVolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]) + void generateRoughIndicesForSlice(VolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8* bitmask0, uint8* bitmask1, int32 vertexIndicesX0[],int32 vertexIndicesY0[],int32 vertexIndicesZ0[], int32 vertexIndicesX1[],int32 vertexIndicesY1[],int32 vertexIndicesZ1[]) { uint32 indlist[12]; diff --git a/library/source/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.cpp b/library/source/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.cpp index 95218764..22f0a666 100644 --- a/library/source/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.cpp +++ b/library/source/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.cpp @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.h" -#include "PolyVoxCore/BlockVolume.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/Volume.h" +#include "PolyVoxCore/VolumeIterator.h" #include "PolyVoxCore/IndexedSurfacePatch.h" #include "PolyVoxCore/MarchingCubesTables.h" #include "PolyVoxCore/Region.h" @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - void extractReferenceSurfaceImpl(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch) + void extractReferenceSurfaceImpl(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch) { static int32 vertexIndicesX[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; static int32 vertexIndicesY[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; @@ -54,7 +54,7 @@ namespace PolyVox Vector3DFloat vertlist[12]; Vector3DFloat normlist[12]; uint8 vertMaterials[12]; - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); volIter.setValidRegion(region); ////////////////////////////////////////////////////////////////////////// diff --git a/library/source/PolyVoxCore/SurfaceAdjusters.cpp b/library/source/PolyVoxCore/SurfaceAdjusters.cpp index b6dc7746..20767b64 100644 --- a/library/source/PolyVoxCore/SurfaceAdjusters.cpp +++ b/library/source/PolyVoxCore/SurfaceAdjusters.cpp @@ -1,6 +1,6 @@ #include "PolyVoxCore/SurfaceAdjusters.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/VolumeIterator.h" #include "PolyVoxCore/GradientEstimators.h" #include "PolyVoxCore/IndexedSurfacePatch.h" #include "PolyVoxCore/Utility.h" @@ -12,12 +12,12 @@ using namespace std; namespace PolyVox { - void smoothRegionGeometry(BlockVolume* volumeData, IndexedSurfacePatch& isp) + void smoothRegionGeometry(Volume* volumeData, IndexedSurfacePatch& isp) { const uint8 uSmoothingFactor = 2; const float fThreshold = 0.5f; - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); std::vector& vecVertices = isp.getRawVertexData(); std::vector::iterator iterSurfaceVertex = vecVertices.begin(); @@ -76,9 +76,9 @@ namespace PolyVox } //while(iterSurfaceVertex != vecVertices.end()) } - void adjustDecimatedGeometry(BlockVolume* volumeData, IndexedSurfacePatch& isp, uint8 val) + void adjustDecimatedGeometry(Volume* volumeData, IndexedSurfacePatch& isp, uint8 val) { - BlockVolumeIterator volIter(*volumeData); + VolumeIterator 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); - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); //Check all corners are within the volume, allowing a boundary for gradient estimation bool lowerCornerInside = volumeData->containsPoint(v3dFloor,1); diff --git a/library/source/PolyVoxCore/SurfaceExtractors.cpp b/library/source/PolyVoxCore/SurfaceExtractors.cpp index 70a588b4..1aa01058 100644 --- a/library/source/PolyVoxCore/SurfaceExtractors.cpp +++ b/library/source/PolyVoxCore/SurfaceExtractors.cpp @@ -1,12 +1,12 @@ #include "PolyVoxCore/SurfaceExtractors.h" -#include "PolyVoxCore/BlockVolume.h" +#include "PolyVoxCore/Volume.h" #include "PolyVoxCore/GradientEstimators.h" #include "PolyVoxCore/IndexedSurfacePatch.h" #include "PolyVoxCore/MarchingCubesTables.h" #include "PolyVoxCore/Region.h" #include "PolyVoxCore/SurfaceAdjusters.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/VolumeIterator.h" #include "PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h" #include "PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h" @@ -18,7 +18,7 @@ using namespace std; namespace PolyVox { - void extractSurface(BlockVolume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch) + void extractSurface(Volume* volumeData, uint8 uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch) { if(uLevel == 0) { @@ -32,7 +32,7 @@ namespace PolyVox singleMaterialPatch->m_v3dRegionPosition = region.getLowerCorner(); } - void extractReferenceSurface(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch) + void extractReferenceSurface(Volume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch) { extractReferenceSurfaceImpl(volumeData, region, singleMaterialPatch); diff --git a/library/source/PolyVoxCore/VoxelFilters.cpp b/library/source/PolyVoxCore/VoxelFilters.cpp index 49720c8a..cd191001 100644 --- a/library/source/PolyVoxCore/VoxelFilters.cpp +++ b/library/source/PolyVoxCore/VoxelFilters.cpp @@ -1,10 +1,10 @@ #include "PolyVoxCore/VoxelFilters.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/VolumeIterator.h" namespace PolyVox { - float computeSmoothedVoxel(BlockVolumeIterator& volIter) + float computeSmoothedVoxel(VolumeIterator& volIter) { assert(volIter.getPosX() >= 1); assert(volIter.getPosY() >= 1); diff --git a/library/source/PolyVoxUtil/Serialization.cpp b/library/source/PolyVoxUtil/Serialization.cpp index c2bbf6c2..a1ff3e2a 100644 --- a/library/source/PolyVoxUtil/Serialization.cpp +++ b/library/source/PolyVoxUtil/Serialization.cpp @@ -1,7 +1,7 @@ #include "PolyVoxUtil/Serialization.h" -#include "PolyVoxCore/BlockVolume.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/Volume.h" +#include "PolyVoxCore/VolumeIterator.h" #include "PolyVoxCore/Utility.h" using namespace std; @@ -10,7 +10,7 @@ namespace PolyVox { //Note: we don't do much error handling in here - exceptions will simply be propergated up to the caller. //FIXME - think about pointer ownership issues. Or could return volume by value if the copy constructor is shallow - BlockVolume* loadVolumeRaw(istream& stream) + Volume* loadVolumeRaw(istream& stream) { //Read volume dimensions uint8 volumeWidthPower = 0; @@ -21,7 +21,7 @@ namespace PolyVox stream.read(reinterpret_cast(&volumeDepthPower), sizeof(volumeDepthPower)); //FIXME - need to support non cubic volumes - BlockVolume* volume = new BlockVolume(volumeWidthPower); + Volume* volume = new Volume(volumeWidthPower); uint16 volumeWidth = 0x0001 << volumeWidthPower; uint16 volumeHeight = 0x0001 << volumeHeightPower; @@ -45,7 +45,7 @@ namespace PolyVox return volume; } - void saveVolumeRaw(std::ostream& stream, BlockVolume& volume) + void saveVolumeRaw(std::ostream& stream, Volume& volume) { //Write volume dimensions uint16 volumeWidth = volume.getSideLength(); @@ -61,7 +61,7 @@ namespace PolyVox stream.write(reinterpret_cast(&volumeDepthPower), sizeof(volumeDepthPower)); //Write data - BlockVolumeIterator volIter(volume); + VolumeIterator volIter(volume); for(uint16 z = 0; z < volumeDepth; ++z) { for(uint16 y = 0; y < volumeHeight; ++y) @@ -78,7 +78,7 @@ namespace PolyVox //Note: we don't do much error handling in here - exceptions will simply be propergated up to the caller. //FIXME - think about pointer ownership issues. Or could return volume by value if the copy constructor is shallow - BlockVolume* loadVolumeRle(istream& stream) + Volume* loadVolumeRle(istream& stream) { //Read volume dimensions uint8 volumeWidthPower = 0; @@ -89,7 +89,7 @@ namespace PolyVox stream.read(reinterpret_cast(&volumeDepthPower), sizeof(volumeDepthPower)); //FIXME - need to support non cubic volumes - BlockVolume* volume = new BlockVolume(volumeWidthPower); + Volume* volume = new Volume(volumeWidthPower); uint16 volumeWidth = 0x0001 << volumeWidthPower; uint16 volumeHeight = 0x0001 << volumeHeightPower; @@ -127,7 +127,7 @@ namespace PolyVox return volume; } - void saveVolumeRle(std::ostream& stream, BlockVolume& volume) + void saveVolumeRle(std::ostream& stream, Volume& volume) { //Write volume dimensions uint16 volumeWidth = volume.getSideLength(); @@ -143,7 +143,7 @@ namespace PolyVox stream.write(reinterpret_cast(&volumeDepthPower), sizeof(volumeDepthPower)); //Write data - BlockVolumeIterator volIter(volume); + VolumeIterator volIter(volume); uint8 current = 0; uint32 runLength = 0; bool firstTime = true; diff --git a/library/source/PolyVoxUtil/VolumeChangeTracker.cpp b/library/source/PolyVoxUtil/VolumeChangeTracker.cpp index a6625146..848fef91 100644 --- a/library/source/PolyVoxUtil/VolumeChangeTracker.cpp +++ b/library/source/PolyVoxUtil/VolumeChangeTracker.cpp @@ -28,8 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxCore/SurfaceVertex.h" #include "PolyVoxCore/Utility.h" #include "PolyVoxCore/Vector.h" -#include "PolyVoxCore/BlockVolume.h" -#include "PolyVoxCore/BlockVolumeIterator.h" +#include "PolyVoxCore/Volume.h" +#include "PolyVoxCore/VolumeIterator.h" using namespace std; @@ -50,7 +50,7 @@ namespace PolyVox { } - void VolumeChangeTracker::setVolumeData(BlockVolume* volumeDataToSet) + void VolumeChangeTracker::setVolumeData(Volume* volumeDataToSet) { volumeData = volumeDataToSet; volRegionLastModified = new Block(PolyVox::logBase2(POLYVOX_VOLUME_SIDE_LENGTH_IN_REGIONS)); @@ -102,12 +102,12 @@ namespace PolyVox assert(uY < volumeData->getSideLength()); assert(uZ < volumeData->getSideLength()); - BlockVolumeIterator volIter(*volumeData); + VolumeIterator volIter(*volumeData); volIter.setPosition(uX,uY,uZ); return volIter.getVoxel(); } - BlockVolume* VolumeChangeTracker::getVolumeData(void) const + Volume* VolumeChangeTracker::getVolumeData(void) const { return volumeData; } @@ -117,7 +117,7 @@ namespace PolyVox { ++m_iCurrentTime; //FIXME - rather than creating a iterator each time we should have one stored - //BlockVolumeIterator iterVol(*volumeData); + //VolumeIterator iterVol(*volumeData); /*iterVol.setPosition(x,y,z); iterVol.setVoxel(value);*/ @@ -166,7 +166,7 @@ namespace PolyVox assert(m_bIsLocked); //FIXME - rather than creating a iterator each time we should have one stored - /*BlockVolumeIterator iterVol(*volumeData); + /*VolumeIterator iterVol(*volumeData); iterVol.setPosition(x,y,z); iterVol.setVoxel(value);*/ volumeData->setVoxelAt(x,y,z,value);