VTK
vtkXMLHyperTreeGridReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLHyperTreeGridReader.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 =========================================================================*/
28 #ifndef vtkXMLHyperTreeGridReader_h
29 #define vtkXMLHyperTreeGridReader_h
30 
31 #include "vtkIOXMLModule.h" // For export macro
32 #include "vtkXMLDataReader.h"
33 
34 class vtkBitArray;
35 class vtkHyperTree;
36 class vtkHyperTreeCursor;
37 class vtkHyperTreeGrid;
38 class vtkIdTypeArray;
39 
40 class VTKIOXML_EXPORT vtkXMLHyperTreeGridReader : public vtkXMLDataReader
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
51  vtkHyperTreeGrid *GetOutput();
52  vtkHyperTreeGrid *GetOutput(int idx);
54 
55 protected:
57  ~vtkXMLHyperTreeGridReader() override;
58 
59  const char* GetDataSetName() override;
60 
61  // Setup the output with no data available. Used in error cases.
62  void SetupEmptyOutput() override;
63 
64  // Declare that this reader produces HyperTreeGrids
65  int FillOutputPortInformation(int, vtkInformation*) override;
66 
67  //These defer to the HyperTreeGrid output.
68  vtkIdType GetNumberOfPoints() override;
69  vtkIdType GetNumberOfCells() override;
70 
71  // Overridden here to do allocation.
73  vtkAbstractArray* outArray) override;
75  vtkAbstractArray* outArray) override;
76 
77  // The most important stuff is here.
78  // Read the rest of the file and create the HyperTreeGrid.
79  void ReadXMLData() override;
80 
81  // Read the coordinates describing the grid
82  void ReadCoordinates(vtkXMLDataElement *elem);
83 
84  // Recover the structure of the HyperTreeGrid, used by ReadXMLData.
85  void ReadTopology(vtkXMLDataElement *elem);
86 
87 protected:
88  // Used by ReadTopology to recursively build the tree
89  void SubdivideFromDescriptor(
90  vtkHyperTreeCursor* treeCursor,
91  vtkHyperTree* tree,
92  unsigned int level,
93  int numChildren,
94  vtkBitArray* desc,
95  vtkIdTypeArray* posByLevel,
96  vtkIdType* cellsOnProcessor);
97 
98 
99 private:
101  void operator=(const vtkXMLHyperTreeGridReader&) = delete;
102 };
103 
104 #endif
Read VTK XML HyperTreeGrid files.
virtual const char * GetDataSetName()=0
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:347
Objects for depth-first traversal HyperTrees.
void ReadXMLData() override
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual vtkIdType GetNumberOfPoints()=0
Get the number of points in the output.
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
Superclass for VTK XML file readers.
An object structured as a tree where each node has exactly either 2^d or 3^d children.
Definition: vtkHyperTree.h:142
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkAlgorithm * New()
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)