Renamed Volume to BlockVolume.
This commit is contained in:
parent
dc9950d1c8
commit
b42f28793f
@ -14,6 +14,8 @@ SET(SRC_FILES
|
||||
SET(INC_FILES
|
||||
include/Block.h
|
||||
include/Block.inl
|
||||
include/BlockVolume.h
|
||||
include/BlockVolume.inl
|
||||
include/Constants.h
|
||||
include/GradientEstimators.h
|
||||
include/GradientEstimators.inl
|
||||
@ -28,9 +30,7 @@ SET(INC_FILES
|
||||
include/TypeDef.h
|
||||
include/Utility.h
|
||||
include/Vector.h
|
||||
include/Vector.inl
|
||||
include/Volume.h
|
||||
include/Volume.inl
|
||||
include/Vector.inl
|
||||
include/VolumeIterator.h
|
||||
include/VolumeIterator.inl
|
||||
)
|
||||
|
@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
******************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#ifndef __PolyVox_Volume_H__
|
||||
#define __PolyVox_Volume_H__
|
||||
#ifndef __PolyVox_BlockVolume_H__
|
||||
#define __PolyVox_BlockVolume_H__
|
||||
|
||||
#pragma region Headers
|
||||
#include "PolyVoxForwardDeclarations.h"
|
||||
@ -33,17 +33,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType>
|
||||
class Volume
|
||||
class BlockVolume
|
||||
{
|
||||
//Make VolumeIterator a friend
|
||||
friend class VolumeIterator<VoxelType>;
|
||||
|
||||
public:
|
||||
Volume(boost::uint8_t uSideLengthPower, boost::uint8_t uBlockSideLengthPower = 5);
|
||||
Volume(const Volume& rhs);
|
||||
~Volume();
|
||||
BlockVolume(boost::uint8_t uSideLengthPower, boost::uint8_t uBlockSideLengthPower = 5);
|
||||
BlockVolume(const BlockVolume& rhs);
|
||||
~BlockVolume();
|
||||
|
||||
Volume& operator=(const Volume& rhs);
|
||||
BlockVolume& operator=(const BlockVolume& rhs);
|
||||
|
||||
boost::uint16_t getSideLength(void) const;
|
||||
VoxelType getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const;
|
||||
@ -75,11 +75,11 @@ namespace PolyVox
|
||||
};
|
||||
|
||||
//Some handy typedefs
|
||||
typedef Volume<float> FloatVolume;
|
||||
typedef Volume<boost::uint8_t> UInt8Volume;
|
||||
typedef Volume<boost::uint16_t> UInt16Volume;
|
||||
typedef BlockVolume<float> FloatBlockVolume;
|
||||
typedef BlockVolume<boost::uint8_t> UInt8BlockVolume;
|
||||
typedef BlockVolume<boost::uint16_t> UInt16BlockVolume;
|
||||
}
|
||||
|
||||
#include "Volume.inl"
|
||||
#include "BlockVolume.inl"
|
||||
|
||||
#endif
|
@ -30,7 +30,7 @@ namespace PolyVox
|
||||
{
|
||||
#pragma region Constructors/Destructors
|
||||
template <typename VoxelType>
|
||||
Volume<VoxelType>::Volume(boost::uint8_t uSideLengthPower, boost::uint8_t uBlockSideLengthPower)
|
||||
BlockVolume<VoxelType>::BlockVolume(boost::uint8_t uSideLengthPower, boost::uint8_t uBlockSideLengthPower)
|
||||
:m_pBlocks(0)
|
||||
{
|
||||
//Check the volume size is sensible. This corresponds to a side length of 65536 voxels
|
||||
@ -68,13 +68,13 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Volume<VoxelType>::Volume(const Volume<VoxelType>& rhs)
|
||||
BlockVolume<VoxelType>::BlockVolume(const BlockVolume<VoxelType>& rhs)
|
||||
{
|
||||
*this = rhs;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Volume<VoxelType>::~Volume()
|
||||
BlockVolume<VoxelType>::~BlockVolume()
|
||||
{
|
||||
for(boost::uint32_t i = 0; i < m_uNoOfBlocksInVolume; ++i)
|
||||
{
|
||||
@ -85,7 +85,7 @@ namespace PolyVox
|
||||
|
||||
#pragma region Operators
|
||||
template <typename VoxelType>
|
||||
Volume<VoxelType>& Volume<VoxelType>::operator=(const Volume& rhs)
|
||||
BlockVolume<VoxelType>& BlockVolume<VoxelType>::operator=(const BlockVolume& rhs)
|
||||
{
|
||||
if (this == &rhs)
|
||||
{
|
||||
@ -119,13 +119,13 @@ namespace PolyVox
|
||||
|
||||
#pragma region Getters
|
||||
template <typename VoxelType>
|
||||
boost::uint16_t Volume<VoxelType>::getSideLength(void) const
|
||||
boost::uint16_t BlockVolume<VoxelType>::getSideLength(void) const
|
||||
{
|
||||
return m_uSideLength;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const
|
||||
VoxelType BlockVolume<VoxelType>::getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const
|
||||
{
|
||||
assert(uXPos < getSideLength());
|
||||
assert(uYPos < getSideLength());
|
||||
@ -150,7 +150,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::getVoxelAt(const Vector3DUint16& v3dPos) const
|
||||
VoxelType BlockVolume<VoxelType>::getVoxelAt(const Vector3DUint16& v3dPos) const
|
||||
{
|
||||
assert(v3dPos.x() < m_uSideLength);
|
||||
assert(v3dPos.y() < m_uSideLength);
|
||||
@ -162,7 +162,7 @@ namespace PolyVox
|
||||
|
||||
#pragma region Other
|
||||
template <typename VoxelType>
|
||||
bool Volume<VoxelType>::containsPoint(Vector3DFloat pos, float boundary) const
|
||||
bool BlockVolume<VoxelType>::containsPoint(Vector3DFloat pos, float boundary) const
|
||||
{
|
||||
return (pos.x() <= m_uSideLength - 1 - boundary)
|
||||
&& (pos.y() <= m_uSideLength - 1 - boundary)
|
||||
@ -173,7 +173,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool Volume<VoxelType>::containsPoint(Vector3DInt32 pos, boost::uint16_t boundary) const
|
||||
bool BlockVolume<VoxelType>::containsPoint(Vector3DInt32 pos, boost::uint16_t boundary) const
|
||||
{
|
||||
return (pos.x() <= m_uSideLength - 1 - boundary)
|
||||
&& (pos.y() <= m_uSideLength - 1 - boundary)
|
||||
@ -184,7 +184,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VolumeIterator<VoxelType> Volume<VoxelType>::firstVoxel(void)
|
||||
VolumeIterator<VoxelType> BlockVolume<VoxelType>::firstVoxel(void)
|
||||
{
|
||||
VolumeIterator<VoxelType> iter(*this);
|
||||
iter.setPosition(0,0,0);
|
||||
@ -192,12 +192,12 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::idle(boost::uint32_t uAmount)
|
||||
void BlockVolume<VoxelType>::idle(boost::uint32_t uAmount)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VolumeIterator<VoxelType> Volume<VoxelType>::lastVoxel(void)
|
||||
VolumeIterator<VoxelType> BlockVolume<VoxelType>::lastVoxel(void)
|
||||
{
|
||||
VolumeIterator<VoxelType> iter(*this);
|
||||
iter.setPosition(m_uSideLength-1,m_uSideLength-1,m_uSideLength-1);
|
||||
@ -207,9 +207,9 @@ namespace PolyVox
|
||||
|
||||
#pragma region Private Implementation
|
||||
template <typename VoxelType>
|
||||
Block<VoxelType>* Volume<VoxelType>::getHomogenousBlock(VoxelType tHomogenousValue) const
|
||||
Block<VoxelType>* BlockVolume<VoxelType>::getHomogenousBlock(VoxelType tHomogenousValue) const
|
||||
{
|
||||
typename std::map<VoxelType, Block<VoxelType>*>::iterator iterResult = m_pHomogenousBlocks.find(tHomogenousValue);
|
||||
std::map<VoxelType, Block<VoxelType>*>::iterator iterResult = m_pHomogenousBlocks.find(tHomogenousValue);
|
||||
if(iterResult == m_pHomogenousBlocks.end())
|
||||
{
|
||||
Block<VoxelType>* pBlock = new Block<VoxelType>(m_uBlockSideLengthPower);
|
@ -27,6 +27,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType> class Block;
|
||||
template <typename VoxelType> class BlockVolume;
|
||||
//Some handy typedefs
|
||||
typedef BlockVolume<float> FloatBlockVolume;
|
||||
typedef BlockVolume<boost::uint8_t> UInt8BlockVolume;
|
||||
typedef BlockVolume<boost::uint16_t> UInt16BlockVolume;
|
||||
class IndexedSurfacePatch;
|
||||
class IntegrealVector3;
|
||||
template <typename VoxelType> class LinearVolume;
|
||||
@ -41,12 +46,7 @@ namespace PolyVox
|
||||
typedef Vector<3,boost::int16_t> Vector3DInt16;
|
||||
typedef Vector<3,boost::uint16_t> Vector3DUint16;
|
||||
typedef Vector<3,boost::int32_t> Vector3DInt32;
|
||||
typedef Vector<3,boost::uint32_t> Vector3DUint32;
|
||||
template <typename VoxelType> class Volume;
|
||||
//Some handy typedefs
|
||||
typedef Volume<float> FloatVolume;
|
||||
typedef Volume<boost::uint8_t> UInt8Volume;
|
||||
typedef Volume<boost::uint16_t> UInt16Volume;
|
||||
typedef Vector<3,boost::uint32_t> Vector3DUint32;
|
||||
template <typename VoxelType> class VolumeIterator;
|
||||
}
|
||||
|
||||
|
@ -52,11 +52,11 @@ namespace PolyVox
|
||||
const std::string& getTypeName(void) const;
|
||||
boost::uint16_t getSideLength(void);
|
||||
|
||||
const Volume<boost::uint8_t>* getVolumeData(void) const;
|
||||
const BlockVolume<boost::uint8_t>* getVolumeData(void) const;
|
||||
|
||||
|
||||
//Setters
|
||||
void setVolumeData(Volume<boost::uint8_t>* volumeDataToSet);
|
||||
void setVolumeData(BlockVolume<boost::uint8_t>* volumeDataToSet);
|
||||
void setNormalGenerationMethod(NormalGenerationMethod method);
|
||||
//void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo * visibleBounds, bool onlyShadowCasters);
|
||||
|
||||
@ -92,7 +92,7 @@ namespace PolyVox
|
||||
NormalGenerationMethod m_normalGenerationMethod;
|
||||
|
||||
private:
|
||||
Volume<boost::uint8_t>* volumeData;
|
||||
BlockVolume<boost::uint8_t>* volumeData;
|
||||
|
||||
bool m_bHaveGeneratedMeshes;
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace PolyVox
|
||||
class VolumeIterator
|
||||
{
|
||||
public:
|
||||
VolumeIterator(Volume<VoxelType>& volume);
|
||||
VolumeIterator(BlockVolume<VoxelType>& volume);
|
||||
~VolumeIterator();
|
||||
|
||||
bool operator==(const VolumeIterator& rhs);
|
||||
@ -89,7 +89,7 @@ namespace PolyVox
|
||||
private:
|
||||
|
||||
//The current volume
|
||||
Volume<VoxelType>& mVolume;
|
||||
BlockVolume<VoxelType>& mVolume;
|
||||
|
||||
//The current position in the volume
|
||||
boost::uint16_t mXPosInVolume;
|
||||
|
@ -21,15 +21,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#pragma region Headers
|
||||
#include "Block.h"
|
||||
#include "BlockVolume.h"
|
||||
#include "Vector.h"
|
||||
#include "Volume.h"
|
||||
#pragma endregion
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
#pragma region Constructors/Destructors
|
||||
template <typename VoxelType>
|
||||
VolumeIterator<VoxelType>::VolumeIterator(Volume<VoxelType>& volume)
|
||||
VolumeIterator<VoxelType>::VolumeIterator(BlockVolume<VoxelType>& volume)
|
||||
:mVolume(volume)
|
||||
{
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include "SurfaceVertex.h"
|
||||
#include "Utility.h"
|
||||
#include "Vector.h"
|
||||
#include "Volume.h"
|
||||
#include "BlockVolume.h"
|
||||
#include "VolumeIterator.h"
|
||||
|
||||
using namespace boost;
|
||||
@ -53,7 +53,7 @@ namespace PolyVox
|
||||
{
|
||||
}
|
||||
|
||||
void PolyVoxSceneManager::setVolumeData(Volume<boost::uint8_t>* volumeDataToSet)
|
||||
void PolyVoxSceneManager::setVolumeData(BlockVolume<boost::uint8_t>* volumeDataToSet)
|
||||
{
|
||||
volumeData = volumeDataToSet;
|
||||
volSurfaceUpToDate = new LinearVolume<bool>(PolyVox::logBase2(POLYVOX_VOLUME_SIDE_LENGTH_IN_REGIONS));
|
||||
@ -1073,7 +1073,7 @@ namespace PolyVox
|
||||
m_axisNode->setVisible(visible);
|
||||
}*/
|
||||
|
||||
const Volume<boost::uint8_t>* PolyVoxSceneManager::getVolumeData(void) const
|
||||
const BlockVolume<boost::uint8_t>* PolyVoxSceneManager::getVolumeData(void) const
|
||||
{
|
||||
return volumeData;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user