Removed some not useful functions.

This commit is contained in:
David Williams 2015-03-04 23:31:24 +01:00
parent 1213a4047a
commit 61bffc9783
4 changed files with 3 additions and 58 deletions

View File

@ -43,7 +43,7 @@ namespace PolyVox
template <typename VoxelType> template <typename VoxelType>
BaseVolume<VoxelType>::BaseVolume(const BaseVolume<VoxelType>& /*rhs*/) BaseVolume<VoxelType>::BaseVolume(const BaseVolume<VoxelType>& /*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 <typename VoxelType> template <typename VoxelType>
BaseVolume<VoxelType>& BaseVolume<VoxelType>::operator=(const BaseVolume<VoxelType>& /*rhs*/) BaseVolume<VoxelType>& BaseVolume<VoxelType>::operator=(const BaseVolume<VoxelType>& /*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.");
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -355,11 +355,6 @@ namespace PolyVox
//Clear the previous data //Clear the previous data
m_pRecentlyUsedChunks.clear(); 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<float>(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth()));
} }
template <typename VoxelType> template <typename VoxelType>

View File

@ -134,12 +134,6 @@ namespace PolyVox
int32_t getHeight(void) const; int32_t getHeight(void) const;
/// Gets the depth of the volume in voxels. /// Gets the depth of the volume in voxels.
int32_t getDepth(void) const; 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 <tt>x,y,z</tt> coordinates /// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates
VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos) const;
@ -169,11 +163,6 @@ namespace PolyVox
//The size of the volume //The size of the volume
Region m_regValidRegion; Region m_regValidRegion;
//Some useful sizes
int32_t m_uLongestSideLength;
int32_t m_uShortestSideLength;
float m_fDiagonalLength;
//The border value //The border value
VoxelType m_tBorderValue; VoxelType m_tBorderValue;

View File

@ -125,40 +125,6 @@ namespace PolyVox
return m_regValidRegion.getUpperZ() - m_regValidRegion.getLowerZ() + 1; 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 <typename VoxelType>
int32_t RawVolume<VoxelType>::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 <typename VoxelType>
int32_t RawVolume<VoxelType>::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 <typename VoxelType>
float RawVolume<VoxelType>::getDiagonalLength(void) const
{
return m_fDiagonalLength;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// This version of the function is provided so that the wrap mode does not need /// 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. /// to be specified as a template parameter, as it may be confusing to some users.
@ -186,7 +152,7 @@ namespace PolyVox
} }
else else
{ {
return VoxelType(); return m_tBorderValue;
} }
} }
@ -274,11 +240,6 @@ namespace PolyVox
// Clear to zeros // Clear to zeros
std::fill(m_pData, m_pData + this->getWidth() * this->getHeight()* this->getDepth(), VoxelType()); 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<float>(this->getWidth() * this->getWidth() + this->getHeight() * this->getHeight() + this->getDepth() * this->getDepth()));
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////