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