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

Method ReadOutputType

IO/Legacy/vtkGenericDataObjectReader.cxx:377–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377int vtkGenericDataObjectReader::ReadOutputType()
378{
379 char line[256];
380
381 vtkDebugMacro(<< "Reading vtk data object...");
382
383 if (!this->OpenVTKFile() || !this->ReadHeader())
384 {
385 return -1;
386 }
387
388 // Determine dataset type
389 //
390 if (!this->ReadString(line))
391 {
392 vtkDebugMacro(<< "Premature EOF reading dataset keyword");
393 return -1;
394 }
395
396 if (!strncmp(this->LowerCase(line), "dataset", static_cast<unsigned long>(7)))
397 {
398 // See iftype is recognized.
399 //
400 if (!this->ReadString(line))
401 {
402 vtkDebugMacro(<< "Premature EOF reading type");
403 this->CloseVTKFile();
404 return -1;
405 }
406
407 this->CloseVTKFile();
408
409 if (!strncmp(this->LowerCase(line), "cell_grid", 9))
410 {
411 return VTK_CELL_GRID;
412 }
413 if (!strncmp(this->LowerCase(line), "molecule", 8))
414 {
415 return VTK_MOLECULE;
416 }
417 if (!strncmp(this->LowerCase(line), "directed_graph", 14))
418 {
419 return VTK_DIRECTED_GRAPH;
420 }
421 if (!strncmp(this->LowerCase(line), "undirected_graph", 16))
422 {
423 return VTK_UNDIRECTED_GRAPH;
424 }
425 if (!strncmp(this->LowerCase(line), "polydata", 8))
426 {
427 return VTK_POLY_DATA;
428 }
429 if (!strncmp(this->LowerCase(line), "rectilinear_grid", 16))
430 {
431 return VTK_RECTILINEAR_GRID;
432 }
433 if (!strncmp(this->LowerCase(line), "statistical_model", 17))
434 {

Callers 3

CreateOutputMethod · 0.95
ReadMetaDataSimpleMethod · 0.95
ReadMeshSimpleMethod · 0.95

Calls 5

ReadStringMethod · 0.80
OpenVTKFileMethod · 0.45
ReadHeaderMethod · 0.45
LowerCaseMethod · 0.45
CloseVTKFileMethod · 0.45

Tested by

no test coverage detected