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

dox/IO/vtkXMLDataReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLDataReader.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00030 #ifndef __vtkXMLDataReader_h
00031 #define __vtkXMLDataReader_h
00032 
00033 #include "vtkXMLReader.h"
00034 
00035 class VTK_IO_EXPORT vtkXMLDataReader : public vtkXMLReader
00036 {
00037 public:
00038   vtkTypeRevisionMacro(vtkXMLDataReader,vtkXMLReader);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040   
00042   virtual vtkIdType GetNumberOfPoints()=0;
00043   
00045   virtual vtkIdType GetNumberOfCells()=0;
00046   
00047 protected:
00048   vtkXMLDataReader();
00049   ~vtkXMLDataReader();
00050   
00051   // Add functionality to methods from superclass.
00052   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00053   void SetupOutputInformation();  
00054   void SetupOutputData();
00055   
00056   // Setup the reader for a given number of pieces.
00057   virtual void SetupPieces(int numPieces);
00058   virtual void DestroyPieces();
00059   
00060   // Read information from the file for the given piece.
00061   int ReadPiece(vtkXMLDataElement* ePiece, int piece);
00062   virtual int ReadPiece(vtkXMLDataElement* ePiece);
00063   
00064   // Read data from the file for the given piece.
00065   int ReadPieceData(int piece);
00066   virtual int ReadPieceData();
00067   
00068   // Read a data array whose tuples coorrespond to points or cells.
00069   virtual int ReadArrayForPoints(vtkXMLDataElement* da,
00070                                  vtkDataArray* outArray);
00071   virtual int ReadArrayForCells(vtkXMLDataElement* da,
00072                                 vtkDataArray* outArray);
00073   
00074   // Read data from a given element.
00075   int ReadData(vtkXMLDataElement* da, void* data, int wordType, int startWord,
00076                int numWords);
00077   
00078   // The number of Pieces of data found in the file.
00079   int NumberOfPieces;
00080   
00081   // The PointData and CellData element representations for each piece.
00082   vtkXMLDataElement** PointDataElements;
00083   vtkXMLDataElement** CellDataElements;  
00084   
00085   // The piece currently being read.
00086   int Piece;
00087   
00088 private:
00089   vtkXMLDataReader(const vtkXMLDataReader&);  // Not implemented.
00090   void operator=(const vtkXMLDataReader&);  // Not implemented.
00091 };
00092 
00093 #endif