MCPcopy Create free account
hub / github.com/Kitware/VTK / GetArray

Method GetArray

Filters/General/vtkTemporalStatistics.cxx:724–748  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

722
723//------------------------------------------------------------------------------
724vtkDataArray* 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}
749VTK_ABI_NAMESPACE_END

Calls 6

GetNameMethod · 0.45
c_strMethod · 0.45
GetNumberOfComponentsMethod · 0.45
GetNumberOfTuplesMethod · 0.45
RemoveArrayMethod · 0.45