Commit 5004e64c authored by Kenneth Moreland's avatar Kenneth Moreland

Fix CleanGrid when compact point fields is off

There was an error in the CleanGrid filter where if the
CompactPointFields flag was off it would still try to compact the point
coordinates. Add an extra check so that the coordinate systems are just
passed when this flag is off.
parent 503bebda
Pipeline #43520 passed with stage
......@@ -128,11 +128,18 @@ CleanGrid::DoExecute(const vtkm::cont::DataSet &inData,
vtkm::cont::CoordinateSystem coordSystem =
inData.GetCoordinateSystem(coordSystemIndex);
vtkm::filter::ApplyPolicy(coordSystem,
Policy(),
vtkm::filter::FilterTraits<CleanGrid>())
.CastAndCall(detail::CleanCompactPointArrayFunctor<Device>(
outData,coordSystem.GetName(),this));
if (this->GetCompactPointFields())
{
vtkm::filter::ApplyPolicy(coordSystem,
Policy(),
vtkm::filter::FilterTraits<CleanGrid>())
.CastAndCall(detail::CleanCompactPointArrayFunctor<Device>(
outData,coordSystem.GetName(),this));
}
else
{
outData.AddCoordinateSystem(coordSystem);
}
}
return outData;
......
......@@ -25,7 +25,7 @@
namespace {
void TestUniformGrid()
void TestUniformGrid(vtkm::filter::CleanGrid clean)
{
std::cout << "Testing 'clean' uniform grid." << std::endl;
......@@ -33,8 +33,6 @@ void TestUniformGrid()
vtkm::cont::DataSet inData = makeData.Make2DUniformDataSet0();
vtkm::filter::CleanGrid clean;
vtkm::filter::ResultDataSet result = clean.Execute(inData);
VTKM_TEST_ASSERT(result.IsValid(), "Filter failed to execute");
......@@ -83,7 +81,15 @@ void TestUniformGrid()
void RunTest()
{
TestUniformGrid();
vtkm::filter::CleanGrid clean;
std::cout << "*** Test wqith compact point fields on" << std::endl;
clean.SetCompactPointFields(true);
TestUniformGrid(clean);
std::cout << "*** Test wqith compact point fields off" << std::endl;
clean.SetCompactPointFields(false);
TestUniformGrid(clean);
}
} // anonymous namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment