Added handy type aliases for meshes.

This commit is contained in:
David Williams
2014-08-18 16:01:31 +02:00
parent be47aec7f7
commit 5e7c4fbc12
4 changed files with 18 additions and 11 deletions

View File

@ -148,10 +148,9 @@ void TestSurfaceExtractor::testExecute()
QCOMPARE(floatMesh.getIndex(100), uint32_t(26)); // Verifies that we have 32-bit indices
QCOMPARE(floatMesh.getVertex(100).data, float(1.0f)); // Not really meaningful for a primative type
// 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.
// This test makes use of a user provided mesh, while stil using the default controller.
auto intVol = createAndFillVolume<int8_t>();
Mesh< MarchingCubesVertex< int8_t >, uint16_t > intMesh;
MarchingCubesMesh< 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
QCOMPARE(intMesh.getNoOfIndices(), uint32_t(34041)); // Verifies size of mesh
@ -161,7 +160,7 @@ void TestSurfaceExtractor::testExecute()
// This test makes use of a user-provided mesh and also a custom controller.
auto doubleVol = createAndFillVolume<double>();
CustomMarchingCubesController doubleCustomController;
Mesh< MarchingCubesVertex< double >, uint16_t > doubleMesh;
MarchingCubesMesh< double, uint16_t > doubleMesh;
extractMarchingCubesMeshCustom(doubleVol, doubleVol->getEnclosingRegion(), &doubleMesh, doubleCustomController);
QCOMPARE(doubleMesh.getNoOfVertices(), uint16_t(16113)); // Verifies size of mesh and that we have 32-bit indices
QCOMPARE(doubleMesh.getNoOfIndices(), uint32_t(22053)); // Verifies size of mesh