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

Method ReadDataObject

IO/XML/vtkXMLCompositeDataReader.cxx:466–495  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

464
465//------------------------------------------------------------------------------
466vtkDataObject* vtkXMLCompositeDataReader::ReadDataObject(
467 vtkXMLDataElement* xmlElem, const char* filePath)
468{
469 // Get the reader for this file
470 std::string fileName = this->GetFileNameFromXML(xmlElem, filePath);
471 if (fileName.empty())
472 { // No filename in XML element. Not necessarily an error.
473 return nullptr;
474 }
475 vtkXMLReader* reader = this->GetReaderForFile(fileName);
476 if (!reader)
477 {
478 vtkErrorMacro("Could not create reader for " << fileName);
479 return nullptr;
480 }
481 reader->SetFileName(fileName.c_str());
482 reader->GetPointDataArraySelection()->CopySelections(this->PointDataArraySelection);
483 reader->GetCellDataArraySelection()->CopySelections(this->CellDataArraySelection);
484 reader->GetColumnArraySelection()->CopySelections(this->ColumnArraySelection);
485 reader->Update();
486 vtkDataObject* output = reader->GetOutputDataObject(0);
487 if (!output)
488 {
489 return nullptr;
490 }
491
492 vtkDataObject* outputCopy = output->NewInstance();
493 outputCopy->ShallowCopy(output);
494 return outputCopy;
495}
496
497//------------------------------------------------------------------------------
498vtkDataSet* vtkXMLCompositeDataReader::ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath)

Callers 3

ReadCompositeMethod · 0.80
ReadCompositeMethod · 0.80
ReadCompositeMethod · 0.80

Calls 12

GetFileNameFromXMLMethod · 0.95
GetReaderForFileMethod · 0.95
CopySelectionsMethod · 0.80
emptyMethod · 0.45
SetFileNameMethod · 0.45
c_strMethod · 0.45
UpdateMethod · 0.45
GetOutputDataObjectMethod · 0.45
NewInstanceMethod · 0.45
ShallowCopyMethod · 0.45

Tested by

no test coverage detected