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

Method ReadXMLData

IO/XML/vtkXMLCompositeDataReader.cxx:335–383  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

333
334//------------------------------------------------------------------------------
335void vtkXMLCompositeDataReader::ReadXMLData()
336{
337 vtkLogF(TRACE, "vtkXMLCompositeDataReader::ReadXMLData");
338 vtkInformation* info = this->GetCurrentOutputInformation();
339
340 this->Internal->UpdatePiece = info->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
341 this->Internal->UpdateNumberOfPieces =
342 info->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
343 this->Internal->NumDataSets = this->CountNestedElements(this->GetPrimaryElement(), "DataSet");
344
345 vtkDataObject* doOutput = info->Get(vtkDataObject::DATA_OBJECT());
346 vtkCompositeDataSet* composite = vtkCompositeDataSet::SafeDownCast(doOutput);
347 if (!composite)
348 {
349 return;
350 }
351
352 this->ReadFieldData();
353
354 // Find the path to this file in case the internal files are
355 // specified as relative paths.
356 std::string filePath = this->GetFilePath();
357
358 vtkInformation* outInfo = this->GetCurrentOutputInformation();
359 if (outInfo->Has(vtkCompositeDataPipeline::UPDATE_COMPOSITE_INDICES()))
360 {
361 this->Internal->HasUpdateRestriction = true;
362 this->Internal->UpdateIndices = std::set<int>();
363 int length = outInfo->Length(vtkCompositeDataPipeline::UPDATE_COMPOSITE_INDICES());
364 if (length > 0)
365 {
366 int* idx = outInfo->Get(vtkCompositeDataPipeline::UPDATE_COMPOSITE_INDICES());
367 this->Internal->UpdateIndices = std::set<int>(idx, idx + length);
368
369 // Change the total number of datasets so that we'll properly load
370 // balance across the valid datasets.
371 this->Internal->NumDataSets = length;
372 }
373 }
374 else
375 {
376 this->Internal->HasUpdateRestriction = false;
377 }
378
379 // All processes create the entire tree structure however, but each one only
380 // reads the datasets assigned to it.
381 unsigned int dataSetIndex = 0;
382 this->ReadComposite(this->GetPrimaryElement(), composite, filePath.c_str(), dataSetIndex);
383}
384
385//------------------------------------------------------------------------------
386int vtkXMLCompositeDataReader::ShouldReadDataSet(

Callers

nothing calls this directly

Calls 10

CountNestedElementsMethod · 0.95
GetPrimaryElementMethod · 0.95
GetFilePathMethod · 0.95
GetMethod · 0.45
ReadFieldDataMethod · 0.45
HasMethod · 0.45
LengthMethod · 0.45
ReadCompositeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected