Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkXMLUnstructuredGridReader.h

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