------------------------------------------------------------------------------
| 463 | |
| 464 | //------------------------------------------------------------------------------ |
| 465 | void vtkXMLPTableReader::SetupUpdateExtent(int piece, int numberOfPieces) |
| 466 | { |
| 467 | this->UpdatePieceId = piece; |
| 468 | this->UpdateNumberOfPieces = numberOfPieces; |
| 469 | |
| 470 | // If more pieces are requested than available, just return empty |
| 471 | // pieces for the extra ones |
| 472 | this->UpdateNumberOfPieces = std::min(this->UpdateNumberOfPieces, this->NumberOfPieces); |
| 473 | |
| 474 | // Find the range of pieces to read. |
| 475 | if (this->UpdatePieceId < this->UpdateNumberOfPieces) |
| 476 | { |
| 477 | this->StartPiece = (this->UpdatePieceId * this->NumberOfPieces) / this->UpdateNumberOfPieces; |
| 478 | this->EndPiece = |
| 479 | ((this->UpdatePieceId + 1) * this->NumberOfPieces) / this->UpdateNumberOfPieces; |
| 480 | } |
| 481 | else |
| 482 | { |
| 483 | this->StartPiece = 0; |
| 484 | this->EndPiece = 0; |
| 485 | } |
| 486 | |
| 487 | // Update the information of the pieces we need. |
| 488 | for (int i = this->StartPiece; i < this->EndPiece; ++i) |
| 489 | { |
| 490 | if (this->CanReadPiece(i)) |
| 491 | { |
| 492 | this->PieceReaders[i]->UpdateInformation(); |
| 493 | vtkXMLTableReader* pReader = this->PieceReaders[i]; |
| 494 | pReader->SetupUpdateExtent(0, 1); |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | // Find the total size of the output. |
| 499 | this->SetupOutputTotals(); |
| 500 | } |
| 501 | |
| 502 | //------------------------------------------------------------------------------ |
| 503 | vtkIdType vtkXMLPTableReader::GetNumberOfRowsInPiece(int piece) |
no test coverage detected