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 virtual int ReadArrayForCells(vtkXMLDataElement* da, 00069 vtkAbstractArray* outArray); 00070 00071 // Get the number of cells in the given piece. Valid after 00072 // UpdateInformation. 00073 virtual vtkIdType GetNumberOfCellsInPiece(int piece); 00074 00075 virtual int FillOutputPortInformation(int, vtkInformation*); 00076 00077 // The index of the cell in the output where the current piece 00078 // begins. 00079 vtkIdType StartCell; 00080 00081 // The Cells element for each piece. 00082 vtkXMLDataElement** CellElements; 00083 vtkIdType* NumberOfCells; 00084 00085 int CellsTimeStep; 00086 unsigned long CellsOffset; 00087 00088 private: 00089 vtkXMLUnstructuredGridReader(const vtkXMLUnstructuredGridReader&); // Not implemented. 00090 void operator=(const vtkXMLUnstructuredGridReader&); // Not implemented. 00091 }; 00092 00093 #endif