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 "vtkIOXMLModule.h" // For export macro
30 #include "vtkXMLDataReader.h"
31 
32 
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
40  virtual vtkIdType GetNumberOfPoints();
41 
43  virtual vtkIdType GetNumberOfCells();
44 
46 
50  vtkSetMacro(WholeSlices, int);
51  vtkGetMacro(WholeSlices, int);
52  vtkBooleanMacro(WholeSlices, int);
54 
56 
58  virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
59 protected:
63 
64  virtual void SetOutputExtent(int* extent)=0;
66 
67  // Pipeline execute data driver. Called by vtkXMLReader.
68  void ReadXMLData();
69 
70  // Internal representation of pieces in the file that may have come
71  // from a streamed write.
77 
78  // Whether to read in whole slices mode.
80 
81  // The update extent and corresponding increments and dimensions.
82  int UpdateExtent[6];
83  int PointDimensions[3];
84  int CellDimensions[3];
85  vtkIdType PointIncrements[3];
86  vtkIdType CellIncrements[3];
87 
88  int WholeExtent[6];
89 
90  // The extent currently being read.
91  int SubExtent[6];
92  int SubPointDimensions[3];
93  int SubCellDimensions[3];
94 
95  // Override methods from superclass.
96  void SetupEmptyOutput();
97  void SetupPieces(int numPieces);
98  void DestroyPieces();
99  virtual int ReadArrayForPoints(vtkXMLDataElement* da,
100  vtkAbstractArray* outArray);
101  virtual int ReadArrayForCells(vtkXMLDataElement* da,
102  vtkAbstractArray* outArray);
103 
104  // Internal utility methods.
105  int ReadPiece(vtkXMLDataElement* ePiece);
106  virtual int ReadSubExtent(
107  int* inExtent, int* inDimensions, vtkIdType* inIncrements,
108  int* outExtent,int* outDimensions,vtkIdType* outIncrements,
109  int* subExtent, int* subDimensions, vtkXMLDataElement* da,
110  vtkAbstractArray* array);
111 
112 private:
113  vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&); // Not implemented.
114  void operator=(const vtkXMLStructuredDataReader&); // Not implemented.
115 };
116 
117 #endif
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
Superclass for structured data XML readers.
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
int vtkIdType
Definition: vtkType.h:268
int ReadPrimaryElement(vtkXMLDataElement *ePrimary)
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
void PrintSelf(ostream &os, vtkIndent indent)
virtual void DestroyPieces()
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void SetupPieces(int numPieces)
#define VTKIOXML_EXPORT
virtual vtkIdType GetNumberOfPoints()=0
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
virtual vtkIdType GetNumberOfCells()=0
virtual void ReadXMLData()
Superclass for VTK XML file readers.
int ReadPiece(vtkXMLDataElement *ePiece, int piece)
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
virtual void CopyOutputInformation(vtkInformation *outInfo, int port)
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69