From 92cf2402e2d07eb86fa4e635e43484e872a4dd5e Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 2 Apr 2009 20:37:43 +0000 Subject: [PATCH] Moved various files from PolyVoxCore to PolyVoxImpl. --- library/CMakeLists.txt | 3 ++- .../include/PolyVoxCore/GradientEstimators.h | 9 +++++++ .../PolyVoxCore/PolyVoxForwardDeclarations.h | 1 - .../{Enums.h => PolyVoxImpl/Block.h} | 25 +++++++++++++------ .../include/PolyVoxCore/PolyVoxImpl/Block.inl | 0 library/include/PolyVoxCore/Volume.h | 13 +--------- library/include/PolyVoxCore/Volume.inl | 16 ------------ 7 files changed, 29 insertions(+), 38 deletions(-) rename library/include/PolyVoxCore/{Enums.h => PolyVoxImpl/Block.h} (68%) create mode 100644 library/include/PolyVoxCore/PolyVoxImpl/Block.inl diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 6b32387b..fb1b3d0c 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -15,7 +15,6 @@ SET(CORE_SRC_FILES #Projects headers files SET(CORE_INC_FILES - include/PolyVoxCore/Enums.h include/PolyVoxCore/GradientEstimators.h include/PolyVoxCore/GradientEstimators.inl include/PolyVoxCore/IndexedSurfacePatch.h @@ -42,6 +41,8 @@ SET(IMPL_SRC_FILES ) SET(IMPL_INC_FILES + include/PolyVoxCore/PolyVoxImpl/Block.h + include/PolyVoxCore/PolyVoxImpl/Block.inl include/PolyVoxCore/PolyVoxImpl/BlockData.h include/PolyVoxCore/PolyVoxImpl/BlockData.inl include/PolyVoxCore/PolyVoxImpl/CPlusPlusZeroXSupport.h diff --git a/library/include/PolyVoxCore/GradientEstimators.h b/library/include/PolyVoxCore/GradientEstimators.h index a7e05e88..eb057b77 100644 --- a/library/include/PolyVoxCore/GradientEstimators.h +++ b/library/include/PolyVoxCore/GradientEstimators.h @@ -28,6 +28,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { + enum NormalGenerationMethod + { + SIMPLE, /// Vector3DFloat computeCentralDifferenceGradient(const VolumeIterator& volIter); diff --git a/library/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 0face6b4..917411e3 100644 --- a/library/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __PolyVox_ForwardDeclarations_H__ #define __PolyVox_ForwardDeclarations_H__ -#include "Enums.h" #include "PolyVoxImpl/CPlusPlusZeroXSupport.h" namespace PolyVox diff --git a/library/include/PolyVoxCore/Enums.h b/library/include/PolyVoxCore/PolyVoxImpl/Block.h similarity index 68% rename from library/include/PolyVoxCore/Enums.h rename to library/include/PolyVoxCore/PolyVoxImpl/Block.h index 00e09a39..1b67a52b 100644 --- a/library/include/PolyVoxCore/Enums.h +++ b/library/include/PolyVoxCore/PolyVoxImpl/Block.h @@ -19,19 +19,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ #pragma endregion -#ifndef __PolyVox_Enums_H__ -#define __PolyVox_Enums_H__ +#ifndef __PolyVox_Block_H__ +#define __PolyVox_Block_H__ + +#pragma region Headers +#include "PolyVoxForwardDeclarations.h" + +#include "PolyVoxImpl/CPlusPlusZeroXSupport.h" +#pragma endregion namespace PolyVox { - enum NormalGenerationMethod + template + class Block { - SIMPLE, /// > m_pBlockData; + VoxelType m_pHomogenousValue; + bool m_bIsShared; + bool m_bIsPotentiallySharable; }; } +#include "Block.inl" + #endif diff --git a/library/include/PolyVoxCore/PolyVoxImpl/Block.inl b/library/include/PolyVoxCore/PolyVoxImpl/Block.inl new file mode 100644 index 00000000..e69de29b diff --git a/library/include/PolyVoxCore/Volume.h b/library/include/PolyVoxCore/Volume.h index 84880f64..1a696a2f 100644 --- a/library/include/PolyVoxCore/Volume.h +++ b/library/include/PolyVoxCore/Volume.h @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define __PolyVox_Volume_H__ #pragma region Headers +#include "PolyVoxCore/PolyVoxImpl/Block.h" #include "PolyVoxForwardDeclarations.h" #include "PolyVoxImpl/CPlusPlusZeroXSupport.h" @@ -32,16 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - template - class Block - { - public: - POLYVOX_SHARED_PTR< BlockData > m_pBlockData; - VoxelType m_pHomogenousValue; - bool m_bIsShared; - bool m_bIsPotentiallySharable; - }; - template class Volume { @@ -63,10 +54,8 @@ namespace PolyVox void setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue); void setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue); - VolumeIterator firstVoxel(void); void idle(uint32_t uAmount); bool isRegionHomogenous(const Region& region); - VolumeIterator lastVoxel(void); private: POLYVOX_SHARED_PTR< BlockData > getHomogenousBlockData(VoxelType tHomogenousValue) const; diff --git a/library/include/PolyVoxCore/Volume.inl b/library/include/PolyVoxCore/Volume.inl index b267fa81..688a68a9 100644 --- a/library/include/PolyVoxCore/Volume.inl +++ b/library/include/PolyVoxCore/Volume.inl @@ -221,14 +221,6 @@ namespace PolyVox #pragma endregion #pragma region Other - template - VolumeIterator Volume::firstVoxel(void) - { - VolumeIterator iter(*this); - iter.setPosition(0,0,0); - return iter; - } - template void Volume::idle(uint32_t uAmount) { @@ -283,14 +275,6 @@ namespace PolyVox return true; } - - template - VolumeIterator Volume::lastVoxel(void) - { - VolumeIterator iter(*this); - iter.setPosition(m_uSideLength-1,m_uSideLength-1,m_uSideLength-1); - return iter; - } #pragma endregion #pragma region Private Implementation