vtkXMLUnstructuredDataReader.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035 #ifndef __vtkXMLUnstructuredDataReader_h
00036 #define __vtkXMLUnstructuredDataReader_h
00037
00038 #include "vtkXMLDataReader.h"
00039
00040 class vtkCellArray;
00041 class vtkIdTypeArray;
00042 class vtkPointSet;
00043 class vtkUnsignedCharArray;
00044
00045 class VTK_IO_EXPORT vtkXMLUnstructuredDataReader : public vtkXMLDataReader
00046 {
00047 public:
00048 vtkTypeRevisionMacro(vtkXMLUnstructuredDataReader,vtkXMLDataReader);
00049 void PrintSelf(ostream& os, vtkIndent indent);
00050
00052 virtual vtkIdType GetNumberOfPoints();
00053
00055 virtual vtkIdType GetNumberOfCells();
00056
00061 void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel);
00062
00063 protected:
00064 vtkXMLUnstructuredDataReader();
00065 ~vtkXMLUnstructuredDataReader();
00066
00067 vtkPointSet* GetOutputAsPointSet();
00068 vtkXMLDataElement* FindDataArrayWithName(vtkXMLDataElement* eParent,
00069 const char* name);
00070 vtkIdTypeArray* ConvertToIdTypeArray(vtkDataArray* a);
00071 vtkUnsignedCharArray* ConvertToUnsignedCharArray(vtkDataArray* a);
00072
00073
00074 void ReadXMLData();
00075
00076 virtual void SetupEmptyOutput();
00077 virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces,
00078 int& ghostLevel)=0;
00079 virtual void SetupOutputTotals();
00080 virtual void SetupNextPiece();
00081 void SetupPieces(int numPieces);
00082 void DestroyPieces();
00083
00084 void SetupOutputInformation();
00085 void SetupOutputData();
00086 int ReadPiece(vtkXMLDataElement* ePiece);
00087 int ReadPieceData();
00088 int ReadCellArray(vtkIdType numberOfCells, vtkIdType totalNumberOfCells,
00089 vtkXMLDataElement* eCells, vtkCellArray* outCells);
00090
00091
00092 int ReadArrayForPoints(vtkXMLDataElement* da, vtkDataArray* outArray);
00093
00094
00095
00096 virtual vtkIdType GetNumberOfPointsInPiece(int piece);
00097 virtual vtkIdType GetNumberOfCellsInPiece(int piece)=0;
00098
00099
00100 int UpdatePiece;
00101 int UpdateNumberOfPieces;
00102 int UpdateGhostLevel;
00103
00104
00105 int StartPiece;
00106 int EndPiece;
00107 vtkIdType TotalNumberOfPoints;
00108 vtkIdType TotalNumberOfCells;
00109 vtkIdType StartPoint;
00110
00111
00112 vtkXMLDataElement** PointElements;
00113 vtkIdType* NumberOfPoints;
00114
00115 private:
00116 vtkXMLUnstructuredDataReader(const vtkXMLUnstructuredDataReader&);
00117 void operator=(const vtkXMLUnstructuredDataReader&);
00118 };
00119
00120 #endif