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

Method OpenFile

IO/Geometry/vtkProStarReader.cxx:102–122  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

100
101//------------------------------------------------------------------------------
102FILE* vtkProStarReader::OpenFile(const char* ext)
103{
104 std::string fullName = this->FileName;
105 const char* dot = strrchr(this->FileName, '.');
106
107 if (dot != nullptr &&
108 (strcmp(dot, ".cel") == 0 || strcmp(dot, ".vrt") == 0 || strcmp(dot, ".inp") == 0))
109 {
110 fullName.resize(dot - this->FileName);
111 }
112
113 fullName += ext;
114 FILE* in = vtksys::SystemTools::Fopen(fullName, "r");
115 if (in == nullptr)
116 {
117 vtkErrorMacro(<< "Error opening file: " << fullName);
118 this->SetErrorCode(vtkErrorCode::CannotOpenFileError);
119 }
120
121 return in;
122}
123
124//
125// read in the points from the .vrt file

Callers 2

ReadVrtFileMethod · 0.95
ReadCelFileMethod · 0.95

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected