00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkXMLUnstructuredDataReader_h
00026 #define __vtkXMLUnstructuredDataReader_h
00027
00028 #include "vtkXMLDataReader.h"
00029
00030 class vtkCellArray;
00031 class vtkIdTypeArray;
00032 class vtkPointSet;
00033 class vtkUnsignedCharArray;
00034
00035 class VTK_IO_EXPORT vtkXMLUnstructuredDataReader : public vtkXMLDataReader
00036 {
00037 public:
00038 vtkTypeMacro(vtkXMLUnstructuredDataReader,vtkXMLDataReader);
00039 void PrintSelf(ostream& os, vtkIndent indent);
00040
00042 virtual vtkIdType GetNumberOfPoints();
00043
00045 virtual vtkIdType GetNumberOfCells();
00046
00051 void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel);
00052
00053
00054
00055 virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
00056
00057
00058 protected:
00059 vtkXMLUnstructuredDataReader();
00060 ~vtkXMLUnstructuredDataReader();
00061
00062 vtkPointSet* GetOutputAsPointSet();
00063 vtkXMLDataElement* FindDataArrayWithName(vtkXMLDataElement* eParent,
00064 const char* name);
00065 vtkIdTypeArray* ConvertToIdTypeArray(vtkDataArray* a);
00066 vtkUnsignedCharArray* ConvertToUnsignedCharArray(vtkDataArray* a);
00067
00068
00069 void ReadXMLData();
00070
00071 virtual void SetupEmptyOutput();
00072 virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces,
00073 int& ghostLevel)=0;
00074 virtual void SetupOutputTotals();
00075 virtual void SetupNextPiece();
00076 void SetupPieces(int numPieces);
00077 void DestroyPieces();
00078
00079
00080 void SetupOutputInformation(vtkInformation *outInfo);
00081
00082 void SetupOutputData();
00083 int ReadPiece(vtkXMLDataElement* ePiece);
00084 int ReadPieceData();
00085 int ReadCellArray(vtkIdType numberOfCells, vtkIdType totalNumberOfCells,
00086 vtkXMLDataElement* eCells, vtkCellArray* outCells);
00087
00088
00089 virtual int ReadArrayForPoints(vtkXMLDataElement* da, vtkAbstractArray* outArray);
00090
00091
00092
00093 virtual vtkIdType GetNumberOfPointsInPiece(int piece);
00094 virtual vtkIdType GetNumberOfCellsInPiece(int piece)=0;
00095
00096
00097 int UpdatePiece;
00098 int UpdateNumberOfPieces;
00099 int UpdateGhostLevel;
00100
00101
00102 int StartPiece;
00103 int EndPiece;
00104 vtkIdType TotalNumberOfPoints;
00105 vtkIdType TotalNumberOfCells;
00106 vtkIdType StartPoint;
00107
00108
00109 vtkXMLDataElement** PointElements;
00110 vtkIdType* NumberOfPoints;
00111
00112 int PointsTimeStep;
00113 unsigned long PointsOffset;
00114 int PointsNeedToReadTimeStep(vtkXMLDataElement *eNested);
00115 int CellsNeedToReadTimeStep(vtkXMLDataElement *eNested, int &cellstimestep,
00116 unsigned long &cellsoffset);
00117
00118
00119 private:
00120 vtkXMLUnstructuredDataReader(const vtkXMLUnstructuredDataReader&);
00121 void operator=(const vtkXMLUnstructuredDataReader&);
00122 };
00123
00124 #endif