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

Method SetupUpdateExtent

IO/XML/vtkXMLPTableReader.cxx:465–500  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

463
464//------------------------------------------------------------------------------
465void 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//------------------------------------------------------------------------------
503vtkIdType vtkXMLPTableReader::GetNumberOfRowsInPiece(int piece)

Callers 1

ReadXMLDataMethod · 0.95

Calls 4

CanReadPieceMethod · 0.95
SetupOutputTotalsMethod · 0.95
minFunction · 0.50
UpdateInformationMethod · 0.45

Tested by

no test coverage detected