VTK  9.0.3
vtkXMLPTableReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLPTableReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkXMLPTableReader_h
30 #define vtkXMLPTableReader_h
31 
32 #include "vtkIOXMLModule.h" // For export macro
34 
35 class vtkTable;
36 class vtkXMLTableReader;
37 
38 class VTKIOXML_EXPORT vtkXMLPTableReader : public vtkXMLPDataObjectReader
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
50  vtkTable* GetOutput(int idx);
52 
57  void CopyOutputInformation(vtkInformation* outInfo, int port) override;
58 
63 
68  const char* GetColumnArrayName(int index);
69 
71 
75  int GetColumnArrayStatus(const char* name);
76  void SetColumnArrayStatus(const char* name, int status);
78 
83  vtkGetObjectMacro(ColumnSelection, vtkDataArraySelection);
84 
85 protected:
87  ~vtkXMLPTableReader() override;
88 
92  const char* GetDataSetName() override;
93 
98 
103  virtual vtkIdType GetNumberOfRowsInPiece(int piece);
104 
106 
108 
112  void GetOutputUpdateExtent(int& piece, int& numberOfPieces);
113 
117  void SetupEmptyOutput() override;
118 
122  void SetupOutputData() override;
123 
127  void SetupOutputInformation(vtkInformation* outInfo) override;
128 
133 
138 
142  void SetupPieces(int numPieces) override;
143 
147  void SetupUpdateExtent(int piece, int numberOfPieces);
148 
152  void ReadXMLData() override;
153 
157  int CanReadPiece(int index) override;
158 
162  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
163 
167  void DestroyPieces() override;
168 
170 
174  int ReadPiece(vtkXMLDataElement* ePiece) override;
175 
180 
185 
190 
192 
194  vtkInformationVector* outputVector) override;
195 
199  void PieceProgressCallback() override;
200 
204  int ColumnIsEnabled(vtkXMLDataElement* elementRowData);
205 
207  const char* GetRowArrayName(int index);
208 
214 
219  int EndPiece;
222 
224 
229 
231 
232 private:
233  vtkXMLPTableReader(const vtkXMLPTableReader&) = delete;
234  void operator=(const vtkXMLPTableReader&) = delete;
235 };
236 
237 #endif
Store on/off settings for data arrays for a vtkSource.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:63
Represents an XML element and those nested inside.
Superclass for PVTK XML file readers.
int ReadPiece(vtkXMLDataElement *ePiece, int index)
Setup the piece reader at the given index.
Read PVTK XML Table files.
void DestroyPieces() override
Delete all piece readers and related information.
int ColumnIsEnabled(vtkXMLDataElement *elementRowData)
Check whether the given array element is an enabled array.
vtkTable * GetPieceInputAsTable(int piece)
int GetColumnArrayStatus(const char *name)
Get/Set whether the column array with the given name is to be read.
void GetOutputUpdateExtent(int &piece, int &numberOfPieces)
Get the current piece index and the total number of piece in the dataset.
virtual vtkIdType GetNumberOfRowsInPiece(int piece)
Get the number of rows in the given piece.
vtkTable * GetOutput(int idx)
void SetupUpdateExtent(int piece, int numberOfPieces)
Setup the extent for the parallel reader and the piece readers.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
void PieceProgressCallback() override
Callback registered with the PieceProgressObserver.
vtkTable * GetOutputAsTable()
vtkXMLDataElement * PRowElement
The PRowData element representations.
int ReadPieceData(int index)
Read piece at the given index RowData.
void SetupNextPiece()
Initialize the index of the first row to be read in the next piece.
void SetupOutputInformation(vtkInformation *outInfo) override
Setup the output's information.
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
vtkTable * GetOutput()
Get the reader's output.
static vtkXMLPTableReader * New()
void ReadXMLData() override
Setup the readers and then read the input data.
const char * GetRowArrayName(int index)
vtkDataArraySelection * ColumnSelection
const char * GetDataSetName() override
Return the type of the dataset being read.
vtkIdType GetNumberOfRows()
Get the number of rows of the table.
int ReadPrimaryElement(vtkXMLDataElement *ePrimary) override
Pipeline execute data driver.
void SetColumnArrayStatus(const char *name, int status)
void SetupOutputTotals()
Initialize the total number of rows to be read.
int GetNumberOfColumnArrays()
Get the number of columns arrays available in the input.
int UpdatePieceId
The update request.
int ReadPiece(vtkXMLDataElement *ePiece) override
Setup the current piece reader.
void SetupOutputData() override
Initialize current output data: allocate arrays for RowData.
int CanReadPiece(int index) override
Whether or not the current reader can read the current piece.
void SetupEmptyOutput() override
Initialize current output.
void CopyOutputInformation(vtkInformation *outInfo, int port) override
For the specified port, copy the information this reader sets up in SetupOutputInformation to outInfo...
void SetupPieces(int numPieces) override
Setup the number of pieces to be read and allocate space accordingly.
int StartPiece
The range of pieces from the file that will form the UpdatePiece.
vtkXMLTableReader ** PieceReaders
int ReadPieceData()
Actually read the current piece data.
const char * GetColumnArrayName(int index)
Get the name of the column with the given index in the input.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXMLTableReader * CreatePieceReader()
Create a reader according to the data to read.
~vtkXMLPTableReader() override
Read VTK XML Table files.
@ port
Definition: vtkX3D.h:453
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:338