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

vtkXMLDataReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLDataReader.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 __vtkXMLDataReader_h
00027 #define __vtkXMLDataReader_h
00028 
00029 #include "vtkXMLReader.h"
00030 
00031 class VTK_IO_EXPORT vtkXMLDataReader : public vtkXMLReader
00032 {
00033 public:
00034   vtkTypeRevisionMacro(vtkXMLDataReader,vtkXMLReader);
00035   void PrintSelf(ostream& os, vtkIndent indent);
00036   
00038   virtual vtkIdType GetNumberOfPoints()=0;
00039   
00041   virtual vtkIdType GetNumberOfCells()=0;
00042   
00043   // For the specified port, copy the information this reader sets up in
00044   // SetupOutputInformation to outInfo
00045   virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
00046 
00047 protected:
00048   vtkXMLDataReader();
00049   ~vtkXMLDataReader();  
00050   
00051   // Add functionality to methods from superclass.
00052   virtual void CreateXMLParser();
00053   virtual void DestroyXMLParser();
00054   virtual void SetupOutputInformation(vtkInformation *outInfo);
00055 
00056   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00057   void SetupOutputData();
00058   
00059   // Setup the reader for a given number of pieces.
00060   virtual void SetupPieces(int numPieces);
00061   virtual void DestroyPieces();
00062   
00063   // Read information from the file for the given piece.
00064   int ReadPiece(vtkXMLDataElement* ePiece, int piece);
00065   virtual int ReadPiece(vtkXMLDataElement* ePiece);
00066   
00067   // Read data from the file for the given piece.
00068   int ReadPieceData(int piece);
00069   virtual int ReadPieceData();
00070   
00071   virtual void ReadXMLData();
00072 
00073   // Read a data array whose tuples coorrespond to points or cells.
00074   virtual int ReadArrayForPoints(vtkXMLDataElement* da,
00075                                  vtkDataArray* outArray);
00076   virtual int ReadArrayForCells(vtkXMLDataElement* da,
00077                                 vtkDataArray* outArray);
00078   
00079   // Read data from a given element.
00080   int ReadData(vtkXMLDataElement* da, void* data, int wordType,
00081                vtkIdType startWord, vtkIdType numWords);
00082   
00083   // Callback registered with the DataProgressObserver.
00084   static void DataProgressCallbackFunction(vtkObject*, unsigned long, void*,
00085                                            void*);
00086   // Progress callback from XMLParser.
00087   virtual void DataProgressCallback();
00088   
00089   // The number of Pieces of data found in the file.
00090   int NumberOfPieces;
00091   
00092   // The PointData and CellData element representations for each piece.
00093   vtkXMLDataElement** PointDataElements;
00094   vtkXMLDataElement** CellDataElements;
00095   
00096   // The piece currently being read.
00097   int Piece;
00098   
00099   // The number of point/cell data arrays in the output.  Valid after
00100   // SetupOutputData has been called.
00101   int NumberOfPointArrays;
00102   int NumberOfCellArrays;  
00103   
00104   // Flag for whether DataProgressCallback should actually update
00105   // progress.
00106   int InReadData;
00107   
00108   // The observer to report progress from reading data from XMLParser.
00109   vtkCallbackCommand* DataProgressObserver;  
00110 
00111   // Specify the last time step read, usefull to know if we need to rearead data
00112   // //PointData
00113   int *PointDataTimeStep;
00114   unsigned long *PointDataOffset;
00115   int PointDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
00116 
00117   //CellData
00118   int *CellDataTimeStep;
00119   unsigned long *CellDataOffset;
00120   int CellDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
00121  
00122 private:
00123   vtkXMLDataReader(const vtkXMLDataReader&);  // Not implemented.
00124   void operator=(const vtkXMLDataReader&);  // Not implemented.
00125 };
00126 
00127 #endif

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