VTK  9.7.1
vtkXMLGenericDataObjectReader.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
19 #ifndef vtkXMLGenericDataObjectReader_h
20 #define vtkXMLGenericDataObjectReader_h
21 
22 #include "vtkIOXMLModule.h" // For export macro
23 #include "vtkSmartPointer.h" // for API
24 #include "vtkXMLDataReader.h"
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkImageData;
29 class vtkOverlappingAMR;
30 class vtkPolyData;
31 class vtkRectilinearGrid;
32 class vtkStructuredGrid;
35 
36 class VTKIOXML_EXPORT vtkXMLGenericDataObjectReader : public vtkXMLDataReader
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  vtkDataObject* GetOutput();
48  vtkDataObject* GetOutput(int idx);
50 
52 
59  vtkOverlappingAMR* GetOverlappingAMROutput();
60  vtkImageData* GetImageDataOutput();
61  vtkMultiBlockDataSet* GetMultiBlockDataSetOutput();
62  vtkPolyData* GetPolyDataOutput();
63  vtkRectilinearGrid* GetRectilinearGridOutput();
64  vtkStructuredGrid* GetStructuredGridOutput();
65  vtkUnstructuredGrid* GetUnstructuredGridOutput();
67 
71  vtkIdType GetNumberOfPoints() override;
72 
76  vtkIdType GetNumberOfCells() override;
77 
81  void SetupEmptyOutput() override;
82 
87  virtual int ReadOutputType(const char* name, bool& parallel);
88 
93  static vtkSmartPointer<vtkXMLReader> CreateReader(int data_object_type, bool parallel);
94 
98  int CanReadFileWithDataType(const char* dsname) override;
99 
100 protected:
102  ~vtkXMLGenericDataObjectReader() override;
103 
107  const char* GetDataSetName() override;
108 
111  virtual int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
112  vtkInformationVector* outputVector);
113 
115  int FillOutputPortInformation(int, vtkInformation*) override;
116 
117  vtkXMLReader* Reader; // actual reader
118 
119 private:
121  void operator=(const vtkXMLGenericDataObjectReader&) = delete;
122 
123  int ReadOutputType(std::istream* stream, bool& parallel);
124  int ReadOutputType(vtkXMLFileReadTester* tester, bool& parallel);
125 
131  int GetTypeIdFromClassName(const std::string& dsname);
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
virtual const char * GetDataSetName()=0
Get the name of the data set being read.
virtual void SetupEmptyOutput()=0
Setup the output with no data available.
Store vtkAlgorithm input/output information.
Read any type of vtk data object.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Definition: vtkXMLReader.h:506
Utility class for vtkXMLReader and subclasses.
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
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
dataset represents arbitrary combinations of all possible cell types
virtual vtkIdType GetNumberOfPoints()=0
Get the number of points in the output.
virtual int CanReadFileWithDataType(const char *dsname)
This method is used by CanReadFile() to check if the reader can read an XML with the primary element ...
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
Superclass for VTK XML file readers.
topologically regular array of data
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Composite dataset that organizes datasets into blocks.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
a multi-resolution dataset based on vtkCartesianGrid allowing overlaps
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
general representation of visualization data
Definition: vtkDataObject.h:55
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:44