COMP: no vtkDataArray::Fill() method prior to VTK-8 (fixes #1156)

This commit is contained in:
Mark Olesen
2019-01-07 11:58:33 +01:00
parent 0fa923d3d5
commit 0748a11fd6

View File

@ -224,7 +224,15 @@ Foam::vtk::Tools::zeroField
data->SetNumberOfComponents(static_cast<int>(pTraits<Type>::nComponents)); data->SetNumberOfComponents(static_cast<int>(pTraits<Type>::nComponents));
data->SetNumberOfTuples(size); data->SetNumberOfTuples(size);
// Fill() was not available before VTK-8
#if (VTK_MAJOR_VERSION < 8)
for (int i = 0; i < data->GetNumberOfComponents(); ++i)
{
data->FillComponent(i, 0);
}
#else
data->Fill(0); data->Fill(0);
#endif
return data; return data;
} }