------------------------------------------------------------------------------
| 722 | |
| 723 | //------------------------------------------------------------------------------ |
| 724 | vtkDataArray* vtkTemporalStatistics::GetArray( |
| 725 | vtkFieldData* fieldData, vtkDataArray* inArray, const char* nameSuffix) |
| 726 | { |
| 727 | std::string outArrayName = vtkTemporalStatisticsMangleName(inArray->GetName(), nameSuffix); |
| 728 | vtkDataArray* outArray = fieldData->GetArray(outArrayName.c_str()); |
| 729 | if (!outArray) |
| 730 | return nullptr; |
| 731 | |
| 732 | if ((inArray->GetNumberOfComponents() != outArray->GetNumberOfComponents()) || |
| 733 | (inArray->GetNumberOfTuples() != outArray->GetNumberOfTuples())) |
| 734 | { |
| 735 | if (!this->GeneratedChangingTopologyWarning) |
| 736 | { |
| 737 | std::string fieldType = vtkCellData::SafeDownCast(fieldData) == nullptr ? "points" : "cells"; |
| 738 | vtkWarningMacro("The number of " << fieldType << " has changed between time " |
| 739 | << "steps. No arrays of this type will be output since this " |
| 740 | << "filter can not handle grids that change over time."); |
| 741 | this->GeneratedChangingTopologyWarning = true; |
| 742 | } |
| 743 | fieldData->RemoveArray(outArray->GetName()); |
| 744 | return nullptr; |
| 745 | } |
| 746 | |
| 747 | return outArray; |
| 748 | } |
| 749 | VTK_ABI_NAMESPACE_END |