VTK
vtkXMLHyperOctreeReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLHyperOctreeReader.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 =========================================================================*/
32 #ifndef vtkXMLHyperOctreeReader_h
33 #define vtkXMLHyperOctreeReader_h
34 
35 #include "vtkIOXMLModule.h" // For export macro
36 #include "vtkXMLDataReader.h"
37 
38 #if !defined(VTK_LEGACY_REMOVE)
39 class vtkHyperOctree;
41 class vtkIntArray;
42 
43 class VTKIOXML_EXPORT vtkXMLHyperOctreeReader : public vtkXMLDataReader
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48  static vtkXMLHyperOctreeReader *New();
49 
51 
54  vtkHyperOctree *GetOutput();
55  vtkHyperOctree *GetOutput(int idx);
57 
58 protected:
60  ~vtkXMLHyperOctreeReader() override;
61 
62  const char* GetDataSetName() override;
63 
64  // Setup the output with no data available. Used in error cases.
65  void SetupEmptyOutput() override;
66 
67  // Declare that this reader produces HyperOctrees
68  int FillOutputPortInformation(int, vtkInformation*) override;
69 
70  //These defer to the HyperOctree output.
71  vtkIdType GetNumberOfPoints() override;
72  vtkIdType GetNumberOfCells() override;
73 
74  // Overridden here to do allocation.
76  vtkAbstractArray* outArray) override;
78  vtkAbstractArray* outArray) override;
79 
80 
81 
82  // The most important stuff is here.
83  // Read the rest of the file and create the HyperOctree.
84  void ReadXMLData() override;
85 
86  // Recover the structure of the HyperOctree, used by ReadXMLData.
87  void ReadTopology(vtkXMLDataElement *elem);
88 
89  // Used by ReadTopology to recusively build the tree, one cell at a time.
90  int BuildNextCell(vtkIntArray *, vtkHyperOctreeCursor *, int);
91 
92  //Helper for BuildNextCell
94 
95 private:
97  void operator=(const vtkXMLHyperOctreeReader&) = delete;
98 };
99 #endif // LEGACY remove
100 
101 #endif
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.
int vtkIdType
Definition: vtkType.h:345
A dataset structured as a tree where each node has exactly 2^n children.
void ReadXMLData() override
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
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)
Objects that can traverse hyperoctree nodes.
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
Superclass for VTK XML file readers.
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)
Read VTK XML HyperOctree files.