Commit c2311c03 authored by Andrew Bauer's avatar Andrew Bauer Committed by Kitware Robot

Merge topic 'TemporalStatisticsFilter_warnings'

feb9251d Reducing output amount from vtkTemporalStatistics filter.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: David Thompson's avatarDavid Thompson <david.thompson@kitware.com>
Merge-request: !1944
parents f3c67add feb9251d
Pipeline #26399 canceled with stage
in 0 seconds
......@@ -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