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 "vtkXMLDataReader.h"
29 
30 class vtkCellArray;
31 class vtkIdTypeArray;
32 class vtkPointSet;
34 
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
42  virtual vtkIdType GetNumberOfPoints();
43 
45  virtual vtkIdType GetNumberOfCells();
46 
51  void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel);
52 
53  // For the specified port, copy the information this reader sets up in
54  // SetupOutputInformation to outInfo
55  virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
56 
57 
58 protected:
61 
62  vtkPointSet* GetOutputAsPointSet();
63  vtkXMLDataElement* FindDataArrayWithName(vtkXMLDataElement* eParent,
64  const char* name);
65  vtkIdTypeArray* ConvertToIdTypeArray(vtkDataArray* a);
66  vtkUnsignedCharArray* ConvertToUnsignedCharArray(vtkDataArray* a);
67 
68  // Pipeline execute data driver. Called by vtkXMLReader.
69  void ReadXMLData();
70 
71  virtual void SetupEmptyOutput();
72  virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces,
73  int& ghostLevel)=0;
74  virtual void SetupOutputTotals();
75  virtual void SetupNextPiece();
76  void SetupPieces(int numPieces);
77  void DestroyPieces();
78 
79  // Setup the output's information.
81 
82  void SetupOutputData();
83  int ReadPiece(vtkXMLDataElement* ePiece);
84  int ReadPieceData();
85  int ReadCellArray(vtkIdType numberOfCells, vtkIdType totalNumberOfCells,
86  vtkXMLDataElement* eCells, vtkCellArray* outCells);
87 
88  // Read faces and faceoffsets arrays for unstructured grid with polyhedon cells
89  int ReadFaceArray(vtkIdType numberOfCells, vtkXMLDataElement* eCells,
90  vtkIdTypeArray* outFaces, vtkIdTypeArray* outFaceOffsets);
91 
92  // Read a data array whose tuples coorrespond to points.
93  virtual int ReadArrayForPoints(vtkXMLDataElement* da, vtkAbstractArray* outArray);
94 
95  // Get the number of points/cells in the given piece. Valid after
96  // UpdateInformation.
97  virtual vtkIdType GetNumberOfPointsInPiece(int piece);
98  virtual vtkIdType GetNumberOfCellsInPiece(int piece)=0;
99 
100  // The update request.
104 
105  // The range of pieces from the file that will form the UpdatePiece.
107  int EndPiece;
111 
112  // The Points element for each piece.
115 
117  unsigned long PointsOffset;
118  int PointsNeedToReadTimeStep(vtkXMLDataElement *eNested);
119  int CellsNeedToReadTimeStep(vtkXMLDataElement *eNested, int &cellstimestep,
120  unsigned long &cellsoffset);
121 
122 
123 private:
125  void operator=(const vtkXMLUnstructuredDataReader&); // Not implemented.
126 };
127 
128 #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:40
Superclass for unstructured data XML readers.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:255
void PrintSelf(ostream &os, vtkIndent indent)
virtual void DestroyPieces()
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void SetupPieces(int numPieces)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
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:48
virtual void ReadXMLData()
Superclass for VTK XML file readers.
int ReadPiece(vtkXMLDataElement *ePiece, int piece)
#define VTK_IO_EXPORT
virtual void CopyOutputInformation(vtkInformation *outInfo, int port)
virtual int ReadPieceData()