Renamed VolumeSampler to Sampler
This commit is contained in:
parent
6f1ddb7d5f
commit
96ff5e890a
@ -39,7 +39,7 @@ namespace PolyVox
|
||||
|
||||
private:
|
||||
Region m_region;
|
||||
Volume<VoxelType>::VolumeSampler m_sampVolume;
|
||||
Volume<VoxelType>::Sampler m_sampVolume;
|
||||
Volume<VoxelType>* m_volInput;
|
||||
Array<3, uint8_t>* m_arrayResult;
|
||||
float m_fRayLength;
|
||||
|
@ -50,7 +50,7 @@ namespace PolyVox
|
||||
private:
|
||||
//The volume data and a sampler to access it.
|
||||
Volume<VoxelType>* m_volData;
|
||||
Volume<VoxelType>::VolumeSampler m_sampVolume;
|
||||
Volume<VoxelType>::Sampler m_sampVolume;
|
||||
|
||||
//Information about the region we are currently processing
|
||||
Region m_regSizeInVoxels;
|
||||
|
@ -42,7 +42,7 @@ namespace PolyVox
|
||||
private:
|
||||
//The volume data and a sampler to access it.
|
||||
Volume<VoxelType>* m_volData;
|
||||
typename Volume<VoxelType>::VolumeSampler m_sampVolume;
|
||||
typename Volume<VoxelType>::Sampler m_sampVolume;
|
||||
|
||||
//The surface patch we are currently filling.
|
||||
SurfaceMesh<PositionMaterialNormal>* m_meshCurrent;
|
||||
|
@ -42,18 +42,18 @@ namespace PolyVox
|
||||
};
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeCentralDifferenceGradient(const typename Volume<VoxelType>::VolumeSampler& volIter);
|
||||
Vector3DFloat computeCentralDifferenceGradient(const typename Volume<VoxelType>::Sampler& volIter);
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(typename Volume<VoxelType>::VolumeSampler& volIter);
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(typename Volume<VoxelType>::Sampler& volIter);
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(typename Volume<VoxelType>::VolumeSampler& volIter);
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(typename Volume<VoxelType>::Sampler& volIter);
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSobelGradient(const typename Volume<VoxelType>::VolumeSampler& volIter);
|
||||
Vector3DFloat computeSobelGradient(const typename Volume<VoxelType>::Sampler& volIter);
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothSobelGradient(typename Volume<VoxelType>::VolumeSampler& volIter);
|
||||
Vector3DFloat computeSmoothSobelGradient(typename Volume<VoxelType>::Sampler& volIter);
|
||||
|
||||
POLYVOX_API void computeNormalsForVertices(Volume<uint8_t>* volumeData, SurfaceMesh<PositionMaterialNormal>& mesh, NormalGenerationMethod normalGenerationMethod);
|
||||
POLYVOX_API Vector3DFloat computeNormal(Volume<uint8_t>* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod);
|
||||
|
@ -28,7 +28,7 @@ freely, subject to the following restrictions:
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeCentralDifferenceGradient(const typename Volume<VoxelType>::VolumeSampler& volIter)
|
||||
Vector3DFloat computeCentralDifferenceGradient(const typename Volume<VoxelType>::Sampler& volIter)
|
||||
{
|
||||
//FIXME - bitwise way of doing this?
|
||||
VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0;
|
||||
@ -49,7 +49,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(const typename Volume<VoxelType>::VolumeSampler& volIter)
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(const typename Volume<VoxelType>::Sampler& volIter)
|
||||
{
|
||||
const int32_t x = volIter.getPosX();
|
||||
const int32_t y = volIter.getPosY();
|
||||
@ -74,7 +74,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(typename Volume<VoxelType>::VolumeSampler& volIter)
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(typename Volume<VoxelType>::Sampler& volIter)
|
||||
{
|
||||
int32_t initialX = volIter.getPosX();
|
||||
int32_t initialY = volIter.getPosY();
|
||||
@ -105,7 +105,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSobelGradient(const typename Volume<VoxelType>::VolumeSampler& volIter)
|
||||
Vector3DFloat computeSobelGradient(const typename Volume<VoxelType>::Sampler& volIter)
|
||||
{
|
||||
static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, {
|
||||
{3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } };
|
||||
@ -188,7 +188,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothSobelGradient(typename Volume<VoxelType>::VolumeSampler& volIter)
|
||||
Vector3DFloat computeSmoothSobelGradient(typename Volume<VoxelType>::Sampler& volIter)
|
||||
{
|
||||
static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, {
|
||||
{3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } };
|
||||
|
@ -99,7 +99,7 @@ namespace PolyVox
|
||||
typedef Vector<3,uint32_t> Vector3DUint32;
|
||||
//----------------------------
|
||||
|
||||
//template <typename VoxelType> class VolumeSampler;
|
||||
//template <typename VoxelType> class Sampler;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -44,8 +44,8 @@ namespace PolyVox
|
||||
static uint32_t maxRunlength(void) {return (std::numeric_limits<LengthType>::max)();}
|
||||
};
|
||||
|
||||
//Make VolumeSampler a friend
|
||||
friend class Volume<VoxelType>::VolumeSampler;
|
||||
//Make Sampler a friend
|
||||
friend class Volume<VoxelType>::Sampler;
|
||||
public:
|
||||
Block(uint16_t uSideLength = 0);
|
||||
|
||||
|
@ -101,7 +101,7 @@ namespace PolyVox
|
||||
void doRaycast(float x1, float y1, float z1, float x2, float y2, float z2);
|
||||
|
||||
Volume<VoxelType>* m_volData;
|
||||
Volume<VoxelType>::VolumeSampler m_sampVolume;
|
||||
Volume<VoxelType>::Sampler m_sampVolume;
|
||||
|
||||
Vector3DFloat m_v3dStart;
|
||||
Vector3DFloat m_v3dDirection;
|
||||
|
@ -47,7 +47,7 @@ namespace PolyVox
|
||||
void doRaycast(float x1, float y1, float z1, float x2, float y2, float z2);
|
||||
|
||||
Volume<VoxelType>* m_volData;
|
||||
Volume<VoxelType>::VolumeSampler m_sampVolume;
|
||||
Volume<VoxelType>::Sampler m_sampVolume;
|
||||
|
||||
Vector3DFloat m_v3dStart;
|
||||
Vector3DFloat m_v3dDirection;
|
||||
|
@ -54,8 +54,8 @@ namespace PolyVox
|
||||
Array2DInt32& m_pCurrentVertexIndicesY,
|
||||
Array2DInt32& m_pCurrentVertexIndicesZ);
|
||||
|
||||
Vector3DFloat computeCentralDifferenceGradient(const typename Volume<VoxelType>::VolumeSampler& volIter);
|
||||
Vector3DFloat computeSobelGradient(const typename Volume<VoxelType>::VolumeSampler& volIter);
|
||||
Vector3DFloat computeCentralDifferenceGradient(const typename Volume<VoxelType>::Sampler& volIter);
|
||||
Vector3DFloat computeSobelGradient(const typename Volume<VoxelType>::Sampler& volIter);
|
||||
|
||||
//Use the cell bitmasks to generate all the indices needed for that slice
|
||||
void generateIndicesForSlice(const Array2DUint8& pPreviousBitmask,
|
||||
@ -68,7 +68,7 @@ namespace PolyVox
|
||||
|
||||
//The volume data and a sampler to access it.
|
||||
Volume<VoxelType>* m_volData;
|
||||
typename Volume<VoxelType>::VolumeSampler m_sampVolume;
|
||||
typename Volume<VoxelType>::Sampler m_sampVolume;
|
||||
|
||||
//Holds a position in volume space.
|
||||
int32_t iXVolSpace;
|
||||
|
@ -507,7 +507,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat SurfaceExtractor<VoxelType>::computeCentralDifferenceGradient(const typename Volume<VoxelType>::VolumeSampler& volIter)
|
||||
Vector3DFloat SurfaceExtractor<VoxelType>::computeCentralDifferenceGradient(const typename Volume<VoxelType>::Sampler& volIter)
|
||||
{
|
||||
uint8_t voxel1nx = volIter.peekVoxel1nx0py0pz().getDensity();
|
||||
uint8_t voxel1px = volIter.peekVoxel1px0py0pz().getDensity();
|
||||
@ -527,7 +527,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat SurfaceExtractor<VoxelType>::computeSobelGradient(const typename Volume<VoxelType>::VolumeSampler& volIter)
|
||||
Vector3DFloat SurfaceExtractor<VoxelType>::computeSobelGradient(const typename Volume<VoxelType>::Sampler& volIter)
|
||||
{
|
||||
static const int weights[3][3][3] = { { {2,3,2}, {3,6,3}, {2,3,2} }, {
|
||||
{3,6,3}, {6,0,6}, {3,6,3} }, { {2,3,2}, {3,6,3}, {2,3,2} } };
|
||||
|
@ -61,7 +61,7 @@ namespace PolyVox
|
||||
/// border value (see getBorderValue() and setBorderValue()). PolyVox also has support for near infinite volumes which will be discussed later.
|
||||
///
|
||||
/// Access to individual voxels is provided via the setVoxelAt() and getVoxelAt() member functions. Advanced users may also be interested in
|
||||
/// the VolumeSampler class for faster read-only access to a large number of voxels.
|
||||
/// the Sampler class for faster read-only access to a large number of voxels.
|
||||
///
|
||||
/// Lastly the example prints out some properties of the Volume. Note that the dimentsions getWidth(), getHeight(), and getDepth() are inclusive, such
|
||||
/// that the width is 64 when the range of valid x coordinates goes from 0 to 63.
|
||||
@ -144,13 +144,13 @@ namespace PolyVox
|
||||
class Volume
|
||||
{
|
||||
public:
|
||||
class VolumeSampler
|
||||
class Sampler
|
||||
{
|
||||
public:
|
||||
VolumeSampler(Volume<VoxelType>* volume);
|
||||
~VolumeSampler();
|
||||
Sampler(Volume<VoxelType>* volume);
|
||||
~Sampler();
|
||||
|
||||
typename VolumeSampler& operator=(const typename VolumeSampler& rhs) throw();
|
||||
typename Sampler& operator=(const typename Sampler& rhs) throw();
|
||||
|
||||
int32_t getPosX(void) const;
|
||||
int32_t getPosY(void) const;
|
||||
|
@ -35,18 +35,18 @@ freely, subject to the following restrictions:
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType>
|
||||
Volume<VoxelType>::VolumeSampler::VolumeSampler(Volume<VoxelType>* volume)
|
||||
Volume<VoxelType>::Sampler::Sampler(Volume<VoxelType>* volume)
|
||||
:mVolume(volume)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Volume<VoxelType>::VolumeSampler::~VolumeSampler()
|
||||
Volume<VoxelType>::Sampler::~Sampler()
|
||||
{
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
typename Volume<VoxelType>::VolumeSampler& Volume<VoxelType>::VolumeSampler::operator=(const typename Volume<VoxelType>::VolumeSampler& rhs) throw()
|
||||
typename Volume<VoxelType>::Sampler& Volume<VoxelType>::Sampler::operator=(const typename Volume<VoxelType>::Sampler& rhs) throw()
|
||||
{
|
||||
if(this == &rhs)
|
||||
{
|
||||
@ -61,25 +61,25 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
int32_t Volume<VoxelType>::VolumeSampler::getPosX(void) const
|
||||
int32_t Volume<VoxelType>::Sampler::getPosX(void) const
|
||||
{
|
||||
return mXPosInVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
int32_t Volume<VoxelType>::VolumeSampler::getPosY(void) const
|
||||
int32_t Volume<VoxelType>::Sampler::getPosY(void) const
|
||||
{
|
||||
return mYPosInVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
int32_t Volume<VoxelType>::VolumeSampler::getPosZ(void) const
|
||||
int32_t Volume<VoxelType>::Sampler::getPosZ(void) const
|
||||
{
|
||||
return mZPosInVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::getSubSampledVoxel(uint8_t uLevel) const
|
||||
VoxelType Volume<VoxelType>::Sampler::getSubSampledVoxel(uint8_t uLevel) const
|
||||
{
|
||||
if(uLevel == 0)
|
||||
{
|
||||
@ -117,25 +117,25 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
const Volume<VoxelType>* Volume<VoxelType>::VolumeSampler::getVolume(void) const
|
||||
const Volume<VoxelType>* Volume<VoxelType>::Sampler::getVolume(void) const
|
||||
{
|
||||
return mVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::getVoxel(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::getVoxel(void) const
|
||||
{
|
||||
return *mCurrentVoxel;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::setPosition(const Vector3DInt32& v3dNewPos)
|
||||
void Volume<VoxelType>::Sampler::setPosition(const Vector3DInt32& v3dNewPos)
|
||||
{
|
||||
setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ());
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos)
|
||||
void Volume<VoxelType>::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos)
|
||||
{
|
||||
mXPosInVolume = xPos;
|
||||
mYPosInVolume = yPos;
|
||||
@ -166,7 +166,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::movePositiveX(void)
|
||||
void Volume<VoxelType>::Sampler::movePositiveX(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mXPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
@ -182,7 +182,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::movePositiveY(void)
|
||||
void Volume<VoxelType>::Sampler::movePositiveY(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mYPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
@ -198,7 +198,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::movePositiveZ(void)
|
||||
void Volume<VoxelType>::Sampler::movePositiveZ(void)
|
||||
{
|
||||
//Note the *pre* increament here
|
||||
if((++mZPosInVolume) % mVolume->m_uBlockSideLength != 0)
|
||||
@ -214,7 +214,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::moveNegativeX(void)
|
||||
void Volume<VoxelType>::Sampler::moveNegativeX(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mXPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
@ -230,7 +230,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::moveNegativeY(void)
|
||||
void Volume<VoxelType>::Sampler::moveNegativeY(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mYPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
@ -246,7 +246,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::VolumeSampler::moveNegativeZ(void)
|
||||
void Volume<VoxelType>::Sampler::moveNegativeZ(void)
|
||||
{
|
||||
//Note the *post* decreament here
|
||||
if((mZPosInVolume--) % mVolume->m_uBlockSideLength != 0)
|
||||
@ -262,7 +262,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx1ny1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx1ny1nz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -272,7 +272,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx1ny0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx1ny0pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
@ -282,7 +282,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx1ny1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx1ny1pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -292,7 +292,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx0py1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx0py1nz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -302,7 +302,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx0py0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx0py0pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) )
|
||||
{
|
||||
@ -312,7 +312,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx0py1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx0py1pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -322,7 +322,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx1py1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx1py1nz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
@ -332,7 +332,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx1py0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx1py0pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
@ -342,7 +342,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1nx1py1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1nx1py1pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -354,7 +354,7 @@ namespace PolyVox
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px1ny1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px1ny1nz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -364,7 +364,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px1ny0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px1ny0pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
@ -374,7 +374,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px1ny1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px1ny1pz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -384,7 +384,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px0py1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px0py1nz(void) const
|
||||
{
|
||||
if( BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -394,13 +394,13 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px0py0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px0py0pz(void) const
|
||||
{
|
||||
return *mCurrentVoxel;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px0py1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px0py1pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -410,7 +410,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px1py1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px1py1nz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -420,7 +420,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px1py0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px1py0pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
@ -430,7 +430,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel0px1py1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel0px1py1pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -442,7 +442,7 @@ namespace PolyVox
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px1ny1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px1ny1nz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -452,7 +452,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px1ny0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px1ny0pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) )
|
||||
{
|
||||
@ -462,7 +462,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px1ny1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px1ny1pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -472,7 +472,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px0py1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px0py1nz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -482,7 +482,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px0py0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px0py0pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) )
|
||||
{
|
||||
@ -492,7 +492,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px0py1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px0py1pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
@ -502,7 +502,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px1py1nz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px1py1nz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_LOW(mZPosInVolume) )
|
||||
{
|
||||
@ -512,7 +512,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px1py0pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px1py0pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) )
|
||||
{
|
||||
@ -522,7 +522,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType Volume<VoxelType>::VolumeSampler::peekVoxel1px1py1pz(void) const
|
||||
VoxelType Volume<VoxelType>::Sampler::peekVoxel1px1py1pz(void) const
|
||||
{
|
||||
if( BORDER_HIGH(mXPosInVolume) && BORDER_HIGH(mYPosInVolume) && BORDER_HIGH(mZPosInVolume) )
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ freely, subject to the following restrictions:
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
float computeSmoothedVoxel(Volume<uint8_t>::VolumeSampler& volIter);
|
||||
float computeSmoothedVoxel(Volume<uint8_t>::Sampler& volIter);
|
||||
}
|
||||
|
||||
#endif
|
@ -41,7 +41,7 @@ namespace PolyVox
|
||||
const Vector3DFloat& v3dPos = iterSurfaceVertex->getPosition() + static_cast<Vector3DFloat>(mesh.m_Region.getLowerCorner());
|
||||
const Vector3DInt32 v3dFloor = static_cast<Vector3DInt32>(v3dPos);
|
||||
|
||||
Volume<uint8_t>::VolumeSampler volIter(volumeData);
|
||||
Volume<uint8_t>::Sampler volIter(volumeData);
|
||||
|
||||
//Check all corners are within the volume, allowing a boundary for gradient estimation
|
||||
bool lowerCornerInside = volumeData->getEnclosingRegion().containsPoint(v3dFloor,2);
|
||||
@ -67,7 +67,7 @@ namespace PolyVox
|
||||
{
|
||||
Vector3DFloat v3dGradient; //To store the result
|
||||
|
||||
Volume<uint8_t>::VolumeSampler volIter(volumeData);
|
||||
Volume<uint8_t>::Sampler volIter(volumeData);
|
||||
|
||||
const Vector3DInt32 v3dFloor = static_cast<Vector3DInt32>(v3dPos);
|
||||
|
||||
|
@ -25,7 +25,7 @@ freely, subject to the following restrictions:
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
float computeSmoothedVoxel(Volume<uint8_t>::VolumeSampler& volIter)
|
||||
float computeSmoothedVoxel(Volume<uint8_t>::Sampler& volIter)
|
||||
{
|
||||
assert(volIter.getPosX() >= 1);
|
||||
assert(volIter.getPosY() >= 1);
|
||||
|
@ -98,7 +98,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//Write data
|
||||
Volume<VoxelType>::VolumeSampler volIter(&volume);
|
||||
Volume<VoxelType>::Sampler volIter(&volume);
|
||||
for(uint16_t z = 0; z < volumeDepth; ++z)
|
||||
{
|
||||
//Update progress once per slice.
|
||||
@ -212,7 +212,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//Write data
|
||||
Volume<VoxelType>::VolumeSampler volIter(&volume);
|
||||
Volume<VoxelType>::Sampler volIter(&volume);
|
||||
VoxelType current;
|
||||
uint32_t runLength = 0;
|
||||
bool firstTime = true;
|
||||
@ -380,7 +380,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepth), sizeof(volumeDepth));
|
||||
|
||||
//Write data
|
||||
Volume<VoxelType>::VolumeSampler volIter(&volume);
|
||||
Volume<VoxelType>::Sampler volIter(&volume);
|
||||
VoxelType current;
|
||||
uint32_t runLength = 0;
|
||||
bool firstTime = true;
|
||||
|
@ -149,7 +149,7 @@ namespace PolyVox
|
||||
assert(m_bIsLocked);
|
||||
|
||||
//FIXME - rather than creating a iterator each time we should have one stored
|
||||
/*VolumeSampler<VoxelType> iterVol(*volumeData);
|
||||
/*Sampler<VoxelType> iterVol(*volumeData);
|
||||
iterVol.setPosition(x,y,z);
|
||||
iterVol.setVoxel(value);*/
|
||||
volumeData->setVoxelAt(x,y,z,value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user