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

Method OpenFile

IO/Geometry/vtkParticleReader.cxx:137–161  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

135
136//------------------------------------------------------------------------------
137void vtkParticleReader::OpenFile()
138{
139 if (!this->FileName)
140 {
141 vtkErrorMacro(<< "FileName must be specified.");
142 return;
143 }
144
145 // If the file was open close it.
146 delete this->File;
147 this->File = nullptr;
148
149 // Open the new file.
150 vtkDebugMacro(<< "Initialize: opening file " << this->FileName);
151 std::ios_base::openmode mode = ios::in;
152#ifdef _WIN32
153 mode |= ios::binary;
154#endif
155 this->File = new vtksys::ifstream(this->FileName, mode);
156 if (!this->File || this->File->fail())
157 {
158 vtkErrorMacro(<< "Initialize: Could not open file " << this->FileName);
159 return;
160 }
161}
162
163//------------------------------------------------------------------------------
164int vtkParticleReader::RequestInformation(vtkInformation* vtkNotUsed(request),

Callers 4

RequestInformationMethod · 0.95
RequestDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected