00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXMLHyperOctreeWriter.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00031 #ifndef __vtkXMLHyperOctreeWriter_h 00032 #define __vtkXMLHyperOctreeWriter_h 00033 00034 #include "vtkXMLWriter.h" 00035 00036 class vtkHyperOctree; 00037 class vtkHyperOctreeCursor; 00038 class vtkIntArray; 00039 00040 class VTK_IO_EXPORT vtkXMLHyperOctreeWriter : public vtkXMLWriter 00041 { 00042 public: 00043 vtkTypeMacro(vtkXMLHyperOctreeWriter,vtkXMLWriter); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 static vtkXMLHyperOctreeWriter* New(); 00046 00047 //BTX 00049 00050 vtkHyperOctree* GetInput(); 00051 //ETX 00053 00055 const char* GetDefaultFileExtension(); 00056 00057 protected: 00058 vtkXMLHyperOctreeWriter(); 00059 ~vtkXMLHyperOctreeWriter(); 00060 00061 const char* GetDataSetName(); 00062 00063 // specify that we require HyperOctree input 00064 virtual int FillInputPortInformation(int port, vtkInformation* info); 00065 00066 //The most important method, make the XML file for my input. 00067 int WriteData(); 00068 00069 //<HyperOctree ... 00070 int StartPrimElement(vtkIndent); 00071 00072 //... dim, size, orgin> 00073 void WritePrimaryElementAttributes(ostream &, vtkIndent); 00074 00075 //Tree Structure 00076 int WriteTopology(vtkIndent); 00077 00078 //Used by WriteTopology to make and array from the Tree structure recursively 00079 void SerializeTopology(vtkHyperOctreeCursor *, int); 00080 00081 //Writes PointData and CellData attribute data. 00082 int WriteAttributeData(vtkIndent); 00083 00084 //</HyperOctree> 00085 int FinishPrimElement(vtkIndent); 00086 00087 //For appended mode placekeeping 00088 vtkIntArray *TopologyArray; 00089 unsigned long TopoOffset; 00090 OffsetsManagerGroup * TopologyOM; 00091 OffsetsManagerGroup * PointDataOM; 00092 OffsetsManagerGroup * CellDataOM; 00093 00094 private: 00095 vtkXMLHyperOctreeWriter(const vtkXMLHyperOctreeWriter&); // Not implemented. 00096 void operator=(const vtkXMLHyperOctreeWriter&); // Not implemented. 00097 }; 00098 00099 #endif