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
vtkXMLDataReader::GetNumberOfCells
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
vtkXMLDataReader::GetNumberOfPoints
virtual vtkIdType GetNumberOfPoints()=0
Get the number of points in the output.
vtkXMLDataReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkXMLDataReader
Superclass for VTK XML file readers.
Definition: vtkXMLDataReader.h:35
vtkX3D::level
Definition: vtkX3D.h:395
vtkHyperTreeCursor
Objects for depth-first traversal HyperTrees.
Definition: vtkHyperTreeCursor.h:42
vtkXMLDataReader::ReadArrayForCells
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
vtkXMLReader::SetupEmptyOutput
virtual void SetupEmptyOutput()=0
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkXMLDataReader.h
vtkHyperTree
An object structured as a tree where each node has exactly either 2^d or 3^d children.
Definition: vtkHyperTree.h:142
vtkXMLReader::GetDataSetName
virtual const char * GetDataSetName()=0
vtkXMLDataElement
Represents an XML element and those nested inside.
Definition: vtkXMLDataElement.h:36
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:78
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkXMLDataReader::ReadXMLData
void ReadXMLData() override
vtkXMLHyperTreeGridReader
Read VTK XML HyperTreeGrid files.
Definition: vtkXMLHyperTreeGridReader.h:40
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
vtkXMLDataReader::ReadArrayForPoints
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
vtkAlgorithm::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:70