Initial version of IteratorController and making LowPassFilter use iterators.
This commit is contained in:
@ -31,6 +31,8 @@ SET(CORE_INC_FILES
|
||||
include/PolyVoxCore/Density.h
|
||||
include/PolyVoxCore/GradientEstimators.h
|
||||
include/PolyVoxCore/GradientEstimators.inl
|
||||
include/PolyVoxCore/IteratorController.h
|
||||
include/PolyVoxCore/IteratorController.inl
|
||||
include/PolyVoxCore/LargeVolume.h
|
||||
include/PolyVoxCore/LargeVolume.inl
|
||||
include/PolyVoxCore/LargeVolumeSampler.inl
|
||||
|
@ -21,6 +21,7 @@ freely, subject to the following restrictions:
|
||||
distribution.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "PolyVoxCore/IteratorController.h"
|
||||
#include "PolyVoxCore/RawVolume.h"
|
||||
|
||||
namespace PolyVox
|
||||
@ -139,8 +140,34 @@ namespace PolyVox
|
||||
}
|
||||
}
|
||||
|
||||
RawVolume<uint32_t>::Sampler satVolumeIter(&satVolume);
|
||||
|
||||
IteratorController<RawVolume<uint32_t>::Sampler> satIterCont;
|
||||
satIterCont.m_regValid = Region(satLowerCorner, satUpperCorner);
|
||||
satIterCont.m_Iter = &satVolumeIter;
|
||||
satIterCont.reset();
|
||||
|
||||
SrcVolumeType<VoxelType>::Sampler srcVolumeIter(m_pVolSrc);
|
||||
|
||||
IteratorController<SrcVolumeType<VoxelType>::Sampler> srcIterCont;
|
||||
srcIterCont.m_regValid = Region(satLowerCorner, satUpperCorner);
|
||||
srcIterCont.m_Iter = &srcVolumeIter;
|
||||
srcIterCont.reset();
|
||||
|
||||
do
|
||||
{
|
||||
uint32_t previousSum = satVolumeIter.peekVoxel1nx0py0pz();
|
||||
|
||||
uint32_t currentVal = srcVolumeIter.getVoxel().getDensity();
|
||||
|
||||
satVolumeIter.setVoxel(previousSum + currentVal);
|
||||
|
||||
srcIterCont.moveForward();
|
||||
|
||||
}while(satIterCont.moveForward());
|
||||
|
||||
//Build SAT in three passes
|
||||
for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++)
|
||||
/*for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++)
|
||||
{
|
||||
for(int32_t y = satLowerCorner.getY(); y <= satUpperCorner.getY(); y++)
|
||||
{
|
||||
@ -152,7 +179,7 @@ namespace PolyVox
|
||||
satVolume.setVoxelAt(x,y,z,previousSum + currentVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
for(int32_t z = satLowerCorner.getZ(); z <= satUpperCorner.getZ(); z++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user