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