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
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
virtual vtkDataObject * CreateOutput(vtkDataObject *currentOutput)
This can be overridden by a subclass to create an output that is determined by the file being read...
int ReadMeshSimple(const std::string &, vtkDataObject *) override
Overridden with default implementation of doing nothing so that subclasses only override what is need...
Base class for graph data types.
Definition: vtkGraph.h:287
static vtkDataReader * New()
read vtkGraph data file
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:49
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
general representation of visualization data
Definition: vtkDataObject.h:64