| 47 | |
| 48 | template <typename ReaderT, typename DataT> |
| 49 | void 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 | |
| 92 | vtkGenericDataObjectReader::vtkGenericDataObjectReader() = default; |
| 93 | vtkGenericDataObjectReader::~vtkGenericDataObjectReader() = default; |
nothing calls this directly
no test coverage detected