diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index cfa415ef..5de989ae 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -26,14 +26,14 @@ freely, subject to the following restrictions: #include "PolyVox/CubicSurfaceExtractor.h" #include "PolyVox/MarchingCubesSurfaceExtractor.h" #include "PolyVox/Mesh.h" -#include "PolyVox/PagedVolume.h" +#include "PolyVox/RawVolume.h" #include //Use the PolyVox namespace using namespace PolyVox; -void createSphereInVolume(PagedVolume& volData, float fRadius) +void createSphereInVolume(RawVolume& volData, float fRadius) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); @@ -78,7 +78,7 @@ protected: void initializeExample() override { // Create an empty volume and then place a sphere in it - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); + RawVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. diff --git a/examples/DecodeOnGPU/main.cpp b/examples/DecodeOnGPU/main.cpp index f36989f4..f61bd242 100644 --- a/examples/DecodeOnGPU/main.cpp +++ b/examples/DecodeOnGPU/main.cpp @@ -26,14 +26,14 @@ freely, subject to the following restrictions: #include "PolyVox/CubicSurfaceExtractor.h" #include "PolyVox/MarchingCubesSurfaceExtractor.h" #include "PolyVox/Mesh.h" -#include "PolyVox/PagedVolume.h" +#include "PolyVox/RawVolume.h" #include //Use the PolyVox namespace using namespace PolyVox; -void createSphereInVolume(PagedVolume& volData, float fRadius) +void createSphereInVolume(RawVolume& volData, float fRadius) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); @@ -94,7 +94,7 @@ protected: setShader(shader); //Create an empty volume and then place a sphere in it - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); + RawVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index 48cd350b..8821e7fb 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -27,7 +27,7 @@ freely, subject to the following restrictions: using namespace PolyVox; -void createSphereInVolume(PagedVolume& volData, float fRadius, uint8_t uValue) +void createSphereInVolume(RawVolume& volData, float fRadius, uint8_t uValue) { //This vector hold the position of the center of the volume Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast(2); @@ -55,7 +55,7 @@ void createSphereInVolume(PagedVolume& volData, float fRa } } -void createCubeInVolume(PagedVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) +void createCubeInVolume(RawVolume& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue) { uint8_t maxDen = MaterialDensityPair88::getMaxDensity(); uint8_t minDen = MaterialDensityPair88::getMinDensity(); diff --git a/examples/OpenGL/Shapes.h b/examples/OpenGL/Shapes.h index f2f5b193..4ff84883 100644 --- a/examples/OpenGL/Shapes.h +++ b/examples/OpenGL/Shapes.h @@ -24,10 +24,10 @@ freely, subject to the following restrictions: #ifndef __OpenGLExample_Shapes_H__ #define __OpenGLExample_Shapes_H__ -#include "PolyVox/PagedVolume.h" +#include "PolyVox/RawVolume.h" #include "PolyVox/MaterialDensityPair.h" -void createSphereInVolume(PolyVox::LargeVolume& volData, float fRadius, uint8_t uValue); -void createCubeInVolume(PolyVox::LargeVolume& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue); +void createSphereInVolume(PolyVox::RawVolume& volData, float fRadius, uint8_t uValue); +void createCubeInVolume(PolyVox::RawVolume& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue); #endif //__OpenGLExample_Shapes_H__ \ No newline at end of file diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index e39249f0..f73a1b8e 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -58,8 +58,7 @@ public: protected: void initializeExample() override { - FilePager* pager = new FilePager("."); - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1)), pager); + RawVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1))); //Make our volume contain a sphere in the center. int32_t minPos = 0; diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 39a43d0e..5709e44c 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -151,7 +151,7 @@ protected: void initializeExample() override { PerlinNoisePager* pager = new PerlinNoisePager(); - PagedVolume volData(PolyVox::Region::MaxRegion(), pager, 64); + PagedVolume volData(pager, 64); volData.setMemoryUsageLimit(8 * 1024 * 1024); // 8Mb //createSphereInVolume(volData, 30); diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 73be1ca5..7279f0c7 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -27,7 +27,6 @@ freely, subject to the following restrictions: #include "PolyVox/MarchingCubesSurfaceExtractor.h" #include "PolyVox/Mesh.h" #include "PolyVox/RawVolume.h" -#include "PolyVox/PagedVolume.h" #include "PolyVox/VolumeResampler.h" #include @@ -35,7 +34,7 @@ freely, subject to the following restrictions: //Use the PolyVox namespace using namespace PolyVox; -void createSphereInVolume(PagedVolume& volData, float fRadius) +void createSphereInVolume(RawVolume& volData, float fRadius) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); @@ -80,7 +79,7 @@ protected: void initializeExample() override { //Create an empty volume and then place a sphere in it - PagedVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); + RawVolume volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63))); createSphereInVolume(volData, 28); //Smooth the data - should reimplement this using LowPassFilter @@ -90,7 +89,7 @@ protected: RawVolume volDataLowLOD(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(15, 31, 31))); - VolumeResampler< PagedVolume, RawVolume > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion()); + VolumeResampler< RawVolume, RawVolume > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion()); volumeResampler.execute(); //Extract the surface diff --git a/include/PolyVox/PagedVolume.h b/include/PolyVox/PagedVolume.h index 79c8913b..cd981863 100644 --- a/include/PolyVox/PagedVolume.h +++ b/include/PolyVox/PagedVolume.h @@ -251,7 +251,6 @@ namespace PolyVox /// Constructor for creating a fixed size volume. PagedVolume ( - const Region& regValid, Pager* pPager = nullptr, uint16_t uChunkSideLength = 32 ); diff --git a/include/PolyVox/PagedVolume.inl b/include/PolyVox/PagedVolume.inl index b9d8a5e5..16e415b3 100644 --- a/include/PolyVox/PagedVolume.inl +++ b/include/PolyVox/PagedVolume.inl @@ -39,11 +39,10 @@ namespace PolyVox template PagedVolume::PagedVolume ( - const Region& regValid, Pager* pPager, uint16_t uChunkSideLength ) - :BaseVolume(regValid) + :BaseVolume(Region::MaxRegion()) { m_uChunkSideLength = uChunkSideLength; m_pPager = pPager; @@ -52,10 +51,10 @@ namespace PolyVox { // If the user is creating a vast (almost infinite) volume then we can bet they will be // expecting a high memory usage and will want a fair number of chunks to play around with. - if (regValid == Region::MaxRegion()) - { + /*if (regValid == Region::MaxRegion()) + {*/ m_uChunkCountLimit = 1024; - } + /*} else { // Otherwise we try to choose a chunk count to avoid too much thrashing, particularly when iterating @@ -68,7 +67,7 @@ namespace PolyVox shortestSide /= m_uChunkSideLength; m_uChunkCountLimit = longestSide * shortestSide; - } + }*/ } else { diff --git a/tests/TestAmbientOcclusionGenerator.cpp b/tests/TestAmbientOcclusionGenerator.cpp index f08b7111..dcdab847 100644 --- a/tests/TestAmbientOcclusionGenerator.cpp +++ b/tests/TestAmbientOcclusionGenerator.cpp @@ -49,7 +49,7 @@ void TestAmbientOcclusionGenerator::testExecute() const int32_t g_uVolumeSideLength = 64; //Create empty volume - PagedVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(g_uVolumeSideLength - 1, g_uVolumeSideLength - 1, g_uVolumeSideLength - 1))); + PagedVolume volData; //Create two solid walls at opposite sides of the volume for (int32_t z = 0; z < g_uVolumeSideLength; z++) diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index db029e66..563effb2 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -60,11 +60,8 @@ public: // Runs the surface extractor for a given type. template -VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename VolumeType::VoxelType minValue, typename VolumeType::VoxelType maxValue) +void createAndFillVolumeWithNoise(VolumeType& volData, int32_t iVolumeSideLength, typename VolumeType::VoxelType minValue, typename VolumeType::VoxelType maxValue) { - //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1))); - // Set up a random number generator std::mt19937 rng; @@ -78,7 +75,7 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename Vol if (minValue == maxValue) { // In this case we are filling the whole volume with a single value. - volData->setVoxel(x, y, z, minValue); + volData.setVoxel(x, y, z, minValue); } else { @@ -86,13 +83,11 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename Vol // We can't use std distributions because they vary between platforms (breaking tests). int voxelValue = (rng() % (maxValue - minValue + 1)) + minValue; // +1 for inclusive bounds - volData->setVoxel(x, y, z, static_cast(voxelValue)); + volData.setVoxel(x, y, z, static_cast(voxelValue)); } } } } - - return volData; } // Runs the surface extractor for a given type. @@ -100,7 +95,7 @@ template VolumeType* createAndFillVolumeRealistic(int32_t iVolumeSideLength) { //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1))); + VolumeType* volData = new VolumeType; //Fill the volume with data for (int32_t z = 0; z < iVolumeSideLength; z++) @@ -128,38 +123,45 @@ VolumeType* createAndFillVolumeRealistic(int32_t iVolumeSideLength) void TestCubicSurfaceExtractor::testBehaviour() { + int32_t iVolumeSideLength = 32; + // Test with default mesh and contoller types. - auto uint8Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); - auto uint8Mesh = extractCubicMesh(uint8Vol, uint8Vol->getEnclosingRegion()); + RawVolume uint8Vol(Region(0, 0, 0, iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)); + createAndFillVolumeWithNoise(uint8Vol, 32, 0, 2); + auto uint8Mesh = extractCubicMesh(&uint8Vol, uint8Vol.getEnclosingRegion()); QCOMPARE(uint8Mesh.getNoOfVertices(), uint32_t(57544)); QCOMPARE(uint8Mesh.getNoOfIndices(), uint32_t(215304)); // Test with default mesh type but user-provided controller. - auto int8Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); - auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), CustomIsQuadNeeded()); + RawVolume int8Vol(Region(0, 0, 0, iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)); + createAndFillVolumeWithNoise(int8Vol, 32, 0, 2); + auto int8Mesh = extractCubicMesh(&int8Vol, int8Vol.getEnclosingRegion(), CustomIsQuadNeeded()); QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(29106)); QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(178566)); // Test with default controller but user-provided mesh. - auto uint32Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); + RawVolume uint32Vol(Region(0, 0, 0, iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)); + createAndFillVolumeWithNoise(uint32Vol, 32, 0, 2); Mesh< CubicVertex< uint32_t >, uint16_t > uint32Mesh; - extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh); + extractCubicMeshCustom(&uint32Vol, uint32Vol.getEnclosingRegion(), &uint32Mesh); QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57544)); QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(215304)); // Test with both mesh and controller being provided by the user. - auto int32Vol = createAndFillVolumeWithNoise< PagedVolume >(32, 0, 2); + RawVolume int32Vol(Region(0, 0, 0, iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)); + createAndFillVolumeWithNoise(int32Vol, 32, 0, 2); Mesh< CubicVertex< int32_t >, uint16_t > int32Mesh; - extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); + extractCubicMeshCustom(&int32Vol, int32Vol.getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded()); QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29106)); QCOMPARE(int32Mesh.getNoOfIndices(), uint32_t(178566)); } void TestCubicSurfaceExtractor::testEmptyVolumePerformance() { - auto emptyVol = createAndFillVolumeWithNoise< PagedVolume >(128, 0, 0); + PagedVolume emptyVol; + createAndFillVolumeWithNoise(emptyVol, 128, 0, 0); Mesh< CubicVertex< uint32_t >, uint16_t > emptyMesh; - QBENCHMARK{ extractCubicMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } + QBENCHMARK{ extractCubicMeshCustom(&emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); } QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0)); } @@ -173,9 +175,10 @@ void TestCubicSurfaceExtractor::testRealisticVolumePerformance() void TestCubicSurfaceExtractor::testNoiseVolumePerformance() { - auto noiseVol = createAndFillVolumeWithNoise< PagedVolume >(128, 0, 2); + PagedVolume noiseVol; + createAndFillVolumeWithNoise(noiseVol, 128, 0, 2); Mesh< CubicVertex< uint32_t >, uint16_t > noiseMesh; - QBENCHMARK{ extractCubicMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } + QBENCHMARK{ extractCubicMeshCustom(&noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); } QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(57905)); } diff --git a/tests/TestPicking.cpp b/tests/TestPicking.cpp index 0dda302c..748b31e2 100644 --- a/tests/TestPicking.cpp +++ b/tests/TestPicking.cpp @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #include "TestPicking.h" #include "PolyVox/Picking.h" -#include "PolyVox/PagedVolume.h" +#include "PolyVox/RawVolume.h" #include @@ -34,7 +34,7 @@ void TestPicking::testExecute() { const int32_t uVolumeSideLength = 32; - PagedVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); + RawVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); for (int32_t z = 0; z < uVolumeSideLength; z++) { for (int32_t y = 0; y < uVolumeSideLength; y++) diff --git a/tests/TestRaycast.cpp b/tests/TestRaycast.cpp index 22ab2c20..1ea9c9e0 100644 --- a/tests/TestRaycast.cpp +++ b/tests/TestRaycast.cpp @@ -25,7 +25,7 @@ freely, subject to the following restrictions: #include "PolyVox/Density.h" #include "PolyVox/Raycast.h" -#include "PolyVox/PagedVolume.h" +#include "PolyVox/RawVolume.h" #include "PolyVox/Impl/RandomUnitVectors.h" @@ -47,7 +47,7 @@ public: { } - bool operator()(const PagedVolume::Sampler& sampler) + bool operator()(const RawVolume::Sampler& sampler) { m_uVoxelsTouched++; @@ -73,7 +73,7 @@ void TestRaycast::testExecute() const int32_t uVolumeSideLength = 32; //Create a hollow volume, with solid sides on x and y but with open ends in z. - PagedVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); + RawVolume volData(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1))); for (int32_t z = 0; z < uVolumeSideLength; z++) { for (int32_t y = 0; y < uVolumeSideLength; y++) diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index 14623f9d..56c61092 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -103,10 +103,8 @@ VolumeType* createAndFillVolume(void) { const int32_t uVolumeSideLength = 64; - FilePager* pager = new FilePager("."); - //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)), pager); + VolumeType* volData = new VolumeType(Region(0, 0, 0, uVolumeSideLength - 1, uVolumeSideLength - 1, uVolumeSideLength - 1)); // Fill for (int32_t z = 0; z < uVolumeSideLength; z++) @@ -134,7 +132,7 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minVal FilePager* pager = new FilePager("."); //Create empty volume - VolumeType* volData = new VolumeType(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(iVolumeSideLength - 1, iVolumeSideLength - 1, iVolumeSideLength - 1)), pager); + VolumeType* volData = new VolumeType(pager); // Set up a random number generator std::mt19937 rng; @@ -168,7 +166,7 @@ void TestSurfaceExtractor::testBehaviour() // Of course, the use of a custom controller will also make a significant diference, but this probably does need investigating further in the future. // This basic test just uses the default controller and automatically generates a mesh of the appropriate type. - auto uintVol = createAndFillVolume< PagedVolume >(); + auto uintVol = createAndFillVolume< RawVolume >(); auto uintMesh = extractMarchingCubesMesh(uintVol, uintVol->getEnclosingRegion()); QCOMPARE(uintMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(uintMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh @@ -176,7 +174,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(uintMesh.getVertex(100).data, uint8_t(1)); // Not really meaningful for a primative type // This test makes use of a custom controller - auto floatVol = createAndFillVolume< PagedVolume >(); + auto floatVol = createAndFillVolume< RawVolume >(); CustomMarchingCubesController floatCustomController; auto floatMesh = extractMarchingCubesMesh(floatVol, floatVol->getEnclosingRegion(), floatCustomController); QCOMPARE(floatMesh.getNoOfVertices(), uint32_t(16113)); // Verifies size of mesh and that we have 32-bit indices @@ -186,7 +184,7 @@ void TestSurfaceExtractor::testBehaviour() // This test makes use of a user provided mesh. It uses the default controller, but we have to explicitly provide this because C++ won't let us // use a default for the second-to-last parameter but noot use a default for the last parameter. - auto intVol = createAndFillVolume< PagedVolume >(); + auto intVol = createAndFillVolume< RawVolume >(); Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh; extractMarchingCubesMeshCustom(intVol, intVol->getEnclosingRegion(), &intMesh); QCOMPARE(intMesh.getNoOfVertices(), uint16_t(11718)); // Verifies size of mesh and that we have 16-bit indices @@ -195,7 +193,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(intMesh.getVertex(100).data, int8_t(1)); // Not really meaningful for a primative type // This test makes use of a user-provided mesh and also a custom controller. - auto doubleVol = createAndFillVolume< PagedVolume >(); + auto doubleVol = createAndFillVolume< RawVolume >(); CustomMarchingCubesController doubleCustomController; Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh; extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController); @@ -205,7 +203,7 @@ void TestSurfaceExtractor::testBehaviour() QCOMPARE(doubleMesh.getVertex(100).data, double(1.0f)); // Not really meaningful for a primative type // This test ensures the extractor works on a non-primitive voxel type. - auto materialVol = createAndFillVolume< PagedVolume >(); + auto materialVol = createAndFillVolume< RawVolume >(); auto materialMesh = extractMarchingCubesMesh(materialVol, materialVol->getEnclosingRegion()); QCOMPARE(materialMesh.getNoOfVertices(), uint32_t(12096)); // Verifies size of mesh and that we have 32-bit indices QCOMPARE(materialMesh.getNoOfIndices(), uint32_t(35157)); // Verifies size of mesh diff --git a/tests/testvolume.cpp b/tests/testvolume.cpp index 0a488f52..1e4d3857 100644 --- a/tests/testvolume.cpp +++ b/tests/testvolume.cpp @@ -265,7 +265,7 @@ TestVolume::TestVolume() //Create the volumes m_pRawVolume = new RawVolume(region); - m_pPagedVolume = new PagedVolume(region, m_pFilePager, 32); + m_pPagedVolume = new PagedVolume(m_pFilePager, 32); m_pPagedVolume->setMemoryUsageLimit(1 * 1024 * 1024);