1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkXMLUnstructuredGridReader.h,v $
6 Date: $Date: 2003/02/07 20:06:29 $
7 Version: $Revision: 1.2 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkXMLUnstructuredGridReader - Read VTK XML UnstructuredGrid files.
19 // .SECTION Description
20 // vtkXMLUnstructuredGridReader reads the VTK XML UnstructuredGrid
21 // file format. One unstructured grid file can be read to produce one
22 // output. Streaming is supported. The standard extension for this
23 // reader's file format is "vtu". This reader is also used to read a
24 // single piece of the parallel file format.
27 // vtkXMLPUnstructuredGridReader
29 #ifndef __vtkXMLUnstructuredGridReader_h
30 #define __vtkXMLUnstructuredGridReader_h
32 #include "vtkXMLUnstructuredDataReader.h"
34 class vtkUnstructuredGrid;
36 class VTK_IO_EXPORT vtkXMLUnstructuredGridReader : public vtkXMLUnstructuredDataReader
39 vtkTypeRevisionMacro(vtkXMLUnstructuredGridReader,vtkXMLUnstructuredDataReader);
40 void PrintSelf(ostream& os, vtkIndent indent);
41 static vtkXMLUnstructuredGridReader *New();
44 // Get/Set the reader's output.
45 void SetOutput(vtkUnstructuredGrid *output);
46 vtkUnstructuredGrid *GetOutput();
47 vtkUnstructuredGrid *GetOutput(int idx);
50 vtkXMLUnstructuredGridReader();
51 ~vtkXMLUnstructuredGridReader();
53 const char* GetDataSetName();
54 void GetOutputUpdateExtent(int& piece, int& numberOfPieces, int& ghostLevel);
55 void SetupOutputTotals();
56 void SetupPieces(int numPieces);
59 void SetupOutputData();
60 int ReadPiece(vtkXMLDataElement* ePiece);
61 void SetupNextPiece();
64 // Read a data array whose tuples coorrespond to cells.
65 int ReadArrayForCells(vtkXMLDataElement* da, vtkDataArray* outArray);
67 // The index of the cell in the output where the current piece
71 // The Cells element for each piece.
72 vtkXMLDataElement** CellElements;
73 vtkIdType* NumberOfCells;
76 vtkXMLUnstructuredGridReader(const vtkXMLUnstructuredGridReader&); // Not implemented.
77 void operator=(const vtkXMLUnstructuredGridReader&); // Not implemented.