Applied default Visual Studio formatting to most files. This is a quick fix for the tabs vs spaces issue that messes up the formatting in any editor (esp. Linux) which handles tabs/spaces differently to Visual Studio. Some parts of the formatting look a bit worse but overall it should be better (or at least more consistent).
I didn't apply the changes to a few macro-heavy files as Visual Studio removes all indentation from macros, whereas the indentation can be handy to see nesting.
This commit is contained in:
@ -37,9 +37,9 @@ namespace PolyVox
|
||||
template< typename SrcVolumeType, typename DstVolumeType>
|
||||
VolumeResampler<SrcVolumeType, DstVolumeType>::VolumeResampler(SrcVolumeType* pVolSrc, const Region ®Src, DstVolumeType* pVolDst, const Region& regDst)
|
||||
:m_pVolSrc(pVolSrc)
|
||||
,m_regSrc(regSrc)
|
||||
,m_pVolDst(pVolDst)
|
||||
,m_regDst(regDst)
|
||||
, m_regSrc(regSrc)
|
||||
, m_pVolDst(pVolDst)
|
||||
, m_regDst(regDst)
|
||||
{
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ namespace PolyVox
|
||||
int32_t uDstHeight = m_regDst.getUpperY() - m_regDst.getLowerY() + 1;
|
||||
int32_t uDstDepth = m_regDst.getUpperZ() - m_regDst.getLowerZ() + 1;
|
||||
|
||||
if((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth))
|
||||
if ((uSrcWidth == uDstWidth) && (uSrcHeight == uDstHeight) && (uSrcDepth == uDstDepth))
|
||||
{
|
||||
resampleSameSize();
|
||||
}
|
||||
@ -67,15 +67,15 @@ namespace PolyVox
|
||||
template< typename SrcVolumeType, typename DstVolumeType>
|
||||
void VolumeResampler<SrcVolumeType, DstVolumeType>::resampleSameSize()
|
||||
{
|
||||
for(int32_t sz = m_regSrc.getLowerZ(), dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); sz++, dz++)
|
||||
for (int32_t sz = m_regSrc.getLowerZ(), dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); sz++, dz++)
|
||||
{
|
||||
for(int32_t sy = m_regSrc.getLowerY(), dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); sy++, dy++)
|
||||
for (int32_t sy = m_regSrc.getLowerY(), dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); sy++, dy++)
|
||||
{
|
||||
for(int32_t sx = m_regSrc.getLowerX(), dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); sx++,dx++)
|
||||
for (int32_t sx = m_regSrc.getLowerX(), dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); sx++, dx++)
|
||||
{
|
||||
const typename SrcVolumeType::VoxelType& tSrcVoxel = m_pVolSrc->getVoxel(sx,sy,sz);
|
||||
const typename SrcVolumeType::VoxelType& tSrcVoxel = m_pVolSrc->getVoxel(sx, sy, sz);
|
||||
const typename DstVolumeType::VoxelType& tDstVoxel = static_cast<typename DstVolumeType::VoxelType>(tSrcVoxel);
|
||||
m_pVolDst->setVoxel(dx,dy,dz,tDstVoxel);
|
||||
m_pVolDst->setVoxel(dx, dy, dz, tDstVoxel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -84,25 +84,25 @@ namespace PolyVox
|
||||
template< typename SrcVolumeType, typename DstVolumeType>
|
||||
void VolumeResampler<SrcVolumeType, DstVolumeType>::resampleArbitrary()
|
||||
{
|
||||
float srcWidth = m_regSrc.getWidthInCells();
|
||||
float srcWidth = m_regSrc.getWidthInCells();
|
||||
float srcHeight = m_regSrc.getHeightInCells();
|
||||
float srcDepth = m_regSrc.getDepthInCells();
|
||||
float srcDepth = m_regSrc.getDepthInCells();
|
||||
|
||||
float dstWidth = m_regDst.getWidthInCells();
|
||||
float dstWidth = m_regDst.getWidthInCells();
|
||||
float dstHeight = m_regDst.getHeightInCells();
|
||||
float dstDepth = m_regDst.getDepthInCells();
|
||||
|
||||
float dstDepth = m_regDst.getDepthInCells();
|
||||
|
||||
float fScaleX = srcWidth / dstWidth;
|
||||
float fScaleY = srcHeight / dstHeight;
|
||||
float fScaleZ = srcDepth / dstDepth;
|
||||
|
||||
typename SrcVolumeType::Sampler sampler(m_pVolSrc);
|
||||
|
||||
for(int32_t dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); dz++)
|
||||
for (int32_t dz = m_regDst.getLowerZ(); dz <= m_regDst.getUpperZ(); dz++)
|
||||
{
|
||||
for(int32_t dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); dy++)
|
||||
for (int32_t dy = m_regDst.getLowerY(); dy <= m_regDst.getUpperY(); dy++)
|
||||
{
|
||||
for(int32_t dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); dx++)
|
||||
for (int32_t dx = m_regDst.getLowerX(); dx <= m_regDst.getUpperX(); dx++)
|
||||
{
|
||||
float sx = (dx - m_regDst.getLowerX()) * fScaleX;
|
||||
float sy = (dy - m_regDst.getLowerY()) * fScaleY;
|
||||
@ -112,7 +112,7 @@ namespace PolyVox
|
||||
sy += m_regSrc.getLowerY();
|
||||
sz += m_regSrc.getLowerZ();
|
||||
|
||||
sampler.setPosition(sx,sy,sz);
|
||||
sampler.setPosition(sx, sy, sz);
|
||||
const typename SrcVolumeType::VoxelType& voxel000 = sampler.peekVoxel0px0py0pz();
|
||||
const typename SrcVolumeType::VoxelType& voxel001 = sampler.peekVoxel0px0py1pz();
|
||||
const typename SrcVolumeType::VoxelType& voxel010 = sampler.peekVoxel0px1py0pz();
|
||||
@ -128,10 +128,10 @@ namespace PolyVox
|
||||
sy = modf(sy, &dummy);
|
||||
sz = modf(sz, &dummy);
|
||||
|
||||
typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp<float>(voxel000,voxel100,voxel010,voxel110,voxel001,voxel101,voxel011,voxel111,sx,sy,sz);
|
||||
typename SrcVolumeType::VoxelType tInterpolatedValue = trilerp<float>(voxel000, voxel100, voxel010, voxel110, voxel001, voxel101, voxel011, voxel111, sx, sy, sz);
|
||||
|
||||
typename DstVolumeType::VoxelType result = static_cast<typename DstVolumeType::VoxelType>(tInterpolatedValue);
|
||||
m_pVolDst->setVoxel(dx,dy,dz,result);
|
||||
m_pVolDst->setVoxel(dx, dy, dz, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user