00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkXMLPStructuredDataReader_h
00027 #define __vtkXMLPStructuredDataReader_h
00028
00029 #include "vtkXMLPDataReader.h"
00030
00031 class vtkExtentSplitter;
00032 class vtkExtentTranslator;
00033 class vtkTableExtentTranslator;
00034 class vtkXMLStructuredDataReader;
00035
00036 class VTK_IO_EXPORT vtkXMLPStructuredDataReader : public vtkXMLPDataReader
00037 {
00038 public:
00039 vtkTypeRevisionMacro(vtkXMLPStructuredDataReader,vtkXMLPDataReader);
00040 void PrintSelf(ostream& os, vtkIndent indent);
00041
00046 virtual vtkExtentTranslator* GetExtentTranslator();
00047
00048
00049
00050 virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
00051 protected:
00052 vtkXMLPStructuredDataReader();
00053 ~vtkXMLPStructuredDataReader();
00054
00055 vtkIdType GetNumberOfPoints();
00056 vtkIdType GetNumberOfCells();
00057 void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray);
00058 void CopyArrayForCells(vtkDataArray* inArray, vtkDataArray* outArray);
00059
00060 virtual void SetOutputExtent(int* extent)=0;
00061 virtual void GetPieceInputExtent(int index, int* extent)=0;
00062
00063
00064 void ReadXMLData();
00065 int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00066
00067 void SetupOutputData();
00068
00069 void SetupEmptyOutput();
00070 void SetupPieces(int numPieces);
00071 void DestroyPieces();
00072 int ReadPiece(vtkXMLDataElement* ePiece);
00073 int ReadPieceData();
00074 void CopySubExtent(int* inExtent, int* inDimensions, vtkIdType* inIncrements,
00075 int* outExtent,int* outDimensions,vtkIdType* outIncrements,
00076 int* subExtent, int* subDimensions,
00077 vtkDataArray* inArray, vtkDataArray* outArray);
00078 int ComputePieceSubExtents();
00079
00080 vtkTableExtentTranslator* ExtentTranslator;
00081 vtkExtentSplitter* ExtentSplitter;
00082
00083
00084 int UpdateExtent[6];
00085 int PointDimensions[3];
00086 vtkIdType PointIncrements[3];
00087 int CellDimensions[3];
00088 vtkIdType CellIncrements[3];
00089
00090
00091 int SubExtent[6];
00092 int SubPointDimensions[3];
00093 int SubCellDimensions[3];
00094 int SubPieceExtent[6];
00095 int SubPiecePointDimensions[3];
00096 vtkIdType SubPiecePointIncrements[3];
00097 int SubPieceCellDimensions[3];
00098 vtkIdType SubPieceCellIncrements[3];
00099
00100
00101 int* PieceExtents;
00102
00103 private:
00104 vtkXMLPStructuredDataReader(const vtkXMLPStructuredDataReader&);
00105 void operator=(const vtkXMLPStructuredDataReader&);
00106 };
00107
00108 #endif