VTK  9.3.20240513
vtkXMLUnstructuredDataReader.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
14#ifndef vtkXMLUnstructuredDataReader_h
15#define vtkXMLUnstructuredDataReader_h
16
17#include "vtkIOXMLModule.h" // For export macro
18#include "vtkXMLDataReader.h"
19
20VTK_ABI_NAMESPACE_BEGIN
21class vtkCellArray;
22class vtkIdTypeArray;
23class vtkPointSet;
25
26class VTKIOXML_EXPORT vtkXMLUnstructuredDataReader : public vtkXMLDataReader
27{
28public:
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
36
41
46
53 void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel);
54
55 // For the specified port, copy the information this reader sets up in
56 // SetupOutputInformation to outInfo
57 void CopyOutputInformation(vtkInformation* outInfo, int port) override;
58
59protected:
62
65
66 // note that these decref the input array and return an array with a
67 // new reference:
70
71 // Pipeline execute data driver. Called by vtkXMLReader.
72 void ReadXMLData() override;
73
74 void SetupEmptyOutput() override;
75 virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces, int& ghostLevel) = 0;
76 virtual void SetupOutputTotals();
77 virtual void SetupNextPiece();
78 void SetupPieces(int numPieces) override;
79 void DestroyPieces() override;
80
81 // Setup the output's information.
82 void SetupOutputInformation(vtkInformation* outInfo) override;
83
84 void SetupOutputData() override;
85 int ReadPiece(vtkXMLDataElement* ePiece) override;
86 int ReadPieceData() override;
87 int ReadCellArray(vtkIdType numberOfCells, vtkIdType totalNumberOfCells,
88 vtkXMLDataElement* eCells, vtkCellArray* outCells);
89
90 // Read faces and faceoffsets arrays for unstructured grid with polyhedon cells
91 int ReadFaceArray(vtkIdType numberOfCells, vtkXMLDataElement* eCells, vtkIdTypeArray* outFaces,
92 vtkIdTypeArray* outFaceOffsets);
93 int ReadFaceCellArray(vtkIdType numberOfCells, vtkXMLDataElement* eCells, vtkCellArray* outFaces,
94 vtkCellArray* outFaceOffsets);
95
96 // Read a data array whose tuples coorrespond to points.
98
99 // Get the number of points/cells in the given piece. Valid after
100 // UpdateInformation.
102 virtual vtkIdType GetNumberOfCellsInPiece(int piece) = 0;
103
104 // The update request.
108
109 // The range of pieces from the file that will form the UpdatePiece.
115
116 // The Points element for each piece.
119
121 unsigned long PointsOffset;
124 vtkXMLDataElement* eNested, int& cellstimestep, unsigned long& cellsoffset);
125
130
131private:
133 void operator=(const vtkXMLUnstructuredDataReader&) = delete;
134};
135
136VTK_ABI_NAMESPACE_END
137#endif
Abstract superclass for all arrays.
object to represent cell connectivity
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition vtkPointSet.h:98
dynamic, self-adjusting array of unsigned char
Represents an XML element and those nested inside.
Superclass for VTK XML file readers.
Superclass for unstructured data XML readers.
void SetupEmptyOutput() override
Setup the output with no data available.
virtual vtkIdType GetNumberOfCellsInPiece(int piece)=0
vtkIdType GetNumberOfPoints() override
Get the number of points in the output.
void SetupOutputData() override
Setup the output's data with allocation.
int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray) override
vtkPointSet * GetOutputAsPointSet()
int ReadFaceArray(vtkIdType numberOfCells, vtkXMLDataElement *eCells, vtkIdTypeArray *outFaces, vtkIdTypeArray *outFaceOffsets)
int ReadCellArray(vtkIdType numberOfCells, vtkIdType totalNumberOfCells, vtkXMLDataElement *eCells, vtkCellArray *outCells)
int ReadPiece(vtkXMLDataElement *ePiece) override
vtkUnsignedCharArray * ConvertToUnsignedCharArray(vtkDataArray *a)
vtkIdTypeArray * ConvertToIdTypeArray(vtkDataArray *a)
~vtkXMLUnstructuredDataReader() override
virtual vtkIdType GetNumberOfPointsInPiece(int piece)
int CellsNeedToReadTimeStep(vtkXMLDataElement *eNested, int &cellstimestep, unsigned long &cellsoffset)
virtual void GetOutputUpdateExtent(int &piece, int &numberOfPieces, int &ghostLevel)=0
void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel)
Setup the reader as if the given update extent were requested by its output.
int ReadFaceCellArray(vtkIdType numberOfCells, vtkXMLDataElement *eCells, vtkCellArray *outFaces, vtkCellArray *outFaceOffsets)
void ReadXMLData() override
Pipeline execution methods to be defined by subclass.
void DestroyPieces() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkIdType GetNumberOfPieces()
Get the number of pieces in the file.
vtkIdType GetNumberOfCells() override
Get the number of cells in the output.
virtual void SetupOutputTotals()
void SetupPieces(int numPieces) override
void SetupOutputInformation(vtkInformation *outInfo) override
int PointsNeedToReadTimeStep(vtkXMLDataElement *eNested)
vtkXMLDataElement * FindDataArrayWithName(vtkXMLDataElement *eParent, const char *name)
void CopyOutputInformation(vtkInformation *outInfo, int port) override
int vtkIdType
Definition vtkType.h:315