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

Method ProcessRequest

Filters/Extraction/vtkExtractDataOverTime.cxx:64–140  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

62
63//------------------------------------------------------------------------------
64vtkTypeBool vtkExtractDataOverTime::ProcessRequest(
65 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
66{
67 if (request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION()))
68 {
69 return this->RequestInformation(request, inputVector, outputVector);
70 }
71 else if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
72 {
73 // get the requested update extent
74 double* inTimes =
75 inputVector[0]->GetInformationObject(0)->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
76 if (inTimes)
77 {
78 double timeReq = inTimes[this->CurrentTimeIndex];
79 inputVector[0]->GetInformationObject(0)->Set(
80 vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP(), timeReq);
81 }
82 return 1;
83 }
84
85 // generate the data
86 else if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA()))
87 {
88 if (this->NumberOfTimeSteps == 0)
89 {
90 vtkErrorMacro("No Time steps in input time data!");
91 return 0;
92 }
93
94 // get the output data object
95 vtkInformation* outInfo = outputVector->GetInformationObject(0);
96 vtkPointSet* output = vtkPointSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
97
98 // and input data object
99 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
100 vtkPointSet* input = vtkPointSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
101
102 // is this the first request
103 if (!this->CurrentTimeIndex)
104 {
105 // Tell the pipeline to start looping.
106 request->Set(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING(), 1);
107 this->AllocateOutputData(input, output);
108 }
109
110 // extract the actual data
111 output->GetPoints()->SetPoint(
112 this->CurrentTimeIndex, input->GetPoints()->GetPoint(this->PointIndex));
113 output->GetPointData()->CopyData(
114 input->GetPointData(), this->PointIndex, this->CurrentTimeIndex);
115 if (input->GetPointData()->GetArray("Time"))
116 {
117 output->GetPointData()
118 ->GetArray("TimeData")
119 ->SetTuple1(
120 this->CurrentTimeIndex, input->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP()));
121 }

Callers 4

RequestDataMethod · 0.45
RequestInformationMethod · 0.45
RequestUpdateExtentMethod · 0.45
RequestDataMethod · 0.45

Calls 15

RequestInformationMethod · 0.95
AllocateOutputDataMethod · 0.95
GetInformationObjectMethod · 0.80
SetTuple1Method · 0.80
CheckAbortMethod · 0.80
HasMethod · 0.45
GetMethod · 0.45
SetMethod · 0.45
SetPointMethod · 0.45
GetPointsMethod · 0.45
GetPointMethod · 0.45
CopyDataMethod · 0.45

Tested by

no test coverage detected