Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkXMLPDataReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLPDataReader.h,v $
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 "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   vtkTypeRevisionMacro(vtkXMLPDataReader,vtkXMLReader);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040   
00042 
00043   vtkGetMacro(NumberOfPieces, int);  
00045   
00046   // For the specified port, copy the information this reader sets up in
00047   // SetupOutputInformation to outInfo
00048   virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
00049 
00050 protected:
00051   vtkXMLPDataReader();
00052   ~vtkXMLPDataReader();
00053   
00054   // Pipeline execute information driver.  Called by vtkXMLReader.
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   // Callback registered with the PieceProgressObserver.
00083   static void PieceProgressCallbackFunction(vtkObject*, unsigned long, void*,
00084                                            void*);
00085   virtual void PieceProgressCallback();
00086   
00087   // Pieces from the input summary file.
00088   int NumberOfPieces;
00089   
00090   // The ghost level available on each input piece.
00091   int GhostLevel;
00092   
00093   // The piece currently being read.
00094   int Piece;
00095   
00096   // The path to the input file without the file name.
00097   char* PathName;
00098   
00099   // Information per-piece.
00100   vtkXMLDataElement** PieceElements;
00101   vtkXMLDataReader** PieceReaders;
00102   int* CanReadPieceFlag;
00103   
00104   // The PPointData and PCellData element representations.
00105   vtkXMLDataElement* PPointDataElement;
00106   vtkXMLDataElement* PCellDataElement;  
00107   
00108   // The observer to report progress from reading serial data in each
00109   // piece.
00110   vtkCallbackCommand* PieceProgressObserver;  
00111   
00112 private:
00113   vtkXMLPDataReader(const vtkXMLPDataReader&);  // Not implemented.
00114   void operator=(const vtkXMLPDataReader&);  // Not implemented.
00115 };
00116 
00117 #endif

Generated on Mon Jan 21 23:07:32 2008 for VTK by  doxygen 1.4.3-20050530