VTK  9.3.1
vtkXMLTableReader.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 vtkXMLTableReader_h
16 #define vtkXMLTableReader_h
17 
18 #include "vtkIOXMLModule.h" // For export macro
19 #include "vtkXMLReader.h"
20 
21 #include <map> // needed for std::map
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkCellArray;
25 class vtkIdTypeArray;
27 class vtkTable;
28 
29 class VTKIOXML_EXPORT vtkXMLTableReader : public vtkXMLReader
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34  static vtkXMLTableReader* New();
35 
37 
40  vtkTable* GetOutput();
41  vtkTable* GetOutput(int idx);
43 
47  vtkIdType GetNumberOfRows();
48 
52  vtkIdType GetNumberOfPieces();
53 
60  void SetupUpdateExtent(int piece, int numberOfPieces);
61 
66  void CopyOutputInformation(vtkInformation* outInfo, int port) override;
67 
68 protected:
70  ~vtkXMLTableReader() override;
71 
75  int ColumnIsEnabled(vtkXMLDataElement* eRowData);
76 
77  void DestroyPieces();
78 
82  const char* GetDataSetName() override;
83 
87  void GetOutputUpdateExtent(int& piece, int& numberOfPieces);
88 
92  int RowDataNeedToReadTimeStep(vtkXMLDataElement* eNested);
93 
97  void SetupEmptyOutput() override;
98 
102  void SetupOutputTotals();
103 
107  void SetupNextPiece();
108 
112  void SetupOutputData() override;
113 
117  void SetupOutputInformation(vtkInformation* outInfo) override;
118 
122  void SetupPieces(int numPieces);
123 
127  void ReadXMLData() override;
128 
132  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
133 
137  int ReadPiece(vtkXMLDataElement* ePiece, int piece);
138 
142  int ReadPiece(vtkXMLDataElement* ePiece);
143 
147  int ReadPieceData(int);
148 
149  int FillOutputPortInformation(int, vtkInformation*) override;
150 
160  int EndPiece;
163 
169 
174 
178  int Piece;
179 
184 
190 
191 private:
192  std::map<std::string, int> RowDataTimeStep;
193  std::map<std::string, vtkTypeInt64> RowDataOffset;
194 
195  vtkXMLTableReader(const vtkXMLTableReader&) = delete;
196  void operator=(const vtkXMLTableReader&) = delete;
197 };
198 
199 VTK_ABI_NAMESPACE_END
200 #endif
virtual const char * GetDataSetName()=0
Get the name of the data set being read.
virtual void SetupEmptyOutput()=0
Setup the output with no data available.
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
int UpdatedPiece
The update request.
Read VTK XML Table files.
int NumberOfPieces
The number of Pieces of data found in the file.
int NumberOfColumns
The number of columns arrays in the output.
dynamic, self-adjusting array of vtkIdType
virtual void ReadXMLData()
Pipeline execution methods to be defined by subclass.
int vtkIdType
Definition: vtkType.h:315
vtkXMLDataElement ** RowDataElements
The RowData element representations for each piece.
int Piece
The piece currently being read.
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkIdType * NumberOfRows
virtual void SetupOutputInformation(vtkInformation *vtkNotUsed(outInfo))
Setup the output's information.
Definition: vtkXMLReader.h:228
dynamic, self-adjusting array of unsigned char
virtual int ReadPrimaryElement(vtkXMLDataElement *ePrimary)
Read the primary element from the file.
vtkXMLDataElement ** RowElements
The Points element for each piece.
object to represent cell connectivity
Definition: vtkCellArray.h:175
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
virtual void CopyOutputInformation(vtkInformation *vtkNotUsed(outInfo), int vtkNotUsed(port))
Definition: vtkXMLReader.h:150
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkAlgorithm * New()
int StartPiece
The range of pieces from the file that will form the UpdatedPiece.
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:38
virtual void SetupOutputData()
Setup the output's data with allocation.