VTK
vtkXMLDataReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkXMLDataReader.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 vtkXMLDataReader_h
28#define vtkXMLDataReader_h
29
30#include "vtkIOXMLModule.h" // For export macro
31#include "vtkXMLReader.h"
32
33class VTKIOXML_EXPORT vtkXMLDataReader : public vtkXMLReader
34{
35public:
37 {
40 OTHER
41 };
42
43
45 void PrintSelf(ostream& os, vtkIndent indent);
46
51
56
57 // For the specified port, copy the information this reader sets up in
58 // SetupOutputInformation to outInfo
59 virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
60
61protected:
64
65 // Add functionality to methods from superclass.
66 virtual void CreateXMLParser();
67 virtual void DestroyXMLParser();
68 virtual void SetupOutputInformation(vtkInformation *outInfo);
69
72
73 // Setup the reader for a given number of pieces.
74 virtual void SetupPieces(int numPieces);
75 virtual void DestroyPieces();
76
77 // Read information from the file for the given piece.
78 int ReadPiece(vtkXMLDataElement* ePiece, int piece);
79 virtual int ReadPiece(vtkXMLDataElement* ePiece);
80
81 // Read data from the file for the given piece.
82 int ReadPieceData(int piece);
83 virtual int ReadPieceData();
84
85 virtual void ReadXMLData();
86
87 // Read a data array whose tuples coorrespond to points or cells.
89 vtkAbstractArray* outArray);
91 vtkAbstractArray* outArray);
92
93 // Read an Array values starting at the given index and up to numValues.
94 // This method assumes that the array is of correct size to
95 // accommodate all numValues values. arrayIndex is the value index at which the read
96 // values will be put in the array.
98 vtkXMLDataElement* da, vtkIdType arrayIndex, vtkAbstractArray* array,
99 vtkIdType startIndex, vtkIdType numValues, FieldType type = OTHER);
100
101
102
103 // Callback registered with the DataProgressObserver.
104 static void DataProgressCallbackFunction(vtkObject*, unsigned long, void*,
105 void*);
106 // Progress callback from XMLParser.
107 virtual void DataProgressCallback();
108
109 // The number of Pieces of data found in the file.
111
112 // The PointData and CellData element representations for each piece.
115
116 // The piece currently being read.
117 int Piece;
118
119 // The number of point/cell data arrays in the output. Valid after
120 // SetupOutputData has been called.
123
124 // Flag for whether DataProgressCallback should actually update
125 // progress.
127
128 // The observer to report progress from reading data from XMLParser.
130
131 // Specify the last time step read, useful to know if we need to rearead data
132 // //PointData
134 vtkTypeInt64 *PointDataOffset;
136
137 //CellData
139 vtkTypeInt64 *CellDataOffset;
141
142private:
143 vtkXMLDataReader(const vtkXMLDataReader&) VTK_DELETE_FUNCTION;
144 void operator=(const vtkXMLDataReader&) VTK_DELETE_FUNCTION;
145
146 void ConvertGhostLevelsToGhostType(
148 vtkIdType numValues);
149
150};
151
152#endif
Abstract superclass for all arrays.
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObject.h:60
Represents an XML element and those nested inside.
Superclass for VTK XML file readers.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
int PointDataNeedToReadTimeStep(vtkXMLDataElement *eNested)
virtual int ReadPiece(vtkXMLDataElement *ePiece)
vtkTypeInt64 * CellDataOffset
virtual void CreateXMLParser()
virtual void DataProgressCallback()
virtual vtkIdType GetNumberOfPoints()=0
Get the number of points in the output.
virtual void CopyOutputInformation(vtkInformation *outInfo, int port)
vtkCallbackCommand * DataProgressObserver
virtual void SetupOutputInformation(vtkInformation *outInfo)
vtkXMLDataElement ** PointDataElements
virtual void DestroyXMLParser()
static void DataProgressCallbackFunction(vtkObject *, unsigned long, void *, void *)
vtkXMLDataElement ** CellDataElements
vtkTypeInt64 * PointDataOffset
int ReadPieceData(int piece)
virtual int ReadPieceData()
virtual void ReadXMLData()
int ReadPiece(vtkXMLDataElement *ePiece, int piece)
void SetupOutputData()
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
int ReadPrimaryElement(vtkXMLDataElement *ePrimary)
int ReadArrayValues(vtkXMLDataElement *da, vtkIdType arrayIndex, vtkAbstractArray *array, vtkIdType startIndex, vtkIdType numValues, FieldType type=OTHER)
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
virtual void SetupPieces(int numPieces)
virtual void DestroyPieces()
int CellDataNeedToReadTimeStep(vtkXMLDataElement *eNested)
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:44
@ port
Definition: vtkX3D.h:447
@ type
Definition: vtkX3D.h:516
@ data
Definition: vtkX3D.h:315
int vtkIdType
Definition: vtkType.h:287