------------------------------------------------------------------------------
| 237 | |
| 238 | //------------------------------------------------------------------------------ |
| 239 | int vtkHyperTreeGridAlgorithm::RequestData(vtkInformation* vtkNotUsed(request), |
| 240 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 241 | { |
| 242 | // Update progress |
| 243 | this->UpdateProgress(0.); |
| 244 | |
| 245 | // Retrieve input and output |
| 246 | vtkHyperTreeGrid* input = vtkHyperTreeGrid::GetData(inputVector[0], 0); |
| 247 | if (!input) |
| 248 | { |
| 249 | vtkErrorMacro("No input available. Cannot proceed with hyper tree grid algorithm."); |
| 250 | return 0; |
| 251 | } |
| 252 | vtkDataObject* outputDO = vtkDataObject::GetData(outputVector, 0); |
| 253 | if (!outputDO) |
| 254 | { |
| 255 | vtkErrorMacro("No output available. Cannot proceed with hyper tree grid algorithm."); |
| 256 | return 0; |
| 257 | } |
| 258 | |
| 259 | this->OutData = nullptr; |
| 260 | |
| 261 | // Process all trees in input grid and generate input data object |
| 262 | // only if extents are correct |
| 263 | if ((input->GetExtent()[0] <= input->GetExtent()[1] || |
| 264 | input->GetExtent()[2] <= input->GetExtent()[3] || |
| 265 | input->GetExtent()[4] <= input->GetExtent()[5]) && |
| 266 | !this->ProcessTrees(input, outputDO)) |
| 267 | { |
| 268 | return 0; |
| 269 | } |
| 270 | |
| 271 | // Squeeze output data if present |
| 272 | if (this->OutData) |
| 273 | { |
| 274 | this->OutData->Squeeze(); |
| 275 | } |
| 276 | |
| 277 | // Update progress and return |
| 278 | this->UpdateProgress(1.); |
| 279 | return 1; |
| 280 | } |
| 281 | |
| 282 | //------------------------------------------------------------------------------ |
| 283 | void vtkHyperTreeGridAlgorithm::SetInputData(vtkDataObject* input) |
no test coverage detected