----------------------------------------------------------------------------
| 294 | |
| 295 | //---------------------------------------------------------------------------- |
| 296 | int vtkIOSSWriter::RequestData(vtkInformation* request, |
| 297 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* vtkNotUsed(outputVector)) |
| 298 | { |
| 299 | if (!this->FileName || !this->FileName[0]) |
| 300 | { |
| 301 | vtkErrorMacro("Cannot write without a valid filename!"); |
| 302 | return 0; |
| 303 | } |
| 304 | auto& internals = (*this->Internals); |
| 305 | if (!internals.TimeSteps.empty()) |
| 306 | { |
| 307 | const auto& currentTime = internals.TimeSteps[internals.CurrentTimeStepIndex]; |
| 308 | // check if timestep should be processed or skipped |
| 309 | const bool processTimeStep = |
| 310 | std::find(internals.TimeStepsToProcess.begin(), internals.TimeStepsToProcess.end(), |
| 311 | currentTime) != internals.TimeStepsToProcess.end(); |
| 312 | if (!processTimeStep) |
| 313 | { |
| 314 | ++internals.CurrentTimeStepIndex; |
| 315 | if (static_cast<size_t>(internals.CurrentTimeStepIndex) < internals.TimeSteps.size()) |
| 316 | { |
| 317 | request->Set(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING(), 1); |
| 318 | } |
| 319 | else |
| 320 | { |
| 321 | internals.Initialize(); |
| 322 | request->Remove(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING()); |
| 323 | } |
| 324 | return 1; |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | this->WriteData(); |
| 329 | |
| 330 | ++internals.CurrentTimeStepIndex; |
| 331 | if (static_cast<size_t>(internals.CurrentTimeStepIndex) < internals.TimeSteps.size()) |
| 332 | { |
| 333 | request->Set(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING(), 1); |
| 334 | } |
| 335 | else |
| 336 | { |
| 337 | internals.Initialize(); |
| 338 | request->Remove(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING()); |
| 339 | } |
| 340 | return 1; |
| 341 | } |
| 342 | |
| 343 | //---------------------------------------------------------------------------- |
| 344 | void vtkIOSSWriter::WriteData() |
no test coverage detected