------------------------------------------------------------------------------
| 131 | |
| 132 | //------------------------------------------------------------------------------ |
| 133 | vtkTypeBool vtkDemandDrivenPipeline::ProcessRequest( |
| 134 | vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec) |
| 135 | { |
| 136 | // The algorithm should not invoke anything on the executive. |
| 137 | if (!this->CheckAlgorithm("ProcessRequest", request)) |
| 138 | { |
| 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | if (this->Algorithm && request->Has(REQUEST_DATA_OBJECT())) |
| 143 | { |
| 144 | // if we are up to date then short circuit |
| 145 | if (this->PipelineMTime < this->DataObjectTime.GetMTime()) |
| 146 | { |
| 147 | return 1; |
| 148 | } |
| 149 | // Update inputs first if they are out of date |
| 150 | if (!this->ForwardUpstream(request)) |
| 151 | { |
| 152 | return 0; |
| 153 | } |
| 154 | |
| 155 | // Make sure our output data type is up-to-date. |
| 156 | int result = 1; |
| 157 | if (this->PipelineMTime > this->DataObjectTime.GetMTime()) |
| 158 | { |
| 159 | // Request data type from the algorithm. |
| 160 | vtkLogF(TRACE, "%s execute-data-object", vtkLogIdentifier(this->Algorithm)); |
| 161 | result = this->ExecuteDataObject(request, inInfoVec, outInfoVec); |
| 162 | |
| 163 | // Make sure the data object exists for all output ports. |
| 164 | for (int i = 0; result && i < outInfoVec->GetNumberOfInformationObjects(); ++i) |
| 165 | { |
| 166 | vtkInformation* info = outInfoVec->GetInformationObject(i); |
| 167 | if (!info->Get(vtkDataObject::DATA_OBJECT())) |
| 168 | { |
| 169 | result = 0; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | if (result) |
| 174 | { |
| 175 | // Data object is now up to date. |
| 176 | this->DataObjectTime.Modified(); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | return result; |
| 181 | } |
| 182 | |
| 183 | if (this->Algorithm && request->Has(REQUEST_INFORMATION())) |
| 184 | { |
| 185 | // if we are up to date then short circuit |
| 186 | if (this->PipelineMTime < this->InformationTime.GetMTime()) |
| 187 | { |
| 188 | return 1; |
| 189 | } |
| 190 | // Update inputs first. |
no test coverage detected