00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00025 #ifndef __vtkPDataSetReader_h
00026 #define __vtkPDataSetReader_h
00027 
00028 #include "vtkDataSetAlgorithm.h"
00029 
00030 class vtkDataSet;
00031 
00032 class VTK_PARALLEL_EXPORT vtkPDataSetReader : public vtkDataSetAlgorithm
00033 {
00034 public:
00035   void PrintSelf(ostream& os, vtkIndent indent);
00036   vtkTypeRevisionMacro(vtkPDataSetReader,vtkDataSetAlgorithm);
00037   static vtkPDataSetReader *New();
00038 
00040 
00041   vtkSetStringMacro(FileName);
00042   vtkGetStringMacro(FileName);
00044 
00046 
00048   vtkGetMacro(DataType, int);
00050   
00052   int CanReadFile(const char* filename);
00053 
00054 protected:
00055   vtkPDataSetReader();
00056   ~vtkPDataSetReader();
00057 
00058   virtual int RequestDataObject(vtkInformation* request, 
00059                                 vtkInformationVector** inputVector, 
00060                                 vtkInformationVector* outputVector);
00061   void ReadPVTKFileInformation(ifstream *fp,
00062                                vtkInformation* request, 
00063                                vtkInformationVector** inputVector,
00064                                vtkInformationVector* outputVector);
00065   void ReadVTKFileInformation(ifstream *fp,
00066                                vtkInformation* request, 
00067                                vtkInformationVector** inputVector,
00068                                vtkInformationVector* outputVector);
00069 
00070   virtual int RequestData(vtkInformation*, 
00071                           vtkInformationVector**, 
00072                           vtkInformationVector*);
00073   int PolyDataExecute(vtkInformation*, 
00074                       vtkInformationVector**, 
00075                       vtkInformationVector*);
00076   int UnstructuredGridExecute(vtkInformation*, 
00077                               vtkInformationVector**, 
00078                               vtkInformationVector*);
00079   int ImageDataExecute(vtkInformation*, 
00080                        vtkInformationVector**, 
00081                        vtkInformationVector*);
00082   int StructuredGridExecute(vtkInformation*, 
00083                             vtkInformationVector**, 
00084                             vtkInformationVector*);
00085 
00086   void CoverExtent(int ext[6], int *pieceMask);
00087 
00088   vtkDataSet *CheckOutput();
00089   void SetNumberOfPieces(int num);
00090 
00091 
00092   ifstream *OpenFile(const char *);
00093 
00094   int ReadXML(ifstream *file, char **block, char **param, char **value);
00095   void SkipFieldData(ifstream *file);
00096 
00097   int VTKFileFlag;
00098   int StructuredFlag;
00099   char *FileName;
00100   int DataType;
00101   int NumberOfPieces;
00102   char **PieceFileNames;
00103   int **PieceExtents;
00104 
00105 private:
00106   vtkPDataSetReader(const vtkPDataSetReader&); 
00107   void operator=(const vtkPDataSetReader&); 
00108 };
00109 
00110 #endif