diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e63a0fc..c5933caa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,11 @@ PROJECT(PolyVox) SET(SRC_FILES source/IndexedSurfacePatch.cpp source/MarchingCubesTables.cpp - source/PolyVoxSceneManager.cpp source/RegionGeometry.cpp source/SurfaceExtractors.cpp source/SurfaceVertex.cpp source/Utility.cpp + source/VolumeChangeTracker.cpp ) #Projects headers files @@ -26,14 +26,14 @@ SET(INC_FILES include/IndexedSurfacePatch.h include/MarchingCubesTables.h include/PolyVoxForwardDeclarations.h - include/PolyVoxSceneManager.h include/RegionGeometry.h include/SurfaceExtractors.h include/SurfaceVertex.h include/TypeDef.h include/Utility.h include/Vector.h - include/Vector.inl + include/Vector.inl + include/VolumeChangeTracker.h include/VolumeIterator.h include/VolumeIterator.inl ) diff --git a/include/PolyVoxForwardDeclarations.h b/include/PolyVoxForwardDeclarations.h index 8f6d7c3a..427a2492 100644 --- a/include/PolyVoxForwardDeclarations.h +++ b/include/PolyVoxForwardDeclarations.h @@ -37,7 +37,7 @@ namespace PolyVox class IndexedSurfacePatch; class IntegrealVector3; template class LinearVolume; - class PolyVoxSceneManager; + class VolumeChangeTracker; class RegionGeometry; class SurfaceVertex; template class Vector; diff --git a/include/PolyVoxSceneManager.h b/include/VolumeChangeTracker.h similarity index 90% rename from include/PolyVoxSceneManager.h rename to include/VolumeChangeTracker.h index 1091ce51..396a5888 100644 --- a/include/PolyVoxSceneManager.h +++ b/include/VolumeChangeTracker.h @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ #pragma endregion -#ifndef __PolyVox_PolyVoxSceneManager_H__ -#define __PolyVox_PolyVoxSceneManager_H__ +#ifndef __PolyVox_VolumeChangeTracker_H__ +#define __PolyVox_VolumeChangeTracker_H__ #include @@ -33,12 +33,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { /// Voxel scene manager - class POLYVOX_API PolyVoxSceneManager + class POLYVOX_API VolumeChangeTracker { public: //Constructors, etc - PolyVoxSceneManager(); - ~PolyVoxSceneManager(); + VolumeChangeTracker(); + ~VolumeChangeTracker(); //Getters boost::uint8_t getMaterialIndexAt(boost::uint16_t uX, boost::uint16_t uY, boost::uint16_t uZ); diff --git a/source/PolyVoxSceneManager.cpp b/source/VolumeChangeTracker.cpp similarity index 88% rename from source/PolyVoxSceneManager.cpp rename to source/VolumeChangeTracker.cpp index 9857afd7..be529203 100644 --- a/source/PolyVoxSceneManager.cpp +++ b/source/VolumeChangeTracker.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "IndexedSurfacePatch.h" #include "LinearVolume.h" #include "MarchingCubesTables.h" -#include "PolyVoxSceneManager.h" +#include "VolumeChangeTracker.h" #include "RegionGeometry.h" #include "SurfaceExtractors.h" #include "SurfaceVertex.h" @@ -38,9 +38,9 @@ namespace PolyVox { ////////////////////////////////////////////////////////////////////////// - // PolyVoxSceneManager + // VolumeChangeTracker ////////////////////////////////////////////////////////////////////////// - PolyVoxSceneManager::PolyVoxSceneManager() + VolumeChangeTracker::VolumeChangeTracker() :volumeData(0) ,useNormalSmoothing(false) ,normalSmoothingFilterSize(1) @@ -50,17 +50,17 @@ namespace PolyVox //sceneNodes.clear();` } - PolyVoxSceneManager::~PolyVoxSceneManager() + VolumeChangeTracker::~VolumeChangeTracker() { } - void PolyVoxSceneManager::setVolumeData(BlockVolume* volumeDataToSet) + void VolumeChangeTracker::setVolumeData(BlockVolume* volumeDataToSet) { volumeData = volumeDataToSet; volSurfaceUpToDate = new LinearVolume(PolyVox::logBase2(POLYVOX_VOLUME_SIDE_LENGTH_IN_REGIONS)); } - std::list PolyVoxSceneManager::getChangedRegionGeometry(void) + std::list VolumeChangeTracker::getChangedRegionGeometry(void) { std::list listChangedRegionGeometry; @@ -98,7 +98,7 @@ namespace PolyVox return listChangedRegionGeometry; } - void PolyVoxSceneManager::setAllUpToDateFlagsTo(bool newUpToDateValue) + void VolumeChangeTracker::setAllUpToDateFlagsTo(bool newUpToDateValue) { for(uint16_t blockZ = 0; blockZ < POLYVOX_VOLUME_SIDE_LENGTH_IN_REGIONS; ++blockZ) { @@ -113,7 +113,7 @@ namespace PolyVox } } - void PolyVoxSceneManager::createSphereAt(Vector3DFloat centre, float radius, uint8_t value, bool painting) + void VolumeChangeTracker::createSphereAt(Vector3DFloat centre, float radius, uint8_t value, bool painting) { int firstX = static_cast(std::floor(centre.x() - radius)); int firstY = static_cast(std::floor(centre.y() - radius)); @@ -162,7 +162,7 @@ namespace PolyVox markRegionChanged(firstX,firstY,firstZ,lastX,lastY,lastZ); } - void PolyVoxSceneManager::markVoxelChanged(uint16_t x, uint16_t y, uint16_t z) + void VolumeChangeTracker::markVoxelChanged(uint16_t x, uint16_t y, uint16_t z) { //If we are not on a boundary, just mark one region. if((x % POLYVOX_REGION_SIDE_LENGTH != 0) && @@ -203,7 +203,7 @@ namespace PolyVox } } - void PolyVoxSceneManager::markRegionChanged(uint16_t firstX, uint16_t firstY, uint16_t firstZ, uint16_t lastX, uint16_t lastY, uint16_t lastZ) + void VolumeChangeTracker::markRegionChanged(uint16_t firstX, uint16_t firstY, uint16_t firstZ, uint16_t lastX, uint16_t lastY, uint16_t lastZ) { const uint16_t firstRegionX = firstX >> POLYVOX_REGION_SIDE_LENGTH_POWER; const uint16_t firstRegionY = firstY >> POLYVOX_REGION_SIDE_LENGTH_POWER; @@ -226,12 +226,12 @@ namespace PolyVox } } - uint16_t PolyVoxSceneManager::getSideLength(void) + uint16_t VolumeChangeTracker::getSideLength(void) { return volumeData->getSideLength(); } - uint8_t PolyVoxSceneManager::getMaterialIndexAt(uint16_t uX, uint16_t uY, uint16_t uZ) + uint8_t VolumeChangeTracker::getMaterialIndexAt(uint16_t uX, uint16_t uY, uint16_t uZ) { if(volumeData->containsPoint(Vector3DInt32(uX,uY,uZ),0)) { @@ -245,30 +245,30 @@ namespace PolyVox } } - void PolyVoxSceneManager::setNormalGenerationMethod(NormalGenerationMethod method) + void VolumeChangeTracker::setNormalGenerationMethod(NormalGenerationMethod method) { m_normalGenerationMethod = method; } - /*bool PolyVoxSceneManager::containsPoint(Vector3DFloat pos, float boundary) + /*bool VolumeChangeTracker::containsPoint(Vector3DFloat pos, float boundary) { return volumeData->containsPoint(pos, boundary); } - bool PolyVoxSceneManager::containsPoint(Vector3DInt32 pos, uint16_t boundary) + bool VolumeChangeTracker::containsPoint(Vector3DInt32 pos, uint16_t boundary) { return volumeData->containsPoint(pos, boundary); }*/ /* - void PolyVoxSceneManager::setAxisVisible(bool visible) + void VolumeChangeTracker::setAxisVisible(bool visible) { if(m_axisNode) m_axisNode->setVisible(visible); }*/ - const BlockVolume* PolyVoxSceneManager::getVolumeData(void) const + const BlockVolume* VolumeChangeTracker::getVolumeData(void) const { return volumeData; }