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