----------------------------------------------------------------------------
| 74 | |
| 75 | //---------------------------------------------------------------------------- |
| 76 | int vtkGroupTimeStepsFilter::RequestData( |
| 77 | vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) |
| 78 | { |
| 79 | auto inputDO = vtkDataObject::GetData(inInfo[0], 0); |
| 80 | auto dataInfo = inputDO->GetInformation(); |
| 81 | auto outputDO = vtkDataObject::GetData(outInfo); |
| 82 | |
| 83 | vtkSmartPointer<vtkDataObject> clone = |
| 84 | vtkSmartPointer<vtkDataObject>::Take(inputDO->NewInstance()); |
| 85 | clone->ShallowCopy(inputDO); |
| 86 | |
| 87 | if (this->AccumulatedData == nullptr) |
| 88 | { |
| 89 | assert(this->UpdateTimeIndex == 0); |
| 90 | this->AccumulatedData.TakeReference(outputDO->NewInstance()); |
| 91 | this->AccumulatedData->Initialize(); |
| 92 | if (auto pdc = vtkPartitionedDataSetCollection::SafeDownCast(this->AccumulatedData)) |
| 93 | { |
| 94 | vtkNew<vtkDataAssembly> assembly; |
| 95 | assembly->Initialize(); |
| 96 | assembly->SetRootNodeName("TimeSteps"); |
| 97 | pdc->SetDataAssembly(assembly); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | double time = dataInfo->Has(vtkDataObject::DATA_TIME_STEP()) |
| 102 | ? dataInfo->Get(vtkDataObject::DATA_TIME_STEP()) |
| 103 | : 0.0; |
| 104 | const int timeStep = this->TimeSteps.empty() ? 0 : static_cast<int>(this->UpdateTimeIndex); |
| 105 | |
| 106 | if (auto inputMB = vtkMultiBlockDataSet::SafeDownCast(clone)) |
| 107 | { |
| 108 | this->AddTimeStep(time, timeStep, inputMB); |
| 109 | } |
| 110 | else if (auto inputPDC = vtkPartitionedDataSetCollection::SafeDownCast(clone)) |
| 111 | { |
| 112 | this->AddTimeStep(time, timeStep, inputPDC); |
| 113 | } |
| 114 | else if (auto inputPDS = vtkPartitionedDataSet::SafeDownCast(clone)) |
| 115 | { |
| 116 | this->AddTimeStep(time, timeStep, inputPDS); |
| 117 | } |
| 118 | else if (auto inputCD = vtkCompositeDataSet::SafeDownCast(clone)) |
| 119 | { |
| 120 | this->AddTimeStep(time, timeStep, inputCD); |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | this->AddTimeStep(time, timeStep, clone); |
| 125 | } |
| 126 | |
| 127 | if ((++this->UpdateTimeIndex) < this->TimeSteps.size() && !this->CheckAbort()) |
| 128 | { |
| 129 | request->Set(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING(), 1); |
| 130 | } |
| 131 | else |
| 132 | { |
| 133 | this->UpdateTimeIndex = 0; |
nothing calls this directly
no test coverage detected