VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/XML/vtkXMLPDataReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkXMLPDataReader.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00026 #ifndef vtkXMLPDataReader_h
00027 #define vtkXMLPDataReader_h
00028 
00029 #include "vtkIOXMLModule.h" // For export macro
00030 #include "vtkXMLReader.h"
00031 
00032 class vtkDataArray;
00033 class vtkDataSet;
00034 class vtkXMLDataReader;
00035 
00036 class VTKIOXML_EXPORT vtkXMLPDataReader : public vtkXMLReader
00037 {
00038 public:
00039   vtkTypeMacro(vtkXMLPDataReader,vtkXMLReader);
00040   void PrintSelf(ostream& os, vtkIndent indent);
00041 
00043 
00044   vtkGetMacro(NumberOfPieces, int);
00046 
00047   // For the specified port, copy the information this reader sets up in
00048   // SetupOutputInformation to outInfo
00049   virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
00050 
00051 protected:
00052   vtkXMLPDataReader();
00053   ~vtkXMLPDataReader();
00054 
00055   // Pipeline execute information driver.  Called by vtkXMLReader.
00056   int ReadXMLInformation();
00057   virtual void SetupOutputInformation(vtkInformation *outInfo);
00058 
00059   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00060 
00061   vtkDataSet* GetPieceInputAsDataSet(int piece);
00062   void SetupOutputData();
00063 
00064   virtual vtkXMLDataReader* CreatePieceReader()=0;
00065   virtual vtkIdType GetNumberOfPoints()=0;
00066   virtual vtkIdType GetNumberOfCells()=0;
00067   virtual void CopyArrayForPoints(vtkDataArray* inArray,
00068                                   vtkDataArray* outArray)=0;
00069   virtual void CopyArrayForCells(vtkDataArray* inArray,
00070                                  vtkDataArray* outArray)=0;
00071 
00072   virtual void SetupPieces(int numPieces);
00073   virtual void DestroyPieces();
00074   int ReadPiece(vtkXMLDataElement* ePiece, int index);
00075   virtual int ReadPiece(vtkXMLDataElement* ePiece);
00076   int ReadPieceData(int index);
00077   virtual int ReadPieceData();
00078   int CanReadPiece(int index);
00079 
00080   char* CreatePieceFileName(const char* fileName);
00081   void SplitFileName();
00082 
00083   // Callback registered with the PieceProgressObserver.
00084   static void PieceProgressCallbackFunction(vtkObject*, unsigned long, void*,
00085                                            void*);
00086   virtual void PieceProgressCallback();
00087 
00088   // Pieces from the input summary file.
00089   int NumberOfPieces;
00090 
00091   // The ghost level available on each input piece.
00092   int GhostLevel;
00093 
00094   // The piece currently being read.
00095   int Piece;
00096 
00097   // The path to the input file without the file name.
00098   char* PathName;
00099 
00100   // Information per-piece.
00101   vtkXMLDataElement** PieceElements;
00102   vtkXMLDataReader** PieceReaders;
00103   int* CanReadPieceFlag;
00104 
00105   // The PPointData and PCellData element representations.
00106   vtkXMLDataElement* PPointDataElement;
00107   vtkXMLDataElement* PCellDataElement;
00108 
00109   // The observer to report progress from reading serial data in each
00110   // piece.
00111   vtkCallbackCommand* PieceProgressObserver;
00112 
00113 private:
00114   vtkXMLPDataReader(const vtkXMLPDataReader&);  // Not implemented.
00115   void operator=(const vtkXMLPDataReader&);  // Not implemented.
00116 };
00117 
00118 #endif