------------------------------------------------------------------------------
| 367 | |
| 368 | //------------------------------------------------------------------------------ |
| 369 | int vtkXMLPStructuredDataReader::ComputePieceSubExtents() |
| 370 | { |
| 371 | // Reset the extent splitter. |
| 372 | this->ExtentSplitter->RemoveAllExtentSources(); |
| 373 | |
| 374 | // Add each readable piece as an extent source. |
| 375 | int i; |
| 376 | for (i = 0; i < this->NumberOfPieces; ++i) |
| 377 | { |
| 378 | // if(this->CanReadPiece(i)) |
| 379 | { |
| 380 | // Add the exact extent provided by the piece to the splitter. |
| 381 | // BUG: This was causing all processes to read the meta-data for all |
| 382 | // pieces which is a nightmare!!! Using the this->PieceExtents information |
| 383 | // which we had already collected while reading the pvti file for |
| 384 | // determining the piece extents. |
| 385 | // int extent[6]; |
| 386 | // this->PieceReaders[i]->UpdateInformation(); |
| 387 | // this->PieceReaders[i]->GetOutputAsDataSet()->GetWholeExtent(extent); |
| 388 | int* extent = this->PieceExtents + 6 * i; |
| 389 | this->ExtentSplitter->AddExtentSource(i, 0, extent); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | // We want to split the entire update extent across the pieces. |
| 394 | this->ExtentSplitter->AddExtent(this->UpdateExtent); |
| 395 | |
| 396 | // Compute the sub-extents. |
| 397 | if (!this->ExtentSplitter->ComputeSubExtents()) |
| 398 | { |
| 399 | // A portion of the extent is not available. |
| 400 | std::ostringstream e_with_warning_C4701; |
| 401 | e_with_warning_C4701 << "No available piece provides data for the following extents:\n"; |
| 402 | for (i = 0; i < this->ExtentSplitter->GetNumberOfSubExtents(); ++i) |
| 403 | { |
| 404 | if (this->ExtentSplitter->GetSubExtentSource(i) < 0) |
| 405 | { |
| 406 | int extent[6]; |
| 407 | this->ExtentSplitter->GetSubExtent(i, extent); |
| 408 | e_with_warning_C4701 << " " << extent[0] << " " << extent[1] << " " << extent[2] << " " |
| 409 | << extent[3] << " " << extent[4] << " " << extent[5] << "\n"; |
| 410 | } |
| 411 | } |
| 412 | e_with_warning_C4701 << "The UpdateExtent cannot be filled."; |
| 413 | vtkErrorMacro(<< e_with_warning_C4701.str()); |
| 414 | return 0; |
| 415 | } |
| 416 | |
| 417 | return 1; |
| 418 | } |
| 419 | VTK_ABI_NAMESPACE_END |
no test coverage detected