VTK  9.3.1
vtkXMLStructuredDataReader.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
15 #ifndef vtkXMLStructuredDataReader_h
16 #define vtkXMLStructuredDataReader_h
17 
18 #include "vtkIOXMLModule.h" // For export macro
19 #include "vtkXMLDataReader.h"
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class VTKIOXML_EXPORT vtkXMLStructuredDataReader : public vtkXMLDataReader
23 {
24 public:
26  void PrintSelf(ostream& os, vtkIndent indent) override;
27 
31  vtkIdType GetNumberOfPoints() override;
32 
36  vtkIdType GetNumberOfCells() override;
37 
39 
45  vtkSetMacro(WholeSlices, vtkTypeBool);
46  vtkGetMacro(WholeSlices, vtkTypeBool);
47  vtkBooleanMacro(WholeSlices, vtkTypeBool);
49 
54  void CopyOutputInformation(vtkInformation* outInfo, int port) override;
55 
56 protected:
58  ~vtkXMLStructuredDataReader() override;
59 
60  virtual void SetOutputExtent(int* extent) = 0;
61  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
62 
63  // Pipeline execute data driver. Called by vtkXMLReader.
64  void ReadXMLData() override;
65 
66  void SetupOutputInformation(vtkInformation* outInfo) override;
67 
68  // Internal representation of pieces in the file that may have come
69  // from a streamed write.
75 
76  // Whether to read in whole slices mode.
78 
79  // The update extent and corresponding increments and dimensions.
80  int UpdateExtent[6];
81  int PointDimensions[3];
83  vtkIdType PointIncrements[3];
84  vtkIdType CellIncrements[3];
85 
86  int WholeExtent[6];
87 
88  // The extent currently being read.
89  int SubExtent[6];
90  int SubPointDimensions[3];
91  int SubCellDimensions[3];
92 
93  // Override methods from superclass.
94  void SetupEmptyOutput() override;
95  void SetupPieces(int numPieces) override;
96  void DestroyPieces() override;
97  int ReadArrayForPoints(vtkXMLDataElement* da, vtkAbstractArray* outArray) override;
98  int ReadArrayForCells(vtkXMLDataElement* da, vtkAbstractArray* outArray) override;
99 
100  // Internal utility methods.
101  int ReadPiece(vtkXMLDataElement* ePiece) override;
102  virtual int ReadSubExtent(int* inExtent, int* inDimensions, vtkIdType* inIncrements,
103  int* outExtent, int* outDimensions, vtkIdType* outIncrements, int* subExtent,
104  int* subDimensions, vtkXMLDataElement* da, vtkAbstractArray* array, FieldType type);
105 
106 private:
108  void operator=(const vtkXMLStructuredDataReader&) = delete;
109 };
110 
111 VTK_ABI_NAMESPACE_END
112 #endif
int ReadPrimaryElement(vtkXMLDataElement *ePrimary) override
Read the primary element from the file.
virtual void SetupEmptyOutput()=0
Setup the output with no data available.
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
Superclass for structured data XML readers.
int vtkIdType
Definition: vtkType.h:315
const std::map< CGNS_ENUMT(ElementType_t), int > CellDimensions
void CopyOutputInformation(vtkInformation *outInfo, int port) override
int vtkTypeBool
Definition: vtkABI.h:64
void ReadXMLData() override
Pipeline execution methods to be defined by subclass.
virtual void DestroyPieces()
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void SetupPieces(int numPieces)
virtual vtkIdType GetNumberOfPoints()=0
Get the number of points in the output.
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
Superclass for VTK XML file readers.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ReadPiece(vtkXMLDataElement *ePiece, int piece)
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
void SetupOutputInformation(vtkInformation *outInfo) override