From 61bffc9783524d3920c3a691dba0f33e22d213c1 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 4 Mar 2015 23:31:24 +0100 Subject: [PATCH] Removed some not useful functions. --- include/PolyVox/BaseVolume.inl | 4 ++-- include/PolyVox/PagedVolume.inl | 5 ---- include/PolyVox/RawVolume.h | 11 --------- include/PolyVox/RawVolume.inl | 41 +-------------------------------- 4 files changed, 3 insertions(+), 58 deletions(-) diff --git a/include/PolyVox/BaseVolume.inl b/include/PolyVox/BaseVolume.inl index 6ba07f1f..f3fcfd06 100644 --- a/include/PolyVox/BaseVolume.inl +++ b/include/PolyVox/BaseVolume.inl @@ -43,7 +43,7 @@ namespace PolyVox template BaseVolume::BaseVolume(const BaseVolume& /*rhs*/) { - POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented for performance reasons."); + POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented to prevent accidental copying."); } //////////////////////////////////////////////////////////////////////////////// @@ -64,7 +64,7 @@ namespace PolyVox template BaseVolume& BaseVolume::operator=(const BaseVolume& /*rhs*/) { - POLYVOX_THROW(not_implemented, "Volume assignment operator not implemented for performance reasons."); + POLYVOX_THROW(not_implemented, "Volume copy constructor not implemented to prevent accidental copying."); } //////////////////////////////////////////////////////////////////////////////// diff --git a/include/PolyVox/PagedVolume.inl b/include/PolyVox/PagedVolume.inl index 82c55e54..bf648a40 100644 --- a/include/PolyVox/PagedVolume.inl +++ b/include/PolyVox/PagedVolume.inl @@ -355,11 +355,6 @@ namespace PolyVox //Clear the previous data m_pRecentlyUsedChunks.clear(); - - //Other properties we might find useful later - //this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); - //this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth()); - //this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); } template diff --git a/include/PolyVox/RawVolume.h b/include/PolyVox/RawVolume.h index 41139f78..4b05f7d5 100644 --- a/include/PolyVox/RawVolume.h +++ b/include/PolyVox/RawVolume.h @@ -134,12 +134,6 @@ namespace PolyVox int32_t getHeight(void) const; /// Gets the depth of the volume in voxels. int32_t getDepth(void) const; - /// Gets the length of the longest side in voxels - int32_t getLongestSideLength(void) const; - /// Gets the length of the shortest side in voxels - int32_t getShortestSideLength(void) const; - /// Gets the length of the diagonal in voxels - float getDiagonalLength(void) const; /// Gets a voxel at the position given by x,y,z coordinates VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; @@ -169,11 +163,6 @@ namespace PolyVox //The size of the volume Region m_regValidRegion; - //Some useful sizes - int32_t m_uLongestSideLength; - int32_t m_uShortestSideLength; - float m_fDiagonalLength; - //The border value VoxelType m_tBorderValue; diff --git a/include/PolyVox/RawVolume.inl b/include/PolyVox/RawVolume.inl index 0a04655b..efca9982 100644 --- a/include/PolyVox/RawVolume.inl +++ b/include/PolyVox/RawVolume.inl @@ -125,40 +125,6 @@ namespace PolyVox return m_regValidRegion.getUpperZ() - m_regValidRegion.getLowerZ() + 1; } - //////////////////////////////////////////////////////////////////////////////// - /// \return The length of the shortest side in voxels. For example, if a volume has - /// dimensions 256x512x1024 this function will return 256. - /// \sa getLongestSideLength(), getDiagonalLength() - //////////////////////////////////////////////////////////////////////////////// - template - int32_t RawVolume::getShortestSideLength(void) const - { - return m_uShortestSideLength; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The length of the longest side in voxels. For example, if a volume has - /// dimensions 256x512x1024 this function will return 1024. - /// \sa getShortestSideLength(), getDiagonalLength() - //////////////////////////////////////////////////////////////////////////////// - template - int32_t RawVolume::getLongestSideLength(void) const - { - return m_uLongestSideLength; - } - - //////////////////////////////////////////////////////////////////////////////// - /// \return The length of the diagonal in voxels. For example, if a volume has - /// dimensions 256x512x1024 this function will return sqrt(256*256+512*512+1024*1024) - /// = 1173.139. This value is computed on volume creation so retrieving it is fast. - /// \sa getShortestSideLength(), getLongestSideLength() - //////////////////////////////////////////////////////////////////////////////// - template - float RawVolume::getDiagonalLength(void) const - { - return m_fDiagonalLength; - } - //////////////////////////////////////////////////////////////////////////////// /// This version of the function is provided so that the wrap mode does not need /// to be specified as a template parameter, as it may be confusing to some users. @@ -186,7 +152,7 @@ namespace PolyVox } else { - return VoxelType(); + return m_tBorderValue; } } @@ -274,11 +240,6 @@ namespace PolyVox // Clear to zeros std::fill(m_pData, m_pData + this->getWidth() * this->getHeight()* this->getDepth(), VoxelType()); - - //Other properties we might find useful later - this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_uShortestSideLength = (std::min)((std::min)(this->getWidth(),this->getHeight()),this->getDepth()); - this->m_fDiagonalLength = sqrtf(static_cast(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth())); } ////////////////////////////////////////////////////////////////////////////////