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

Method M_Read

Utilities/MetaIO/vtkmetaio/metaTubeGraph.cxx:261–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259
260
261bool
262MetaTubeGraph::M_Read()
263{
264 META_DEBUG_PRINT( "MetaTubeGraph: M_Read: Loading Header" );
265
266 if (!MetaObject::M_Read())
267 {
268 std::cout << "MetaTubeGraph: M_Read: Error parsing file" << std::endl;
269 return false;
270 }
271
272 META_DEBUG_PRINT( "MetaTubeGraph: M_Read: Parsing Header" );
273
274 MET_FieldRecordType * mF;
275
276 mF = MET_GetFieldRecord("Root", &m_Fields);
277 if (mF->defined)
278 {
279 m_Root = static_cast<int>(mF->value[0]);
280 }
281
282 mF = MET_GetFieldRecord("NPoints", &m_Fields);
283 if (mF->defined)
284 {
285 m_NPoints = static_cast<int>(mF->value[0]);
286 }
287
288 mF = MET_GetFieldRecord("PointDim", &m_Fields);
289 if (mF->defined)
290 {
291 strcpy(m_PointDim, reinterpret_cast<char *>(mF->value));
292 }
293
294
295 int i;
296 int posR = -1;
297 int posP = -1;
298 int posTx = -1;
299 int posGraphNode = -1;
300
301 int pntDim;
302 char ** pntVal = nullptr;
303 MET_StringToWordArray(m_PointDim, &pntDim, &pntVal);
304
305 META_DEBUG_PRINT( "MetaTubeGraph: Parsing point dim" );
306
307 unsigned int j;
308 for (j = 0; j < static_cast<unsigned int>(pntDim); j++)
309 {
310 if (!strcmp(pntVal[j], "node") || !strcmp(pntVal[j], "Node"))
311 {
312 posGraphNode = j;
313 }
314 if (!strcmp(pntVal[j], "s") || !strcmp(pntVal[j], "S") || !strcmp(pntVal[j], "r") || !strcmp(pntVal[j], "R") ||
315 !strcmp(pntVal[j], "rad") || !strcmp(pntVal[j], "Rad") || !strcmp(pntVal[j], "radius") ||
316 !strcmp(pntVal[j], "Radius"))
317 {
318 posR = j;

Callers

nothing calls this directly

Calls 9

MET_GetFieldRecordFunction · 0.85
MET_StringToWordArrayFunction · 0.85
MET_SizeOfTypeFunction · 0.85
MET_ValueToDoubleFunction · 0.85
StartReadingMethod · 0.45
readMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45
eofMethod · 0.45

Tested by

no test coverage detected