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

Method ReadGeometryFile

IO/EnSight/vtkEnSight6Reader.cxx:79–263  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

77
78//------------------------------------------------------------------------------
79int vtkEnSight6Reader::ReadGeometryFile(
80 const char* fileName, int timeStep, vtkMultiBlockDataSet* output)
81{
82 char line[256];
83 int partId;
84 int lineRead;
85 int pointId;
86 float point[3];
87 int i, j;
88 int pointIdsListed;
89
90 // Initialize
91 //
92 if (!fileName)
93 {
94 vtkErrorMacro("A GeometryFileName must be specified in the case file.");
95 return 0;
96 }
97 std::string sfilename;
98 if (this->FilePath)
99 {
100 sfilename = this->FilePath;
101 if (sfilename.at(sfilename.length() - 1) != '/')
102 {
103 sfilename += "/";
104 }
105 sfilename += fileName;
106 vtkDebugMacro("full path to geometry file: " << sfilename);
107 }
108 else
109 {
110 sfilename = fileName;
111 }
112
113 this->IS = new vtksys::ifstream(sfilename.c_str(), ios::in);
114 if (this->IS->fail())
115 {
116 vtkErrorMacro("Unable to open file: " << sfilename);
117 delete this->IS;
118 this->IS = nullptr;
119 return 0;
120 }
121
122 this->ReadLine(line);
123
124 auto resultSubLine0 =
125 vtk::scan<std::string_view, std::string_view>(std::string_view(line), "{:s} {:s}");
126 if (resultSubLine0)
127 {
128 auto subLine = std::get<1>(resultSubLine0->values());
129 if (subLine == "Binary")
130 {
131 vtkErrorMacro("This is a binary data set. Try vtkEnSight6BinaryReader.");
132 return 0;
133 }
134 }
135
136 if (this->UseFileSets)

Callers 1

RequestDataMethod · 0.45

Calls 15

CleanUpCacheMethod · 0.95
vtkEnSight6ReaderRead4Function · 0.85
vtkEnSight6ReaderRead3Function · 0.85
strdupFunction · 0.85
RemoveLeadingBlanksMethod · 0.80
ReadNextDataLineMethod · 0.80
FillComponentMethod · 0.80
InsertNewPartIdMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50

Tested by

no test coverage detected