Skip to content
Snippets Groups Projects
Commit 5aae44d8 authored by Sujin Philip's avatar Sujin Philip
Browse files

ComputeScalars only affects the scalar field

vtkmContour was treating `ComputeScalars` as a flag to turn on/off the
interpolation and generation of all of the fields in the output.
As per its superclass `vtkContourFilter`, it should only affect the generation
of the scalar field.
parent 925a2929
No related branches found
No related tags found
No related merge requests found
......@@ -211,20 +211,12 @@ int vtkmContour::RequestData(
}
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in;
if (this->ComputeScalars)
{
in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
}
else
vtkm::cont::DataSet in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
if (!this->ComputeScalars)
{
in = tovtkm::Convert(input, tovtkm::FieldsFlag::None);
// explicitly convert just the field we need
auto inField = tovtkm::Convert(inputArray, association);
in.AddField(inField);
// don't pass this field
// don't pass the scalar field
filter.SetFieldsToPass(
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::Mode::None));
vtkm::filter::FieldSelection(scalarFieldName, vtkm::filter::FieldSelection::Mode::Exclude));
}
vtkm::cont::DataSet result = filter.Execute(in);
......
# Fix `ComputeScalars` in vtkmContour filter
The `ComputScalars` parameter was toggling the interpolation and generation of
all of the fields in the output. Whereas, in `vtkContourFilter` it is only used
to enable the generation of the scalar field. This has now been fixed and setting
the option in `vtkmContour` has the same effect as `vtkContourFilter`.
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