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 =========================================================================*/
25 #ifndef vtkXMLHyperTreeGridReader_h
26 #define vtkXMLHyperTreeGridReader_h
27 
28 #include "vtkIOXMLModule.h" // For export macro
29 #include "vtkXMLDataReader.h"
30 
31 class vtkBitArray;
32 class vtkHyperTree;
33 class vtkHyperTreeCursor;
34 class vtkHyperTreeGrid;
35 class vtkIdTypeArray;
36 
37 class VTKIOXML_EXPORT vtkXMLHyperTreeGridReader : public vtkXMLDataReader
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
48  vtkHyperTreeGrid *GetOutput();
49  vtkHyperTreeGrid *GetOutput(int idx);
51 
52 protected:
54  ~vtkXMLHyperTreeGridReader() override;
55 
56  const char* GetDataSetName() override;
57 
58  // Setup the output with no data available. Used in error cases.
59  void SetupEmptyOutput() override;
60 
61  // Declare that this reader produces HyperTreeGrids
62  int FillOutputPortInformation(int, vtkInformation*) override;
63 
64  //These defer to the HyperTreeGrid output.
65  vtkIdType GetNumberOfPoints() override;
66  vtkIdType GetNumberOfCells() override;
67 
68  // Overridden here to do allocation.
70  vtkAbstractArray* outArray) override;
72  vtkAbstractArray* outArray) override;
73 
74  // The most important stuff is here.
75  // Read the rest of the file and create the HyperTreeGrid.
76  void ReadXMLData() override;
77 
78  // Read the coordinates describing the grid
79  void ReadCoordinates(vtkXMLDataElement *elem);
80 
81  // Recover the structure of the HyperTreeGrid, used by ReadXMLData.
82  void ReadTopology(vtkXMLDataElement *elem);
83 
84 protected:
85  // Used by ReadTopology to recusively build the tree
86  void SubdivideFromDescriptor(
87  vtkHyperTreeCursor* treeCursor,
88  vtkHyperTree* tree,
89  unsigned int level,
90  int numChildren,
91  vtkBitArray* desc,
92  vtkIdTypeArray* posByLevel,
93  vtkIdType* cellsOnProcessor);
94 
95 
96 private:
98  void operator=(const vtkXMLHyperTreeGridReader&) = delete;
99 };
100 
101 #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:345
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:33
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:33
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)