Update Contour tests to be aware of flying edge output
This commit is contained in:
parent
1b256281f4
commit
91c56d680c
@ -72,6 +72,12 @@ void TestPointMerging()
|
||||
vtkm::cont::testing::MakeTestDataSet makeDataSet;
|
||||
vtkm::cont::DataSet baseData = makeDataSet.Make3DUniformDataSet3(vtkm::Id3(4, 4, 4));
|
||||
|
||||
//Convert the baseData implicit points to explicit points, since the contour
|
||||
//filter for uniform data always does point merging
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f> newcoords;
|
||||
vtkm::cont::Algorithm::Copy(baseData.GetCoordinateSystem().GetData(), newcoords);
|
||||
baseData.GetCoordinateSystem().SetData(newcoords);
|
||||
|
||||
vtkm::filter::Contour marchingCubes;
|
||||
marchingCubes.SetIsoValue(0.05);
|
||||
marchingCubes.SetMergeDuplicatePoints(false);
|
||||
|
@ -227,15 +227,17 @@ void TestContourUniformGrid()
|
||||
VTKM_TEST_ASSERT(cells.GetNumberOfCells() == 160, "");
|
||||
}
|
||||
|
||||
//Now try with vertex merging disabled
|
||||
//Now try with vertex merging disabled. Since this
|
||||
//we use FlyingEdges we now which does point merging for free
|
||||
//so we should see the number of points not change
|
||||
mc.SetMergeDuplicatePoints(false);
|
||||
mc.SetFieldsToPass(vtkm::filter::FieldSelection::MODE_ALL);
|
||||
result = mc.Execute(dataSet);
|
||||
{
|
||||
vtkm::cont::CoordinateSystem coords = result.GetCoordinateSystem();
|
||||
|
||||
VTKM_TEST_ASSERT(coords.GetNumberOfPoints() == 480,
|
||||
"Should have less coordinates than the unmerged version");
|
||||
VTKM_TEST_ASSERT(coords.GetNumberOfPoints() == 72,
|
||||
"Shouldn't have less coordinates than the unmerged version");
|
||||
|
||||
//verify that the number of cells is correct (160)
|
||||
vtkm::cont::DynamicCellSet dcells = result.GetCellSet();
|
||||
|
@ -233,7 +233,7 @@ void TestContourUniformGrid()
|
||||
|
||||
VTKM_TEST_ASSERT(result.GetNumberOfCells() == 160);
|
||||
|
||||
VTKM_TEST_ASSERT(verticesArray.GetNumberOfValues() == 480);
|
||||
VTKM_TEST_ASSERT(verticesArray.GetNumberOfValues() == 72);
|
||||
}
|
||||
|
||||
void TestContourExplicit()
|
||||
|
Loading…
Reference in New Issue
Block a user