VTK
vtkGraphReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGraphReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
34 #ifndef vtkGraphReader_h
35 #define vtkGraphReader_h
36 
37 #include "vtkIOLegacyModule.h" // For export macro
38 #include "vtkDataReader.h"
39 
40 class vtkGraph;
41 
42 class VTKIOLEGACY_EXPORT vtkGraphReader : public vtkDataReader
43 {
44 public:
45  static vtkGraphReader *New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
54  vtkGraph *GetOutput(int idx);
56 
60  int ReadMeshSimple(const std::string& fname,
61  vtkDataObject* output) override;
62 
63 
64 protected:
66  ~vtkGraphReader() override;
67 
68  enum GraphType
69  {
73  Molecule
74  };
75 
76  vtkDataObject* CreateOutput(vtkDataObject* currentOutput) override;
77 
78  // Read beginning of file to determine whether the graph is directed.
79  virtual int ReadGraphType(const char* fname, GraphType &type);
80 
81 
83 private:
84  vtkGraphReader(const vtkGraphReader&) = delete;
85  void operator=(const vtkGraphReader&) = delete;
86 };
87 
88 #endif
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkDataReader
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:52
vtkGraphReader::UndirectedGraph
@ UndirectedGraph
Definition: vtkGraphReader.h:72
vtkGraphReader::ReadMeshSimple
int ReadMeshSimple(const std::string &fname, vtkDataObject *output) override
Actual reading happens here.
vtkGraphReader::New
static vtkGraphReader * New()
vtkGraphReader::FillOutputPortInformation
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
vtkGraphReader::ReadGraphType
virtual int ReadGraphType(const char *fname, GraphType &type)
vtkGraphReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataReader.h
vtkGraphReader::vtkGraphReader
vtkGraphReader()
vtkGraphReader::~vtkGraphReader
~vtkGraphReader() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkGraphReader::CreateOutput
vtkDataObject * CreateOutput(vtkDataObject *currentOutput) override
This can be overridden by a subclass to create an output that is determined by the file being read.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkGraphReader::GraphType
GraphType
Definition: vtkGraphReader.h:69
vtkGraphReader::GetOutput
vtkGraph * GetOutput()
Get the output of this reader.
vtkGraphReader::GetOutput
vtkGraph * GetOutput(int idx)
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:288
vtkGraphReader
read vtkGraph data file
Definition: vtkGraphReader.h:43
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkGraphReader::DirectedGraph
@ DirectedGraph
Definition: vtkGraphReader.h:71
vtkGraphReader::UnknownGraph
@ UnknownGraph
Definition: vtkGraphReader.h:70