VTK  9.3.20240419
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 
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 
69 
70 private:
71  vtkGraphReader(const vtkGraphReader&) = delete;
72  void operator=(const vtkGraphReader&) = delete;
73 };
74 
75 VTK_ABI_NAMESPACE_END
76 #endif
general representation of visualization data
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:44
read vtkGraph data file
~vtkGraphReader() override
vtkGraph * GetOutput(int idx)
Get the output of this reader.
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
vtkDataObject * CreateOutput(vtkDataObject *currentOutput) override
This can be overridden by a subclass to create an output that is determined by the file being read.
vtkGraph * GetOutput()
Get the output of this reader.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int ReadGraphType(const char *fname, GraphType &type)
int ReadMeshSimple(VTK_FILEPATH const std::string &fname, vtkDataObject *output) override
Actual reading happens here.
static vtkGraphReader * New()
Base class for graph data types.
Definition: vtkGraph.h:340
a simple class to control print indentation
Definition: vtkIndent.h:108
Store vtkAlgorithm input/output information.
@ type
Definition: vtkX3D.h:516
@ string
Definition: vtkX3D.h:490
#define VTK_FILEPATH