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