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 
53  vtkGraph *GetOutput();
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 
82  int FillOutputPortInformation(int, vtkInformation*) override;
83 private:
84  vtkGraphReader(const vtkGraphReader&) = delete;
85  void operator=(const vtkGraphReader&) = delete;
86 };
87 
88 #endif
vtkX3D::type
Definition: vtkX3D.h:516
vtkDataReader
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:51
vtkDataReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGraphReader::UndirectedGraph
Definition: vtkGraphReader.h:72
vtkReaderAlgorithm::CreateOutput
virtual vtkDataObject * CreateOutput(vtkDataObject *currentOutput)
This can be overridden by a subclass to create an output that is determined by the file being read.
Definition: vtkReaderAlgorithm.h:52
vtkDataReader.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkDataReader::New
static vtkDataReader * New()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkX3D::string
Definition: vtkX3D.h:490
vtkGraphReader::GraphType
GraphType
Definition: vtkGraphReader.h:68
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:287
vtkGraphReader
read vtkGraph data file
Definition: vtkGraphReader.h:42
vtkDataReader::ReadMeshSimple
int ReadMeshSimple(const std::string &, vtkDataObject *) override
Overridden with default implementation of doing nothing so that subclasses only override what is need...
Definition: vtkDataReader.h:474
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkGraphReader::DirectedGraph
Definition: vtkGraphReader.h:71
vtkAlgorithm::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
vtkGraphReader::UnknownGraph
Definition: vtkGraphReader.h:70