VTK  9.2.20221001
vtkGenericDataObjectReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGenericDataObjectReader.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 =========================================================================*/
57 #ifndef vtkGenericDataObjectReader_h
58 #define vtkGenericDataObjectReader_h
59 
60 #include "vtkDataReader.h"
61 #include "vtkIOLegacyModule.h" // For export macro
62 
63 VTK_ABI_NAMESPACE_BEGIN
64 class vtkDataObject;
65 class vtkGraph;
66 class vtkMolecule;
67 class vtkPolyData;
68 class vtkRectilinearGrid;
69 class vtkStructuredGrid;
71 class vtkTable;
72 class vtkTree;
74 
75 class VTKIOLEGACY_EXPORT vtkGenericDataObjectReader : public vtkDataReader
76 {
77 public:
80  void PrintSelf(ostream& os, vtkIndent indent) override;
81 
83 
89 
91 
108 
113  virtual int ReadOutputType();
114 
118  int ReadMetaDataSimple(VTK_FILEPATH const std::string& fname, vtkInformation* metadata) override;
119 
123  int ReadMeshSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) override;
124 
125 protected:
128 
129  vtkDataObject* CreateOutput(vtkDataObject* currentOutput) override;
130 
132 
133 private:
135  void operator=(const vtkGenericDataObjectReader&) = delete;
136 
137  template <typename ReaderT, typename DataT>
138  void ReadData(const char* fname, const char* dataClass, vtkDataObject* output);
139 
140  vtkSetStringMacro(Header);
141 };
142 
143 VTK_ABI_NAMESPACE_END
144 #endif
general representation of visualization data
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:56
class to read any type of vtk data object
vtkMolecule * GetMoleculeOutput()
Get the output as various concrete types.
virtual int ReadOutputType()
This method can be used to find out the type of output expected without needing to read the whole fil...
vtkRectilinearGrid * GetRectilinearGridOutput()
Get the output as various concrete types.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ReadMeshSimple(VTK_FILEPATH const std::string &fname, vtkDataObject *output) override
Actual reading happens here.
int ReadMetaDataSimple(VTK_FILEPATH const std::string &fname, vtkInformation *metadata) override
Read metadata from file.
vtkTree * GetTreeOutput()
Get the output as various concrete types.
vtkStructuredGrid * GetStructuredGridOutput()
Get the output as various concrete types.
vtkDataObject * GetOutput()
Get the output of this filter.
vtkPolyData * GetPolyDataOutput()
Get the output as various concrete types.
vtkDataObject * CreateOutput(vtkDataObject *currentOutput) override
This can be overridden by a subclass to create an output that is determined by the file being read.
vtkStructuredPoints * GetStructuredPointsOutput()
Get the output as various concrete types.
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
~vtkGenericDataObjectReader() override
vtkUnstructuredGrid * GetUnstructuredGridOutput()
Get the output as various concrete types.
static vtkGenericDataObjectReader * New()
vtkTable * GetTableOutput()
Get the output as various concrete types.
vtkGraph * GetGraphOutput()
Get the output as various concrete types.
vtkDataObject * GetOutput(int idx)
Get the output of this filter.
Base class for graph data types.
Definition: vtkGraph.h:346
a simple class to control print indentation
Definition: vtkIndent.h:120
Store vtkAlgorithm input/output information.
class describing a molecule
Definition: vtkMolecule.h:115
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:201
a dataset that is topologically regular with variable spacing in the three coordinate directions
topologically regular array of data
A subclass of ImageData.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:184
A rooted tree data structure.
Definition: vtkTree.h:171
dataset represents arbitrary combinations of all possible cell types
@ string
Definition: vtkX3D.h:502
#define VTK_FILEPATH