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

Method RequestData

IO/Core/vtkArrayReader.cxx:396–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396int vtkArrayReader::RequestData(
397 vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
398{
399 try
400 {
401 vtkArray* array = nullptr;
402 if (this->ReadFromInputString)
403 {
404 array = vtkArrayReader::Read(this->InputString);
405 }
406 else
407 {
408 if (!this->FileName)
409 throw std::runtime_error("FileName not set.");
410
411 vtksys::ifstream file(this->FileName, std::ios::binary);
412
413 array = vtkArrayReader::Read(file);
414 }
415 if (!array)
416 throw std::runtime_error("Error reading array.");
417
418 vtkArrayData* const array_data = vtkArrayData::GetData(outputVector);
419 array_data->ClearArrays();
420 array_data->AddArray(array);
421 array->Delete();
422
423 return 1;
424 }
425 catch (std::exception& e)
426 {
427 vtkErrorMacro(<< e.what());
428 }
429
430 return 0;
431}
432
433vtkArray* vtkArrayReader::Read(const vtkStdString& str)
434{

Callers

nothing calls this directly

Calls 6

ReadFunction · 0.70
DeleteMethod · 0.65
GetDataFunction · 0.50
ClearArraysMethod · 0.45
AddArrayMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected