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

Method ReadData

IO/Legacy/vtkGenericDataObjectReader.cxx:49–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48template <typename ReaderT, typename DataT>
49void vtkGenericDataObjectReader::ReadData(
50 const char* fname, const char* DataClass, vtkDataObject* Output)
51{
52 ReaderT* const reader = ReaderT::New();
53
54 reader->SetFileName(fname);
55 reader->SetInputArray(this->GetInputArray());
56 reader->SetInputString(this->GetInputString(), this->GetInputStringLength());
57 reader->SetReadFromInputString(this->GetReadFromInputString());
58 reader->SetScalarsName(this->GetScalarsName());
59 reader->SetVectorsName(this->GetVectorsName());
60 reader->SetNormalsName(this->GetNormalsName());
61 reader->SetTensorsName(this->GetTensorsName());
62 reader->SetTCoordsName(this->GetTCoordsName());
63 reader->SetLookupTableName(this->GetLookupTableName());
64 reader->SetFieldDataName(this->GetFieldDataName());
65 reader->SetReadAllScalars(this->GetReadAllScalars());
66 reader->SetReadAllVectors(this->GetReadAllVectors());
67 reader->SetReadAllNormals(this->GetReadAllNormals());
68 reader->SetReadAllTensors(this->GetReadAllTensors());
69 reader->SetReadAllColorScalars(this->GetReadAllColorScalars());
70 reader->SetReadAllTCoords(this->GetReadAllTCoords());
71 reader->SetReadAllFields(this->GetReadAllFields());
72 reader->Update();
73
74 // copy the header from the reader.
75 this->SetHeader(reader->GetHeader());
76
77 // Can we use the old output?
78 if (!(Output && strcmp(Output->GetClassName(), DataClass) == 0))
79 {
80 // Hack to make sure that the object is not modified
81 // with SetNthOutput. Otherwise, extra executions occur.
82 const vtkTimeStamp mtime = this->MTime;
83 Output = DataT::New();
84 this->GetExecutive()->SetOutputData(0, Output);
85 Output->Delete();
86 this->MTime = mtime;
87 }
88 Output->ShallowCopy(reader->GetOutput());
89 reader->Delete();
90}
91
92vtkGenericDataObjectReader::vtkGenericDataObjectReader() = default;
93vtkGenericDataObjectReader::~vtkGenericDataObjectReader() = default;

Callers

nothing calls this directly

Calls 15

GetInputArrayMethod · 0.80
SetHeaderMethod · 0.80
GetHeaderMethod · 0.80
SetOutputDataMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
SetFileNameMethod · 0.45
SetInputArrayMethod · 0.45
SetInputStringMethod · 0.45
GetInputStringMethod · 0.45
UpdateMethod · 0.45
GetClassNameMethod · 0.45

Tested by

no test coverage detected