Renamed Volume to LargeVolume.
This commit is contained in:
@ -42,28 +42,28 @@ namespace PolyVox
|
||||
// THESE FUNCTIONS ARE DEPRECATED. USE VERSIONED 'loadVolume' AND 'saveVolume' INSTEAD.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
template <typename VoxelType>
|
||||
polyvox_shared_ptr< Volume<VoxelType> > loadVolumeRaw(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
|
||||
polyvox_shared_ptr< LargeVolume<VoxelType> > loadVolumeRaw(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
|
||||
template <typename VoxelType>
|
||||
void saveVolumeRaw(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
void saveVolumeRaw(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
|
||||
template <typename VoxelType>
|
||||
polyvox_shared_ptr< Volume<VoxelType> > loadVolumeRle(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
|
||||
polyvox_shared_ptr< LargeVolume<VoxelType> > loadVolumeRle(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
|
||||
template <typename VoxelType>
|
||||
void saveVolumeRle(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
void saveVolumeRle(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// END OF DEPRECATED FUNCTIONS
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename VoxelType>
|
||||
bool loadVolume(std::istream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
bool loadVolume(std::istream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
template <typename VoxelType>
|
||||
bool saveVolume(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
bool saveVolume(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
|
||||
template <typename VoxelType>
|
||||
bool loadVersion0(std::istream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
bool loadVersion0(std::istream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
template <typename VoxelType>
|
||||
bool saveVersion0(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
bool saveVersion0(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
|
||||
}
|
||||
|
||||
#include "Serialization.inl"
|
||||
|
@ -21,7 +21,7 @@ freely, subject to the following restrictions:
|
||||
distribution.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "Volume.h"
|
||||
#include "LargeVolume.h"
|
||||
#include "PolyVoxImpl/Utility.h"
|
||||
|
||||
namespace PolyVox
|
||||
@ -29,7 +29,7 @@ namespace PolyVox
|
||||
//Note: we don't do much error handling in here - exceptions will simply be propergated up to the caller.
|
||||
//FIXME - think about pointer ownership issues. Or could return volume by value if the copy constructor is shallow
|
||||
template <typename VoxelType>
|
||||
polyvox_shared_ptr< Volume<VoxelType> > loadVolumeRaw(std::istream& stream, VolumeSerializationProgressListener* progressListener)
|
||||
polyvox_shared_ptr< LargeVolume<VoxelType> > loadVolumeRaw(std::istream& stream, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
assert(false); //THIS FUNCTION IS DEPRECATED. REMOVE THIS ASSERT TO CONTINUE, BUT SWITCH TO 'loadVolume()' ASAP.
|
||||
|
||||
@ -46,7 +46,7 @@ namespace PolyVox
|
||||
uint16_t volumeDepth = 0x0001 << volumeDepthPower;
|
||||
|
||||
//FIXME - need to support non cubic volumes
|
||||
polyvox_shared_ptr< Volume<VoxelType> > volume(new Volume<VoxelType>(volumeWidth, volumeHeight, volumeDepth));
|
||||
polyvox_shared_ptr< LargeVolume<VoxelType> > volume(new LargeVolume<VoxelType>(volumeWidth, volumeHeight, volumeDepth));
|
||||
|
||||
//Read data
|
||||
for(uint16_t z = 0; z < volumeDepth; ++z)
|
||||
@ -80,7 +80,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void saveVolumeRaw(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
void saveVolumeRaw(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
assert(false); //THIS FUNCTION IS DEPRECATED. REMOVE THIS ASSERT TO CONTINUE, BUT SWITCH TO 'saveVolume()' ASAP.
|
||||
|
||||
@ -98,7 +98,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//Write data
|
||||
Volume<VoxelType>::Sampler volIter(&volume);
|
||||
LargeVolume<VoxelType>::Sampler volIter(&volume);
|
||||
for(uint16_t z = 0; z < volumeDepth; ++z)
|
||||
{
|
||||
//Update progress once per slice.
|
||||
@ -129,7 +129,7 @@ namespace PolyVox
|
||||
//Note: we don't do much error handling in here - exceptions will simply be propergated up to the caller.
|
||||
//FIXME - think about pointer ownership issues. Or could return volume by value if the copy constructor is shallow
|
||||
template <typename VoxelType>
|
||||
polyvox_shared_ptr< Volume<VoxelType> > loadVolumeRle(std::istream& stream, VolumeSerializationProgressListener* progressListener)
|
||||
polyvox_shared_ptr< LargeVolume<VoxelType> > loadVolumeRle(std::istream& stream, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
assert(false); //THIS FUNCTION IS DEPRECATED. REMOVE THIS ASSERT TO CONTINUE, BUT SWITCH TO 'loadVolume()' ASAP.
|
||||
|
||||
@ -146,7 +146,7 @@ namespace PolyVox
|
||||
uint16_t volumeDepth = 0x0001 << volumeDepthPower;
|
||||
|
||||
//FIXME - need to support non cubic volumes
|
||||
polyvox_shared_ptr< Volume<VoxelType> > volume(new Volume<VoxelType>(volumeWidth, volumeHeight, volumeDepth));
|
||||
polyvox_shared_ptr< LargeVolume<VoxelType> > volume(new LargeVolume<VoxelType>(volumeWidth, volumeHeight, volumeDepth));
|
||||
|
||||
//Read data
|
||||
bool firstTime = true;
|
||||
@ -194,7 +194,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void saveVolumeRle(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
void saveVolumeRle(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
assert(false); //THIS FUNCTION IS DEPRECATED. REMOVE THIS ASSERT TO CONTINUE, BUT SWITCH TO 'saveVolume()' ASAP.
|
||||
|
||||
@ -212,7 +212,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//Write data
|
||||
Volume<VoxelType>::Sampler volIter(&volume);
|
||||
LargeVolume<VoxelType>::Sampler volIter(&volume);
|
||||
VoxelType current;
|
||||
uint32_t runLength = 0;
|
||||
bool firstTime = true;
|
||||
@ -269,7 +269,7 @@ namespace PolyVox
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename VoxelType>
|
||||
bool loadVolume(std::istream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
bool loadVolume(std::istream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
char pIdentifier[8];
|
||||
stream.read(pIdentifier, 7);
|
||||
@ -294,7 +294,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool saveVolume(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
bool saveVolume(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
char pIdentifier[] = "PolyVox";
|
||||
stream.write(pIdentifier, 7);
|
||||
@ -308,7 +308,7 @@ namespace PolyVox
|
||||
//Note: we don't do much error handling in here - exceptions will simply be propergated up to the caller.
|
||||
//FIXME - think about pointer ownership issues. Or could return volume by value if the copy constructor is shallow
|
||||
template <typename VoxelType>
|
||||
bool loadVersion0(std::istream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
bool loadVersion0(std::istream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
//Read volume dimensions
|
||||
uint16_t volumeWidth = 0;
|
||||
@ -368,7 +368,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool saveVersion0(std::ostream& stream, Volume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
bool saveVersion0(std::ostream& stream, LargeVolume<VoxelType>& volume, VolumeSerializationProgressListener* progressListener)
|
||||
{
|
||||
//Write volume dimensions
|
||||
uint16_t volumeWidth = volume.getWidth();
|
||||
@ -380,7 +380,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepth), sizeof(volumeDepth));
|
||||
|
||||
//Write data
|
||||
Volume<VoxelType>::Sampler volIter(&volume);
|
||||
LargeVolume<VoxelType>::Sampler volIter(&volume);
|
||||
VoxelType current;
|
||||
uint32_t runLength = 0;
|
||||
bool firstTime = true;
|
||||
|
@ -37,13 +37,13 @@ namespace PolyVox
|
||||
{
|
||||
public:
|
||||
//Constructors, etc
|
||||
VolumeChangeTracker(Volume<VoxelType>* volumeDataToSet, uint16_t regionSideLength);
|
||||
VolumeChangeTracker(LargeVolume<VoxelType>* volumeDataToSet, uint16_t regionSideLength);
|
||||
~VolumeChangeTracker();
|
||||
|
||||
//Getters
|
||||
int32_t getCurrentTime(void) const;
|
||||
int32_t getLastModifiedTimeForRegion(uint16_t uX, uint16_t uY, uint16_t uZ);
|
||||
Volume<VoxelType>* getWrappedVolume(void) const;
|
||||
LargeVolume<VoxelType>* getWrappedVolume(void) const;
|
||||
|
||||
//Setters
|
||||
void setAllRegionsModified(void);
|
||||
@ -59,7 +59,7 @@ namespace PolyVox
|
||||
void incrementCurrentTime(void);
|
||||
bool m_bIsLocked;
|
||||
Region m_regLastLocked;
|
||||
Volume<VoxelType>* volumeData;
|
||||
LargeVolume<VoxelType>* volumeData;
|
||||
|
||||
uint16_t m_uRegionSideLength;
|
||||
uint8_t m_uRegionSideLengthPower;
|
||||
@ -70,7 +70,7 @@ namespace PolyVox
|
||||
|
||||
//It's not what the block class was designed for, but it
|
||||
//provides a handy way of storing a 3D grid of values.
|
||||
Volume<int32_t>* volRegionLastModified;
|
||||
LargeVolume<int32_t>* volRegionLastModified;
|
||||
|
||||
static uint32_t m_uCurrentTime;
|
||||
};
|
||||
|
@ -29,7 +29,7 @@ freely, subject to the following restrictions:
|
||||
#include "VertexTypes.h"
|
||||
#include "PolyVoxImpl/Utility.h"
|
||||
#include "Vector.h"
|
||||
#include "Volume.h"
|
||||
#include "LargeVolume.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
@ -40,7 +40,7 @@ namespace PolyVox
|
||||
// VolumeChangeTracker
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
template <typename VoxelType>
|
||||
VolumeChangeTracker<VoxelType>::VolumeChangeTracker(Volume<VoxelType>* volumeDataToSet, uint16_t regionSideLength)
|
||||
VolumeChangeTracker<VoxelType>::VolumeChangeTracker(LargeVolume<VoxelType>* volumeDataToSet, uint16_t regionSideLength)
|
||||
:m_bIsLocked(false)
|
||||
,volumeData(0)
|
||||
,m_uRegionSideLength(regionSideLength)
|
||||
@ -51,7 +51,7 @@ namespace PolyVox
|
||||
m_uVolumeDepthInRegions = volumeData->getDepth() / m_uRegionSideLength;
|
||||
m_uRegionSideLengthPower = PolyVox::logBase2(m_uRegionSideLength);
|
||||
|
||||
volRegionLastModified = new Volume<int32_t>(m_uVolumeWidthInRegions, m_uVolumeHeightInRegions, m_uVolumeDepthInRegions, 0);
|
||||
volRegionLastModified = new LargeVolume<int32_t>(m_uVolumeWidthInRegions, m_uVolumeHeightInRegions, m_uVolumeDepthInRegions, 0);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -88,7 +88,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Volume<VoxelType>* VolumeChangeTracker<VoxelType>::getWrappedVolume(void) const
|
||||
LargeVolume<VoxelType>* VolumeChangeTracker<VoxelType>::getWrappedVolume(void) const
|
||||
{
|
||||
return volumeData;
|
||||
}
|
||||
|
Reference in New Issue
Block a user