VTK
vtkXMLStructuredDataReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLStructuredDataReader.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 vtkXMLStructuredDataReader_h
28 #define vtkXMLStructuredDataReader_h
29 
30 #include "vtkIOXMLModule.h" // For export macro
31 #include "vtkXMLDataReader.h"
32 
33 class VTKIOXML_EXPORT vtkXMLStructuredDataReader : public vtkXMLDataReader
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  vtkIdType GetNumberOfPoints() override;
43 
47  vtkIdType GetNumberOfCells() override;
48 
50 
56  vtkSetMacro(WholeSlices, vtkTypeBool);
57  vtkGetMacro(WholeSlices, vtkTypeBool);
58  vtkBooleanMacro(WholeSlices, vtkTypeBool);
60 
65  void CopyOutputInformation(vtkInformation* outInfo, int port) override;
66 
67 protected:
69  ~vtkXMLStructuredDataReader() override;
70 
71  virtual void SetOutputExtent(int* extent) = 0;
72  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
73 
74  // Pipeline execute data driver. Called by vtkXMLReader.
75  void ReadXMLData() override;
76 
77  void SetupOutputInformation(vtkInformation* outInfo) override;
78 
79  // Internal representation of pieces in the file that may have come
80  // from a streamed write.
86 
87  // Whether to read in whole slices mode.
89 
90  // The update extent and corresponding increments and dimensions.
91  int UpdateExtent[6];
92  int PointDimensions[3];
93  int CellDimensions[3];
94  vtkIdType PointIncrements[3];
95  vtkIdType CellIncrements[3];
96 
97  int WholeExtent[6];
98 
99  // The extent currently being read.
100  int SubExtent[6];
101  int SubPointDimensions[3];
102  int SubCellDimensions[3];
103 
104  // Override methods from superclass.
105  void SetupEmptyOutput() override;
106  void SetupPieces(int numPieces) override;
107  void DestroyPieces() override;
108  int ReadArrayForPoints(vtkXMLDataElement* da, vtkAbstractArray* outArray) override;
109  int ReadArrayForCells(vtkXMLDataElement* da, vtkAbstractArray* outArray) override;
110 
111  // Internal utility methods.
112  int ReadPiece(vtkXMLDataElement* ePiece) override;
113  virtual int ReadSubExtent(int* inExtent, int* inDimensions, vtkIdType* inIncrements,
114  int* outExtent, int* outDimensions, vtkIdType* outIncrements, int* subExtent,
115  int* subDimensions, vtkXMLDataElement* da, vtkAbstractArray* array, FieldType type);
116 
117 private:
119  void operator=(const vtkXMLStructuredDataReader&) = delete;
120 };
121 
122 #endif
vtkXMLDataReader::GetNumberOfCells
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
vtkXMLDataReader::GetNumberOfPoints
virtual vtkIdType GetNumberOfPoints()=0
Get the number of points in the output.
vtkXMLStructuredDataReader::PieceExtents
int * PieceExtents
Definition: vtkXMLStructuredDataReader.h:81
vtkXMLStructuredDataReader::WholeSlices
vtkTypeBool WholeSlices
Definition: vtkXMLStructuredDataReader.h:88
vtkXMLDataReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::type
Definition: vtkX3D.h:522
vtkIdType
int vtkIdType
Definition: vtkType.h:349
vtkXMLDataReader::ReadPiece
int ReadPiece(vtkXMLDataElement *ePiece, int piece)
vtkXMLDataReader
Superclass for VTK XML file readers.
Definition: vtkXMLDataReader.h:35
vtkXMLStructuredDataReader::PiecePointIncrements
vtkIdType * PiecePointIncrements
Definition: vtkXMLStructuredDataReader.h:83
vtkX3D::port
Definition: vtkX3D.h:453
vtkXMLDataReader::SetupOutputInformation
void SetupOutputInformation(vtkInformation *outInfo) override
vtkXMLDataReader::ReadPrimaryElement
int ReadPrimaryElement(vtkXMLDataElement *ePrimary) override
vtkXMLDataReader::ReadArrayForCells
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
vtkXMLReader::SetupEmptyOutput
virtual void SetupEmptyOutput()=0
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkXMLDataReader.h
vtkXMLDataElement
Represents an XML element and those nested inside.
Definition: vtkXMLDataElement.h:36
vtkXMLStructuredDataReader
Superclass for structured data XML readers.
Definition: vtkXMLStructuredDataReader.h:33
vtkXMLStructuredDataReader::PiecePointDimensions
int * PiecePointDimensions
Definition: vtkXMLStructuredDataReader.h:82
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:75
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkXMLDataReader::ReadXMLData
void ReadXMLData() override
vtkXMLReader::FieldType
FieldType
Definition: vtkXMLReader.h:49
vtkXMLDataReader::DestroyPieces
virtual void DestroyPieces()
vtkXMLStructuredDataReader::PieceCellIncrements
vtkIdType * PieceCellIncrements
Definition: vtkXMLStructuredDataReader.h:85
vtkXMLDataReader::CopyOutputInformation
void CopyOutputInformation(vtkInformation *outInfo, int port) override
vtkX3D::extent
Definition: vtkX3D.h:351
vtkXMLDataReader::SetupPieces
virtual void SetupPieces(int numPieces)
vtkXMLStructuredDataReader::PieceCellDimensions
int * PieceCellDimensions
Definition: vtkXMLStructuredDataReader.h:84
vtkXMLDataReader::ReadArrayForPoints
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69