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 =========================================================================*/ 00040 #ifndef __vtkXMLDataReader_h 00041 #define __vtkXMLDataReader_h 00042 00043 #include "vtkXMLReader.h" 00044 00045 class VTK_IO_EXPORT vtkXMLDataReader : public vtkXMLReader 00046 { 00047 public: 00048 vtkTypeRevisionMacro(vtkXMLDataReader,vtkXMLReader); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 virtual vtkIdType GetNumberOfPoints()=0; 00053 00055 virtual vtkIdType GetNumberOfCells()=0; 00056 00057 protected: 00058 vtkXMLDataReader(); 00059 ~vtkXMLDataReader(); 00060 00061 // Add functionality to methods from superclass. 00062 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00063 void SetupOutputInformation(); 00064 void SetupOutputData(); 00065 00066 // Setup the reader for a given number of pieces. 00067 virtual void SetupPieces(int numPieces); 00068 virtual void DestroyPieces(); 00069 00070 // Read information from the file for the given piece. 00071 int ReadPiece(vtkXMLDataElement* ePiece, int piece); 00072 virtual int ReadPiece(vtkXMLDataElement* ePiece); 00073 00074 // Read data from the file for the given piece. 00075 int ReadPieceData(int piece); 00076 virtual int ReadPieceData(); 00077 00078 // Read a data array whose tuples coorrespond to points or cells. 00079 virtual int ReadArrayForPoints(vtkXMLDataElement* da, 00080 vtkDataArray* outArray); 00081 virtual int ReadArrayForCells(vtkXMLDataElement* da, 00082 vtkDataArray* outArray); 00083 00084 // Read data from a given element. 00085 int ReadData(vtkXMLDataElement* da, void* data, int wordType, int startWord, 00086 int numWords); 00087 00088 // The number of Pieces of data found in the file. 00089 int NumberOfPieces; 00090 00091 // The PointData and CellData element representations for each piece. 00092 vtkXMLDataElement** PointDataElements; 00093 vtkXMLDataElement** CellDataElements; 00094 00095 // The piece currently being read. 00096 int Piece; 00097 00098 private: 00099 vtkXMLDataReader(const vtkXMLDataReader&); // Not implemented. 00100 void operator=(const vtkXMLDataReader&); // Not implemented. 00101 }; 00102 00103 #endif