VTK  9.3.1
vtkXMLPStructuredDataReader.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 vtkXMLPStructuredDataReader_h
16 #define vtkXMLPStructuredDataReader_h
17 
18 #include "vtkIOXMLModule.h" // For export macro
19 #include "vtkXMLPDataReader.h"
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkAbstractArray;
23 class vtkExtentSplitter;
25 
26 class VTKIOXML_EXPORT vtkXMLPStructuredDataReader : public vtkXMLPDataReader
27 {
28 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
32  // For the specified port, copy the information this reader sets up in
33  // SetupOutputInformation to outInfo
34  void CopyOutputInformation(vtkInformation* outInfo, int port) override;
35 
36 protected:
38  ~vtkXMLPStructuredDataReader() override;
39 
40  vtkIdType GetNumberOfPoints() override;
41  vtkIdType GetNumberOfCells() override;
42  void CopyArrayForPoints(vtkAbstractArray* inArray, vtkAbstractArray* outArray) override;
43  void CopyArrayForCells(vtkAbstractArray* inArray, vtkAbstractArray* outArray) override;
44 
45  virtual void SetOutputExtent(int* extent) = 0;
46  virtual void GetPieceInputExtent(int index, int* extent) = 0;
47 
48  // Pipeline execute data driver. Called by vtkXMLReader.
49  void ReadXMLData() override;
50  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
51 
52  void SetupOutputData() override;
53 
54  void SetupPieces(int numPieces) override;
55  void DestroyPieces() override;
56  int ReadPiece(vtkXMLDataElement* ePiece) override;
57  int ReadPieceData() override;
58  void CopySubExtent(int* inExtent, int* inDimensions, vtkIdType* inIncrements, int* outExtent,
59  int* outDimensions, vtkIdType* outIncrements, int* subExtent, int* subDimensions,
60  vtkAbstractArray* inArray, vtkAbstractArray* outArray);
61  int ComputePieceSubExtents();
62 
64 
65  // The extent to be updated in the output.
66  int UpdateExtent[6];
67  int PointDimensions[3];
68  vtkIdType PointIncrements[3];
70  vtkIdType CellIncrements[3];
71 
72  // The extent currently being read from a piece.
73  int SubExtent[6];
74  int SubPointDimensions[3];
75  int SubCellDimensions[3];
76  int SubPieceExtent[6];
77  int SubPiecePointDimensions[3];
78  vtkIdType SubPiecePointIncrements[3];
79  int SubPieceCellDimensions[3];
80  vtkIdType SubPieceCellIncrements[3];
81 
82  // Information per-piece.
84 
85  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
86  vtkInformationVector* outputVector) override;
87 
88 private:
90  void operator=(const vtkXMLPStructuredDataReader&) = delete;
91 };
92 
93 VTK_ABI_NAMESPACE_END
94 #endif
virtual vtkIdType GetNumberOfPoints()=0
void DestroyPieces() override
Delete all piece readers and related information.
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
Superclass for structured data XML readers.
virtual vtkIdType GetNumberOfCells()=0
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
int ReadPiece(vtkXMLDataElement *ePiece) override
Setup the current piece reader.
virtual void ReadXMLData()
Pipeline execution methods to be defined by subclass.
int vtkIdType
Definition: vtkType.h:315
virtual void CopyArrayForCells(vtkAbstractArray *inArray, vtkAbstractArray *outArray)=0
virtual void CopyArrayForPoints(vtkAbstractArray *inArray, vtkAbstractArray *outArray)=0
const std::map< CGNS_ENUMT(ElementType_t), int > CellDimensions
Split an extent across other extents.
int ReadPrimaryElement(vtkXMLDataElement *ePrimary) override
Read the information relative to the dataset and allocate the needed structures according to it...
void CopyOutputInformation(vtkInformation *outInfo, int port) override
For the specified port, copy the information this reader sets up in SetupOutputInformation to outInfo...
a simple class to control print indentation
Definition: vtkIndent.h:28
Superclass for parallel structured data XML readers.
Superclass for PVTK XML file readers that read vtkDataSets.
void SetupPieces(int numPieces) override
Setup the number of pieces to be read and allocate space accordingly.
virtual int ReadPieceData()
Actually read the current piece data.
Store zero or more vtkInformation instances.
void SetupOutputData() override
Initialize the output data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.