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