VTK  9.1.0
vtkXMLHyperTreeGridWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkXMLHyperTreeGridWriter.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=========================================================================*/
63#ifndef vtkXMLHyperTreeGridWriter_h
64#define vtkXMLHyperTreeGridWriter_h
65
66#include "vtkIOXMLModule.h" // For export macro
67#include "vtkSmartPointer.h" // For internal attributes
68#include "vtkXMLWriter.h"
69
70#include <vector> // std::vector
71
74class vtkBitArray;
75class vtkIdList;
76class vtkHyperTree;
79class vtkTypeInt64Array;
80class vtkTypeUInt32Array;
81
82class VTKIOXML_EXPORT vtkXMLHyperTreeGridWriter : public vtkXMLWriter
83{
84public:
86 void PrintSelf(ostream& os, vtkIndent indent) override;
88
93
97 const char* GetDefaultFileExtension() override;
98
107 vtkSetMacro(DataSetMajorVersion, int);
108 vtkSetMacro(DataSetMinorVersion, int);
109
110protected:
113
114 const char* GetDataSetName() override;
115
122 int GetDataSetMajorVersion() override { return DataSetMajorVersion; }
123 int GetDataSetMinorVersion() override { return DataSetMinorVersion; }
124
125 // Specify that we require HyperTreeGrid input
127
128 // The most important method, make the XML file for my input.
129 int WriteData() override;
130
131 // <HyperTreeGrid ...
133
134 // ... dim, size, origin>
135 void WritePrimaryElementAttributes(ostream&, vtkIndent) override;
136
137 // Grid coordinates and mask
139
140 // Tree Descriptor and CellData
144
145 // </HyperTreeGrid>
147
148 // Descriptors for individual hypertrees
149 std::vector<vtkSmartPointer<vtkBitArray>> Descriptors;
150
151 // Descriptors for individual hypertrees
152 std::vector<vtkSmartPointer<vtkTypeInt64Array>> NbVerticesByLevels;
153
154 // Masks for individual hypertrees
155 std::vector<vtkSmartPointer<vtkBitArray>> Masks;
156
157 // Ids (index selection) for individual hypertrees
158 std::vector<vtkSmartPointer<vtkIdList>> Ids;
159
160 // Helper to simplify writing appended array data
162
164 OffsetsManager& offsets, vtkHyperTree* tree);
165
167 {
169
175 } MetaDataForVersion2;
176
184
186
187 // Default choice
190
191private:
193 void operator=(const vtkXMLHyperTreeGridWriter&) = delete;
194};
195
196#endif
Helper class due to PIMPL excess.
Abstract superclass for all arrays.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:34
Objects for traversal a HyperTreeGrid.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
A data object structured as a tree.
Definition: vtkHyperTree.h:177
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
Store vtkAlgorithm input/output information.
Write VTK XML HyperTreeGrid files.
int WriteGrid(vtkIndent)
void WriteCellDataAppendedArrayDataHelper(vtkAbstractArray *array, vtkIdType numberOfVertices, OffsetsManager &offsets, vtkHyperTree *tree)
int StartPrimaryElement(vtkIndent)
std::vector< vtkSmartPointer< vtkTypeInt64Array > > NbVerticesByLevels
const char * GetDataSetName() override
std::vector< vtkSmartPointer< vtkBitArray > > Descriptors
void WritePrimaryElementAttributes(ostream &, vtkIndent) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int WriteData() override
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
std::vector< vtkSmartPointer< vtkBitArray > > Masks
int WriteTrees_0(vtkIndent)
int WriteTrees_2(vtkIndent)
const char * GetDefaultFileExtension() override
Get the default file extension for files written by this writer.
int WriteTrees_1(vtkIndent)
~vtkXMLHyperTreeGridWriter() override
int FinishPrimaryElement(vtkIndent)
OffsetsManagerGroup * DepthPerTreeOMG
OffsetsManagerGroup * NbVerticesByLevelOMG
std::vector< vtkSmartPointer< vtkIdList > > Ids
static vtkXMLHyperTreeGridWriter * New()
int GetDataSetMajorVersion() override
Methods to define the file's major and minor version numbers.
void WriteAppendedArrayDataHelper(vtkAbstractArray *array, OffsetsManager &offsets)
vtkHyperTreeGrid * GetInput()
Get/Set the writer's input.
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:62
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
int vtkIdType
Definition: vtkType.h:332