VTK
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 =========================================================================*/
23 #ifndef vtkXMLHyperTreeGridWriter_h
24 #define vtkXMLHyperTreeGridWriter_h
25 
26 #include "vtkBitArray.h" // For ivar
27 #include "vtkIOXMLModule.h" // For export macro
28 #include "vtkXMLWriter.h"
29 
30 #include <vector> // std::vector
31 
34 class vtkHyperTree;
35 class vtkHyperTreeGrid;
37 
38 class VTKIOXML_EXPORT vtkXMLHyperTreeGridWriter : public vtkXMLWriter
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49 
53  const char* GetDefaultFileExtension() override;
54 
55 protected:
57  ~vtkXMLHyperTreeGridWriter() override;
58 
59  const char* GetDataSetName() override;
60 
61  // specify that we require HyperTreeGrid input
63 
64  // The most important method, make the XML file for my input.
65  int WriteData() override;
66 
67  // <HyperTreeGrid ...
68  int StartPrimaryElement(vtkIndent);
69 
70  // ... dim, size, origin>
71  void WritePrimaryElementAttributes(ostream&, vtkIndent) override;
72 
73  // Grid coordinates and mask
74  int WriteGrid(vtkIndent);
75 
76  // Tree Descriptor and PointData
77  int WriteTrees(vtkIndent);
78 
79  // </HyperTreeGrid>
80  int FinishPrimaryElement(vtkIndent);
81 
82  // Descriptors for individual hypertrees
83  std::vector<vtkBitArray*> Descriptors;
84 
85  // Masks for individual hypertrees
86  std::vector<vtkBitArray*> Masks;
87 
88  // Helper to simplify writing appended array data
89  void WriteAppendedArrayDataHelper(vtkAbstractArray* array, OffsetsManager& offsets);
90  void WritePointDataAppendedArrayDataHelper(vtkAbstractArray* array,
91  vtkIdType treeCount,
92  OffsetsManager& offsets,
93  vtkHyperTree *tree
94  );
95 
100 
102 
103 private:
105  void operator=(const vtkXMLHyperTreeGridWriter&) = delete;
106 };
107 
108 #endif
vtkXMLWriter::GetDefaultFileExtension
virtual const char * GetDefaultFileExtension()=0
Get the default file extension for files written by this writer.
vtkIdType
int vtkIdType
Definition: vtkType.h:349
vtkXMLWriter::WritePrimaryElementAttributes
virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
vtkAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkXMLWriter.h
vtkXMLHyperTreeGridWriter::MaskOMG
OffsetsManagerGroup * MaskOMG
Definition: vtkXMLHyperTreeGridWriter.h:98
vtkHyperTreeGridNonOrientedCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedCursor.h:54
vtkX3D::port
Definition: vtkX3D.h:447
vtkXMLWriter
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:62
vtkXMLHyperTreeGridWriter::CoordsOMG
OffsetsManagerGroup * CoordsOMG
Definition: vtkXMLHyperTreeGridWriter.h:96
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkXMLWriter::GetDataSetName
virtual const char * GetDataSetName()=0
vtkXMLHyperTreeGridWriter
Write VTK XML HyperTreeGrid files.
Definition: vtkXMLHyperTreeGridWriter.h:38
vtkHyperTree
A data object structured as a tree.
Definition: vtkHyperTree.h:178
vtkXMLWriter::WriteData
virtual int WriteData()
Definition: vtkXMLWriter.h:360
OffsetsManagerGroup
Definition: vtkXMLOffsetsManager.h:109
vtkXMLHyperTreeGridWriter::PointDataOMG
OffsetsManagerGroup * PointDataOMG
Definition: vtkXMLHyperTreeGridWriter.h:99
vtkXMLWriter::GetInput
vtkDataObject * GetInput()
Definition: vtkXMLWriter.h:235
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:78
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:70
vtkX3D::info
Definition: vtkX3D.h:376
vtkAlgorithm::New
static vtkAlgorithm * New()
OffsetsManagerArray
Definition: vtkXMLOffsetsManager.h:158
vtkBitArray.h
vtkXMLHyperTreeGridWriter::NumberOfTrees
int NumberOfTrees
Definition: vtkXMLHyperTreeGridWriter.h:101
vtkXMLHyperTreeGridWriter::Masks
std::vector< vtkBitArray * > Masks
Definition: vtkXMLHyperTreeGridWriter.h:86
OffsetsManager
Helper class due to PIMPL excess.
Definition: vtkXMLOffsetsManager.h:54
vtkXMLWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXMLHyperTreeGridWriter::DescriptorOMG
OffsetsManagerGroup * DescriptorOMG
Definition: vtkXMLHyperTreeGridWriter.h:97
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:100
vtkXMLHyperTreeGridWriter::Descriptors
std::vector< vtkBitArray * > Descriptors
Definition: vtkXMLHyperTreeGridWriter.h:83