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

Method RequestData

IO/Core/vtkArrayDataReader.cxx:51–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51int vtkArrayDataReader::RequestData(
52 vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
53{
54 try
55 {
56 vtkArrayData* array_data = nullptr;
57 if (this->ReadFromInputString)
58 {
59 array_data = vtkArrayDataReader::Read(this->InputString);
60 }
61 else
62 {
63 if (!this->FileName)
64 throw std::runtime_error("FileName not set.");
65
66 vtksys::ifstream file(this->FileName, std::ios::binary);
67
68 array_data = vtkArrayDataReader::Read(file);
69 }
70 if (!array_data)
71 throw std::runtime_error("Error reading vtkArrayData.");
72
73 vtkArrayData* const output_array_data = vtkArrayData::GetData(outputVector);
74 output_array_data->ShallowCopy(array_data);
75 array_data->Delete();
76
77 return 1;
78 }
79 catch (std::exception& e)
80 {
81 vtkErrorMacro(<< e.what());
82 }
83
84 return 0;
85}
86
87vtkArrayData* vtkArrayDataReader::Read(const vtkStdString& str)
88{

Callers

nothing calls this directly

Calls 5

ReadFunction · 0.70
DeleteMethod · 0.65
GetDataFunction · 0.50
ShallowCopyMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected