00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXMLUnstructuredGridReader.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 =========================================================================*/ 00031 #ifndef __vtkXMLUnstructuredGridReader_h 00032 #define __vtkXMLUnstructuredGridReader_h 00033 00034 #include "vtkXMLUnstructuredDataReader.h" 00035 00036 class vtkUnstructuredGrid; 00037 00038 class VTK_IO_EXPORT vtkXMLUnstructuredGridReader : public vtkXMLUnstructuredDataReader 00039 { 00040 public: 00041 vtkTypeRevisionMacro(vtkXMLUnstructuredGridReader,vtkXMLUnstructuredDataReader); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 static vtkXMLUnstructuredGridReader *New(); 00044 00046 00047 vtkUnstructuredGrid *GetOutput(); 00048 vtkUnstructuredGrid *GetOutput(int idx); 00050 00051 protected: 00052 vtkXMLUnstructuredGridReader(); 00053 ~vtkXMLUnstructuredGridReader(); 00054 00055 const char* GetDataSetName(); 00056 void GetOutputUpdateExtent(int& piece, int& numberOfPieces, int& ghostLevel); 00057 void SetupOutputTotals(); 00058 void SetupPieces(int numPieces); 00059 void DestroyPieces(); 00060 00061 void SetupOutputData(); 00062 int ReadPiece(vtkXMLDataElement* ePiece); 00063 void SetupNextPiece(); 00064 int ReadPieceData(); 00065 00066 // Read a data array whose tuples correspond to cells. 00067 virtual int ReadArrayForCells(vtkXMLDataElement* da, 00068 vtkAbstractArray* outArray); 00069 00070 // Get the number of cells in the given piece. Valid after 00071 // UpdateInformation. 00072 virtual vtkIdType GetNumberOfCellsInPiece(int piece); 00073 00074 virtual int FillOutputPortInformation(int, vtkInformation*); 00075 00076 // The index of the cell in the output where the current piece 00077 // begins. 00078 vtkIdType StartCell; 00079 00080 // The Cells element for each piece. 00081 vtkXMLDataElement** CellElements; 00082 vtkIdType* NumberOfCells; 00083 00084 int CellsTimeStep; 00085 unsigned long CellsOffset; 00086 00087 private: 00088 vtkXMLUnstructuredGridReader(const vtkXMLUnstructuredGridReader&); // Not implemented. 00089 void operator=(const vtkXMLUnstructuredGridReader&); // Not implemented. 00090 }; 00091 00092 #endif