00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkXMLPDataReader_h
00027 #define __vtkXMLPDataReader_h
00028
00029 #include "vtkXMLReader.h"
00030
00031 class vtkDataArray;
00032 class vtkDataSet;
00033 class vtkXMLDataReader;
00034
00035 class VTK_IO_EXPORT vtkXMLPDataReader : public vtkXMLReader
00036 {
00037 public:
00038 vtkTypeMacro(vtkXMLPDataReader,vtkXMLReader);
00039 void PrintSelf(ostream& os, vtkIndent indent);
00040
00042
00043 vtkGetMacro(NumberOfPieces, int);
00045
00046
00047
00048 virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
00049
00050 protected:
00051 vtkXMLPDataReader();
00052 ~vtkXMLPDataReader();
00053
00054
00055 int ReadXMLInformation();
00056 virtual void SetupOutputInformation(vtkInformation *outInfo);
00057
00058 int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00059
00060 vtkDataSet* GetPieceInputAsDataSet(int piece);
00061 void SetupOutputData();
00062
00063 virtual vtkXMLDataReader* CreatePieceReader()=0;
00064 virtual vtkIdType GetNumberOfPoints()=0;
00065 virtual vtkIdType GetNumberOfCells()=0;
00066 virtual void CopyArrayForPoints(vtkDataArray* inArray,
00067 vtkDataArray* outArray)=0;
00068 virtual void CopyArrayForCells(vtkDataArray* inArray,
00069 vtkDataArray* outArray)=0;
00070
00071 virtual void SetupPieces(int numPieces);
00072 virtual void DestroyPieces();
00073 int ReadPiece(vtkXMLDataElement* ePiece, int index);
00074 virtual int ReadPiece(vtkXMLDataElement* ePiece);
00075 int ReadPieceData(int index);
00076 virtual int ReadPieceData();
00077 int CanReadPiece(int index);
00078
00079 char* CreatePieceFileName(const char* fileName);
00080 void SplitFileName();
00081
00082
00083 static void PieceProgressCallbackFunction(vtkObject*, unsigned long, void*,
00084 void*);
00085 virtual void PieceProgressCallback();
00086
00087
00088 int NumberOfPieces;
00089
00090
00091 int GhostLevel;
00092
00093
00094 int Piece;
00095
00096
00097 char* PathName;
00098
00099
00100 vtkXMLDataElement** PieceElements;
00101 vtkXMLDataReader** PieceReaders;
00102 int* CanReadPieceFlag;
00103
00104
00105 vtkXMLDataElement* PPointDataElement;
00106 vtkXMLDataElement* PCellDataElement;
00107
00108
00109
00110 vtkCallbackCommand* PieceProgressObserver;
00111
00112 private:
00113 vtkXMLPDataReader(const vtkXMLPDataReader&);
00114 void operator=(const vtkXMLPDataReader&);
00115 };
00116
00117 #endif