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
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:255
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:42
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:37
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()
#define VTK_IO_EXPORT
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
Read VTK XML HyperOctree files.