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

Method ReadXMLData

IO/XML/vtkXMLStructuredDataReader.cxx:211–317  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

209
210//------------------------------------------------------------------------------
211void vtkXMLStructuredDataReader::ReadXMLData()
212{
213 // Get the requested Update Extent.
214 vtkInformation* outInfo = this->GetCurrentOutputInformation();
215 outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), this->UpdateExtent);
216
217 // For debugging
218 /*
219 int numPieces = outInfo->Get(
220 vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
221 int piece = outInfo->Get(
222 vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
223 int numGhosts = outInfo->Get(
224 vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
225
226 if (piece == 0)
227 {
228 std::cout << "Piece:" << piece << " " << numPieces << " " << numGhosts << endl;
229 std::cout << "Extent: "
230 << this->UpdateExtent[0] << " "
231 << this->UpdateExtent[1] << " "
232 << this->UpdateExtent[2] << " "
233 << this->UpdateExtent[3] << " "
234 << this->UpdateExtent[4] << " "
235 << this->UpdateExtent[5] << endl;
236 }
237 */
238
239 vtkDebugMacro("Updating extent " << this->UpdateExtent[0] << " " << this->UpdateExtent[1] << " "
240 << this->UpdateExtent[2] << " " << this->UpdateExtent[3] << " "
241 << this->UpdateExtent[4] << " " << this->UpdateExtent[5]
242 << "\n");
243
244 // Prepare increments for the update extent.
245 this->ComputePointDimensions(this->UpdateExtent, this->PointDimensions);
246 this->ComputePointIncrements(this->UpdateExtent, this->PointIncrements);
247 this->ComputeCellDimensions(this->UpdateExtent, this->CellDimensions);
248 this->ComputeCellIncrements(this->UpdateExtent, this->CellIncrements);
249
250 // Let superclasses read data. This also allocates output data.
251 this->Superclass::ReadXMLData();
252
253 // Split current progress range based on fraction contributed by
254 // each piece.
255 float progressRange[2] = { 0.f, 0.f };
256 this->GetProgressRange(progressRange);
257
258 // Calculate the cumulative fraction of data contributed by each
259 // piece (for progress).
260 float* fractions = new float[this->NumberOfPieces + 1];
261 fractions[0] = 0;
262 for (int i = 0; i < this->NumberOfPieces; ++i)
263 {
264 int* pieceExtent = this->PieceExtents + i * 6;
265 int pieceDims[3] = { 0, 0, 0 };
266 // Intersect the extents to get the part we need to read.
267 if (this->IntersectExtents(pieceExtent, this->UpdateExtent, this->SubExtent))
268 {

Callers

nothing calls this directly

Calls 11

ComputeCellDimensionsMethod · 0.80
ComputeCellIncrementsMethod · 0.80
GetMethod · 0.45
GetProgressRangeMethod · 0.45
IntersectExtentsMethod · 0.45
SetProgressRangeMethod · 0.45
ReadPieceDataMethod · 0.45
SetOutputExtentMethod · 0.45

Tested by

no test coverage detected