VTK  9.4.20250114
vtkXMLUnstructuredDataWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
11#ifndef vtkXMLUnstructuredDataWriter_h
12#define vtkXMLUnstructuredDataWriter_h
13
14#include "vtkIOXMLModule.h" // For export macro
15#include "vtkXMLWriter.h"
16
17#include "vtkSmartPointer.h" // for vtkSmartPointer
18
19VTK_ABI_NAMESPACE_BEGIN
20class vtkPointSet;
21class vtkCellArray;
22class vtkCellIterator;
23class vtkDataArray;
24class vtkIdTypeArray;
26
27class VTKIOXML_EXPORT vtkXMLUnstructuredDataWriter : public vtkXMLWriter
28{
29public:
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
34
38 vtkSetMacro(NumberOfPieces, int);
39 vtkGetMacro(NumberOfPieces, int);
41
43
47 vtkSetMacro(WritePiece, int);
48 vtkGetMacro(WritePiece, int);
50
52
55 vtkSetMacro(GhostLevel, int);
56 vtkGetMacro(GhostLevel, int);
58
59 // See the vtkAlgorithm for a description of what these do
62
63protected:
66
68 const char* GetDataSetName() override = 0;
69 virtual void SetInputUpdateExtent(int piece, int numPieces, int ghostLevel);
70
71 virtual int WriteHeader();
72 virtual int WriteAPiece();
73 virtual int WriteFooter();
74
75 virtual void AllocatePositionArrays();
76 virtual void DeletePositionArrays();
77
78 virtual int WriteInlineMode(vtkIndent indent);
80 virtual void WriteInlinePiece(vtkIndent indent);
81
82 virtual void WriteAppendedPieceAttributes(int index);
83 virtual void WriteAppendedPiece(int index, vtkIndent indent);
84 virtual void WriteAppendedPieceData(int index);
85
86 void WriteCellsInline(const char* name, vtkCellIterator* cellIter, vtkIdType numCells,
87 vtkIdType cellSizeEstimate, vtkIndent indent);
88
90 const char* name, vtkCellArray* cells, vtkDataArray* types, vtkIndent indent);
91
92 // New API with face information for polyhedron cell support.
93 VTK_DEPRECATED_IN_9_4_0("Use WritePolyCellsInline instead.")
94 void WriteCellsInline(const char* name, vtkCellArray* cells, vtkDataArray* types,
95 vtkIdTypeArray* faces, vtkIdTypeArray* faceOffsets, vtkIndent indent);
96
97 void WritePolyCellsInline(const char* name, vtkCellArray* cells, vtkDataArray* types,
98 vtkCellArray* faces, vtkCellArray* faceOffsets, vtkIndent indent);
99
100 void WriteCellsInlineWorker(const char* name, vtkDataArray* types, vtkIndent indent);
101
102 void WriteCellsAppended(
103 const char* name, vtkDataArray* types, vtkIndent indent, OffsetsManagerGroup* cellsManager);
104
105 VTK_DEPRECATED_IN_9_4_0("Use WritePolyCellsAppended instead.")
106 void WriteCellsAppended(const char* name, vtkDataArray* types, vtkIdTypeArray* faces,
107 vtkIdTypeArray* faceOffsets, vtkIndent indent, OffsetsManagerGroup* cellsManager);
108
109 void WriteCellsAppended(const char* name, vtkCellIterator* cellIter, vtkIdType numCells,
110 vtkIndent indent, OffsetsManagerGroup* cellsManager);
111
112 void WritePolyCellsAppended(const char* name, vtkDataArray* types, vtkCellArray* faces,
113 vtkCellArray* faceOffsets, vtkIndent indent, OffsetsManagerGroup* cellsManager);
114
115 void WriteCellsAppendedData(
116 vtkCellArray* cells, vtkDataArray* types, int timestep, OffsetsManagerGroup* cellsManager);
117
118 void WriteCellsAppendedData(vtkCellIterator* cellIter, vtkIdType numCells,
119 vtkIdType cellSizeEstimate, int timestep, OffsetsManagerGroup* cellsManager);
120
121 // New API with face information for polyhedron cell support.
122 VTK_DEPRECATED_IN_9_4_0("Use WritePolyCellsAppendedData instead.")
123 void WriteCellsAppendedData(vtkCellArray* cells, vtkDataArray* types, vtkIdTypeArray* faces,
124 vtkIdTypeArray* faceOffsets, int timestep, OffsetsManagerGroup* cellsManager);
125
126 void WritePolyCellsAppendedData(vtkCellArray* cells, vtkDataArray* types, vtkCellArray* faces,
127 vtkCellArray* faceOffsets, int timestep, OffsetsManagerGroup* cellsManager);
128
129 void WriteCellsAppendedDataWorker(
130 vtkDataArray* types, int timestep, OffsetsManagerGroup* cellsManager);
131
132 void ConvertCells(vtkCellIterator* cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate);
133
134 void ConvertCells(vtkCellArray* cells);
135
136 // For polyhedron support, conversion results are stored in Faces and FaceOffsets
137 VTK_DEPRECATED_IN_9_4_0("Use ConvertPolyFaces instead.")
138 void ConvertFaces(vtkIdTypeArray* faces, vtkIdTypeArray* faceOffsets);
139
140 void ConvertPolyFaces(vtkCellArray* faces, vtkCellArray* faceOffsets);
141
142 // Get the number of points/cells. Valid after Update has been
143 // invoked on the input.
144 virtual vtkIdType GetNumberOfInputPoints();
145 virtual vtkIdType GetNumberOfInputCells() = 0;
146 void CalculateDataFractions(float* fractions);
147 void CalculateCellFractions(float* fractions, vtkIdType typesSize);
148
149 // Number of pieces used for streaming.
150 int NumberOfPieces;
151
152 // Which piece to write, if not all.
153 int WritePiece;
154
155 // The ghost level on each piece.
156 int GhostLevel;
157
158 // Positions of attributes for each piece.
159 vtkTypeInt64* NumberOfPointsPositions;
160
161 // For TimeStep support
165
166 // Hold the new cell representation arrays while writing a piece.
169
170 int CurrentPiece;
171
176 VTK_DEPRECATED_IN_9_4_0("This member is deprecated.")
177 vtkIdTypeArray* LegacyFaces;
178 VTK_DEPRECATED_IN_9_4_0("This member is deprecated.")
179 vtkIdTypeArray* LegacyFaceOffsets;
180
181 // Hold the face arrays for polyhedron cells.
182 vtkSmartPointer<vtkDataArray> FaceConnectivity;
184 vtkSmartPointer<vtkDataArray> PolyhedronToFaces;
185 vtkSmartPointer<vtkDataArray> PolyhedronOffsets;
186
187private:
189 void operator=(const vtkXMLUnstructuredDataWriter&) = delete;
190};
191
192VTK_ABI_NAMESPACE_END
193#endif
object to represent cell connectivity
Efficient cell iterator for vtkDataSet topologies.
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition vtkPointSet.h:98
Hold a reference to a vtkObjectBase instance.
dataset represents arbitrary combinations of all possible cell types
Superclass for VTK XML unstructured data writers.
void WriteCellsInline(const char *name, vtkCellIterator *cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate, vtkIndent indent)
virtual void WriteAppendedPiece(int index, vtkIndent indent)
virtual void SetInputUpdateExtent(int piece, int numPieces, int ghostLevel)
void WriteCellsInline(const char *name, vtkCellArray *cells, vtkDataArray *types, vtkIndent indent)
virtual void WriteAppendedPieceAttributes(int index)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void WriteInlinePiece(vtkIndent indent)
virtual int WriteInlineMode(vtkIndent indent)
vtkPointSet * GetInputAsPointSet()
virtual void WriteInlinePieceAttributes()
~vtkXMLUnstructuredDataWriter() override
virtual void WriteAppendedPieceData(int index)
virtual void AllocatePositionArrays()
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
const char * GetDataSetName() override=0
virtual void DeletePositionArrays()
Superclass for VTK's XML file writers.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_4_0(reason)
int vtkIdType
Definition vtkType.h:315