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);
50  static vtkXMLHyperOctreeReader *New();
51 
53 
56  vtkHyperOctree *GetOutput();
57  vtkHyperOctree *GetOutput(int idx);
59 
60 protected:
63 
64  const char* GetDataSetName();
65 
66  // Setup the output with no data available. Used in error cases.
67  void SetupEmptyOutput();
68 
69  // Declare that this reader produces HyperOctrees
70  virtual int FillOutputPortInformation(int, vtkInformation*);
71 
72  //These defer to the HyperOctree output.
75 
76  // Overriden here to do allocation.
77  virtual int ReadArrayForPoints(vtkXMLDataElement* da,
78  vtkAbstractArray* outArray);
79  virtual int ReadArrayForCells(vtkXMLDataElement* da,
80  vtkAbstractArray* outArray);
81 
82 
83 
84  // The most important stuff is here.
85  // Read the rest of the file and create the HyperOctree.
86  void ReadXMLData();
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
96 
97 private:
98  vtkXMLHyperOctreeReader(const vtkXMLHyperOctreeReader&) VTK_DELETE_FUNCTION;
99  void operator=(const vtkXMLHyperOctreeReader&) VTK_DELETE_FUNCTION;
100 };
101 
102 #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:287
A dataset structured as a tree where each node has exactly 2^n children.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual vtkIdType GetNumberOfPoints()=0
Get the number of points in the output.
virtual int ReadArrayForPoints(vtkXMLDataElement *da, vtkAbstractArray *outArray)
Objects that can traverse hyperoctree nodes.
virtual vtkIdType GetNumberOfCells()=0
Get the number of cells in the output.
virtual void ReadXMLData()
Superclass for VTK XML file readers.
static vtkAlgorithm * New()
virtual int ReadArrayForCells(vtkXMLDataElement *da, vtkAbstractArray *outArray)
Read VTK XML HyperOctree files.