Added asserting copy constructors and assignment operators to volumes.

This commit is contained in:
unknown
2012-11-02 14:41:56 +01:00
parent 2566f3a7d2
commit b5414381ec
8 changed files with 150 additions and 31 deletions

View File

@ -29,17 +29,26 @@ namespace PolyVox
/// \param uBlockSideLength The size of the block to use within the volume
////////////////////////////////////////////////////////////////////////////////
template <typename VoxelType>
SimpleVolume<VoxelType>::SimpleVolume
(
const Region& regValid,
uint16_t uBlockSideLength
)
:BaseVolume<VoxelType>(regValid)
SimpleVolume<VoxelType>::SimpleVolume(const Region& regValid, uint16_t uBlockSideLength)
:BaseVolume<VoxelType>(regValid)
{
//Create a volume of the right size.
initialise(regValid,uBlockSideLength);
}
////////////////////////////////////////////////////////////////////////////////
/// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing
/// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to
/// make a copy of a volume and in this case you should look at the Volumeresampler.
///
/// \sa VolumeResampler
////////////////////////////////////////////////////////////////////////////////
template <typename VoxelType>
SimpleVolume<VoxelType>::SimpleVolume(const SimpleVolume<VoxelType>& rhs)
{
assert(false); // See function comment above.
}
////////////////////////////////////////////////////////////////////////////////
/// Destroys the volume
////////////////////////////////////////////////////////////////////////////////
@ -50,6 +59,19 @@ namespace PolyVox
delete[] m_pUncompressedBorderData;
}
////////////////////////////////////////////////////////////////////////////////
/// This function should never be called. Copying volumes by value would be expensive, and we want to prevent users from doing
/// it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to
/// make a copy of a volume and in this case you should look at the Volumeresampler.
///
/// \sa VolumeResampler
////////////////////////////////////////////////////////////////////////////////
template <typename VoxelType>
SimpleVolume<VoxelType>& SimpleVolume<VoxelType>::operator=(const SimpleVolume<VoxelType>& rhs)
{
assert(false); // See function comment above.
}
////////////////////////////////////////////////////////////////////////////////
/// The border value is returned whenever an attempt is made to read a voxel which
/// is outside the extents of the volume.