VTK  9.7.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 vtkCellGrid;
34 class vtkDataObject;
35 class vtkGraph;
36 class vtkMolecule;
37 class vtkPolyData;
38 class vtkRectilinearGrid;
40 class vtkStructuredGrid;
42 class vtkTable;
43 class vtkTree;
45 
46 class VTKIOLEGACY_EXPORT vtkGenericDataObjectReader : public vtkDataReader
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
57  vtkDataObject* GetOutput();
58  vtkDataObject* GetOutput(int idx);
60 
62 
69  vtkCellGrid* GetCellGridOutput();
70  vtkGraph* GetGraphOutput();
71  vtkMolecule* GetMoleculeOutput();
72  vtkPolyData* GetPolyDataOutput();
73  vtkRectilinearGrid* GetRectilinearGridOutput();
74  vtkStructuredGrid* GetStructuredGridOutput();
75  vtkStructuredPoints* GetStructuredPointsOutput();
76  vtkTable* GetTableOutput();
77  vtkTree* GetTreeOutput();
78  vtkStatisticalModel* GetStatisticalModelOutput();
79  vtkUnstructuredGrid* GetUnstructuredGridOutput();
81 
86  virtual int ReadOutputType();
87 
91  int ReadMetaDataSimple(VTK_FILEPATH const std::string& fname, vtkInformation* metadata) override;
92 
96  int ReadMeshSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) override;
97 
98 protected:
100  ~vtkGenericDataObjectReader() override;
101 
102  vtkDataObject* CreateOutput(vtkDataObject* currentOutput) override;
103 
104  int FillOutputPortInformation(int, vtkInformation*) override;
105 
106 private:
108  void operator=(const vtkGenericDataObjectReader&) = delete;
109 
110  template <typename ReaderT, typename DataT>
111  void ReadData(const char* fname, const char* dataClass, vtkDataObject* output);
112 
113  vtkSetStringMacro(Header);
114 };
115 
116 VTK_ABI_NAMESPACE_END
117 #endif
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.
a base class for statistical modeling of other data
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:71
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:282
static vtkDataReader * New()
Visualization data composed of cells of arbitrary type.
Definition: vtkCellGrid.h:48
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:52
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
dataset represents arbitrary combinations of all possible cell types
class to read any type of vtk data object
virtual int ReadMetaDataSimple(const std::string &, vtkInformation *)
A subclass can override this method to provide meta data specific to a particular file...
#define VTK_FILEPATH
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
A subclass of ImageData.
topologically regular array of data
A rooted tree data structure.
Definition: vtkTree.h:46
general representation of visualization data
Definition: vtkDataObject.h:55