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

Method CreateOutput

IO/Legacy/vtkGraphReader.cxx:379–417  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

377
378//------------------------------------------------------------------------------
379vtkDataObject* vtkGraphReader::CreateOutput(vtkDataObject* currentOutput)
380{
381 GraphType graphType;
382 if (!this->ReadGraphType(this->GetFileName(), graphType))
383 {
384 this->CloseVTKFile();
385 return nullptr;
386 }
387 this->CloseVTKFile();
388
389 switch (graphType)
390 {
391 case vtkGraphReader::DirectedGraph:
392 if (currentOutput && currentOutput->IsA("vtkDirectedGraph"))
393 {
394 return currentOutput;
395 }
396 return vtkDirectedGraph::New();
397
398 case vtkGraphReader::UndirectedGraph:
399 if (currentOutput && currentOutput->IsA("vtkUndirectedGraph"))
400 {
401 return currentOutput;
402 }
403 return vtkUndirectedGraph::New();
404
405 case vtkGraphReader::Molecule:
406 if (currentOutput && currentOutput->IsA("vtkMolecule"))
407 {
408 return currentOutput;
409 }
410 return vtkMolecule::New();
411
412 case vtkGraphReader::UnknownGraph:
413 default:
414 vtkErrorMacro("ReadGraphType returned invalid result.");
415 return nullptr;
416 }
417}
418
419//------------------------------------------------------------------------------
420void vtkGraphReader::PrintSelf(ostream& os, vtkIndent indent)

Callers 3

WriteMaterialFunction · 0.45
ProcessRequestMethod · 0.45
RequestOneTimeStepMethod · 0.45

Calls 5

ReadGraphTypeMethod · 0.95
IsAMethod · 0.80
NewFunction · 0.50
GetFileNameMethod · 0.45
CloseVTKFileMethod · 0.45

Tested by

no test coverage detected