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 =========================================================================*/
27 #ifndef vtkXMLPDataReader_h
28 #define vtkXMLPDataReader_h
29 
30 #include "vtkIOXMLModule.h" // For export macro
31 #include "vtkXMLReader.h"
32 
33 class vtkDataArray;
34 class vtkDataSet;
35 class vtkXMLDataReader;
36 
37 class VTKIOXML_EXPORT vtkXMLPDataReader : public vtkXMLReader
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
44 
47  vtkGetMacro(NumberOfPieces, int);
49 
50  // For the specified port, copy the information this reader sets up in
51  // SetupOutputInformation to outInfo
52  void CopyOutputInformation(vtkInformation *outInfo, int port) VTK_OVERRIDE;
53 
54 protected:
56  ~vtkXMLPDataReader() VTK_OVERRIDE;
57 
58  // Pipeline execute information driver. Called by vtkXMLReader.
59  int ReadXMLInformation() VTK_OVERRIDE;
60  void SetupOutputInformation(vtkInformation *outInfo) VTK_OVERRIDE;
61 
62  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) VTK_OVERRIDE;
63 
64  vtkDataSet* GetPieceInputAsDataSet(int piece);
65  void SetupOutputData() VTK_OVERRIDE;
66 
67  virtual vtkXMLDataReader* CreatePieceReader()=0;
68  virtual vtkIdType GetNumberOfPoints()=0;
69  virtual vtkIdType GetNumberOfCells()=0;
70  virtual void CopyArrayForPoints(vtkDataArray* inArray,
71  vtkDataArray* outArray)=0;
72  virtual void CopyArrayForCells(vtkDataArray* inArray,
73  vtkDataArray* outArray)=0;
74 
75  virtual void SetupPieces(int numPieces);
76  virtual void DestroyPieces();
77  int ReadPiece(vtkXMLDataElement* ePiece, int index);
78  virtual int ReadPiece(vtkXMLDataElement* ePiece);
79  int ReadPieceData(int index);
80  virtual int ReadPieceData();
81  int CanReadPiece(int index);
82 
83  char* CreatePieceFileName(const char* fileName);
84  void SplitFileName();
85 
86  // Callback registered with the PieceProgressObserver.
87  static void PieceProgressCallbackFunction(vtkObject*, unsigned long, void*,
88  void*);
89  virtual void PieceProgressCallback();
90 
91  // Pieces from the input summary file.
92  int NumberOfPieces;
93 
94  // The ghost level available on each input piece.
95  int GhostLevel;
96 
97  // The piece currently being read.
98  int Piece;
99 
100  // The path to the input file without the file name.
101  char* PathName;
102 
103  // Information per-piece.
104  vtkXMLDataElement** PieceElements;
105  vtkXMLDataReader** PieceReaders;
106  int* CanReadPieceFlag;
107 
108  // The PPointData and PCellData element representations.
109  vtkXMLDataElement* PPointDataElement;
110  vtkXMLDataElement* PCellDataElement;
111 
112  // The observer to report progress from reading serial data in each
113  // piece.
114  vtkCallbackCommand* PieceProgressObserver;
115 
116 private:
117  vtkXMLPDataReader(const vtkXMLPDataReader&) VTK_DELETE_FUNCTION;
118  void operator=(const vtkXMLPDataReader&) VTK_DELETE_FUNCTION;
119 };
120 
121 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
int vtkIdType
Definition: vtkType.h:345
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
Superclass for PVTK XML file readers.
Superclass for VTK XML file readers.
virtual void CopyOutputInformation(vtkInformation *vtkNotUsed(outInfo), int vtkNotUsed(port))
Definition: vtkXMLReader.h:131
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:43