------------------------------------------------------------------------------
| 738 | |
| 739 | //------------------------------------------------------------------------------ |
| 740 | int vtkExtractDataArraysOverTime::RequestData( |
| 741 | vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 742 | { |
| 743 | if (this->NumberOfTimeSteps <= 0) |
| 744 | { |
| 745 | vtkErrorMacro("No time steps in input data!"); |
| 746 | return 0; |
| 747 | } |
| 748 | |
| 749 | if (this->FieldAssociation == vtkDataObject::FIELD || |
| 750 | this->FieldAssociation == vtkDataObject::POINT_THEN_CELL || this->FieldAssociation < 0 || |
| 751 | this->FieldAssociation >= vtkDataObject::NUMBER_OF_ATTRIBUTE_TYPES) |
| 752 | { |
| 753 | vtkErrorMacro("Unsupported FieldAssociation '" << this->FieldAssociation << "'."); |
| 754 | return 0; |
| 755 | } |
| 756 | |
| 757 | // is this the first request? |
| 758 | if (this->Internal == nullptr) |
| 759 | { |
| 760 | this->Internal = new vtkInternal(this->NumberOfTimeSteps, this); |
| 761 | this->Error = vtkExtractDataArraysOverTime::NoError; |
| 762 | this->CurrentTimeIndex = 0; |
| 763 | |
| 764 | // Tell the pipeline to start looping. |
| 765 | request->Set(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING(), 1); |
| 766 | } |
| 767 | |
| 768 | assert(this->Internal); |
| 769 | |
| 770 | vtkDataObject* input = vtkDataObject::GetData(inputVector[0], 0); |
| 771 | const double time_step = input->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP()); |
| 772 | this->Internal->AddTimeStep(this->CurrentTimeIndex, time_step, input); |
| 773 | this->UpdateProgress(static_cast<double>(this->CurrentTimeIndex) / this->NumberOfTimeSteps); |
| 774 | |
| 775 | // increment the time index |
| 776 | this->CurrentTimeIndex++; |
| 777 | if (this->CheckAbort() || this->CurrentTimeIndex == this->NumberOfTimeSteps) |
| 778 | { |
| 779 | this->PostExecute(request, inputVector, outputVector); |
| 780 | delete this->Internal; |
| 781 | this->Internal = nullptr; |
| 782 | } |
| 783 | |
| 784 | return 1; |
| 785 | } |
| 786 | |
| 787 | //------------------------------------------------------------------------------ |
| 788 | void vtkExtractDataArraysOverTime::PostExecute( |
nothing calls this directly
no test coverage detected