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

Method GetCriticalTimeArray

Filters/Temporal/vtkCriticalTime.cxx:489–521  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

487
488//------------------------------------------------------------------------------
489vtkDoubleArray* vtkCriticalTime::vtkCriticalTimeInternals::GetCriticalTimeArray(
490 vtkFieldData* fieldData, vtkDataArray* inArray, const std::string& nameSuffix)
491{
492 if (!inArray)
493 {
494 return nullptr;
495 }
496
497 std::string outArrayName = vtkCriticalTimeMangleName(inArray->GetName(), nameSuffix);
498 vtkDoubleArray* outArray =
499 vtkDoubleArray::SafeDownCast(fieldData->GetArray(outArrayName.c_str()));
500 if (!outArray)
501 {
502 return nullptr;
503 }
504
505 if (inArray->GetNumberOfTuples() != outArray->GetNumberOfTuples())
506 {
507 if (!this->GeneratedChangingTopologyWarning)
508 {
509 std::string fieldType = vtkCellData::SafeDownCast(fieldData) == nullptr ? "points" : "cells";
510 vtkWarningWithObjectMacro(this->Self,
511 "The number of " << fieldType << " has changed between time "
512 << "steps. No arrays of this type will be output since this "
513 << "filter can not handle topology that change over time.");
514 this->GeneratedChangingTopologyWarning = true;
515 }
516 fieldData->RemoveArray(outArray->GetName());
517 return nullptr;
518 }
519
520 return outArray;
521}
522
523//------------------------------------------------------------------------------
524vtkCriticalTime::vtkCriticalTime()

Callers 1

Calls 6

GetNameMethod · 0.45
GetArrayMethod · 0.45
c_strMethod · 0.45
GetNumberOfTuplesMethod · 0.45
RemoveArrayMethod · 0.45

Tested by

no test coverage detected