VTK  9.3.0
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 void WriteCellsInline(const char* name, vtkCellArray* cells, vtkDataArray* types,
94 vtkIdTypeArray* faces, vtkIdTypeArray* faceOffsets, vtkIndent indent);
95
96 void WriteCellsInlineWorker(const char* name, vtkDataArray* types, vtkIndent indent);
97
99 const char* name, vtkDataArray* types, vtkIndent indent, OffsetsManagerGroup* cellsManager);
100
101 void WriteCellsAppended(const char* name, vtkDataArray* types, vtkIdTypeArray* faces,
102 vtkIdTypeArray* faceOffsets, vtkIndent indent, OffsetsManagerGroup* cellsManager);
103
104 void WriteCellsAppended(const char* name, vtkCellIterator* cellIter, vtkIdType numCells,
105 vtkIndent indent, OffsetsManagerGroup* cellsManager);
106
108 vtkCellArray* cells, vtkDataArray* types, int timestep, OffsetsManagerGroup* cellsManager);
109
111 vtkIdType cellSizeEstimate, int timestep, OffsetsManagerGroup* cellsManager);
112
113 // New API with face information for polyhedron cell support.
115 vtkIdTypeArray* faceOffsets, int timestep, OffsetsManagerGroup* cellsManager);
116
118 vtkDataArray* types, int timestep, OffsetsManagerGroup* cellsManager);
119
120 void ConvertCells(vtkCellIterator* cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate);
121
123
124 // For polyhedron support, conversion results are stored in Faces and FaceOffsets
125 void ConvertFaces(vtkIdTypeArray* faces, vtkIdTypeArray* faceOffsets);
126
127 // Get the number of points/cells. Valid after Update has been
128 // invoked on the input.
131 void CalculateDataFractions(float* fractions);
132 void CalculateCellFractions(float* fractions, vtkIdType typesSize);
133
134 // Number of pieces used for streaming.
136
137 // Which piece to write, if not all.
139
140 // The ghost level on each piece.
142
143 // Positions of attributes for each piece.
145
146 // For TimeStep support
150
151 // Hold the new cell representation arrays while writing a piece.
154
156
157 // Hold the face arrays for polyhedron cells.
160
161private:
163 void operator=(const vtkXMLUnstructuredDataWriter&) = delete;
164};
165
166VTK_ABI_NAMESPACE_END
167#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:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition vtkPointSet.h:59
Hold a reference to a vtkObjectBase instance.
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)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void WriteInlinePiece(vtkIndent indent)
void WriteCellsAppendedData(vtkCellIterator *cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate, int timestep, OffsetsManagerGroup *cellsManager)
vtkSmartPointer< vtkDataArray > CellPoints
virtual int WriteInlineMode(vtkIndent indent)
void WriteCellsAppendedDataWorker(vtkDataArray *types, int timestep, OffsetsManagerGroup *cellsManager)
vtkPointSet * GetInputAsPointSet()
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)
~vtkXMLUnstructuredDataWriter() override
virtual void WriteAppendedPieceData(int index)
vtkSmartPointer< vtkDataArray > CellOffsets
void ConvertCells(vtkCellIterator *cellIter, vtkIdType numCells, vtkIdType cellSizeEstimate)
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)
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
const char * GetDataSetName() override=0
void ConvertFaces(vtkIdTypeArray *faces, vtkIdTypeArray *faceOffsets)
virtual void DeletePositionArrays()
Superclass for VTK's XML file writers.
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315