VTK  9.3.0
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:
58 
65  int CanReadFileWithDataType(const char* dsname) override;
66 
73  int ReadVTKFile(vtkXMLDataElement* eVTKFile) override;
74 
81  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
82 
89  vtkInformationVector* outputVector) override;
90 
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.
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
abstract superclass for composite (multi-block or AMR) datasets
abstract class to specify dataset behavior
Definition: vtkDataSet.h:53
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
hierarchical dataset of vtkUniformGrids
a concrete implementation of vtkCompositeDataSet
Reader for multi-group datasets.
Represents an XML element and those nested inside.
Reader for amr datasets (vtkOverlappingAMR or vtkNonOverlappingAMR).
static vtkXMLUniformGridAMRReader * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ReadVTKFile(vtkXMLDataElement *eVTKFile) override
Read the top-level element from the file.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Overridden to put vtkOverlappingAMR in the pipeline if available/applicable.
~vtkXMLUniformGridAMRReader() override
vtkDataSet * ReadDataset(vtkXMLDataElement *xmlElem, const char *filePath) override
vtkSmartPointer< vtkOverlappingAMR > Metadata
void ReadComposite(vtkXMLDataElement *element, vtkCompositeDataSet *composite, const char *filePath, unsigned int &dataSetIndex) override
const char * GetDataSetName() override
Get the name of the data set being read.
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Overridden to create an output data object based on the type in the file.
int CanReadFileWithDataType(const char *dsname) override
This method is used by CanReadFile() to check if the reader can read an XML with the primary element ...
int ReadPrimaryElement(vtkXMLDataElement *ePrimary) override
Read the meta-data from the AMR from the file.
@ string
Definition: vtkX3D.h:490