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 recursively 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
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:33
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:75
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkXMLDataReader::ReadXMLData
void ReadXMLData() override
vtkXMLHyperTreeGridReader
Read VTK XML HyperTreeGrid files.
Definition: vtkXMLHyperTreeGridReader.h:37
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:33
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:67