OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkXMLUnstructuredGridReader.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkXMLUnstructuredGridReader.h,v $
5   Language:  C++
6   Date:      $Date: 2003/02/07 20:06:29 $
7   Version:   $Revision: 1.2 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
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.
25
26 // .SECTION See Also
27 // vtkXMLPUnstructuredGridReader
28
29 #ifndef __vtkXMLUnstructuredGridReader_h
30 #define __vtkXMLUnstructuredGridReader_h
31
32 #include "vtkXMLUnstructuredDataReader.h"
33
34 class vtkUnstructuredGrid;
35
36 class VTK_IO_EXPORT vtkXMLUnstructuredGridReader : public vtkXMLUnstructuredDataReader
37 {
38 public:
39   vtkTypeRevisionMacro(vtkXMLUnstructuredGridReader,vtkXMLUnstructuredDataReader);
40   void PrintSelf(ostream& os, vtkIndent indent);  
41   static vtkXMLUnstructuredGridReader *New();
42   
43   // Description:
44   // Get/Set the reader's output.
45   void SetOutput(vtkUnstructuredGrid *output);
46   vtkUnstructuredGrid *GetOutput();
47   vtkUnstructuredGrid *GetOutput(int idx);
48   
49 protected:
50   vtkXMLUnstructuredGridReader();
51   ~vtkXMLUnstructuredGridReader();
52   
53   const char* GetDataSetName();
54   void GetOutputUpdateExtent(int& piece, int& numberOfPieces, int& ghostLevel);
55   void SetupOutputTotals();
56   void SetupPieces(int numPieces);
57   void DestroyPieces();
58   
59   void SetupOutputData();
60   int ReadPiece(vtkXMLDataElement* ePiece);
61   void SetupNextPiece();
62   int ReadPieceData();
63   
64   // Read a data array whose tuples coorrespond to cells.
65   int ReadArrayForCells(vtkXMLDataElement* da, vtkDataArray* outArray);
66   
67   // The index of the cell in the output where the current piece
68   // begins.
69   vtkIdType StartCell;
70   
71   // The Cells element for each piece.
72   vtkXMLDataElement** CellElements;
73   vtkIdType* NumberOfCells;
74   
75 private:
76   vtkXMLUnstructuredGridReader(const vtkXMLUnstructuredGridReader&);  // Not implemented.
77   void operator=(const vtkXMLUnstructuredGridReader&);  // Not implemented.
78 };
79
80 #endif