Write out data in MOVIE.BYU format.
| 47 | |
| 48 | // Write out data in MOVIE.BYU format. |
| 49 | void vtkBYUWriter::WriteData() |
| 50 | { |
| 51 | FILE* geomFp; |
| 52 | vtkPolyData* input = this->GetInput(); |
| 53 | |
| 54 | int numPts = input->GetNumberOfPoints(); |
| 55 | |
| 56 | if (numPts < 1) |
| 57 | { |
| 58 | vtkErrorMacro(<< "No data to write!"); |
| 59 | return; |
| 60 | } |
| 61 | |
| 62 | if (!this->GeometryFileName) |
| 63 | { |
| 64 | vtkErrorMacro(<< "Geometry file name was not specified"); |
| 65 | this->SetErrorCode(vtkErrorCode::NoFileNameError); |
| 66 | return; |
| 67 | } |
| 68 | |
| 69 | if ((geomFp = vtksys::SystemTools::Fopen(this->GeometryFileName, "w")) == nullptr) |
| 70 | { |
| 71 | vtkErrorMacro(<< "Couldn't open geometry file: " << this->GeometryFileName); |
| 72 | this->SetErrorCode(vtkErrorCode::CannotOpenFileError); |
| 73 | return; |
| 74 | } |
| 75 | else |
| 76 | { |
| 77 | this->WriteGeometryFile(geomFp, numPts); |
| 78 | if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError) |
| 79 | { |
| 80 | fclose(geomFp); |
| 81 | vtkErrorMacro("Ran out of disk space; deleting file: " << this->GeometryFileName); |
| 82 | unlink(this->GeometryFileName); |
| 83 | return; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | this->WriteDisplacementFile(numPts); |
| 88 | if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError) |
| 89 | { |
| 90 | fclose(geomFp); |
| 91 | unlink(this->GeometryFileName); |
| 92 | unlink(this->DisplacementFileName); |
| 93 | vtkErrorMacro("Ran out of disk space; deleting files: " << this->GeometryFileName << " " |
| 94 | << this->DisplacementFileName); |
| 95 | return; |
| 96 | } |
| 97 | this->WriteScalarFile(numPts); |
| 98 | if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError) |
| 99 | { |
| 100 | std::string errorMessage; |
| 101 | fclose(geomFp); |
| 102 | unlink(this->GeometryFileName); |
| 103 | errorMessage = "Ran out of disk space; deleting files: "; |
| 104 | errorMessage += this->GeometryFileName; |
| 105 | errorMessage += " "; |
| 106 | if (this->DisplacementFileName) |
nothing calls this directly
no test coverage detected