------------------------------------------------------------------------------
| 42 | |
| 43 | //------------------------------------------------------------------------------ |
| 44 | vtkSmartPointer<vtkResourceStream> vtkOFFReader::Open() |
| 45 | { |
| 46 | if (this->Stream) |
| 47 | { |
| 48 | if (this->Stream->SupportSeek()) |
| 49 | { |
| 50 | this->Stream->Seek(0, vtkResourceStream::SeekDirection::Begin); |
| 51 | } |
| 52 | |
| 53 | return this->Stream; |
| 54 | } |
| 55 | |
| 56 | auto fileStream = vtkSmartPointer<vtkFileResourceStream>::New(); |
| 57 | if (!this->FileName || !fileStream->Open(this->FileName)) |
| 58 | { |
| 59 | vtkErrorMacro(<< "Failed to open file: " |
| 60 | << (this->FileName ? this->FileName : "No file name set")); |
| 61 | return nullptr; |
| 62 | } |
| 63 | |
| 64 | return fileStream; |
| 65 | } |
| 66 | |
| 67 | //------------------------------------------------------------------------------ |
| 68 | int vtkOFFReader::RequestData(vtkInformation* vtkNotUsed(request), |