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 void SetOutput(vtkUnstructuredGrid *output); 00048 vtkUnstructuredGrid *GetOutput(); 00049 vtkUnstructuredGrid *GetOutput(int idx); 00051 00052 protected: 00053 vtkXMLUnstructuredGridReader(); 00054 ~vtkXMLUnstructuredGridReader(); 00055 00056 const char* GetDataSetName(); 00057 void GetOutputUpdateExtent(int& piece, int& numberOfPieces, int& ghostLevel); 00058 void SetupOutputTotals(); 00059 void SetupPieces(int numPieces); 00060 void DestroyPieces(); 00061 00062 void SetupOutputData(); 00063 int ReadPiece(vtkXMLDataElement* ePiece); 00064 void SetupNextPiece(); 00065 int ReadPieceData(); 00066 00067 // Read a data array whose tuples correspond to cells. 00068 int ReadArrayForCells(vtkXMLDataElement* da, vtkDataArray* 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