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