| 34 | } |
| 35 | |
| 36 | int vtkDataObjectReader::ReadMeshSimple(const std::string& fname, vtkDataObject* output) |
| 37 | { |
| 38 | char line[256]; |
| 39 | vtkFieldData* field = nullptr; |
| 40 | |
| 41 | vtkDebugMacro(<< "Reading vtk field data..."); |
| 42 | |
| 43 | if (!(this->OpenVTKFile(fname.c_str())) || !this->ReadHeader()) |
| 44 | { |
| 45 | return 1; |
| 46 | } |
| 47 | |
| 48 | // Read field data until end-of-file |
| 49 | // |
| 50 | while (this->ReadString(line) && !field) |
| 51 | { |
| 52 | if (!strncmp(this->LowerCase(line), "field", (unsigned long)5)) |
| 53 | { |
| 54 | field = this->ReadFieldData(); // reads named field (or first found) |
| 55 | if (field != nullptr) |
| 56 | { |
| 57 | output->SetFieldData(field); |
| 58 | field->Delete(); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | else if (!strncmp(this->LowerCase(line), "dataset", 7)) |
| 63 | { |
| 64 | vtkErrorMacro(<< "Field reader cannot read datasets"); |
| 65 | this->CloseVTKFile(); |
| 66 | return 1; |
| 67 | } |
| 68 | |
| 69 | else |
| 70 | { |
| 71 | vtkErrorMacro(<< "Unrecognized keyword: " << line); |
| 72 | this->CloseVTKFile(); |
| 73 | return 1; |
| 74 | } |
| 75 | } |
| 76 | // while field not read |
| 77 | |
| 78 | this->CloseVTKFile(); |
| 79 | |
| 80 | return 1; |
| 81 | } |
| 82 | |
| 83 | int vtkDataObjectReader::FillOutputPortInformation(int, vtkInformation* info) |
| 84 | { |
nothing calls this directly
no test coverage detected