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 =========================================================================*/
34 #ifndef __vtkXMLHyperOctreeReader_h
35 #define __vtkXMLHyperOctreeReader_h
36 
37 #include "vtkXMLDataReader.h"
38 
39 class vtkHyperOctree;
41 class vtkIntArray;
42 
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent);
48  static vtkXMLHyperOctreeReader *New();
49 
51 
52  vtkHyperOctree *GetOutput();
53  vtkHyperOctree *GetOutput(int idx);
55 
56 protected:
59 
60  const char* GetDataSetName();
61 
62  // Setup the output with no data available. Used in error cases.
63  void SetupEmptyOutput();
64 
65  // Declare that this reader produces HyperOctrees
66  virtual int FillOutputPortInformation(int, vtkInformation*);
67 
68  //These defer to the HyperOctree output.
71 
72  // Overriden here to do allocation.
73  virtual int ReadArrayForPoints(vtkXMLDataElement* da,
74  vtkAbstractArray* outArray);
75  virtual int ReadArrayForCells(vtkXMLDataElement* da,
76  vtkAbstractArray* outArray);
77 
78 
79 
80  // The most important stuff is here.
81  // Read the rest of the file and create the HyperOctree.
82  void ReadXMLData();
83 
84  // Recover the structure of the HyperOctree, used by ReadXMLData.
85  void ReadTopology(vtkXMLDataElement *elem);
86 
87  // Used by ReadTopology to recusively build the tree, one cell at a time.
88  int BuildNextCell(vtkIntArray *, vtkHyperOctreeCursor *, int);
89 
90  //Helper for BuildNextCell
92 
93 private:
94  vtkXMLHyperOctreeReader(const vtkXMLHyperOctreeReader&); // Not implemented.
95  void operator=(const vtkXMLHyperOctreeReader&); // Not implemented.
96 };
97 
98 #endif