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 "vtkIOXMLModule.h" // For export macro
38 #include "vtkXMLDataReader.h"
39 
40 class vtkHyperOctree;
42 class vtkIntArray;
43 
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent);
49  static vtkXMLHyperOctreeReader *New();
50 
52 
53  vtkHyperOctree *GetOutput();
54  vtkHyperOctree *GetOutput(int idx);
56 
57 protected:
60 
61  const char* GetDataSetName();
62 
63  // Setup the output with no data available. Used in error cases.
64  void SetupEmptyOutput();
65 
66  // Declare that this reader produces HyperOctrees
67  virtual int FillOutputPortInformation(int, vtkInformation*);
68 
69  //These defer to the HyperOctree output.
72 
73  // Overriden here to do allocation.
74  virtual int ReadArrayForPoints(vtkXMLDataElement* da,
75  vtkAbstractArray* outArray);
76  virtual int ReadArrayForCells(vtkXMLDataElement* da,
77  vtkAbstractArray* outArray);
78 
79 
80 
81  // The most important stuff is here.
82  // Read the rest of the file and create the HyperOctree.
83  void ReadXMLData();
84 
85  // Recover the structure of the HyperOctree, used by ReadXMLData.
86  void ReadTopology(vtkXMLDataElement *elem);
87 
88  // Used by ReadTopology to recusively build the tree, one cell at a time.
89  int BuildNextCell(vtkIntArray *, vtkHyperOctreeCursor *, int);
90 
91  //Helper for BuildNextCell
93 
94 private:
95  vtkXMLHyperOctreeReader(const vtkXMLHyperOctreeReader&); // Not implemented.
96  void operator=(const vtkXMLHyperOctreeReader&); // Not implemented.
97 };
98 
99 #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:275
A dataset structured as a tree where each node has exactly 2^n children.
void PrintSelf(ostream &os, vtkIndent indent)
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:49
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKIOXML_EXPORT
virtual vtkIdType GetNumberOfPoints()=0
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
Objects that can traverse hyperoctree nodes.
virtual vtkIdType GetNumberOfCells()=0
virtual void ReadXMLData()
Superclass for VTK XML file readers.
static vtkAlgorithm * New()
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
Read VTK XML HyperOctree files.