VTK  9.3.1
vtkXMLUniformGridAMRReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Kitware, Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
23 #ifndef vtkXMLUniformGridAMRReader_h
24 #define vtkXMLUniformGridAMRReader_h
25 
26 #include "vtkIOXMLModule.h" // For export macro
27 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkOverlappingAMR;
32 class vtkUniformGridAMR;
33 
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
51  vtkSetMacro(MaximumLevelsToReadByDefault, unsigned int);
52  vtkGetMacro(MaximumLevelsToReadByDefault, unsigned int);
54 
55 protected:
57  ~vtkXMLUniformGridAMRReader() override;
58 
65  int CanReadFileWithDataType(const char* dsname) override;
66 
73  int ReadVTKFile(vtkXMLDataElement* eVTKFile) override;
74 
81  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
82 
88  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
89  vtkInformationVector* outputVector) override;
90 
95  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
96  vtkInformationVector* outputVector) override;
97 
98  // Get the name of the data set being read.
99  const char* GetDataSetName() override;
100 
101  // Read the XML element for the subtree of a the composite dataset.
102  // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
103  void ReadComposite(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
104  const char* filePath, unsigned int& dataSetIndex) override;
105 
106  // Read the vtkDataSet (a leaf) in the composite dataset.
107  vtkDataSet* ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath) override;
108 
111 
112 private:
114  void operator=(const vtkXMLUniformGridAMRReader&) = delete;
115 
116  void SynchronizeDataArraySelectionRecursively(
117  vtkXMLDataElement* element, const std::string& filePath);
118 
119  char* OutputDataType;
120  vtkSetStringMacro(OutputDataType);
121 };
122 
123 VTK_ABI_NAMESPACE_END
124 #endif
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
Reader for multi-group datasets.
int ReadPrimaryElement(vtkXMLDataElement *ePrimary) override
Read the primary element from the file.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkSmartPointer< vtkOverlappingAMR > Metadata
virtual vtkDataSet * ReadDataset(vtkXMLDataElement *xmlElem, const char *filePath)
Reader for amr datasets (vtkOverlappingAMR or vtkNonOverlappingAMR).
virtual int ReadVTKFile(vtkXMLDataElement *eVTKFile)
Read the top-level element from the file.
abstract superclass for composite (multi-block or AMR) datasets
const char * GetDataSetName() override
Get the name of the data set being read.
a simple class to control print indentation
Definition: vtkIndent.h:28
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 int RequestDataObject(vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *vtkNotUsed(outputVector))
Definition: vtkXMLReader.h:438
hierarchical dataset of vtkUniformGrids
virtual void ReadComposite(vtkXMLDataElement *element, vtkCompositeDataSet *composite, const char *filePath, unsigned int &dataSetIndex)=0
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a concrete implementation of vtkCompositeDataSet