VTK
vtkXMLUnstructuredDataWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkXMLUnstructuredDataWriter.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=========================================================================*/
23#ifndef vtkXMLUnstructuredDataWriter_h
24#define vtkXMLUnstructuredDataWriter_h
25
26#include "vtkIOXMLModule.h" // For export macro
27#include "vtkXMLWriter.h"
28
29class vtkPointSet;
30class vtkCellArray;
31class vtkCellIterator;
32class vtkDataArray;
33class vtkIdTypeArray;
35
36class VTKIOXML_EXPORT vtkXMLUnstructuredDataWriter : public vtkXMLWriter
37{
38public:
40 void PrintSelf(ostream& os, vtkIndent indent);
41
43
47 vtkSetMacro(NumberOfPieces, int);
48 vtkGetMacro(NumberOfPieces, int);
50
52
56 vtkSetMacro(WritePiece, int);
57 vtkGetMacro(WritePiece, int);
59
61
64 vtkSetMacro(GhostLevel, int);
65 vtkGetMacro(GhostLevel, int);
67
68 // See the vtkAlgorithm for a desciption of what these do
72
73protected:
76
78 virtual const char* GetDataSetName()=0;
79 virtual void SetInputUpdateExtent(int piece, int numPieces,
80 int ghostLevel);
81
82 virtual int WriteHeader();
83 virtual int WriteAPiece();
84 virtual int WriteFooter();
85
86 virtual void AllocatePositionArrays();
87 virtual void DeletePositionArrays();
88
89 virtual int WriteInlineMode(vtkIndent indent);
91 virtual void WriteInlinePiece(vtkIndent indent);
92
94 virtual void WriteAppendedPiece(int index, vtkIndent indent);
95 virtual void WriteAppendedPieceData(int index);
96
97 void WriteCellsInline(const char* name, vtkCellIterator *cellIter,
98 vtkIdType numCells, vtkIdType cellSizeEstimate,
99 vtkIndent indent);
100
101 void WriteCellsInline(const char* name, vtkCellArray* cells,
102 vtkDataArray* types, vtkIndent indent);
103
104 // New API with face infomration for polyhedron cell support.
105 void WriteCellsInline(const char* name, vtkCellArray* cells,
106 vtkDataArray* types, vtkIdTypeArray* faces,
107 vtkIdTypeArray* faceOffsets, vtkIndent indent);
108
109 void WriteCellsInlineWorker(const char* name, vtkDataArray *types,
110 vtkIndent indent);
111
112 void WriteCellsAppended(const char* name, vtkDataArray* types,
113 vtkIndent indent, OffsetsManagerGroup *cellsManager);
114
115 void WriteCellsAppended(const char* name, vtkDataArray* types,
116 vtkIdTypeArray* faces, vtkIdTypeArray* faceOffsets,
117 vtkIndent indent, OffsetsManagerGroup *cellsManager);
118
119 void WriteCellsAppended(const char* name, vtkCellIterator *cellIter,
120 vtkIdType numCells, vtkIndent indent,
121 OffsetsManagerGroup *cellsManager);
122
124 int timestep, OffsetsManagerGroup *cellsManager);
125
127 vtkIdType cellSizeEstimate, int timestep,
128 OffsetsManagerGroup *cellsManager);
129
130 // New API with face infomration for polyhedron cell support.
132 vtkIdTypeArray* faces,vtkIdTypeArray* faceOffsets,
133 int timestep, OffsetsManagerGroup *cellsManager);
134
136 OffsetsManagerGroup *cellsManager);
137
138 void ConvertCells(vtkCellIterator* cellIter, vtkIdType numCells,
139 vtkIdType cellSizeEstimate);
140
142
143 // For polyhedron support, conversion results are stored in Faces and FaceOffsets
144 void ConvertFaces(vtkIdTypeArray* faces, vtkIdTypeArray* faceOffsets);
145
146 // Get the number of points/cells. Valid after Update has been
147 // invoked on the input.
150 void CalculateDataFractions(float* fractions);
151 void CalculateCellFractions(float* fractions, vtkIdType typesSize);
152
153 // Number of pieces used for streaming.
155
156 // Which piece to write, if not all.
158
159 // The ghost level on each piece.
161
162 // Positions of attributes for each piece.
164
165 // For TimeStep support
169
170 // Hold the new cell representation arrays while writing a piece.
173
175
176 // Hold the face arrays for polyhedron cells.
179
180private:
182 void operator=(const vtkXMLUnstructuredDataWriter&) VTK_DELETE_FUNCTION;
183};
184
185#endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
Efficient cell iterator for vtkDataSet topologies.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:43
dataset represents arbitrary combinations of all possible cell types
Superclass for VTK XML unstructured data writers.
void CalculateDataFractions(float *fractions)
void WriteCellsInline(const char *name, vtkCellIterator *cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate, vtkIndent indent)
void WriteCellsAppended(const char *name, vtkDataArray *types, vtkIdTypeArray *faces, vtkIdTypeArray *faceOffsets, vtkIndent indent, OffsetsManagerGroup *cellsManager)
void ConvertCells(vtkCellArray *cells)
virtual void WriteAppendedPiece(int index, vtkIndent indent)
virtual vtkIdType GetNumberOfInputCells()=0
virtual void SetInputUpdateExtent(int piece, int numPieces, int ghostLevel)
void WriteCellsInline(const char *name, vtkCellArray *cells, vtkDataArray *types, vtkIndent indent)
void WriteCellsAppendedData(vtkCellArray *cells, vtkDataArray *types, vtkIdTypeArray *faces, vtkIdTypeArray *faceOffsets, int timestep, OffsetsManagerGroup *cellsManager)
virtual void WriteAppendedPieceAttributes(int index)
virtual void WriteInlinePiece(vtkIndent indent)
void WriteCellsAppendedData(vtkCellIterator *cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate, int timestep, OffsetsManagerGroup *cellsManager)
virtual int WriteInlineMode(vtkIndent indent)
void WriteCellsAppendedDataWorker(vtkDataArray *types, int timestep, OffsetsManagerGroup *cellsManager)
vtkPointSet * GetInputAsPointSet()
int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
void WriteCellsInlineWorker(const char *name, vtkDataArray *types, vtkIndent indent)
void WriteCellsAppended(const char *name, vtkDataArray *types, vtkIndent indent, OffsetsManagerGroup *cellsManager)
virtual void WriteInlinePieceAttributes()
void WriteCellsAppendedData(vtkCellArray *cells, vtkDataArray *types, int timestep, OffsetsManagerGroup *cellsManager)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void WriteAppendedPieceData(int index)
void ConvertCells(vtkCellIterator *cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate)
virtual const char * GetDataSetName()=0
void WriteCellsInline(const char *name, vtkCellArray *cells, vtkDataArray *types, vtkIdTypeArray *faces, vtkIdTypeArray *faceOffsets, vtkIndent indent)
virtual void AllocatePositionArrays()
virtual vtkIdType GetNumberOfInputPoints()
void CalculateCellFractions(float *fractions, vtkIdType typesSize)
void WriteCellsAppended(const char *name, vtkCellIterator *cellIter, vtkIdType numCells, vtkIndent indent, OffsetsManagerGroup *cellsManager)
void ConvertFaces(vtkIdTypeArray *faces, vtkIdTypeArray *faceOffsets)
virtual void DeletePositionArrays()
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:54
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287