Replaced LargeVolume and SimpleVolume with PagedVolume in tests and examples.
This commit is contained in:
@ -27,7 +27,7 @@ freely, subject to the following restrictions:
|
||||
#include "PolyVoxCore/Material.h"
|
||||
#include "PolyVoxCore/MaterialDensityPair.h"
|
||||
#include "PolyVoxCore/RawVolume.h"
|
||||
#include "PolyVoxCore/SimpleVolume.h"
|
||||
#include "PolyVoxCore/PagedVolume.h"
|
||||
#include "PolyVoxCore/CubicSurfaceExtractor.h"
|
||||
|
||||
#include <QtTest>
|
||||
@ -128,26 +128,26 @@ VolumeType* createAndFillVolumeRealistic(int32_t iVolumeSideLength)
|
||||
void TestCubicSurfaceExtractor::testBehaviour()
|
||||
{
|
||||
// Test with default mesh and contoller types.
|
||||
auto uint8Vol = createAndFillVolumeWithNoise< SimpleVolume<uint8_t> >(32, 0, 2);
|
||||
auto uint8Vol = createAndFillVolumeWithNoise< PagedVolume<uint8_t> >(32, 0, 2);
|
||||
auto uint8Mesh = extractCubicMesh(uint8Vol, uint8Vol->getEnclosingRegion());
|
||||
QCOMPARE(uint8Mesh.getNoOfVertices(), uint32_t(57687));
|
||||
QCOMPARE(uint8Mesh.getNoOfIndices(), uint32_t(216234));
|
||||
|
||||
// Test with default mesh type but user-provided controller.
|
||||
auto int8Vol = createAndFillVolumeWithNoise< SimpleVolume<int8_t> >(32, 0, 2);
|
||||
auto int8Vol = createAndFillVolumeWithNoise< PagedVolume<int8_t> >(32, 0, 2);
|
||||
auto int8Mesh = extractCubicMesh(int8Vol, int8Vol->getEnclosingRegion(), CustomIsQuadNeeded<int8_t>());
|
||||
QCOMPARE(int8Mesh.getNoOfVertices(), uint32_t(29027));
|
||||
QCOMPARE(int8Mesh.getNoOfIndices(), uint32_t(178356));
|
||||
|
||||
// Test with default controller but user-provided mesh.
|
||||
auto uint32Vol = createAndFillVolumeWithNoise< SimpleVolume<uint32_t> >(32, 0, 2);
|
||||
auto uint32Vol = createAndFillVolumeWithNoise< PagedVolume<uint32_t> >(32, 0, 2);
|
||||
Mesh< CubicVertex< uint32_t >, uint16_t > uint32Mesh;
|
||||
extractCubicMeshCustom(uint32Vol, uint32Vol->getEnclosingRegion(), &uint32Mesh);
|
||||
QCOMPARE(uint32Mesh.getNoOfVertices(), uint16_t(57687));
|
||||
QCOMPARE(uint32Mesh.getNoOfIndices(), uint32_t(216234));
|
||||
|
||||
// Test with both mesh and controller being provided by the user.
|
||||
auto int32Vol = createAndFillVolumeWithNoise< SimpleVolume<int32_t> >(32, 0, 2);
|
||||
auto int32Vol = createAndFillVolumeWithNoise< PagedVolume<int32_t> >(32, 0, 2);
|
||||
Mesh< CubicVertex< int32_t >, uint16_t > int32Mesh;
|
||||
extractCubicMeshCustom(int32Vol, int32Vol->getEnclosingRegion(), &int32Mesh, CustomIsQuadNeeded<int32_t>());
|
||||
QCOMPARE(int32Mesh.getNoOfVertices(), uint16_t(29027));
|
||||
@ -156,7 +156,7 @@ void TestCubicSurfaceExtractor::testBehaviour()
|
||||
|
||||
void TestCubicSurfaceExtractor::testEmptyVolumePerformance()
|
||||
{
|
||||
auto emptyVol = createAndFillVolumeWithNoise< SimpleVolume<uint32_t> >(128, 0, 0);
|
||||
auto emptyVol = createAndFillVolumeWithNoise< PagedVolume<uint32_t> >(128, 0, 0);
|
||||
Mesh< CubicVertex< uint32_t >, uint16_t > emptyMesh;
|
||||
QBENCHMARK{ extractCubicMeshCustom(emptyVol, Region(32, 32, 32, 63, 63, 63), &emptyMesh); }
|
||||
QCOMPARE(emptyMesh.getNoOfVertices(), uint16_t(0));
|
||||
@ -164,7 +164,7 @@ void TestCubicSurfaceExtractor::testEmptyVolumePerformance()
|
||||
|
||||
void TestCubicSurfaceExtractor::testRealisticVolumePerformance()
|
||||
{
|
||||
auto realisticVol = createAndFillVolumeRealistic< SimpleVolume<uint32_t> >(128);
|
||||
auto realisticVol = createAndFillVolumeRealistic< PagedVolume<uint32_t> >(128);
|
||||
Mesh< CubicVertex< uint32_t >, uint16_t > realisticMesh;
|
||||
QBENCHMARK{ extractCubicMeshCustom(realisticVol, Region(32, 32, 32, 63, 63, 63), &realisticMesh); }
|
||||
QCOMPARE(realisticMesh.getNoOfVertices(), uint16_t(2176));
|
||||
@ -172,7 +172,7 @@ void TestCubicSurfaceExtractor::testRealisticVolumePerformance()
|
||||
|
||||
void TestCubicSurfaceExtractor::testNoiseVolumePerformance()
|
||||
{
|
||||
auto noiseVol = createAndFillVolumeWithNoise< SimpleVolume<uint32_t> >(128, 0, 2);
|
||||
auto noiseVol = createAndFillVolumeWithNoise< PagedVolume<uint32_t> >(128, 0, 2);
|
||||
Mesh< CubicVertex< uint32_t >, uint16_t > noiseMesh;
|
||||
QBENCHMARK{ extractCubicMeshCustom(noiseVol, Region(32, 32, 32, 63, 63, 63), &noiseMesh); }
|
||||
QCOMPARE(noiseMesh.getNoOfVertices(), uint16_t(57729));
|
||||
|
Reference in New Issue
Block a user