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

Method OpenFile

IO/EnSight/vtkEnSight6BinaryReader.cxx:60–96  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

58
59//------------------------------------------------------------------------------
60int vtkEnSight6BinaryReader::OpenFile(const char* filename)
61{
62 if (!filename)
63 {
64 vtkErrorMacro(<< "Missing filename.");
65 return 0;
66 }
67
68 delete this->BinaryIFile;
69 this->BinaryIFile = nullptr;
70
71 // Open the new file
72 vtkDebugMacro(<< "Opening file " << filename);
73 VTK_STAT_STRUCT fs;
74 if (!VTK_STAT_FUNC(filename, &fs))
75 {
76 // Find out how big the file is.
77 this->FileSize = static_cast<vtkTypeUInt64>(fs.st_size);
78
79 std::ios_base::openmode mode = ios::in;
80#ifdef _WIN32
81 mode |= ios::binary;
82#endif
83 this->BinaryIFile = new vtksys::ifstream(filename, mode);
84 }
85 else
86 {
87 vtkErrorMacro("stat failed.");
88 return 0;
89 }
90 if (!this->BinaryIFile || this->BinaryIFile->fail())
91 {
92 vtkErrorMacro(<< "Could not open file " << filename);
93 return 0;
94 }
95 return 1;
96}
97
98//------------------------------------------------------------------------------
99int vtkEnSight6BinaryReader::ReadGeometryFile(

Callers 8

ReadGeometryFileMethod · 0.95
ReadScalarsPerNodeMethod · 0.95
ReadVectorsPerNodeMethod · 0.95
ReadTensorsPerNodeMethod · 0.95
ReadScalarsPerElementMethod · 0.95
ReadVectorsPerElementMethod · 0.95
ReadTensorsPerElementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected