------------------------------------------------------------------------------
| 172 | |
| 173 | //------------------------------------------------------------------------------ |
| 174 | void vtkXMLPUnstructuredDataReader::SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel) |
| 175 | { |
| 176 | this->UpdatePieceId = piece; |
| 177 | this->UpdateNumberOfPieces = numberOfPieces; |
| 178 | this->UpdateGhostLevel = ghostLevel; |
| 179 | |
| 180 | // If more pieces are requested than available, just return empty |
| 181 | // pieces for the extra ones. |
| 182 | this->UpdateNumberOfPieces = std::min(this->UpdateNumberOfPieces, this->NumberOfPieces); |
| 183 | |
| 184 | // Find the range of pieces to read. |
| 185 | if (this->UpdatePieceId < this->UpdateNumberOfPieces) |
| 186 | { |
| 187 | this->StartPiece = ((this->UpdatePieceId * this->NumberOfPieces) / this->UpdateNumberOfPieces); |
| 188 | this->EndPiece = |
| 189 | (((this->UpdatePieceId + 1) * this->NumberOfPieces) / this->UpdateNumberOfPieces); |
| 190 | } |
| 191 | else |
| 192 | { |
| 193 | this->StartPiece = 0; |
| 194 | this->EndPiece = 0; |
| 195 | } |
| 196 | |
| 197 | // Update the information of the pieces we need. |
| 198 | for (int i = this->StartPiece; i < this->EndPiece; ++i) |
| 199 | { |
| 200 | if (this->CanReadPiece(i)) |
| 201 | { |
| 202 | this->PieceReaders[i]->UpdateInformation(); |
| 203 | vtkXMLUnstructuredDataReader* pReader = |
| 204 | static_cast<vtkXMLUnstructuredDataReader*>(this->PieceReaders[i]); |
| 205 | pReader->SetupUpdateExtent(0, 1, this->UpdateGhostLevel); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | // Find the total size of the output. |
| 210 | this->SetupOutputTotals(); |
| 211 | } |
| 212 | |
| 213 | //------------------------------------------------------------------------------ |
| 214 | int vtkXMLPUnstructuredDataReader::ReadPrimaryElement(vtkXMLDataElement* ePri) |
no test coverage detected