From bdc2770cba68244a2f1aa0e70be97072e4f282a2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 18 Aug 2011 22:45:39 +0100 Subject: [PATCH] G++ compile fixes. --- examples/OpenGL/main.cpp | 2 +- library/PolyVoxCore/include/PolyVoxCore/Density.h | 4 +++- library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl | 6 +++--- library/PolyVoxCore/include/PolyVoxCore/Material.h | 2 +- library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl | 4 ++-- .../PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl | 6 +++--- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 22ad8e6f..9930082a 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) createCubeInVolume(volData, Vector3DInt32(midPos-10, midPos-10 ,1), Vector3DInt32(midPos+10, midPos+10, maxPos-1), MaterialDensityPair44::getMaxDensity()); //Smooth part of the volume - RawVolume tempVolume(Region(0,0,0,128, 128, 128)); + RawVolume tempVolume(PolyVox::Region(0,0,0,128, 128, 128)); LowPassFilter pass1(&volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3); pass1.executeSAT(); LowPassFilter pass2(&tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Density.h b/library/PolyVoxCore/include/PolyVoxCore/Density.h index a2084c3e..368b5234 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Density.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Density.h @@ -27,6 +27,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "PolyVoxImpl/TypeDef.h" +#include + namespace PolyVox { ///This class represents a voxel storing only a density. @@ -62,7 +64,7 @@ namespace PolyVox Type getMaterial() const throw() { return 1; } void setDensity(Type uDensity) { m_uDensity = uDensity; } - void setMaterial(Type uMaterial) { assert("Cannot set material on voxel of type 'Density'"); } + void setMaterial(Type uMaterial) { assert(false); } //Cannot set material on voxel of type Density static Type getMaxDensity() throw() { return (0x01 << (sizeof(Type) * 8)) - 1; } static Type getMinDensity() throw() { return 0; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl b/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl index affa90f2..04dc3f93 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LowPassFilter.inl @@ -65,7 +65,7 @@ namespace PolyVox //int32_t iDstMaxY = m_regDst.getUpperCorner().getY(); //int32_t iDstMaxZ = m_regDst.getUpperCorner().getZ(); - SrcVolumeType::Sampler srcSampler(m_pVolSrc); + typename SrcVolumeType::Sampler srcSampler(m_pVolSrc); for(int32_t iSrcZ = iSrcMinZ, iDstZ = iDstMinZ; iSrcZ <= iSrcMaxZ; iSrcZ++, iDstZ++) { @@ -147,9 +147,9 @@ namespace PolyVox satIterCont.m_Iter = &satVolumeIter; satIterCont.reset(); - SrcVolumeType::Sampler srcVolumeIter(m_pVolSrc); + typename SrcVolumeType::Sampler srcVolumeIter(m_pVolSrc); - IteratorController::Sampler> srcIterCont; + IteratorController::Sampler> srcIterCont; srcIterCont.m_regValid = Region(satLowerCorner, satUpperCorner); srcIterCont.m_Iter = &srcVolumeIter; srcIterCont.reset(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Material.h b/library/PolyVoxCore/include/PolyVoxCore/Material.h index 8f6ff962..54fbd848 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Material.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Material.h @@ -76,7 +76,7 @@ namespace PolyVox Type getMaterial() const throw() { return m_uMaterial; } - void setDensity(Type /*uDensity*/) { assert("Cannot set density on voxel of type 'Material'"); } + void setDensity(Type /*uDensity*/) { assert(false); } //Cannot set density on voxel of type Material void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; } static Type getMaxDensity() throw() { return 2; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl index 27257dc6..6e1e8875 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl @@ -87,7 +87,7 @@ namespace PolyVox { if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) { - const Vector3DInt32& v3dLowerCorner = m_regValidRegion.getLowerCorner(); + const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); @@ -136,7 +136,7 @@ namespace PolyVox { if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos))) { - const Vector3DInt32& v3dLowerCorner = m_regValidRegion.getLowerCorner(); + const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); int32_t iLocalXPos = uXPos - v3dLowerCorner.getX(); int32_t iLocalYPos = uYPos - v3dLowerCorner.getY(); int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl index bf4f97b1..2feac83f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl @@ -100,9 +100,9 @@ namespace PolyVox mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex; - m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(xPos); - m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(yPos); - m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(zPos); + m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(xPos); + m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(yPos); + m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(zPos); } template