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 =========================================================================*/
35 #ifndef vtkXMLHyperOctreeReader_h
36 #define vtkXMLHyperOctreeReader_h
37 
38 #include "vtkIOXMLModule.h" // For export macro
39 #include "vtkXMLDataReader.h"
40 
41 class vtkHyperOctree;
43 class vtkIntArray;
44 
45 class VTKIOXML_EXPORT vtkXMLHyperOctreeReader : public vtkXMLDataReader
46 {
47 public:
49  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
50  static vtkXMLHyperOctreeReader *New();
51 
53 
56  vtkHyperOctree *GetOutput();
57  vtkHyperOctree *GetOutput(int idx);
59 
60 protected:
62  ~vtkXMLHyperOctreeReader() VTK_OVERRIDE;
63 
64  const char* GetDataSetName() VTK_OVERRIDE;
65 
66  // Setup the output with no data available. Used in error cases.
67  void SetupEmptyOutput() VTK_OVERRIDE;
68 
69  // Declare that this reader produces HyperOctrees
70  int FillOutputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
71 
72  //These defer to the HyperOctree output.
73  vtkIdType GetNumberOfPoints() VTK_OVERRIDE;
74  vtkIdType GetNumberOfCells() VTK_OVERRIDE;
75 
76  // Overridden here to do allocation.
77  int ReadArrayForPoints(vtkXMLDataElement* da,
78  vtkAbstractArray* outArray) VTK_OVERRIDE;
79  int ReadArrayForCells(vtkXMLDataElement* da,
80  vtkAbstractArray* outArray) VTK_OVERRIDE;
81 
82 
83 
84  // The most important stuff is here.
85  // Read the rest of the file and create the HyperOctree.
86  void ReadXMLData() VTK_OVERRIDE;
87 
88  // Recover the structure of the HyperOctree, used by ReadXMLData.
89  void ReadTopology(vtkXMLDataElement *elem);
90 
91  // Used by ReadTopology to recusively build the tree, one cell at a time.
92  int BuildNextCell(vtkIntArray *, vtkHyperOctreeCursor *, int);
93 
94  //Helper for BuildNextCell
95  int ArrayIndex;
96 
97 private:
98  vtkXMLHyperOctreeReader(const vtkXMLHyperOctreeReader&) VTK_DELETE_FUNCTION;
99  void operator=(const vtkXMLHyperOctreeReader&) VTK_DELETE_FUNCTION;
100 };
101 
102 #endif
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.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
a simple class to control print indentation
Definition: vtkIndent.h:39
Objects that can traverse hyperoctree nodes.
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()
Read VTK XML HyperOctree files.