VTK  9.3.1
vtkGenericDataObjectReader.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
26 #ifndef vtkGenericDataObjectReader_h
27 #define vtkGenericDataObjectReader_h
28 
29 #include "vtkDataReader.h"
30 #include "vtkIOLegacyModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDataObject;
34 class vtkGraph;
35 class vtkMolecule;
36 class vtkPolyData;
37 class vtkRectilinearGrid;
38 class vtkStructuredGrid;
40 class vtkTable;
41 class vtkTree;
43 
44 class VTKIOLEGACY_EXPORT vtkGenericDataObjectReader : public vtkDataReader
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
55  vtkDataObject* GetOutput();
56  vtkDataObject* GetOutput(int idx);
58 
60 
67  vtkGraph* GetGraphOutput();
68  vtkMolecule* GetMoleculeOutput();
69  vtkPolyData* GetPolyDataOutput();
70  vtkRectilinearGrid* GetRectilinearGridOutput();
71  vtkStructuredGrid* GetStructuredGridOutput();
72  vtkStructuredPoints* GetStructuredPointsOutput();
73  vtkTable* GetTableOutput();
74  vtkTree* GetTreeOutput();
75  vtkUnstructuredGrid* GetUnstructuredGridOutput();
77 
82  virtual int ReadOutputType();
83 
87  int ReadMetaDataSimple(VTK_FILEPATH const std::string& fname, vtkInformation* metadata) override;
88 
92  int ReadMeshSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) override;
93 
94 protected:
96  ~vtkGenericDataObjectReader() override;
97 
98  vtkDataObject* CreateOutput(vtkDataObject* currentOutput) override;
99 
100  int FillOutputPortInformation(int, vtkInformation*) override;
101 
102 private:
104  void operator=(const vtkGenericDataObjectReader&) = delete;
105 
106  template <typename ReaderT, typename DataT>
107  void ReadData(const char* fname, const char* dataClass, vtkDataObject* output);
108 
109  vtkSetStringMacro(Header);
110 };
111 
112 VTK_ABI_NAMESPACE_END
113 #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...
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
class describing a molecule
Definition: vtkMolecule.h:83
virtual vtkDataObject * CreateOutput(vtkDataObject *currentOutput)
This can be overridden by a subclass to create an output that is determined by the file being read...
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Base class for graph data types.
Definition: vtkGraph.h:280
static vtkDataReader * New()
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
virtual int ReadMetaDataSimple(VTK_FILEPATH const std::string &, vtkInformation *)
A subclass can override this method to provide meta data specific to a particular file...
dataset represents arbitrary combinations of all possible cell types
class to read any type of vtk data object
#define VTK_FILEPATH
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
A subclass of ImageData.
topologically regular array of data
A rooted tree data structure.
Definition: vtkTree.h:45
general representation of visualization data
Definition: vtkDataObject.h:54