Commit feb9251d authored by Andrew Bauer's avatar Andrew Bauer

Reducing output amount from vtkTemporalStatistics filter.

For inputs with a lot of time steps and/or arrays, the warning
from the vtkTemporalStatistics filter can be generated a lot of times.
This change will only do it once per filter invocation.
parent a1a94d0c
Pipeline #26260 passed with stage
......@@ -152,6 +152,7 @@ vtkTemporalStatistics::vtkTemporalStatistics()
this->ComputeStandardDeviation = 1;
this->CurrentTimeIndex = 0;
this->GeneratedChangingTopologyWarning = false;
}
vtkTemporalStatistics::~vtkTemporalStatistics()
......@@ -730,9 +731,15 @@ vtkDataArray *vtkTemporalStatistics::GetArray(vtkFieldData *fieldData,
if ( (inArray->GetNumberOfComponents() != outArray->GetNumberOfComponents())
|| (inArray->GetNumberOfTuples() != outArray->GetNumberOfTuples()) )
{
vtkWarningMacro(<< "Size of array " << outArray->GetName()
<< " has changed. Does the source change the topology "
<< " over time?");
if(!this->GeneratedChangingTopologyWarning)
{
std::string fieldType = vtkCellData::SafeDownCast(fieldData) == NULL ?
"points" : "cells";
vtkWarningMacro("The number of " << fieldType << " has changed between time "
<< "steps. No arrays of this type will be output since this "
<< "filter can not handle grids that change over time.");
this->GeneratedChangingTopologyWarning = true;
}
fieldData->RemoveArray(outArray->GetName());
return NULL;
}
......
......@@ -152,6 +152,12 @@ protected:
private:
vtkTemporalStatistics(const vtkTemporalStatistics &) VTK_DELETE_FUNCTION;
void operator=(const vtkTemporalStatistics &) VTK_DELETE_FUNCTION;
// Description:
// Used to avoid multiple warnings for the same filter when
// the number of points or cells in the data set is changing
// between time steps.
bool GeneratedChangingTopologyWarning;
};
#endif //_vtkTemporalStatistics_h
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