Skip to content
Snippets Groups Projects
Commit fe1c7c32 authored by Kenneth Moreland's avatar Kenneth Moreland Committed by Kitware Robot
Browse files

Merge topic 'fix-clean-grid'


5004e64c Fix CleanGrid when compact point fields is off

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !665
parents 96ec8130 5004e64c
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment