VTK
vtkXMLUnstructuredDataReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLUnstructuredDataReader.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 =========================================================================*/
25 #ifndef vtkXMLUnstructuredDataReader_h
26 #define vtkXMLUnstructuredDataReader_h
27 
28 #include "vtkIOXMLModule.h" // For export macro
29 #include "vtkXMLDataReader.h"
30 
31 class vtkCellArray;
32 class vtkIdTypeArray;
33 class vtkPointSet;
35 
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43  virtual vtkIdType GetNumberOfPoints();
44 
46  virtual vtkIdType GetNumberOfCells();
47 
52  void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel);
53 
54  // For the specified port, copy the information this reader sets up in
55  // SetupOutputInformation to outInfo
56  virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
57 
58 
59 protected:
62 
63  vtkPointSet* GetOutputAsPointSet();
64  vtkXMLDataElement* FindDataArrayWithName(vtkXMLDataElement* eParent,
65  const char* name);
66  vtkIdTypeArray* ConvertToIdTypeArray(vtkDataArray* a);
67  vtkUnsignedCharArray* ConvertToUnsignedCharArray(vtkDataArray* a);
68 
69  // Pipeline execute data driver. Called by vtkXMLReader.
70  void ReadXMLData();
71 
72  virtual void SetupEmptyOutput();
73  virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces,
74  int& ghostLevel)=0;
75  virtual void SetupOutputTotals();
76  virtual void SetupNextPiece();
77  void SetupPieces(int numPieces);
78  void DestroyPieces();
79 
80  // Setup the output's information.
82 
83  void SetupOutputData();
84  int ReadPiece(vtkXMLDataElement* ePiece);
85  int ReadPieceData();
86  int ReadCellArray(vtkIdType numberOfCells, vtkIdType totalNumberOfCells,
87  vtkXMLDataElement* eCells, vtkCellArray* outCells);
88 
89  // Read faces and faceoffsets arrays for unstructured grid with polyhedon cells
90  int ReadFaceArray(vtkIdType numberOfCells, vtkXMLDataElement* eCells,
91  vtkIdTypeArray* outFaces, vtkIdTypeArray* outFaceOffsets);
92 
93  // Read a data array whose tuples coorrespond to points.
94  virtual int ReadArrayForPoints(vtkXMLDataElement* da, vtkAbstractArray* outArray);
95 
96  // Get the number of points/cells in the given piece. Valid after
97  // UpdateInformation.
98  virtual vtkIdType GetNumberOfPointsInPiece(int piece);
99  virtual vtkIdType GetNumberOfCellsInPiece(int piece)=0;
100 
101  // The update request.
105 
106  // The range of pieces from the file that will form the UpdatePiece.
108  int EndPiece;
112 
113  // The Points element for each piece.
116 
118  unsigned long PointsOffset;
119  int PointsNeedToReadTimeStep(vtkXMLDataElement *eNested);
120  int CellsNeedToReadTimeStep(vtkXMLDataElement *eNested, int &cellstimestep,
121  unsigned long &cellsoffset);
122 
123 
124 private:
126  void operator=(const vtkXMLUnstructuredDataReader&); // Not implemented.
127 };
128 
129 #endif
void SetupOutputData()
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
virtual void SetupOutputInformation(vtkInformation *outInfo)
Abstract superclass for all arrays.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:44
Superclass for unstructured data XML readers.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:275
void PrintSelf(ostream &os, vtkIndent indent)
virtual void DestroyPieces()
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void SetupPieces(int numPieces)
#define VTKIOXML_EXPORT
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual vtkIdType GetNumberOfPoints()=0
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
dynamic, self-adjusting array of unsigned char
virtual vtkIdType GetNumberOfCells()=0
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual void ReadXMLData()
Superclass for VTK XML file readers.
int ReadPiece(vtkXMLDataElement *ePiece, int piece)
virtual void CopyOutputInformation(vtkInformation *outInfo, int port)
virtual int ReadPieceData()