----------------------------------------------------------------------------
| 140 | |
| 141 | //---------------------------------------------------------------------------- |
| 142 | bool vtkGroupTimeStepsFilter::AddTimeStep( |
| 143 | double vtkNotUsed(time), int timeStep, vtkDataObject* data) |
| 144 | { |
| 145 | auto pdc = vtkPartitionedDataSetCollection::SafeDownCast(this->AccumulatedData); |
| 146 | if (!pdc) |
| 147 | { |
| 148 | vtkErrorMacro("Mismatched output type was created. Did data type change between timesteps?"); |
| 149 | return false; |
| 150 | } |
| 151 | |
| 152 | const auto idx = pdc->GetNumberOfPartitionedDataSets(); |
| 153 | pdc->SetPartition(idx, 0, data); |
| 154 | |
| 155 | const auto name = "timestep" + vtk::to_string(timeStep); |
| 156 | auto assembly = pdc->GetDataAssembly(); |
| 157 | auto node = assembly->AddNode(name.c_str()); |
| 158 | assembly->AddDataSetIndex(node, idx); |
| 159 | pdc->GetMetaData(idx)->Set(vtkCompositeDataSet::NAME(), name.c_str()); |
| 160 | return true; |
| 161 | } |
| 162 | |
| 163 | //---------------------------------------------------------------------------- |
| 164 | bool vtkGroupTimeStepsFilter::AddTimeStep( |
no test coverage detected