VTK
vtkXMLStructuredDataReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLStructuredDataReader.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 __vtkXMLStructuredDataReader_h
27 #define __vtkXMLStructuredDataReader_h
28 
29 #include "vtkXMLDataReader.h"
30 
31 
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent);
37 
39  virtual vtkIdType GetNumberOfPoints();
40 
42  virtual vtkIdType GetNumberOfCells();
43 
45 
49  vtkSetMacro(WholeSlices, int);
50  vtkGetMacro(WholeSlices, int);
51  vtkBooleanMacro(WholeSlices, int);
53 
55 
57  virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
58 protected:
62 
63  virtual void SetOutputExtent(int* extent)=0;
65 
66  // Pipeline execute data driver. Called by vtkXMLReader.
67  void ReadXMLData();
68 
69  // Internal representation of pieces in the file that may have come
70  // from a streamed write.
76 
77  // Whether to read in whole slices mode.
79 
80  // The update extent and corresponding increments and dimensions.
81  int UpdateExtent[6];
82  int PointDimensions[3];
83  int CellDimensions[3];
84  vtkIdType PointIncrements[3];
85  vtkIdType CellIncrements[3];
86 
87  int WholeExtent[6];
88 
89  // The extent currently being read.
90  int SubExtent[6];
91  int SubPointDimensions[3];
92  int SubCellDimensions[3];
93 
94  // Override methods from superclass.
95  void SetupEmptyOutput();
96  void SetupPieces(int numPieces);
97  void DestroyPieces();
98  virtual int ReadArrayForPoints(vtkXMLDataElement* da,
99  vtkAbstractArray* outArray);
100  virtual int ReadArrayForCells(vtkXMLDataElement* da,
101  vtkAbstractArray* outArray);
102 
103  // Internal utility methods.
104  int ReadPiece(vtkXMLDataElement* ePiece);
105  virtual int ReadSubExtent(
106  int* inExtent, int* inDimensions, vtkIdType* inIncrements,
107  int* outExtent,int* outDimensions,vtkIdType* outIncrements,
108  int* subExtent, int* subDimensions, vtkXMLDataElement* da,
109  vtkAbstractArray* array);
110 
111 private:
112  vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&); // Not implemented.
113  void operator=(const vtkXMLStructuredDataReader&); // Not implemented.
114 };
115 
116 #endif