Add 'typename' where necessary
This fixes the compilation on Linux after the template template parameter removals.
This commit is contained in:
		| @@ -136,7 +136,7 @@ namespace PolyVox | |||||||
| 	template<typename VolumeType> | 	template<typename VolumeType> | ||||||
| 	bool AmbientOcclusionCalculator<VolumeType>::raycastCallback(const typename VolumeType::Sampler& sampler) | 	bool AmbientOcclusionCalculator<VolumeType>::raycastCallback(const typename VolumeType::Sampler& sampler) | ||||||
| 	{ | 	{ | ||||||
| 		VolumeType::VoxelType voxel = sampler.getVoxel(); | 		typename VolumeType::VoxelType voxel = sampler.getVoxel(); | ||||||
| 		return m_funcIsTransparent(voxel); | 		return m_funcIsTransparent(voxel); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -90,10 +90,10 @@ namespace PolyVox | |||||||
|  |  | ||||||
| 					volumeSampler.setPosition(x,y,z); | 					volumeSampler.setPosition(x,y,z); | ||||||
|  |  | ||||||
| 					VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); | 					typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel(); | ||||||
| 					bool currentVoxelIsSolid = currentVoxel.getMaterial() != 0; | 					bool currentVoxelIsSolid = currentVoxel.getMaterial() != 0; | ||||||
|  |  | ||||||
| 					VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz(); | 					typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz(); | ||||||
| 					bool negXVoxelIsSolid = negXVoxel.getMaterial() != 0; | 					bool negXVoxelIsSolid = negXVoxel.getMaterial() != 0; | ||||||
|  |  | ||||||
| 					if((currentVoxelIsSolid != negXVoxelIsSolid) && (finalY == false) && (finalZ == false)) | 					if((currentVoxelIsSolid != negXVoxelIsSolid) && (finalY == false) && (finalZ == false)) | ||||||
| @@ -130,7 +130,7 @@ namespace PolyVox | |||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz(); | 					typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz(); | ||||||
| 					bool negYVoxelIsSolid = negYVoxel.getMaterial() != 0; | 					bool negYVoxelIsSolid = negYVoxel.getMaterial() != 0; | ||||||
|  |  | ||||||
| 					if((currentVoxelIsSolid != negYVoxelIsSolid) && (finalX == false) && (finalZ == false)) | 					if((currentVoxelIsSolid != negYVoxelIsSolid) && (finalX == false) && (finalZ == false)) | ||||||
| @@ -167,7 +167,7 @@ namespace PolyVox | |||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					VolumeType::VoxelType negZVoxel = volumeSampler.peekVoxel0px0py1nz(); | 					typename VolumeType::VoxelType negZVoxel = volumeSampler.peekVoxel0px0py1nz(); | ||||||
| 					bool negZVoxelIsSolid = negZVoxel.getMaterial() != 0; | 					bool negZVoxelIsSolid = negZVoxel.getMaterial() != 0; | ||||||
|  |  | ||||||
| 					if((currentVoxelIsSolid != negZVoxelIsSolid) && (finalX == false) && (finalY == false)) | 					if((currentVoxelIsSolid != negZVoxelIsSolid) && (finalX == false) && (finalY == false)) | ||||||
|   | |||||||
| @@ -27,14 +27,14 @@ namespace PolyVox | |||||||
| 	Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) | 	Vector3DFloat computeCentralDifferenceGradient(const typename VolumeType::Sampler& volIter) | ||||||
| 	{ | 	{ | ||||||
| 		//FIXME - bitwise way of doing this? | 		//FIXME - bitwise way of doing this? | ||||||
| 		VolumeType::VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1nx = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; | ||||||
| 		VolumeType::VoxelType voxel1px = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1px = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 		VolumeType::VoxelType voxel1ny = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1ny = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; | ||||||
| 		VolumeType::VoxelType voxel1py = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1py = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 		VolumeType::VoxelType voxel1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; | ||||||
| 		VolumeType::VoxelType voxel1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 		return Vector3DFloat | 		return Vector3DFloat | ||||||
| 		( | 		( | ||||||
| @@ -52,14 +52,14 @@ namespace PolyVox | |||||||
| 		const int32_t z = volIter.getPosition().getZ(); | 		const int32_t z = volIter.getPosition().getZ(); | ||||||
|  |  | ||||||
| 		//FIXME - bitwise way of doing this? | 		//FIXME - bitwise way of doing this? | ||||||
| 		VolumeType::VoxelType voxel1nx = volIter.getVoxelAt(x-2, y  ,z  ) > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1nx = volIter.getVoxelAt(x-2, y  ,z  ) > 0 ? 1: 0; | ||||||
| 		VolumeType::VoxelType voxel1px = volIter.getVoxelAt(x-2, y  ,z  ) > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1px = volIter.getVoxelAt(x-2, y  ,z  ) > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 		VolumeType::VoxelType voxel1ny = volIter.getVoxelAt(x  , y-2,z  ) > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1ny = volIter.getVoxelAt(x  , y-2,z  ) > 0 ? 1: 0; | ||||||
| 		VolumeType::VoxelType voxel1py = volIter.getVoxelAt(x  , y-2,z  ) > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1py = volIter.getVoxelAt(x  , y-2,z  ) > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 		VolumeType::VoxelType voxel1nz = volIter.getVoxelAt(x  , y  ,z-2) > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1nz = volIter.getVoxelAt(x  , y  ,z-2) > 0 ? 1: 0; | ||||||
| 		VolumeType::VoxelType voxel1pz = volIter.getVoxelAt(x  , y  ,z-2) > 0 ? 1: 0; | 		typename VolumeType::VoxelType voxel1pz = volIter.getVoxelAt(x  , y  ,z-2) > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 		return Vector3DFloat | 		return Vector3DFloat | ||||||
| 		( | 		( | ||||||
| @@ -106,35 +106,35 @@ namespace PolyVox | |||||||
| 		static const int weights[3][3][3] = {  {  {2,3,2}, {3,6,3}, {2,3,2}  },  { | 		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} } }; | 			{3,6,3},  {6,0,6},  {3,6,3} },  { {2,3,2},  {3,6,3},  {2,3,2} } }; | ||||||
|  |  | ||||||
| 			const VolumeType::VoxelType pVoxel1nx1ny1nz = volIter.peekVoxel1nx1ny1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx1ny1nz = volIter.peekVoxel1nx1ny1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx1ny0pz = volIter.peekVoxel1nx1ny0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx1ny0pz = volIter.peekVoxel1nx1ny0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx1ny1pz = volIter.peekVoxel1nx1ny1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx1ny1pz = volIter.peekVoxel1nx1ny1pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx0py1nz = volIter.peekVoxel1nx0py1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx0py1nz = volIter.peekVoxel1nx0py1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx0py0pz = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx0py0pz = volIter.peekVoxel1nx0py0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx0py1pz = volIter.peekVoxel1nx0py1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx0py1pz = volIter.peekVoxel1nx0py1pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx1py1nz = volIter.peekVoxel1nx1py1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx1py1nz = volIter.peekVoxel1nx1py1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx1py0pz = volIter.peekVoxel1nx1py0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx1py0pz = volIter.peekVoxel1nx1py0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1nx1py1pz = volIter.peekVoxel1nx1py1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1nx1py1pz = volIter.peekVoxel1nx1py1pz() > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 			const VolumeType::VoxelType pVoxel0px1ny1nz = volIter.peekVoxel0px1ny1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px1ny1nz = volIter.peekVoxel0px1ny1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel0px1ny0pz = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px1ny0pz = volIter.peekVoxel0px1ny0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel0px1ny1pz = volIter.peekVoxel0px1ny1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px1ny1pz = volIter.peekVoxel0px1ny1pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel0px0py1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px0py1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0; | ||||||
| 			//const VolumeType::VoxelType pVoxel0px0py0pz = volIter.peekVoxel0px0py0pz() > 0 ? 1: 0; | 			//const VolumeType::VoxelType pVoxel0px0py0pz = volIter.peekVoxel0px0py0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel0px0py1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px0py1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel0px1py1nz = volIter.peekVoxel0px1py1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px1py1nz = volIter.peekVoxel0px1py1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel0px1py0pz = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px1py0pz = volIter.peekVoxel0px1py0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel0px1py1pz = volIter.peekVoxel0px1py1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel0px1py1pz = volIter.peekVoxel0px1py1pz() > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 			const VolumeType::VoxelType pVoxel1px1ny1nz = volIter.peekVoxel1px1ny1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px1ny1nz = volIter.peekVoxel1px1ny1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px1ny0pz = volIter.peekVoxel1px1ny0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px1ny0pz = volIter.peekVoxel1px1ny0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px1ny1pz = volIter.peekVoxel1px1ny1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px1ny1pz = volIter.peekVoxel1px1ny1pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px0py1nz = volIter.peekVoxel1px0py1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px0py1nz = volIter.peekVoxel1px0py1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px0py0pz = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px0py0pz = volIter.peekVoxel1px0py0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px0py1pz = volIter.peekVoxel1px0py1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px0py1pz = volIter.peekVoxel1px0py1pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px1py1nz = volIter.peekVoxel1px1py1nz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px1py1nz = volIter.peekVoxel1px1py1nz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px1py0pz = volIter.peekVoxel1px1py0pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px1py0pz = volIter.peekVoxel1px1py0pz() > 0 ? 1: 0; | ||||||
| 			const VolumeType::VoxelType pVoxel1px1py1pz = volIter.peekVoxel1px1py1pz() > 0 ? 1: 0; | 			const typename VolumeType::VoxelType pVoxel1px1py1pz = volIter.peekVoxel1px1py1pz() > 0 ? 1: 0; | ||||||
|  |  | ||||||
| 			const int xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - | 			const int xGrad(- weights[0][0][0] * pVoxel1nx1ny1nz - | ||||||
| 				weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * | 				weights[1][0][0] * pVoxel1nx1ny0pz - weights[2][0][0] * | ||||||
|   | |||||||
| @@ -73,7 +73,7 @@ namespace PolyVox | |||||||
| 					//VoxelType tSrcVoxel = m_pVolSrc->getVoxelAt(iSrcX, iSrcY, iSrcZ); | 					//VoxelType tSrcVoxel = m_pVolSrc->getVoxelAt(iSrcX, iSrcY, iSrcZ); | ||||||
| 					srcSampler.setPosition(iSrcX, iSrcY, iSrcZ); | 					srcSampler.setPosition(iSrcX, iSrcY, iSrcZ); | ||||||
|  |  | ||||||
| 					SrcVolumeType::VoxelType tSrcVoxel = srcSampler.getVoxel(); | 					typename SrcVolumeType::VoxelType tSrcVoxel = srcSampler.getVoxel(); | ||||||
|  |  | ||||||
| 					uint32_t uDensity = 0; | 					uint32_t uDensity = 0; | ||||||
| 					uDensity += convertToDensity(srcSampler.peekVoxel1nx1ny1nz()); | 					uDensity += convertToDensity(srcSampler.peekVoxel1nx1ny1nz()); | ||||||
| @@ -247,7 +247,7 @@ namespace PolyVox | |||||||
| 					float average = sum / (static_cast<float>(sideLength*sideLength*sideLength)); | 					float average = sum / (static_cast<float>(sideLength*sideLength*sideLength)); | ||||||
|  |  | ||||||
| 					//Note: These lines need consideration if src and dest have different voxel types. | 					//Note: These lines need consideration if src and dest have different voxel types. | ||||||
| 					SrcVolumeType::VoxelType voxel = m_pVolSrc->getVoxelAt(iDstX, iDstY, iDstZ); | 					typename SrcVolumeType::VoxelType voxel = m_pVolSrc->getVoxelAt(iDstX, iDstY, iDstZ); | ||||||
|  |  | ||||||
| 					voxel.setDensity(static_cast<typename SrcVolumeType::VoxelType::DensityType>(average)); | 					voxel.setDensity(static_cast<typename SrcVolumeType::VoxelType::DensityType>(average)); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -197,14 +197,14 @@ namespace PolyVox | |||||||
| 	{ | 	{ | ||||||
| 		uint8_t iCubeIndex = 0; | 		uint8_t iCubeIndex = 0; | ||||||
|  |  | ||||||
| 		VolumeType::VoxelType v000; | 		typename VolumeType::VoxelType v000; | ||||||
| 		VolumeType::VoxelType v100; | 		typename VolumeType::VoxelType v100; | ||||||
| 		VolumeType::VoxelType v010; | 		typename VolumeType::VoxelType v010; | ||||||
| 		VolumeType::VoxelType v110; | 		typename VolumeType::VoxelType v110; | ||||||
| 		VolumeType::VoxelType v001; | 		typename VolumeType::VoxelType v001; | ||||||
| 		VolumeType::VoxelType v101; | 		typename VolumeType::VoxelType v101; | ||||||
| 		VolumeType::VoxelType v011; | 		typename VolumeType::VoxelType v011; | ||||||
| 		VolumeType::VoxelType v111; | 		typename VolumeType::VoxelType v111; | ||||||
|  |  | ||||||
| 		if(isPrevZAvail) | 		if(isPrevZAvail) | ||||||
| 		{ | 		{ | ||||||
| @@ -423,14 +423,14 @@ namespace PolyVox | |||||||
|  |  | ||||||
|  |  | ||||||
| 				m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); | 				m_sampVolume.setPosition(iXVolSpace,iYVolSpace,iZVolSpace); | ||||||
| 				const VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); | 				const typename VolumeType::VoxelType v000 = m_sampVolume.getVoxel(); | ||||||
| 				const Vector3DFloat n000 = computeCentralDifferenceGradient(m_sampVolume); | 				const Vector3DFloat n000 = computeCentralDifferenceGradient(m_sampVolume); | ||||||
|  |  | ||||||
| 				/* Find the vertices where the surface intersects the cube */ | 				/* Find the vertices where the surface intersects the cube */ | ||||||
| 				if (edgeTable[iCubeIndex] & 1) | 				if (edgeTable[iCubeIndex] & 1) | ||||||
| 				{ | 				{ | ||||||
| 					m_sampVolume.movePositiveX(); | 					m_sampVolume.movePositiveX(); | ||||||
| 					const VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); | 					const typename VolumeType::VoxelType v100 = m_sampVolume.getVoxel(); | ||||||
| 					const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); | 					const Vector3DFloat n100 = computeCentralDifferenceGradient(m_sampVolume); | ||||||
|  |  | ||||||
| 					float fInterp = static_cast<float>(m_tThreshold - convertToDensity(v000)) / static_cast<float>(convertToDensity(v100) - convertToDensity(v000)); | 					float fInterp = static_cast<float>(m_tThreshold - convertToDensity(v000)) / static_cast<float>(convertToDensity(v100) - convertToDensity(v000)); | ||||||
| @@ -456,7 +456,7 @@ namespace PolyVox | |||||||
| 				if (edgeTable[iCubeIndex] & 8) | 				if (edgeTable[iCubeIndex] & 8) | ||||||
| 				{ | 				{ | ||||||
| 					m_sampVolume.movePositiveY(); | 					m_sampVolume.movePositiveY(); | ||||||
| 					const VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); | 					const typename VolumeType::VoxelType v010 = m_sampVolume.getVoxel(); | ||||||
| 					const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); | 					const Vector3DFloat n010 = computeCentralDifferenceGradient(m_sampVolume); | ||||||
|  |  | ||||||
| 					float fInterp = static_cast<float>(m_tThreshold - convertToDensity(v000)) / static_cast<float>(convertToDensity(v010) - convertToDensity(v000)); | 					float fInterp = static_cast<float>(m_tThreshold - convertToDensity(v000)) / static_cast<float>(convertToDensity(v010) - convertToDensity(v000)); | ||||||
| @@ -482,7 +482,7 @@ namespace PolyVox | |||||||
| 				if (edgeTable[iCubeIndex] & 256) | 				if (edgeTable[iCubeIndex] & 256) | ||||||
| 				{ | 				{ | ||||||
| 					m_sampVolume.movePositiveZ(); | 					m_sampVolume.movePositiveZ(); | ||||||
| 					const VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); | 					const typename VolumeType::VoxelType v001 = m_sampVolume.getVoxel(); | ||||||
| 					const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); | 					const Vector3DFloat n001 = computeCentralDifferenceGradient(m_sampVolume); | ||||||
|  |  | ||||||
| 					float fInterp = static_cast<float>(m_tThreshold - convertToDensity(v000)) / static_cast<float>(convertToDensity(v001) - convertToDensity(v000)); | 					float fInterp = static_cast<float>(m_tThreshold - convertToDensity(v000)) / static_cast<float>(convertToDensity(v001) - convertToDensity(v000)); | ||||||
|   | |||||||
| @@ -65,7 +65,7 @@ namespace PolyVox | |||||||
| 				for(int32_t sx = m_regSrc.getLowerCorner().getX(), dx = m_regDst.getLowerCorner().getX(); dx <= m_regDst.getUpperCorner().getX(); sx++,dx++) | 				for(int32_t sx = m_regSrc.getLowerCorner().getX(), dx = m_regDst.getLowerCorner().getX(); dx <= m_regDst.getUpperCorner().getX(); sx++,dx++) | ||||||
| 				{ | 				{ | ||||||
| 					//Note: Consider what should happen if src and dest have different voxel types. | 					//Note: Consider what should happen if src and dest have different voxel types. | ||||||
| 					SrcVolumeType::VoxelType voxel = m_pVolSrc->getVoxelAt(sx,sy,sz); | 					typename SrcVolumeType::VoxelType voxel = m_pVolSrc->getVoxelAt(sx,sy,sz); | ||||||
| 					m_pVolDst->setVoxelAt(dx,dy,dz,voxel); | 					m_pVolDst->setVoxelAt(dx,dy,dz,voxel); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| @@ -104,23 +104,23 @@ namespace PolyVox | |||||||
| 					sz += m_regSrc.getLowerCorner().getZ(); | 					sz += m_regSrc.getLowerCorner().getZ(); | ||||||
|  |  | ||||||
| 					sampler.setPosition(sx,sy,sz); | 					sampler.setPosition(sx,sy,sz); | ||||||
| 					SrcVolumeType::VoxelType voxel000 = sampler.peekVoxel0px0py0pz(); | 					typename SrcVolumeType::VoxelType voxel000 = sampler.peekVoxel0px0py0pz(); | ||||||
| 					SrcVolumeType::VoxelType voxel001 = sampler.peekVoxel0px0py1pz(); | 					typename SrcVolumeType::VoxelType voxel001 = sampler.peekVoxel0px0py1pz(); | ||||||
| 					SrcVolumeType::VoxelType voxel010 = sampler.peekVoxel0px1py0pz(); | 					typename SrcVolumeType::VoxelType voxel010 = sampler.peekVoxel0px1py0pz(); | ||||||
| 					SrcVolumeType::VoxelType voxel011 = sampler.peekVoxel0px1py1pz(); | 					typename SrcVolumeType::VoxelType voxel011 = sampler.peekVoxel0px1py1pz(); | ||||||
| 					SrcVolumeType::VoxelType voxel100 = sampler.peekVoxel1px0py0pz(); | 					typename SrcVolumeType::VoxelType voxel100 = sampler.peekVoxel1px0py0pz(); | ||||||
| 					SrcVolumeType::VoxelType voxel101 = sampler.peekVoxel1px0py1pz(); | 					typename SrcVolumeType::VoxelType voxel101 = sampler.peekVoxel1px0py1pz(); | ||||||
| 					SrcVolumeType::VoxelType voxel110 = sampler.peekVoxel1px1py0pz(); | 					typename SrcVolumeType::VoxelType voxel110 = sampler.peekVoxel1px1py0pz(); | ||||||
| 					SrcVolumeType::VoxelType voxel111 = sampler.peekVoxel1px1py1pz(); | 					typename SrcVolumeType::VoxelType voxel111 = sampler.peekVoxel1px1py1pz(); | ||||||
|  |  | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel000Den = convertToDensity(voxel000); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel000Den = convertToDensity(voxel000); | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel001Den = convertToDensity(voxel001); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel001Den = convertToDensity(voxel001); | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel010Den = convertToDensity(voxel010); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel010Den = convertToDensity(voxel010); | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel011Den = convertToDensity(voxel011); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel011Den = convertToDensity(voxel011); | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel100Den = convertToDensity(voxel100); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel100Den = convertToDensity(voxel100); | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel101Den = convertToDensity(voxel101); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel101Den = convertToDensity(voxel101); | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel110Den = convertToDensity(voxel110); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel110Den = convertToDensity(voxel110); | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType voxel111Den = convertToDensity(voxel111); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType voxel111Den = convertToDensity(voxel111); | ||||||
|  |  | ||||||
| 					//FIXME - should accept all float parameters, but GCC complains? | 					//FIXME - should accept all float parameters, but GCC complains? | ||||||
| 					double dummy; | 					double dummy; | ||||||
| @@ -129,10 +129,10 @@ namespace PolyVox | |||||||
| 					sz = modf(sz, &dummy); | 					sz = modf(sz, &dummy); | ||||||
|  |  | ||||||
| 					//Note: Consider what should happen if src and dest have different voxel types. | 					//Note: Consider what should happen if src and dest have different voxel types. | ||||||
| 					typename VoxelTypeTraits<SrcVolumeType::VoxelType>::DensityType uInterpolatedDensity = trilinearlyInterpolate<float>(voxel000Den,voxel100Den,voxel010Den,voxel110Den,voxel001Den,voxel101Den,voxel011Den,voxel111Den,sx,sy,sz); | 					typename VoxelTypeTraits<typename SrcVolumeType::VoxelType>::DensityType uInterpolatedDensity = trilinearlyInterpolate<float>(voxel000Den,voxel100Den,voxel010Den,voxel110Den,voxel001Den,voxel101Den,voxel011Den,voxel111Den,sx,sy,sz); | ||||||
|  |  | ||||||
| 					//Note: Consider what should happen if src and dest have different voxel types. | 					//Note: Consider what should happen if src and dest have different voxel types. | ||||||
| 					DestVolumeType::VoxelType result; | 					typename DestVolumeType::VoxelType result; | ||||||
| 					//result.setDensity(uInterpolatedDensity); | 					//result.setDensity(uInterpolatedDensity); | ||||||
| 					result = uInterpolatedDensity; | 					result = uInterpolatedDensity; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ freely, subject to the following restrictions: | |||||||
| namespace PolyVox | namespace PolyVox | ||||||
| { | { | ||||||
| 	template<> | 	template<> | ||||||
| 	typename VoxelTypeTraits<Density8>::DensityType convertToDensity(Density8 voxel) | 	VoxelTypeTraits<Density8>::DensityType convertToDensity(Density8 voxel) | ||||||
| 	{ | 	{ | ||||||
| 		return voxel.getDensity(); | 		return voxel.getDensity(); | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ bool testVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos) | |||||||
| 		return false; | 		return false; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	VolumeType::VoxelType voxel = volData->getVoxelAt(v3dPos); | 	typename VolumeType::VoxelType voxel = volData->getVoxelAt(v3dPos); | ||||||
| 	if(voxel != 0) | 	if(voxel != 0) | ||||||
| 	{ | 	{ | ||||||
| 		return false; | 		return false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user