From 36a9be83dbeedb74481c4c96ab5f671fc08e2080 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 30 Apr 2011 22:46:45 +0100 Subject: [PATCH] Added template template parameters to CubicSurfaceExtractorWithNormals. --- examples/Basic/main.cpp | 2 +- .../include/CubicSurfaceExtractorWithNormals.h | 8 ++++---- .../include/CubicSurfaceExtractorWithNormals.inl | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 42814b93..9c76efa4 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) //Extract the surface SurfaceMesh mesh; - CubicSurfaceExtractorWithNormals, MaterialDensityPair44 > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); + CubicSurfaceExtractorWithNormals surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); surfaceExtractor.execute(); //Pass the surface to the OpenGL window diff --git a/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.h b/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.h index 0f9af7de..0097b5e8 100644 --- a/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.h +++ b/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.h @@ -31,18 +31,18 @@ freely, subject to the following restrictions: namespace PolyVox { - template + template< template class VolumeType, typename VoxelType> class CubicSurfaceExtractorWithNormals { public: - CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result); + CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result); void execute(); private: //The volume data and a sampler to access it. - VolumeType* m_volData; - typename VolumeType::Sampler m_sampVolume; + VolumeType* m_volData; + typename VolumeType::Sampler m_sampVolume; //The surface patch we are currently filling. SurfaceMesh* m_meshCurrent; diff --git a/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.inl b/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.inl index 883f0a6f..ba9e7d59 100644 --- a/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.inl +++ b/library/PolyVoxCore/include/CubicSurfaceExtractorWithNormals.inl @@ -29,8 +29,8 @@ freely, subject to the following restrictions: namespace PolyVox { - template - CubicSurfaceExtractorWithNormals::CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result) + template< template class VolumeType, typename VoxelType> + CubicSurfaceExtractorWithNormals::CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result) :m_volData(volData) ,m_sampVolume(volData) ,m_regSizeInVoxels(region) @@ -39,7 +39,7 @@ namespace PolyVox m_meshCurrent->clear(); } - template + template< template class VolumeType, typename VoxelType> void CubicSurfaceExtractorWithNormals::execute() { for(int32_t z = m_regSizeInVoxels.getLowerCorner().getZ(); z < m_regSizeInVoxels.getUpperCorner().getZ(); z++)