VTK  9.3.1
vtkGraphReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
22 #ifndef vtkGraphReader_h
23 #define vtkGraphReader_h
24 
25 #include "vtkDataReader.h"
26 #include "vtkIOLegacyModule.h" // For export macro
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkGraph;
30 
31 class VTKIOLEGACY_EXPORT vtkGraphReader : public vtkDataReader
32 {
33 public:
34  static vtkGraphReader* New();
35  vtkTypeMacro(vtkGraphReader, vtkDataReader);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
42  vtkGraph* GetOutput();
43  vtkGraph* GetOutput(int idx);
45 
49  int ReadMeshSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) override;
50 
51 protected:
53  ~vtkGraphReader() override;
54 
55  enum GraphType
56  {
60  Molecule
61  };
62 
63  vtkDataObject* CreateOutput(vtkDataObject* currentOutput) override;
64 
65  // Read beginning of file to determine whether the graph is directed.
66  virtual int ReadGraphType(const char* fname, GraphType& type);
67 
68  int FillOutputPortInformation(int, vtkInformation*) override;
69 
70 private:
71  vtkGraphReader(const vtkGraphReader&) = delete;
72  void operator=(const vtkGraphReader&) = delete;
73 };
74 
75 VTK_ABI_NAMESPACE_END
76 #endif
int ReadMeshSimple(VTK_FILEPATH const std::string &, vtkDataObject *) override
Overridden with default implementation of doing nothing so that subclasses only override what is need...
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...
Base class for graph data types.
Definition: vtkGraph.h:280
static vtkDataReader * New()
read vtkGraph data file
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:43
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:28
#define VTK_FILEPATH
general representation of visualization data
Definition: vtkDataObject.h:54