VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
IO
XML
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
=========================================================================*/
26
#ifndef __vtkXMLDataReader_h
27
#define __vtkXMLDataReader_h
28
29
#include "vtkIOXMLModule.h"
// For export macro
30
#include "
vtkXMLReader.h
"
31
32
class
VTKIOXML_EXPORT
vtkXMLDataReader
:
public
vtkXMLReader
33
{
34
public
:
35
vtkTypeMacro(
vtkXMLDataReader
,
vtkXMLReader
);
36
void
PrintSelf
(ostream& os,
vtkIndent
indent);
37
39
virtual
vtkIdType
GetNumberOfPoints()=0;
40
42
virtual
vtkIdType
GetNumberOfCells()=0;
43
44
// For the specified port, copy the information this reader sets up in
45
// SetupOutputInformation to outInfo
46
virtual
void
CopyOutputInformation
(
vtkInformation
*outInfo,
int
port
);
47
48
protected
:
49
vtkXMLDataReader
();
50
~
vtkXMLDataReader
();
51
52
int
SetUpdateExtentInfo(
vtkXMLDataElement
*eDSA,
53
vtkInformationVector
*infoVector,
54
int
piece,
int
numPieces);
55
56
// Add functionality to methods from superclass.
57
virtual
void
CreateXMLParser
();
58
virtual
void
DestroyXMLParser
();
59
virtual
void
SetupOutputInformation
(
vtkInformation
*outInfo);
60
virtual
void
SetupUpdateExtentInformation
(
vtkInformation
*outInfo);
61
62
int
ReadPrimaryElement
(
vtkXMLDataElement
* ePrimary);
63
void
SetupOutputData
();
64
65
// Setup the reader for a given number of pieces.
66
virtual
void
SetupPieces(
int
numPieces);
67
virtual
void
DestroyPieces();
68
69
// Read information from the file for the given piece.
70
int
ReadPiece(
vtkXMLDataElement
* ePiece,
int
piece);
71
virtual
int
ReadPiece(
vtkXMLDataElement
* ePiece);
72
73
// Read data from the file for the given piece.
74
int
ReadPieceData(
int
piece);
75
virtual
int
ReadPieceData();
76
77
virtual
void
ReadXMLData
();
78
79
// Read a data array whose tuples coorrespond to points or cells.
80
virtual
int
ReadArrayForPoints(
vtkXMLDataElement
* da,
81
vtkAbstractArray
* outArray);
82
virtual
int
ReadArrayForCells(
vtkXMLDataElement
* da,
83
vtkAbstractArray
* outArray);
84
85
// Read an Array values starting at the given index and up to numValues.
86
// This method assumes that the array is of correct size to
87
// accommodate all numValues values. arrayIndex is the value index at which the read
88
// values will be put in the array.
89
int
ReadArrayValues(
vtkXMLDataElement
* da,
vtkIdType
arrayIndex,
vtkAbstractArray
* array,
90
vtkIdType
startIndex,
vtkIdType
numValues);
91
92
93
94
// Callback registered with the DataProgressObserver.
95
static
void
DataProgressCallbackFunction(
vtkObject
*,
unsigned
long
,
void
*,
96
void
*);
97
// Progress callback from XMLParser.
98
virtual
void
DataProgressCallback();
99
100
// The number of Pieces of data found in the file.
101
int
NumberOfPieces
;
102
103
// The PointData and CellData element representations for each piece.
104
vtkXMLDataElement
**
PointDataElements
;
105
vtkXMLDataElement
**
CellDataElements
;
106
107
// The piece currently being read.
108
int
Piece
;
109
110
// The number of point/cell data arrays in the output. Valid after
111
// SetupOutputData has been called.
112
int
NumberOfPointArrays
;
113
int
NumberOfCellArrays
;
114
115
// Flag for whether DataProgressCallback should actually update
116
// progress.
117
int
InReadData
;
118
119
// The observer to report progress from reading data from XMLParser.
120
vtkCallbackCommand
*
DataProgressObserver
;
121
122
// Specify the last time step read, useful to know if we need to rearead data
123
// //PointData
124
int
*
PointDataTimeStep
;
125
vtkTypeInt64 *
PointDataOffset
;
126
int
PointDataNeedToReadTimeStep(
vtkXMLDataElement
*eNested);
127
128
//CellData
129
int
*
CellDataTimeStep
;
130
vtkTypeInt64 *
CellDataOffset
;
131
int
CellDataNeedToReadTimeStep(
vtkXMLDataElement
*eNested);
132
133
private
:
134
vtkXMLDataReader
(
const
vtkXMLDataReader
&);
// Not implemented.
135
void
operator=(
const
vtkXMLDataReader
&);
// Not implemented.
136
};
137
138
#endif
Generated on Fri May 25 2012 22:39:32 for VTK by
1.8.1