Renamed VlumeIterator to VolumeSampler.
This commit is contained in:
parent
0888948138
commit
6e9c31d6bc
@ -30,8 +30,8 @@ SET(CORE_INC_FILES
|
||||
include/Vector.inl
|
||||
include/Volume.h
|
||||
include/Volume.inl
|
||||
include/VolumeIterator.h
|
||||
include/VolumeIterator.inl
|
||||
include/VolumeSampler.h
|
||||
include/VolumeSampler.inl
|
||||
include/VoxelFilters.h
|
||||
)
|
||||
|
||||
|
@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#ifndef __PolyVox_GradientEstimators_H__
|
||||
#define __PolyVox_GradientEstimators_H__
|
||||
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -38,18 +38,18 @@ namespace PolyVox
|
||||
};
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeCentralDifferenceGradient(const VolumeIterator<VoxelType>& volIter);
|
||||
Vector3DFloat computeCentralDifferenceGradient(const VolumeSampler<VoxelType>& volIter);
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeIterator<VoxelType>& volIter);
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeSampler<VoxelType>& volIter);
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(VolumeIterator<VoxelType>& volIter);
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(VolumeSampler<VoxelType>& volIter);
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSobelGradient(const VolumeIterator<VoxelType>& volIter);
|
||||
Vector3DFloat computeSobelGradient(const VolumeSampler<VoxelType>& volIter);
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothSobelGradient(VolumeIterator<VoxelType>& volIter);
|
||||
Vector3DFloat computeSmoothSobelGradient(VolumeSampler<VoxelType>& volIter);
|
||||
|
||||
POLYVOXCORE_API void computeNormalsForVertices(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod);
|
||||
POLYVOXCORE_API Vector3DFloat computeNormal(Volume<uint8_t>* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod);
|
||||
|
@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeCentralDifferenceGradient(const VolumeIterator<VoxelType>& volIter)
|
||||
Vector3DFloat computeCentralDifferenceGradient(const VolumeSampler<VoxelType>& volIter)
|
||||
{
|
||||
//FIXME - bitwise way of doing this?
|
||||
VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0;
|
||||
@ -45,7 +45,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(const VolumeIterator<VoxelType>& volIter)
|
||||
Vector3DFloat computeDecimatedCentralDifferenceGradient(const VolumeSampler<VoxelType>& volIter)
|
||||
{
|
||||
const uint16_t x = volIter.getPosX();
|
||||
const uint16_t y = volIter.getPosY();
|
||||
@ -70,7 +70,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeIterator<VoxelType>& volIter)
|
||||
Vector3DFloat computeSmoothCentralDifferenceGradient(VolumeSampler<VoxelType>& volIter)
|
||||
{
|
||||
uint16_t initialX = volIter.getPosX();
|
||||
uint16_t initialY = volIter.getPosY();
|
||||
@ -101,7 +101,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSobelGradient(const VolumeIterator<VoxelType>& volIter)
|
||||
Vector3DFloat computeSobelGradient(const VolumeSampler<VoxelType>& 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} } };
|
||||
@ -184,7 +184,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
Vector3DFloat computeSmoothSobelGradient(VolumeIterator<VoxelType>& volIter)
|
||||
Vector3DFloat computeSmoothSobelGradient(VolumeSampler<VoxelType>& 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} } };
|
||||
|
@ -52,7 +52,7 @@ namespace PolyVox
|
||||
typedef Vector<3,uint32_t> Vector3DUint32;
|
||||
//----------------------------
|
||||
|
||||
template <typename VoxelType> class VolumeIterator;
|
||||
template <typename VoxelType> class VolumeSampler;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -33,8 +33,8 @@ namespace PolyVox
|
||||
template <typename VoxelType>
|
||||
class Block
|
||||
{
|
||||
//Make VolumeIterator a friend
|
||||
friend class VolumeIterator<VoxelType>;
|
||||
//Make VolumeSampler a friend
|
||||
friend class VolumeSampler<VoxelType>;
|
||||
public:
|
||||
Block(uint16_t uSideLength);
|
||||
Block(const Block& rhs);
|
||||
|
@ -34,9 +34,9 @@ namespace PolyVox
|
||||
uint32_t getDecimatedIndex(uint32_t x, uint32_t y, uint32_t regionWidth);
|
||||
|
||||
void extractDecimatedSurfaceImpl(Volume<uint8_t>* volumeData, uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch);
|
||||
uint32_t computeDecimatedBitmaskForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateDecimatedIndicesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateDecimatedVerticesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
uint32_t computeDecimatedBitmaskForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateDecimatedIndicesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateDecimatedVerticesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -33,9 +33,9 @@ namespace PolyVox
|
||||
{
|
||||
void extractFastSurfaceImpl(Volume<uint8_t>* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch);
|
||||
uint32_t getIndex(uint32_t x, uint32_t y, uint32_t regionWidth);
|
||||
uint32_t computeRoughBitmaskForSlice(VolumeIterator<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateRoughIndicesForSlice(VolumeIterator<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateRoughVerticesForSlice(VolumeIterator<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
uint32_t computeRoughBitmaskForSlice(VolumeSampler<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateRoughIndicesForSlice(VolumeSampler<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateRoughVerticesForSlice(VolumeSampler<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#pragma region Headers
|
||||
#include "PolyVoxForwardDeclarations.h"
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
|
||||
#include "PolyVoxImpl/TypeDef.h"
|
||||
#include "PolyVoxImpl/CPlusPlusZeroXSupport.h"
|
||||
@ -47,19 +47,19 @@ namespace PolyVox
|
||||
uint8_t m_uLodLevel;
|
||||
|
||||
Volume<uint8_t> m_volData;
|
||||
VolumeIterator<uint8_t> m_iterVolume;
|
||||
VolumeSampler<uint8_t> m_iterVolume;
|
||||
|
||||
uint32_t getIndex(uint32_t x, uint32_t y, uint32_t regionWidth);
|
||||
|
||||
void extractSurfaceForRegionLevel0(Volume<uint8_t>* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch);
|
||||
uint32_t computeBitmaskForSliceLevel0(VolumeIterator<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateIndicesForSliceLevel0(VolumeIterator<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateVerticesForSliceLevel0(VolumeIterator<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
uint32_t computeBitmaskForSliceLevel0(VolumeSampler<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateIndicesForSliceLevel0(VolumeSampler<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateVerticesForSliceLevel0(VolumeSampler<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
|
||||
void extractDecimatedSurfaceImpl(Volume<uint8_t>* volumeData, uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch);
|
||||
uint32_t computeDecimatedBitmaskForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateDecimatedIndicesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateDecimatedVerticesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
uint32_t computeDecimatedBitmaskForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t *bitmask, uint8_t *previousBitmask);
|
||||
void generateDecimatedIndicesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[]);
|
||||
void generateDecimatedVerticesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[]);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,8 @@ namespace PolyVox
|
||||
template <typename VoxelType>
|
||||
class Volume
|
||||
{
|
||||
//Make VolumeIterator a friend
|
||||
friend class VolumeIterator<VoxelType>;
|
||||
//Make VolumeSampler a friend
|
||||
friend class VolumeSampler<VoxelType>;
|
||||
|
||||
public:
|
||||
///Constructor
|
||||
|
@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#pragma region Headers
|
||||
#include "PolyVoxImpl/Block.h"
|
||||
#include "Log.h"
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
#include "Region.h"
|
||||
#include "Vector.h"
|
||||
|
||||
|
@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
******************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#ifndef __VolumeIterator_H__
|
||||
#define __VolumeIterator_H__
|
||||
#ifndef __VolumeSampler_H__
|
||||
#define __VolumeSampler_H__
|
||||
|
||||
#pragma region Headers
|
||||
#include "PolyVoxForwardDeclarations.h"
|
||||
@ -31,17 +31,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VoxelType>
|
||||
class VolumeIterator
|
||||
class VolumeSampler
|
||||
{
|
||||
public:
|
||||
VolumeIterator(Volume<VoxelType>& volume);
|
||||
~VolumeIterator();
|
||||
VolumeSampler(Volume<VoxelType>& volume);
|
||||
~VolumeSampler();
|
||||
|
||||
bool operator==(const VolumeIterator& rhs);
|
||||
bool operator<(const VolumeIterator& rhs);
|
||||
bool operator>(const VolumeIterator& rhs);
|
||||
bool operator<=(const VolumeIterator& rhs);
|
||||
bool operator>=(const VolumeIterator& rhs);
|
||||
bool operator==(const VolumeSampler& rhs);
|
||||
bool operator<(const VolumeSampler& rhs);
|
||||
bool operator>(const VolumeSampler& rhs);
|
||||
bool operator<=(const VolumeSampler& rhs);
|
||||
bool operator>=(const VolumeSampler& rhs);
|
||||
|
||||
uint16_t getPosX(void) const;
|
||||
uint16_t getPosY(void) const;
|
||||
@ -113,6 +113,6 @@ namespace PolyVox
|
||||
};
|
||||
}
|
||||
|
||||
#include "VolumeIterator.inl"
|
||||
#include "VolumeSampler.inl"
|
||||
|
||||
#endif
|
@ -32,20 +32,20 @@ namespace PolyVox
|
||||
{
|
||||
#pragma region Constructors/Destructors
|
||||
template <typename VoxelType>
|
||||
VolumeIterator<VoxelType>::VolumeIterator(Volume<VoxelType>& volume)
|
||||
VolumeSampler<VoxelType>::VolumeSampler(Volume<VoxelType>& volume)
|
||||
:mVolume(volume)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VolumeIterator<VoxelType>::~VolumeIterator()
|
||||
VolumeSampler<VoxelType>::~VolumeSampler()
|
||||
{
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Operators
|
||||
template <typename VoxelType>
|
||||
bool VolumeIterator<VoxelType>::operator==(const VolumeIterator<VoxelType>& rhs)
|
||||
bool VolumeSampler<VoxelType>::operator==(const VolumeSampler<VoxelType>& rhs)
|
||||
{
|
||||
//We could just check whether the two mCurrentVoxel pointers are equal, but this may not
|
||||
//be safe in the future if we decide to allow blocks to be shared between volumes
|
||||
@ -62,7 +62,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool VolumeIterator<VoxelType>::operator<(const VolumeIterator<VoxelType>& rhs)
|
||||
bool VolumeSampler<VoxelType>::operator<(const VolumeSampler<VoxelType>& rhs)
|
||||
{
|
||||
assert(&mVolume == &rhs.mVolume);
|
||||
|
||||
@ -85,21 +85,21 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool VolumeIterator<VoxelType>::operator>(const VolumeIterator<VoxelType>& rhs)
|
||||
bool VolumeSampler<VoxelType>::operator>(const VolumeSampler<VoxelType>& rhs)
|
||||
{
|
||||
assert(&mVolume == &rhs.mVolume);
|
||||
return (rhs < *this);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool VolumeIterator<VoxelType>::operator<=(const VolumeIterator<VoxelType>& rhs)
|
||||
bool VolumeSampler<VoxelType>::operator<=(const VolumeSampler<VoxelType>& rhs)
|
||||
{
|
||||
assert(&mVolume == &rhs.mVolume);
|
||||
return (rhs > *this);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool VolumeIterator<VoxelType>::operator>=(const VolumeIterator<VoxelType>& rhs)
|
||||
bool VolumeSampler<VoxelType>::operator>=(const VolumeSampler<VoxelType>& rhs)
|
||||
{
|
||||
assert(&mVolume == &rhs.mVolume);
|
||||
return (rhs < *this);
|
||||
@ -108,25 +108,25 @@ namespace PolyVox
|
||||
|
||||
#pragma region Getters
|
||||
template <typename VoxelType>
|
||||
uint16_t VolumeIterator<VoxelType>::getPosX(void) const
|
||||
uint16_t VolumeSampler<VoxelType>::getPosX(void) const
|
||||
{
|
||||
return mXPosInVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
uint16_t VolumeIterator<VoxelType>::getPosY(void) const
|
||||
uint16_t VolumeSampler<VoxelType>::getPosY(void) const
|
||||
{
|
||||
return mYPosInVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
uint16_t VolumeIterator<VoxelType>::getPosZ(void) const
|
||||
uint16_t VolumeSampler<VoxelType>::getPosZ(void) const
|
||||
{
|
||||
return mZPosInVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::getSubSampledVoxel(uint8_t uLevel) const
|
||||
VoxelType VolumeSampler<VoxelType>::getSubSampledVoxel(uint8_t uLevel) const
|
||||
{
|
||||
if(uLevel == 0)
|
||||
{
|
||||
@ -164,7 +164,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::getSubSampledVoxelWithBoundsCheck(uint8_t uLevel) const
|
||||
VoxelType VolumeSampler<VoxelType>::getSubSampledVoxelWithBoundsCheck(uint8_t uLevel) const
|
||||
{
|
||||
const uint8_t uSize = 1 << uLevel;
|
||||
|
||||
@ -183,13 +183,13 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
const Volume<VoxelType>& VolumeIterator<VoxelType>::getVolume(void) const
|
||||
const Volume<VoxelType>& VolumeSampler<VoxelType>::getVolume(void) const
|
||||
{
|
||||
return mVolume;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::getVoxel(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::getVoxel(void) const
|
||||
{
|
||||
return *mCurrentVoxel;
|
||||
}
|
||||
@ -197,13 +197,13 @@ namespace PolyVox
|
||||
|
||||
#pragma region Setters
|
||||
template <typename VoxelType>
|
||||
void VolumeIterator<VoxelType>::setPosition(const Vector3DInt16& v3dNewPos)
|
||||
void VolumeSampler<VoxelType>::setPosition(const Vector3DInt16& v3dNewPos)
|
||||
{
|
||||
setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ());
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void VolumeIterator<VoxelType>::setPosition(uint16_t xPos, uint16_t yPos, uint16_t zPos)
|
||||
void VolumeSampler<VoxelType>::setPosition(uint16_t xPos, uint16_t yPos, uint16_t zPos)
|
||||
{
|
||||
mXPosInVolume = xPos;
|
||||
mYPosInVolume = yPos;
|
||||
@ -232,7 +232,7 @@ namespace PolyVox
|
||||
|
||||
#pragma region Other
|
||||
template <typename VoxelType>
|
||||
void VolumeIterator<VoxelType>::movePositiveX(void)
|
||||
void VolumeSampler<VoxelType>::movePositiveX(void)
|
||||
{
|
||||
++mXPosInVolume;
|
||||
if(mXPosInVolume % mVolume.m_uBlockSideLength == 0)
|
||||
@ -251,7 +251,7 @@ namespace PolyVox
|
||||
|
||||
#pragma region Peekers
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx1ny1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx1ny1nz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -261,7 +261,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx1ny0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx1ny0pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -271,7 +271,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx1ny1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx1ny1pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -281,7 +281,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx0py1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx0py1nz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -291,7 +291,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx0py0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx0py0pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -301,7 +301,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx0py1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx0py1pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -311,7 +311,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx1py1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx1py1nz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -321,7 +321,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx1py0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx1py0pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -331,7 +331,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1nx1py1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1nx1py1pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != 0) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -343,7 +343,7 @@ namespace PolyVox
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px1ny1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px1ny1nz(void) const
|
||||
{
|
||||
if((mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -353,7 +353,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px1ny0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px1ny0pz(void) const
|
||||
{
|
||||
if((mYPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -363,7 +363,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px1ny1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px1ny1pz(void) const
|
||||
{
|
||||
if((mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -373,7 +373,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px0py1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px0py1nz(void) const
|
||||
{
|
||||
if((mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -383,13 +383,13 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px0py0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px0py0pz(void) const
|
||||
{
|
||||
return *mCurrentVoxel;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px0py1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px0py1pz(void) const
|
||||
{
|
||||
if((mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -399,7 +399,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px1py1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px1py1nz(void) const
|
||||
{
|
||||
if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -409,7 +409,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px1py0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px1py0pz(void) const
|
||||
{
|
||||
if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -419,7 +419,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel0px1py1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel0px1py1pz(void) const
|
||||
{
|
||||
if((mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -431,7 +431,7 @@ namespace PolyVox
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px1ny1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px1ny1nz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -441,7 +441,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px1ny0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px1ny0pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -451,7 +451,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px1ny1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px1ny1pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != 0) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -461,7 +461,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px0py1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px0py1nz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -471,7 +471,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px0py0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px0py0pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -481,7 +481,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px0py1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px0py1pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -491,7 +491,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px1py1nz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px1py1nz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != 0))
|
||||
{
|
||||
@ -501,7 +501,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px1py0pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px1py0pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
||||
@ -511,7 +511,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
VoxelType VolumeIterator<VoxelType>::peekVoxel1px1py1pz(void) const
|
||||
VoxelType VolumeSampler<VoxelType>::peekVoxel1px1py1pz(void) const
|
||||
{
|
||||
if((mXPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mYPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1) && (mZPosInVolume%mVolume.m_uBlockSideLength != mVolume.m_uBlockSideLength-1))
|
||||
{
|
@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
float computeSmoothedVoxel(VolumeIterator<uint8_t>& volIter);
|
||||
float computeSmoothedVoxel(VolumeSampler<uint8_t>& volIter);
|
||||
}
|
||||
|
||||
#endif
|
@ -16,7 +16,7 @@ namespace PolyVox
|
||||
const Vector3DFloat& v3dPos = iterSurfaceVertex->getPosition() + static_cast<Vector3DFloat>(isp.m_v3dRegionPosition);
|
||||
const Vector3DInt32 v3dFloor = static_cast<Vector3DInt32>(v3dPos);
|
||||
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
//Check all corners are within the volume, allowing a boundary for gradient estimation
|
||||
bool lowerCornerInside = volumeData->getEnclosingRegion().containsPoint(v3dFloor,2);
|
||||
@ -42,7 +42,7 @@ namespace PolyVox
|
||||
{
|
||||
Vector3DFloat v3dGradient; //To store the result
|
||||
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
const Vector3DInt32 v3dFloor = static_cast<Vector3DInt32>(v3dPos);
|
||||
|
||||
|
@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include "IndexedSurfacePatch.h"
|
||||
#include "PolyVoxImpl/MarchingCubesTables.h"
|
||||
#include "Region.h"
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@ -77,7 +77,7 @@ namespace PolyVox
|
||||
regSlice0.setUpperCorner(v3dUpperCorner);
|
||||
|
||||
//Iterator to access the volume data
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
//Compute bitmask for initial slice
|
||||
uint32_t uNoOfNonEmptyCellsForSlice0 = computeDecimatedBitmaskForSlice(volIter, uLevel, regSlice0, offset, bitmask0, 0);
|
||||
@ -132,7 +132,7 @@ namespace PolyVox
|
||||
}*/
|
||||
}
|
||||
|
||||
uint32_t computeDecimatedBitmaskForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
uint32_t computeDecimatedBitmaskForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
{
|
||||
const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel;
|
||||
uint32_t uNoOfNonEmptyCells = 0;
|
||||
@ -374,7 +374,7 @@ namespace PolyVox
|
||||
return uNoOfNonEmptyCells;
|
||||
}
|
||||
|
||||
void generateDecimatedVerticesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
void generateDecimatedVerticesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
{
|
||||
const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel;
|
||||
|
||||
@ -445,7 +445,7 @@ namespace PolyVox
|
||||
}
|
||||
}
|
||||
|
||||
void generateDecimatedIndicesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
void generateDecimatedIndicesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
{
|
||||
const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel;
|
||||
uint32_t indlist[12];
|
||||
|
@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include "PolyVoxImpl/FastSurfaceExtractor.h"
|
||||
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
#include "IndexedSurfacePatch.h"
|
||||
#include "PolyVoxImpl/MarchingCubesTables.h"
|
||||
#include "SurfaceVertex.h"
|
||||
@ -59,7 +59,7 @@ namespace PolyVox
|
||||
regSlice0.setUpperCorner(Vector3DInt32(regSlice0.getUpperCorner().getX(),regSlice0.getUpperCorner().getY(),regSlice0.getLowerCorner().getZ()));
|
||||
|
||||
//Iterator to access the volume data
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
//Compute bitmask for initial slice
|
||||
uint32_t uNoOfNonEmptyCellsForSlice0 = computeRoughBitmaskForSlice(volIter, regSlice0, offset, bitmask0, 0);
|
||||
@ -110,7 +110,7 @@ namespace PolyVox
|
||||
return x + (y * (regionWidth+1));
|
||||
}
|
||||
|
||||
uint32_t computeRoughBitmaskForSlice(VolumeIterator<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
uint32_t computeRoughBitmaskForSlice(VolumeSampler<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
{
|
||||
uint32_t uNoOfNonEmptyCells = 0;
|
||||
|
||||
@ -348,7 +348,7 @@ namespace PolyVox
|
||||
return uNoOfNonEmptyCells;
|
||||
}
|
||||
|
||||
void generateRoughVerticesForSlice(VolumeIterator<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
void generateRoughVerticesForSlice(VolumeSampler<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
{
|
||||
//Iterate over each cell in the region
|
||||
for(uint16_t uYVolSpace = regSlice.getLowerCorner().getY(); uYVolSpace <= regSlice.getUpperCorner().getY(); uYVolSpace++)
|
||||
@ -423,7 +423,7 @@ namespace PolyVox
|
||||
}
|
||||
}
|
||||
|
||||
void generateRoughIndicesForSlice(VolumeIterator<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
void generateRoughIndicesForSlice(VolumeSampler<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
{
|
||||
uint32_t indlist[12];
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "SurfaceAdjusters.h"
|
||||
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
#include "GradientEstimators.h"
|
||||
#include "IndexedSurfacePatch.h"
|
||||
#include "PolyVoxImpl/Utility.h"
|
||||
@ -17,7 +17,7 @@ namespace PolyVox
|
||||
const uint8_t uSmoothingFactor = 2;
|
||||
const float fThreshold = 0.5f;
|
||||
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
std::vector<SurfaceVertex>& vecVertices = isp.getRawVertexData();
|
||||
std::vector<SurfaceVertex>::iterator iterSurfaceVertex = vecVertices.begin();
|
||||
@ -78,7 +78,7 @@ namespace PolyVox
|
||||
|
||||
void adjustDecimatedGeometry(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp, uint8_t val)
|
||||
{
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
std::vector<SurfaceVertex>& vecVertices = isp.getRawVertexData();
|
||||
std::vector<SurfaceVertex>::iterator iterSurfaceVertex = vecVertices.begin();
|
||||
@ -87,7 +87,7 @@ namespace PolyVox
|
||||
Vector3DFloat v3dPos = iterSurfaceVertex->getPosition() + static_cast<Vector3DFloat>(isp.m_v3dRegionPosition);
|
||||
Vector3DInt32 v3dFloor = static_cast<Vector3DInt32>(v3dPos);
|
||||
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
//Check all corners are within the volume, allowing a boundary for gradient estimation
|
||||
bool lowerCornerInside = volumeData->getEnclosingRegion().containsPoint(v3dFloor,1);
|
||||
|
@ -75,7 +75,7 @@ namespace PolyVox
|
||||
regSlice0.setUpperCorner(Vector3DInt32(regSlice0.getUpperCorner().getX(),regSlice0.getUpperCorner().getY(),regSlice0.getLowerCorner().getZ()));
|
||||
|
||||
//Iterator to access the volume data
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
//Compute bitmask for initial slice
|
||||
uint32_t uNoOfNonEmptyCellsForSlice0 = computeBitmaskForSliceLevel0(volIter, regSlice0, offset, bitmask0, 0);
|
||||
@ -121,7 +121,7 @@ namespace PolyVox
|
||||
delete[] vertexIndicesZ1;
|
||||
}
|
||||
|
||||
uint32_t SurfaceExtractor::computeBitmaskForSliceLevel0(VolumeIterator<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
uint32_t SurfaceExtractor::computeBitmaskForSliceLevel0(VolumeSampler<uint8_t>& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
{
|
||||
uint32_t uNoOfNonEmptyCells = 0;
|
||||
|
||||
@ -359,7 +359,7 @@ namespace PolyVox
|
||||
return uNoOfNonEmptyCells;
|
||||
}
|
||||
|
||||
void SurfaceExtractor::generateVerticesForSliceLevel0(VolumeIterator<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
void SurfaceExtractor::generateVerticesForSliceLevel0(VolumeSampler<uint8_t>& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
{
|
||||
//Iterate over each cell in the region
|
||||
for(uint16_t uYVolSpace = regSlice.getLowerCorner().getY(); uYVolSpace <= regSlice.getUpperCorner().getY(); uYVolSpace++)
|
||||
@ -434,7 +434,7 @@ namespace PolyVox
|
||||
}
|
||||
}
|
||||
|
||||
void SurfaceExtractor::generateIndicesForSliceLevel0(VolumeIterator<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
void SurfaceExtractor::generateIndicesForSliceLevel0(VolumeSampler<uint8_t>& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
{
|
||||
uint32_t indlist[12];
|
||||
|
||||
@ -588,7 +588,7 @@ namespace PolyVox
|
||||
regSlice0.setUpperCorner(v3dUpperCorner);
|
||||
|
||||
//Iterator to access the volume data
|
||||
VolumeIterator<uint8_t> volIter(*volumeData);
|
||||
VolumeSampler<uint8_t> volIter(*volumeData);
|
||||
|
||||
//Compute bitmask for initial slice
|
||||
uint32_t uNoOfNonEmptyCellsForSlice0 = computeDecimatedBitmaskForSlice(volIter, uLevel, regSlice0, offset, bitmask0, 0);
|
||||
@ -643,7 +643,7 @@ namespace PolyVox
|
||||
}*/
|
||||
}
|
||||
|
||||
uint32_t SurfaceExtractor::computeDecimatedBitmaskForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
uint32_t SurfaceExtractor::computeDecimatedBitmaskForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask)
|
||||
{
|
||||
const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel;
|
||||
uint32_t uNoOfNonEmptyCells = 0;
|
||||
@ -885,7 +885,7 @@ namespace PolyVox
|
||||
return uNoOfNonEmptyCells;
|
||||
}
|
||||
|
||||
void SurfaceExtractor::generateDecimatedVerticesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
void SurfaceExtractor::generateDecimatedVerticesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,int32_t vertexIndicesX[],int32_t vertexIndicesY[],int32_t vertexIndicesZ[])
|
||||
{
|
||||
const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel;
|
||||
|
||||
@ -956,7 +956,7 @@ namespace PolyVox
|
||||
}
|
||||
}
|
||||
|
||||
void SurfaceExtractor::generateDecimatedIndicesForSlice(VolumeIterator<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
void SurfaceExtractor::generateDecimatedIndicesForSlice(VolumeSampler<uint8_t>& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, int32_t vertexIndicesX0[],int32_t vertexIndicesY0[],int32_t vertexIndicesZ0[], int32_t vertexIndicesX1[],int32_t vertexIndicesY1[],int32_t vertexIndicesZ1[])
|
||||
{
|
||||
const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel;
|
||||
uint32_t indlist[12];
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "PolyVoxImpl/MarchingCubesTables.h"
|
||||
#include "Region.h"
|
||||
#include "SurfaceAdjusters.h"
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
|
||||
#include "PolyVoxImpl/DecimatedSurfaceExtractor.h"
|
||||
#include "PolyVoxImpl/FastSurfaceExtractor.h"
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "VoxelFilters.h"
|
||||
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
float computeSmoothedVoxel(VolumeIterator<uint8_t>& volIter)
|
||||
float computeSmoothedVoxel(VolumeSampler<uint8_t>& volIter)
|
||||
{
|
||||
assert(volIter.getPosX() >= 1);
|
||||
assert(volIter.getPosY() >= 1);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "Serialization.h"
|
||||
|
||||
#include "Volume.h"
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
#include "PolyVoxImpl/Utility.h"
|
||||
|
||||
using namespace std;
|
||||
@ -61,7 +61,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//Write data
|
||||
VolumeIterator<uint8_t> volIter(volume);
|
||||
VolumeSampler<uint8_t> volIter(volume);
|
||||
for(uint16_t z = 0; z < volumeDepth; ++z)
|
||||
{
|
||||
for(uint16_t y = 0; y < volumeHeight; ++y)
|
||||
@ -143,7 +143,7 @@ namespace PolyVox
|
||||
stream.write(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//Write data
|
||||
VolumeIterator<uint8_t> volIter(volume);
|
||||
VolumeSampler<uint8_t> volIter(volume);
|
||||
uint8_t current = 0;
|
||||
uint32_t runLength = 0;
|
||||
bool firstTime = true;
|
||||
|
@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include "PolyVoxImpl/Utility.h"
|
||||
#include "Vector.h"
|
||||
#include "Volume.h"
|
||||
#include "VolumeIterator.h"
|
||||
#include "VolumeSampler.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -142,7 +142,7 @@ namespace PolyVox
|
||||
assert(m_bIsLocked);
|
||||
|
||||
//FIXME - rather than creating a iterator each time we should have one stored
|
||||
/*VolumeIterator<uint8_t> iterVol(*volumeData);
|
||||
/*VolumeSampler<uint8_t> 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