VTK
vtkXMLPDataReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLPDataReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef __vtkXMLPDataReader_h
27 #define __vtkXMLPDataReader_h
28 
29 #include "vtkXMLReader.h"
30 
31 class vtkDataArray;
32 class vtkDataSet;
33 class vtkXMLDataReader;
34 
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
42 
43  vtkGetMacro(NumberOfPieces, int);
45 
46  // For the specified port, copy the information this reader sets up in
47  // SetupOutputInformation to outInfo
48  virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
49 
50 protected:
53 
54  // Pipeline execute information driver. Called by vtkXMLReader.
55  int ReadXMLInformation();
56  virtual void SetupOutputInformation(vtkInformation *outInfo);
57 
59 
60  vtkDataSet* GetPieceInputAsDataSet(int piece);
61  void SetupOutputData();
62 
63  virtual vtkXMLDataReader* CreatePieceReader()=0;
64  virtual vtkIdType GetNumberOfPoints()=0;
65  virtual vtkIdType GetNumberOfCells()=0;
66  virtual void CopyArrayForPoints(vtkDataArray* inArray,
67  vtkDataArray* outArray)=0;
68  virtual void CopyArrayForCells(vtkDataArray* inArray,
69  vtkDataArray* outArray)=0;
70 
71  virtual void SetupPieces(int numPieces);
72  virtual void DestroyPieces();
73  int ReadPiece(vtkXMLDataElement* ePiece, int index);
74  virtual int ReadPiece(vtkXMLDataElement* ePiece);
75  int ReadPieceData(int index);
76  virtual int ReadPieceData();
77  int CanReadPiece(int index);
78 
79  char* CreatePieceFileName(const char* fileName);
80  void SplitFileName();
81 
82  // Callback registered with the PieceProgressObserver.
83  static void PieceProgressCallbackFunction(vtkObject*, unsigned long, void*,
84  void*);
85  virtual void PieceProgressCallback();
86 
87  // Pieces from the input summary file.
89 
90  // The ghost level available on each input piece.
92 
93  // The piece currently being read.
94  int Piece;
95 
96  // The path to the input file without the file name.
97  char* PathName;
98 
99  // Information per-piece.
103 
104  // The PPointData and PCellData element representations.
107 
108  // The observer to report progress from reading serial data in each
109  // piece.
111 
112 private:
113  vtkXMLPDataReader(const vtkXMLPDataReader&); // Not implemented.
114  void operator=(const vtkXMLPDataReader&); // Not implemented.
115 };
116 
117 #endif